[Bf-blender-cvs] [c0ddbf39c4e] blender2.8: Fix T53646: Blender 2.8 multiple crashes in auto UVs generation
Sergey Sharybin
noreply at git.blender.org
Wed Jan 24 14:03:14 CET 2018
Commit: c0ddbf39c4e175537de89d63be60bd3bc20fbace
Author: Sergey Sharybin
Date: Wed Jan 24 14:00:49 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBc0ddbf39c4e175537de89d63be60bd3bc20fbace
Fix T53646: Blender 2.8 multiple crashes in auto UVs generation
Make sure scene and view_layer set for depsgraph before running editors
update. This is required since tagging might happen before we created depsgraph.
===================================================================
M source/blender/depsgraph/intern/depsgraph_tag.cc
===================================================================
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index f63a4c90427..38f43f5720b 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -379,6 +379,20 @@ void deg_graph_id_tag_update(Main *bmain, Depsgraph *graph, ID *id, int flag)
id_tag_update_ntree_special(bmain, graph, id, flag);
}
+/* TODO(sergey): Consider storing scene and view layer at depsgraph allocation
+ * time.
+ */
+void deg_ensure_scene_view_layer(Depsgraph *graph,
+ Scene *scene,
+ ViewLayer *view_layer)
+{
+ if (!graph->need_update) {
+ return;
+ }
+ graph->scene = scene;
+ graph->view_layer = view_layer;
+}
+
void deg_id_tag_update(Main *bmain, ID *id, int flag)
{
deg_graph_id_tag_update(bmain, NULL, id, flag);
@@ -389,6 +403,11 @@ void deg_id_tag_update(Main *bmain, ID *id, int flag)
view_layer,
false);
if (depsgraph != NULL) {
+ /* Make sure depsgraph is pointing to a correct scene and
+ * view layer. This is mainly required in cases when depsgraph
+ * was not built yet.
+ */
+ deg_ensure_scene_view_layer(depsgraph, scene, view_layer);
deg_graph_id_tag_update(bmain, depsgraph, id, flag);
}
}
More information about the Bf-blender-cvs
mailing list