# SOLVEDGet identical document as the Render document

Hello,

I'm trying to create a script where I export models from the document across different frames exactly as they appear in the animated render.

However there are differences. The document is sampling a noise to drive values, and there could be minute differences between the editor document and the render document that is causing it to produce slightly different values.

Is there a way to ensure in my script that I'm using the exact same document execution that the renderer is using?

Hi @orestiskon the way to have a document identical to what is render, is to animate the document from the beginning to the targeted frame and evaluating the document each frame. The evaluation of a document is done via ExecutePasses.

One important thing is that internally sometime Cinema 4D use several call to ExecutePasses to really have the final result. Usually calling it 3 time in a raw is enough.

There is the basedocument_animate example which demonstrate how to animate a scene, one things to note is the use of DrawView, this internally does call ExecutePass beside also refreshing the ViewPort.

Hope it helps,
Cheers,
Maxime.

I think I managed to make it work by using:

``````c4d.documents.LoadDocument(docPath, c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS)
``````

and then going to the end of the document and rewinding back to the beginning.

Doing this on the active document didn't work.

I'm using the Render execute passes as well, and the combination of all these seem to match the render results.

After more testing unfortunately there were still differences, not sure if I'm missing the proper way to go with it or if it's a limitation that the editor won't ever match the render state precisely.

Hi @orestiskon the way to have a document identical to what is render, is to animate the document from the beginning to the targeted frame and evaluating the document each frame. The evaluation of a document is done via ExecutePasses.

One important thing is that internally sometime Cinema 4D use several call to ExecutePasses to really have the final result. Usually calling it 3 time in a raw is enough.

There is the basedocument_animate example which demonstrate how to animate a scene, one things to note is the use of DrawView, this internally does call ExecutePass beside also refreshing the ViewPort.

Hope it helps,
Cheers,
Maxime.

Hello @orestiskon,

without any further questions, we will consider this topic as solved by Tuesday, November the 2nd and flag it accordingly.
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9091229438781738, "perplexity": 1528.3475215735373}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964363515.28/warc/CC-MAIN-20211208144647-20211208174647-00049.warc.gz"}