diff options
author | Wannes Malfait <Wannes> | 2021-01-16 22:09:19 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-01-16 22:09:19 +0300 |
commit | 6fb7d0f5592793196c8100ef6cdbdf99ed695952 (patch) | |
tree | 19c4c7a5dcdf724840eae52711358d8e87c2ce19 | |
parent | 1e193a0b564c72c006203a1e349269e4bb004d0e (diff) |
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
-rw-r--r-- | source/blender/nodes/geometry/node_geometry_tree.cc | 10 |
1 files changed, 9 insertions, 1 deletions
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); |