From 6fb7d0f5592793196c8100ef6cdbdf99ed695952 Mon Sep 17 00:00:00 2001 From: Wannes Malfait Date: Sat, 16 Jan 2021 13:09:19 -0600 Subject: 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 --- source/blender/nodes/geometry/node_geometry_tree.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to '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( @@ -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); -- cgit v1.2.3