[Bf-blender-cvs] [6fb7d0f5592] blender-v2.92-release: Fix T84713: Geometry nodes reroute sockets have incorrect type

Wannes Malfait noreply at git.blender.org
Sat Jan 16 20:11:05 CET 2021


Commit: 6fb7d0f5592793196c8100ef6cdbdf99ed695952
Author: Wannes Malfait
Date:   Sat Jan 16 13:09:19 2021 -0600
Branches: blender-v2.92-release
https://developer.blender.org/rB6fb7d0f5592793196c8100ef6cdbdf99ed695952

Fix T84713: Geometry nodes reroute sockets have incorrect type

This implements the node tree update function, which is needed so that the
reroutes get updated to the correct type. It is based on the same code in
the shader and compositor node trees.

Differential Revision: https://developer.blender.org/D10123

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

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

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

diff --git a/source/blender/nodes/geometry/node_geometry_tree.cc b/source/blender/nodes/geometry/node_geometry_tree.cc
index da77e8896fb..87178c52ab9 100644
--- a/source/blender/nodes/geometry/node_geometry_tree.cc
+++ b/source/blender/nodes/geometry/node_geometry_tree.cc
@@ -32,6 +32,8 @@
 
 #include "RNA_access.h"
 
+#include "node_common.h"
+
 bNodeTreeType *ntreeType_Geometry;
 
 static void geometry_node_tree_get_from_context(const bContext *C,
@@ -63,6 +65,12 @@ static void geometry_node_tree_get_from_context(const bContext *C,
   }
 }
 
+static void geometry_node_tree_update(bNodeTree *ntree)
+{
+  /* Needed to give correct types to reroutes. */
+  ntree_update_reroute_nodes(ntree);
+}
+
 void register_node_tree_type_geo(void)
 {
   bNodeTreeType *tt = ntreeType_Geometry = static_cast<bNodeTreeType *>(
@@ -73,7 +81,7 @@ void register_node_tree_type_geo(void)
   tt->ui_icon = 0; /* defined in drawnode.c */
   strcpy(tt->ui_description, N_("Geometry nodes"));
   tt->rna_ext.srna = &RNA_GeometryNodeTree;
-
+  tt->update = geometry_node_tree_update;
   tt->get_from_context = geometry_node_tree_get_from_context;
 
   ntreeTypeAdd(tt);



More information about the Bf-blender-cvs mailing list