[Bf-blender-cvs] [bc3b48400d7] geometry-nodes: Geometry Nodes: do not create geometry depsgraph relation for empty object

Jacques Lucke noreply at git.blender.org
Fri Nov 27 19:44:35 CET 2020


Commit: bc3b48400d7b1ae24bdff05168d465e3288ae8f6
Author: Jacques Lucke
Date:   Fri Nov 27 19:44:06 2020 +0100
Branches: geometry-nodes
https://developer.blender.org/rBbc3b48400d7b1ae24bdff05168d465e3288ae8f6

Geometry Nodes: do not create geometry depsgraph relation for empty object

This resulted in a warning.

===================================================================

M	source/blender/modifiers/intern/MOD_nodes.cc

===================================================================

diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index d91a7c5d78d..f9f523ce2d4 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -134,9 +134,13 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
     findUsedIds(*nmd->node_group, used_ids);
     for (ID *id : used_ids) {
       if (GS(id->name) == ID_OB) {
-        DEG_add_object_relation(ctx->node, (Object *)id, DEG_OB_COMP_TRANSFORM, "Nodes Modifier");
+        Object *object = reinterpret_cast<Object *>(id);
+        DEG_add_object_relation(ctx->node, object, DEG_OB_COMP_TRANSFORM, "Nodes Modifier");
         if (id != &ctx->object->id) {
-          DEG_add_object_relation(ctx->node, (Object *)id, DEG_OB_COMP_GEOMETRY, "Nodes Modifier");
+          if (object->type != OB_EMPTY) {
+            DEG_add_object_relation(
+                ctx->node, (Object *)id, DEG_OB_COMP_GEOMETRY, "Nodes Modifier");
+          }
         }
       }
     }



More information about the Bf-blender-cvs mailing list