[Bf-blender-cvs] [195a271bab9] temp-nodes-group-declarations: Add more early return checks to geometry node group declaration

Hans Goudey noreply at git.blender.org
Thu Dec 22 21:04:35 CET 2022


Commit: 195a271bab9eefe669cd070af620d3988e4c617a
Author: Hans Goudey
Date:   Thu Dec 22 15:04:27 2022 -0500
Branches: temp-nodes-group-declarations
https://developer.blender.org/rB195a271bab9eefe669cd070af620d3988e4c617a

Add more early return checks to geometry node group declaration

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

M	source/blender/nodes/geometry/nodes/node_geo_common.cc

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

diff --git a/source/blender/nodes/geometry/nodes/node_geo_common.cc b/source/blender/nodes/geometry/nodes/node_geo_common.cc
index 077c260e71a..731d86d7bc1 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_common.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_common.cc
@@ -15,15 +15,20 @@ static void node_declare(const bNodeTree &node_tree,
                          const bNode &node,
                          NodeDeclaration &r_declaration)
 {
+  const bNodeTree *group = reinterpret_cast<const bNodeTree *>(node.id);
+  if (!group) {
+    return;
+  }
   node_group_declare_dynamic(node_tree, node, r_declaration);
   if (!node.id) {
     return;
   }
-  /* TODO: Other return early checks. */
+  if (ID_IS_LINKED(&group->id) && (group->id.tag & LIB_TAG_MISSING)) {
+    return;
+  }
 
-  const bNodeTree &group = reinterpret_cast<const bNodeTree &>(*node.id);
   FieldInferencingInterface field_interface;
-  bke::node_field_inferencing::calculate_field_interface(group, field_interface);
+  bke::node_field_inferencing::calculate_field_interface(*group, field_interface);
   for (const int i : r_declaration.inputs_.index_range()) {
     r_declaration.inputs_[i]->input_field_type_ = field_interface.inputs[i];
   }



More information about the Bf-blender-cvs mailing list