[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60660] trunk/blender: NodeSocket RNA property 'in_out' renamed as boolean 'is_output'.
Lukas Toenne
lukas.toenne at googlemail.com
Thu Oct 10 14:58:33 CEST 2013
Revision: 60660
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60660
Author: lukastoenne
Date: 2013-10-10 12:58:33 +0000 (Thu, 10 Oct 2013)
Log Message:
-----------
NodeSocket RNA property 'in_out' renamed as boolean 'is_output'. This is a more useful name and follows the API naming conventions better.
http://wiki.blender.org/index.php/Extensions:2.6/Py/API_Changes#Node_Socket_in_out
Modified Paths:
--------------
trunk/blender/release/scripts/startup/bl_ui/space_node.py
trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
Modified: trunk/blender/release/scripts/startup/bl_ui/space_node.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_node.py 2013-10-10 12:50:34 UTC (rev 60659)
+++ trunk/blender/release/scripts/startup/bl_ui/space_node.py 2013-10-10 12:58:33 UTC (rev 60660)
@@ -407,13 +407,13 @@
row = layout.row(align=True)
# inputs get icon on the left
- if socket.in_out == 'IN':
+ if not socket.is_output:
row.template_node_socket(color)
row.label(text=socket.name, icon_value=icon)
# outputs get icon on the right
- if socket.in_out == 'OUT':
+ if socket.is_output:
row.template_node_socket(color)
elif self.layout_type in {'GRID'}:
Modified: trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2013-10-10 12:50:34 UTC (rev 60659)
+++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2013-10-10 12:58:33 UTC (rev 60660)
@@ -1889,6 +1889,12 @@
ED_node_tag_update_nodetree(bmain, ntree);
}
+static int rna_NodeSocket_is_output_get(PointerRNA *ptr)
+{
+ bNodeSocket *sock = ptr->data;
+ return sock->in_out == SOCK_OUT;
+}
+
static void rna_NodeSocket_link_limit_set(PointerRNA *ptr, int value)
{
bNodeSocket *sock = ptr->data;
@@ -6181,12 +6187,10 @@
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Identifier", "Unique identifier for mapping sockets");
- prop = RNA_def_property(srna, "in_out", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "in_out");
- RNA_def_property_enum_items(prop, node_socket_in_out_items);
- RNA_def_property_enum_default(prop, SOCK_IN);
+ prop = RNA_def_property(srna, "is_output", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_NodeSocket_is_output_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Input or Output", "Input or Output type");
+ RNA_def_property_ui_text(prop, "Is Output", "True if the socket is an output, otherwise input");
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SOCK_HIDDEN);
@@ -6308,12 +6312,10 @@
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Identifier", "Unique identifier for mapping sockets");
- prop = RNA_def_property(srna, "in_out", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "in_out");
- RNA_def_property_enum_items(prop, node_socket_in_out_items);
- RNA_def_property_enum_default(prop, SOCK_IN);
+ prop = RNA_def_property(srna, "is_output", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_NodeSocket_is_output_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Input or Output", "Input or Output type");
+ RNA_def_property_ui_text(prop, "Is Output", "True if the socket is an output, otherwise input");
/* registration */
prop = RNA_def_property(srna, "bl_socket_idname", PROP_STRING, PROP_NONE);
More information about the Bf-blender-cvs
mailing list