Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-10-10 16:58:33 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-10-10 16:58:33 +0400
commit2a549285633f390da44051bbee2f8d5abf693396 (patch)
treedf1a677fb21a53c9c00a382ca57f16bcacf5b4e0
parent33894a4cd528f8fed74f81ed4e5f5a33435130e9 (diff)
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
-rw-r--r--release/scripts/startup/bl_ui/space_node.py4
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c22
2 files changed, 14 insertions, 12 deletions
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index 843bafabdec..1721eacd8ac 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -407,13 +407,13 @@ class NODE_UL_interface_sockets(bpy.types.UIList):
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'}:
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index e8f393efc98..bb8e8d87252 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -1889,6 +1889,12 @@ static void rna_NodeSocket_update(Main *bmain, Scene *UNUSED(scene), PointerRNA
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 @@ static void rna_def_node_socket(BlenderRNA *brna)
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 @@ static void rna_def_node_socket_interface(BlenderRNA *brna)
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);