Merge branch 'master' into blender2.8
[blender.git] / source / blender / alembic / intern / alembic_capi.cc
index 0de0d1a1ab68b0e0ca28c6b7d5bede9255d832eb..cee571b9e412fe264392b1b74ef9be10d94046d5 100644 (file)
@@ -48,12 +48,14 @@ extern "C" {
 #include "BKE_cdderivedmesh.h"
 #include "BKE_context.h"
 #include "BKE_curve.h"
 #include "BKE_cdderivedmesh.h"
 #include "BKE_context.h"
 #include "BKE_curve.h"
-#include "BKE_depsgraph.h"
 #include "BKE_global.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_scene.h"
 
 #include "BKE_global.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_scene.h"
 
+#include "DEG_depsgraph.h"
+#include "DEG_depsgraph_build.h"
+
 /* SpaceType struct has a member called 'new' which obviously conflicts with C++
  * so temporarily redefining the new keyword to make it compile. */
 #define new extern_new
 /* SpaceType struct has a member called 'new' which obviously conflicts with C++
  * so temporarily redefining the new keyword to make it compile. */
 #define new extern_new
@@ -268,8 +270,7 @@ static void export_startjob(void *customdata, short *stop, short *do_update, flo
                if (CFRA != orig_frame) {
                        CFRA = orig_frame;
 
                if (CFRA != orig_frame) {
                        CFRA = orig_frame;
 
-                       BKE_scene_update_for_newframe(data->bmain->eval_ctx, data->bmain,
-                                                     scene, scene->lay);
+                       BKE_scene_update_for_newframe(data->bmain->eval_ctx, data->bmain, scene);
                }
        }
        catch (const std::exception &e) {
                }
        }
        catch (const std::exception &e) {
@@ -325,21 +326,37 @@ void ABC_export(
         * hardcore refactoring. */
        new (&job->settings) ExportSettings();
        job->settings.scene = job->scene;
         * hardcore refactoring. */
        new (&job->settings) ExportSettings();
        job->settings.scene = job->scene;
+
+       /* 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.sl = CTX_data_scene_layer(C);
+
        job->settings.frame_start = params->frame_start;
        job->settings.frame_end = params->frame_end;
        job->settings.frame_step_xform = params->frame_step_xform;
        job->settings.frame_step_shape = params->frame_step_shape;
        job->settings.shutter_open = params->shutter_open;
        job->settings.shutter_close = params->shutter_close;
        job->settings.frame_start = params->frame_start;
        job->settings.frame_end = params->frame_end;
        job->settings.frame_step_xform = params->frame_step_xform;
        job->settings.frame_step_shape = params->frame_step_shape;
        job->settings.shutter_open = params->shutter_open;
        job->settings.shutter_close = params->shutter_close;
+
+       /* Sybren: For now this is ignored, until we can get selection
+        * detection working through Base pointers (instead of ob->flags). */
        job->settings.selected_only = params->selected_only;
        job->settings.selected_only = params->selected_only;
+
        job->settings.export_face_sets = params->face_sets;
        job->settings.export_normals = params->normals;
        job->settings.export_uvs = params->uvs;
        job->settings.export_vcols = params->vcolors;
        job->settings.apply_subdiv = params->apply_subdiv;
        job->settings.flatten_hierarchy = params->flatten_hierarchy;
        job->settings.export_face_sets = params->face_sets;
        job->settings.export_normals = params->normals;
        job->settings.export_uvs = params->uvs;
        job->settings.export_vcols = params->vcolors;
        job->settings.apply_subdiv = params->apply_subdiv;
        job->settings.flatten_hierarchy = params->flatten_hierarchy;
+
+       /* Sybren: visible_layer & renderable only is ignored for now,
+        * to be replaced with collections later in the 2.8 dev process
+        * (also see note above). */
        job->settings.visible_layers_only = params->visible_layers_only;
        job->settings.renderable_only = params->renderable_only;
        job->settings.visible_layers_only = params->visible_layers_only;
        job->settings.renderable_only = params->renderable_only;
+
        job->settings.use_subdiv_schema = params->use_subdiv_schema;
        job->settings.export_ogawa = (params->compression_type == ABC_ARCHIVE_OGAWA);
        job->settings.pack_uv = params->packuv;
        job->settings.use_subdiv_schema = params->use_subdiv_schema;
        job->settings.export_ogawa = (params->compression_type == ABC_ARCHIVE_OGAWA);
        job->settings.pack_uv = params->packuv;
@@ -783,10 +800,10 @@ static void import_endjob(void *user_data)
 
                        BKE_scene_base_add(data->scene, ob);
 
 
                        BKE_scene_base_add(data->scene, ob);
 
-                       DAG_id_tag_update_ex(data->bmain, &ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
+                       DEG_id_tag_update_ex(data->bmain, &ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
                }
 
                }
 
-               DAG_relations_tag_update(data->bmain);
+               DEG_relations_tag_update(data->bmain);
        }
 
        for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
        }
 
        for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {