diff options
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_build.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_build.cc | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 47bf5e7ecbb..e21c3d29aa5 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -216,6 +216,9 @@ void DEG_graph_build_from_scene(Depsgraph *graph, Main *bmain, Scene *scene) DEG::DepsgraphRelationBuilder relation_builder(deg_graph); relation_builder.begin_build(bmain); relation_builder.build_scene(bmain, scene); +#ifdef WITH_COPY_ON_WRITE + relation_builder.build_copy_on_write_relations(); +#endif /* Detect and solve cycles. */ DEG::deg_graph_detect_cycles(deg_graph); @@ -254,12 +257,13 @@ void DEG_graph_tag_relations_update(Depsgraph *graph) /* Tag all relations for update. */ void DEG_relations_tag_update(Main *bmain) { + DEG_DEBUG_PRINTF("%s: Tagging relations for update.\n", __func__); for (Scene *scene = (Scene *)bmain->scene.first; scene != NULL; scene = (Scene *)scene->id.next) { - if (scene->depsgraph != NULL) { - DEG_graph_tag_relations_update(scene->depsgraph); + if (scene->depsgraph_legacy != NULL) { + DEG_graph_tag_relations_update(scene->depsgraph_legacy); } } } @@ -269,24 +273,19 @@ void DEG_relations_tag_update(Main *bmain) */ void DEG_scene_relations_update(Main *bmain, Scene *scene) { - if (scene->depsgraph == NULL) { + if (scene->depsgraph_legacy == NULL) { /* Rebuild graph from scratch and exit. */ - scene->depsgraph = DEG_graph_new(); - DEG_graph_build_from_scene(scene->depsgraph, bmain, scene); + scene->depsgraph_legacy = DEG_graph_new(); + DEG_graph_build_from_scene(scene->depsgraph_legacy, bmain, scene); return; } - DEG::Depsgraph *graph = reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph); + DEG::Depsgraph *graph = reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph_legacy); if (!graph->need_update) { /* Graph is up to date, nothing to do. */ return; } - /* Clear all previous nodes and operations. */ - graph->clear_all_nodes(); - graph->operations.clear(); - BLI_gset_clear(graph->entry_tags, NULL); - /* Build new nodes and relations. */ DEG_graph_build_from_scene(reinterpret_cast< ::Depsgraph * >(graph), bmain, @@ -298,17 +297,17 @@ void DEG_scene_relations_update(Main *bmain, Scene *scene) /* Rebuild dependency graph only for a given scene. */ void DEG_scene_relations_rebuild(Main *bmain, Scene *scene) { - if (scene->depsgraph != NULL) { - DEG_graph_tag_relations_update(scene->depsgraph); + if (scene->depsgraph_legacy != NULL) { + DEG_graph_tag_relations_update(scene->depsgraph_legacy); } DEG_scene_relations_update(bmain, scene); } void DEG_scene_graph_free(Scene *scene) { - if (scene->depsgraph) { - DEG_graph_free(scene->depsgraph); - scene->depsgraph = NULL; + if (scene->depsgraph_legacy) { + DEG_graph_free(scene->depsgraph_legacy); + scene->depsgraph_legacy = NULL; } } @@ -316,14 +315,13 @@ void DEG_add_collision_relations(DepsNodeHandle *handle, Scene *scene, Object *ob, Group *group, - int layer, unsigned int modifier_type, DEG_CollobjFilterFunction fn, bool dupli, const char *name) { unsigned int numcollobj; - Object **collobjs = get_collisionobjects_ext(scene, ob, group, layer, &numcollobj, modifier_type, dupli); + Object **collobjs = get_collisionobjects_ext(scene, ob, group, &numcollobj, modifier_type, dupli); for (unsigned int i = 0; i < numcollobj; i++) { Object *ob1 = collobjs[i]; @@ -346,7 +344,7 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle, int skip_forcefield, const char *name) { - ListBase *effectors = pdInitEffectors(scene, ob, NULL, effector_weights, false); + ListBase *effectors = pdInitEffectors(NULL, scene, ob, NULL, effector_weights, false); if (effectors) { for (EffectorCache *eff = (EffectorCache*)effectors->first; eff; eff = eff->next) { @@ -378,7 +376,6 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle, scene, ob, NULL, - eff->ob->lay, eModifierType_Collision, NULL, true, |