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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 7ccf11af829..a9054d7b4e0 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -2008,6 +2008,12 @@ static void rna_NodeSocket_update(Main *bmain, Scene *UNUSED(scene), PointerRNA
ED_node_tag_update_nodetree(bmain, ntree);
}
+static void rna_NodeSocket_link_limit_set(PointerRNA *ptr, int value)
+{
+ bNodeSocket *sock = ptr->data;
+ sock->limit = (value == 0 ? 0xFFF : value);
+}
+
static void rna_NodeSocket_hide_set(PointerRNA *ptr, int value)
{
bNodeSocket *sock = (bNodeSocket *)ptr->data;
@@ -5893,6 +5899,13 @@ static void rna_def_node_socket(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Enabled", "Enable the socket");
RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, NULL);
+ prop = RNA_def_property(srna, "link_limit", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "limit");
+ RNA_def_property_int_funcs(prop, NULL, "rna_NodeSocket_link_limit_set", NULL);
+ RNA_def_property_range(prop, 1, 0xFFF);
+ RNA_def_property_ui_text(prop, "Link Limit", "Max number of links allowed for this socket");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, NULL);
+
prop = RNA_def_property(srna, "is_linked", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SOCK_IN_USE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);