Patch [#21942] Node links access by Andrey Izrantsev (bdancer) Thanks!
This adds Node Link Acces in RNA.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user