diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-10-24 17:47:34 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-10-24 17:47:34 +0300 |
commit | 3936ba9725b0fd85aadbe844b4742e8088471b47 (patch) | |
tree | b5a1dddb92f8933ef9d27defe73d8345464a2810 /source/blender | |
parent | d012c9d0f46f931bc308da3fd70d9d7d5b298bb3 (diff) |
Depsgraph: Avoid explicit relations rebuild calls
We wouldn't know which dependency graphs needs/safe for reconstruction,
so rather use API which tells that relations are out of date. This way
graph evaluation will take care of the rest.
Committing to 2.8 only since it's where we can't reliably know the graph
and is probably not that safe to apply this in master.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_edit.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files_link.c | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 24f147a68bf..95663092a7d 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -493,7 +493,7 @@ static int outliner_id_remap_exec(bContext *C, wmOperator *op) BKE_main_lib_objects_recalc_all(bmain); /* recreate dependency graph to include new objects */ - DEG_scene_relations_rebuild(bmain, scene); + DEG_relations_tag_update(bmain); /* free gpu materials, some materials depend on existing objects, such as lamps so freeing correctly refreshes */ GPU_materials_free(); diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index dbf0ff90ada..cee08e1f8c1 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -503,7 +503,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op) DEG_id_tag_update(&scene->id, 0); /* recreate dependency graph to include new objects */ - DEG_scene_relations_rebuild(bmain, scene); + DEG_relations_tag_update(bmain); /* XXX TODO: align G.lib with other directory storage (like last opened image etc...) */ BLI_strncpy(G.lib, root, FILE_MAX); @@ -606,7 +606,7 @@ static int wm_lib_relocate_invoke(bContext *C, wmOperator *op, const wmEvent *UN } static void lib_relocate_do( - Main *bmain, Scene *scene, + Main *bmain, Library *library, WMLinkAppendData *lapp_data, ReportList *reports, const bool do_reload) { ListBase *lbarray[MAX_LIBARRAY]; @@ -798,7 +798,7 @@ static void lib_relocate_do( BKE_main_id_tag_all(bmain, LIB_TAG_PRE_EXISTING, false); /* recreate dependency graph to include new objects */ - DEG_scene_relations_rebuild(bmain, scene); + DEG_relations_tag_update(bmain); } void WM_lib_reload(Library *lib, bContext *C, ReportList *reports) @@ -818,7 +818,7 @@ void WM_lib_reload(Library *lib, bContext *C, ReportList *reports) wm_link_append_data_library_add(lapp_data, lib->filepath); - lib_relocate_do(CTX_data_main(C), CTX_data_scene(C), lib, lapp_data, reports, true); + lib_relocate_do(CTX_data_main(C), lib, lapp_data, reports, true); wm_link_append_data_free(lapp_data); @@ -835,7 +835,6 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload) if (lib) { Main *bmain = CTX_data_main(C); - Scene *scene = CTX_data_scene(C); PropertyRNA *prop; WMLinkAppendData *lapp_data; @@ -925,7 +924,7 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload) } } - lib_relocate_do(bmain, scene, lib, lapp_data, op->reports, do_reload); + lib_relocate_do(bmain, lib, lapp_data, op->reports, do_reload); wm_link_append_data_free(lapp_data); |