Fix #111142: Node group property 'bl_static_type' returns empty string for node groups and custom nodes #111154
|
@ -755,6 +755,7 @@ bool nodeGroupPoll(const struct bNodeTree *nodetree,
|
|||
void node_type_base_custom(struct bNodeType *ntype,
|
||||
const char *idname,
|
||||
const char *name,
|
||||
const char *enum_name,
|
||||
short nclass);
|
||||
|
||||
/**
|
||||
|
|
|
@ -4301,12 +4301,14 @@ void node_type_base(bNodeType *ntype, const int type, const char *name, const sh
|
|||
void node_type_base_custom(bNodeType *ntype,
|
||||
const char *idname,
|
||||
const char *name,
|
||||
const char *enum_name,
|
||||
const short nclass)
|
||||
{
|
||||
STRNCPY(ntype->idname, idname);
|
||||
ntype->type = NODE_CUSTOM;
|
||||
STRNCPY(ntype->ui_name, name);
|
||||
ntype->nclass = nclass;
|
||||
ntype->enum_name_legacy = enum_name;
|
||||
|
||||
blender::bke::node_type_base_defaults(ntype);
|
||||
}
|
||||
|
|
|
@ -1794,7 +1794,7 @@ static bNodeType *rna_Node_register_base(Main *bmain,
|
|||
/* setup dummy node & node type to store static properties in */
|
||||
memset(&dummy_nt, 0, sizeof(bNodeType));
|
||||
/* this does some additional initialization of default values */
|
||||
node_type_base_custom(&dummy_nt, identifier, "", 0);
|
||||
node_type_base_custom(&dummy_nt, identifier, "", "CUSTOM", 0);
|
||||
|
||||
memset(&dummy_node, 0, sizeof(bNode));
|
||||
dummy_node.typeinfo = &dummy_nt;
|
||||
|
|
|
@ -22,7 +22,7 @@ void register_node_type_cmp_group()
|
|||
|
||||
/* NOTE: Cannot use sh_node_type_base for node group, because it would map the node type
|
||||
* to the shared NODE_GROUP integer type id. */
|
||||
node_type_base_custom(&ntype, "CompositorNodeGroup", "Group", NODE_CLASS_GROUP);
|
||||
node_type_base_custom(&ntype, "CompositorNodeGroup", "Group", "GROUP", NODE_CLASS_GROUP);
|
||||
ntype.type = NODE_GROUP;
|
||||
ntype.poll = cmp_node_poll_default;
|
||||
ntype.poll_instance = node_group_poll_instance;
|
||||
|
|
|
@ -42,7 +42,7 @@ static void register_node_type_geo_group()
|
|||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base_custom(&ntype, "GeometryNodeGroup", "Group", NODE_CLASS_GROUP);
|
||||
node_type_base_custom(&ntype, "GeometryNodeGroup", "Group", "GROUP", NODE_CLASS_GROUP);
|
||||
ntype.type = NODE_GROUP;
|
||||
ntype.poll = geo_node_poll_default;
|
||||
ntype.poll_instance = node_group_poll_instance;
|
||||
|
|
|
@ -34,7 +34,8 @@ static void register_undefined_types()
|
|||
STRNCPY(blender::bke::NodeTreeTypeUndefined.ui_name, N_("Undefined"));
|
||||
STRNCPY(blender::bke::NodeTreeTypeUndefined.ui_description, N_("Undefined Node Tree Type"));
|
||||
|
||||
node_type_base_custom(&blender::bke::NodeTypeUndefined, "NodeUndefined", "Undefined", 0);
|
||||
node_type_base_custom(
|
||||
&blender::bke::NodeTypeUndefined, "NodeUndefined", "Undefined", "UNDEFINED", 0);
|
||||
blender::bke::NodeTypeUndefined.poll = node_undefined_poll;
|
||||
|
||||
STRNCPY(blender::bke::NodeSocketTypeUndefined.idname, "NodeSocketUndefined");
|
||||
|
|
|
@ -85,7 +85,7 @@ void register_node_type_sh_group()
|
|||
/* NOTE: cannot use #sh_node_type_base for node group, because it would map the node type
|
||||
* to the shared #NODE_GROUP integer type id. */
|
||||
|
||||
node_type_base_custom(&ntype, "ShaderNodeGroup", "Group", NODE_CLASS_GROUP);
|
||||
node_type_base_custom(&ntype, "ShaderNodeGroup", "Group", "GROUP", NODE_CLASS_GROUP);
|
||||
ntype.type = NODE_GROUP;
|
||||
ntype.poll = sh_node_poll_default;
|
||||
ntype.poll_instance = node_group_poll_instance;
|
||||
|
|
|
@ -143,7 +143,7 @@ void register_node_type_tex_group()
|
|||
/* NOTE: Cannot use #sh_node_type_base for node group, because it would map the node type
|
||||
* to the shared #NODE_GROUP integer type id. */
|
||||
|
||||
node_type_base_custom(&ntype, "TextureNodeGroup", "Group", NODE_CLASS_GROUP);
|
||||
node_type_base_custom(&ntype, "TextureNodeGroup", "Group", "GROUP", NODE_CLASS_GROUP);
|
||||
ntype.type = NODE_GROUP;
|
||||
ntype.poll = tex_node_poll_default;
|
||||
ntype.poll_instance = node_group_poll_instance;
|
||||
|
|
Loading…
Reference in New Issue