diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 0a120837191..0afb9da9547 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -799,7 +799,7 @@ const EnumPropertyItem *rna_node_socket_type_itemf(void *data, tmp.value = i; tmp.identifier = stype->idname; tmp.icon = RNA_struct_ui_icon(srna); - tmp.name = RNA_struct_ui_name(srna); + tmp.name = nodeSocketTypeLabel(stype); tmp.description = RNA_struct_ui_description(srna); RNA_enum_item_add(&item, &totitem, &tmp); @@ -1025,8 +1025,7 @@ static void rna_NodeTree_get_from_context( RNA_parameter_list_free(&list); } -static bool rna_NodeTree_valid_socket_type(eNodeSocketDatatype socket_type, - bNodeTreeType *ntreetype) +static bool rna_NodeTree_valid_socket_type(bNodeTreeType *ntreetype, bNodeSocketType *socket_type) { extern FunctionRNA rna_NodeTree_valid_socket_type_func; @@ -1040,7 +1039,7 @@ static bool rna_NodeTree_valid_socket_type(eNodeSocketDatatype socket_type, func = &rna_NodeTree_valid_socket_type_func; RNA_parameter_list_create(&list, &ptr, func); - RNA_parameter_set_lookup(&list, "type", &socket_type); + RNA_parameter_set_lookup(&list, "idname", &socket_type->idname); ntreetype->rna_ext.call(NULL, &ptr, func, &list); RNA_parameter_get_lookup(&list, "valid", &ret); @@ -2866,7 +2865,7 @@ static void rna_NodeSocket_type_set(PointerRNA *ptr, int value) bNodeSocket *sock = (bNodeSocket *)ptr->data; bNode *node; nodeFindNode(ntree, sock, &node, NULL); - nodeModifySocketType(ntree, node, sock, value, 0); + nodeModifySocketTypeStatic(ntree, node, sock, value, 0); } static void rna_NodeSocket_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) @@ -10176,7 +10175,7 @@ static void rna_def_node_socket(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Node Socket", "Input or output socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); RNA_def_struct_refine_func(srna, "rna_NodeSocket_refine"); - RNA_def_struct_ui_icon(srna, ICON_PLUGIN); + RNA_def_struct_ui_icon(srna, ICON_NONE); RNA_def_struct_path_func(srna, "rna_NodeSocket_path"); RNA_def_struct_register_funcs( srna, "rna_NodeSocket_register", "rna_NodeSocket_unregister", NULL); @@ -10281,6 +10280,11 @@ static void rna_def_node_socket(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_ui_text(prop, "ID Name", ""); + prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "typeinfo->label"); + RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + RNA_def_property_ui_text(prop, "Type Label", "Label to display for the socket type in the UI"); + /* draw socket */ func = RNA_def_function(srna, "draw", NULL); RNA_def_function_ui_description(func, "Draw socket"); @@ -10369,6 +10373,11 @@ static void rna_def_node_socket_interface(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_ui_text(prop, "ID Name", ""); + prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "typeinfo->label"); + RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + RNA_def_property_ui_text(prop, "Type Label", "Label to display for the socket type in the UI"); + func = RNA_def_function(srna, "draw", NULL); RNA_def_function_ui_description(func, "Draw template settings"); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); @@ -11879,11 +11888,12 @@ static void rna_def_nodetree(BlenderRNA *brna) func, "result_3", "ID", "From ID", "Original ID data-block selected from the context"); RNA_def_function_output(func, parm); - /* Check for support of a socket type. */ + /* Check for support of a socket type with a type identifier. */ func = RNA_def_function(srna, "valid_socket_type", NULL); RNA_def_function_ui_description(func, "Check if the socket type is valid for the node tree"); RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_REGISTER_OPTIONAL); - parm = RNA_def_enum(func, "type", node_socket_type_items, 0, "", ""); + parm = RNA_def_string( + func, "idname", "NodeSocket", MAX_NAME, "Socket Type", "Identifier of the socket type"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); RNA_def_function_return(func, RNA_def_boolean(func, "valid", false, "", "")); } |