Alembic export: create render-evaluated depsgraph for exporting
authorSybren A. Stüvel <sybren@stuvel.eu>
Fri, 8 Jun 2018 09:52:36 +0000 (11:52 +0200)
committerSybren A. Stüvel <sybren@stuvel.eu>
Fri, 8 Jun 2018 09:53:03 +0000 (11:53 +0200)
Previously the context depsgraph was used, which (most likely) uses
viewport evaluation instead of render evaluation.

source/blender/alembic/intern/alembic_capi.cc

index b3232b3..cc99231 100644 (file)
@@ -260,6 +260,12 @@ static void export_startjob(void *customdata, short *stop, short *do_update, flo
 
        G.is_break = false;
 
+       DEG_graph_build_from_view_layer(data->settings.depsgraph,
+                                       data->bmain,
+                                       data->settings.scene,
+                                       data->view_layer);
+       BKE_scene_graph_update_tagged(data->settings.depsgraph, data->bmain);
+
        try {
                AbcExporter exporter(data->bmain, data->filename, data->settings);
 
@@ -333,13 +339,13 @@ bool ABC_export(
         * hardcore refactoring. */
        new (&job->settings) ExportSettings();
        job->settings.scene = scene;
-       job->settings.depsgraph = CTX_data_depsgraph(C);
+       job->settings.depsgraph = DEG_graph_new(scene, job->view_layer, DAG_EVAL_RENDER);
 
        /* Sybren: for now we only export the active scene layer.
         * Later in the 2.8 development process this may be replaced by using
         * a specific collection for Alembic I/O, which can then be toggled
         * between "real" objects and cached Alembic files. */
-       job->settings.view_layer = CTX_data_view_layer(C);
+       job->settings.view_layer = job->view_layer;
 
        job->settings.frame_start = params->frame_start;
        job->settings.frame_end = params->frame_end;