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:
authorThomas Dinges <blender@dingto.org>2010-11-14 01:38:33 +0300
committerThomas Dinges <blender@dingto.org>2010-11-14 01:38:33 +0300
commite574b3cdcc2cabea2e99dc8ec4ffb0493fead3d2 (patch)
treee65dd8a1aa3515e547bb881d835cac51fb46530b /source/blender/makesrna/intern/rna_nodetree.c
parent2fbfd11f8db0cc6dbb0afc0a018e951f10f2a42c (diff)
Patch [#21942] Node links access by Andrey Izrantsev (bdancer) Thanks!
This adds Node Link Acces in RNA.
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 325362dd587..7a382f537a6 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -2287,6 +2287,37 @@ static void rna_def_node(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Outputs", "");
}
+static void rna_def_node_link(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "NodeLink", NULL);
+ RNA_def_struct_ui_text(srna, "NodeLink", "Link between nodes in a node tree");
+ RNA_def_struct_sdna(srna, "bNodeLink");
+ RNA_def_struct_ui_icon(srna, ICON_NODE);
+
+ prop = RNA_def_property(srna, "from_node", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "fromnode");
+ RNA_def_property_struct_type(prop, "Node");
+ RNA_def_property_ui_text(prop, "From node", "");
+
+ prop = RNA_def_property(srna, "to_node", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "tonode");
+ RNA_def_property_struct_type(prop, "Node");
+ RNA_def_property_ui_text(prop, "To node", "");
+
+ prop = RNA_def_property(srna, "from_socket", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "fromsock");
+ RNA_def_property_struct_type(prop, "NodeSocket");
+ RNA_def_property_ui_text(prop, "From socket", "");
+
+ prop = RNA_def_property(srna, "to_socket", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "tosock");
+ RNA_def_property_struct_type(prop, "NodeSocket");
+ RNA_def_property_ui_text(prop, "To socket", "");
+}
+
static void rna_def_nodetree(BlenderRNA *brna)
{
StructRNA *srna;
@@ -2305,6 +2336,12 @@ static void rna_def_nodetree(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "nodes", NULL);
RNA_def_property_struct_type(prop, "Node");
RNA_def_property_ui_text(prop, "Nodes", "");
+
+ /* NodeLinks Collection */
+ prop = RNA_def_property(srna, "links", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "links", NULL);
+ RNA_def_property_struct_type(prop, "NodeLink");
+ RNA_def_property_ui_text(prop, "Links", "");
/* Grease Pencil */
prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
@@ -2331,6 +2368,7 @@ void RNA_def_nodetree(BlenderRNA *brna)
rna_def_node_socket_vector(brna);
rna_def_node_socket_rgba(brna);
rna_def_node(brna);
+ rna_def_node_link(brna);
rna_def_shader_node(brna);
rna_def_compositor_node(brna);
rna_def_texture_node(brna);