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
This commit is contained in:
Wannes Malfait 2021-01-16 13:09:19 -06:00 committed by Hans Goudey
parent 1e193a0b56
commit 6fb7d0f559
Notes: blender-bot 2023-02-14 04:39:18 +01:00
Referenced by issue #84793, Render error CUDA_ERROR_ILLEGAL_ADDRESS
Referenced by issue #84713, Reroute Colors, behave differently in Geomtry Nodes compared to Shader Nodes or Compositor Nodes
1 changed files with 9 additions and 1 deletions

View File

@ -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);