|
|
|
|
@@ -726,7 +726,7 @@ static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *C, ReportList *r
|
|
|
|
|
return node;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_NodeTree_node_remove(bNodeTree *ntree, ReportList *reports, PointerRNA *node_ptr)
|
|
|
|
|
static void rna_NodeTree_node_remove(bNodeTree *ntree, Main *bmain, ReportList *reports, PointerRNA *node_ptr)
|
|
|
|
|
{
|
|
|
|
|
bNode *node = node_ptr->data;
|
|
|
|
|
|
|
|
|
|
@@ -742,11 +742,11 @@ static void rna_NodeTree_node_remove(bNodeTree *ntree, ReportList *reports, Poin
|
|
|
|
|
nodeFreeNode(ntree, node);
|
|
|
|
|
RNA_POINTER_INVALIDATE(node_ptr);
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree); /* update group node socket links */
|
|
|
|
|
ntreeUpdateTree(bmain, ntree); /* update group node socket links */
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_NodeTree_node_clear(bNodeTree *ntree, ReportList *reports)
|
|
|
|
|
static void rna_NodeTree_node_clear(bNodeTree *ntree, Main *bmain, ReportList *reports)
|
|
|
|
|
{
|
|
|
|
|
bNode *node = ntree->nodes.first;
|
|
|
|
|
|
|
|
|
|
@@ -764,7 +764,7 @@ static void rna_NodeTree_node_clear(bNodeTree *ntree, ReportList *reports)
|
|
|
|
|
node = next_node;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
@@ -787,7 +787,7 @@ static void rna_NodeTree_active_node_set(PointerRNA *ptr, const PointerRNA value
|
|
|
|
|
nodeClearActive(ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, ReportList *reports,
|
|
|
|
|
static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, Main *bmain, ReportList *reports,
|
|
|
|
|
bNodeSocket *fromsock, bNodeSocket *tosock,
|
|
|
|
|
int verify_limits)
|
|
|
|
|
{
|
|
|
|
|
@@ -829,15 +829,15 @@ static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, ReportList *reports,
|
|
|
|
|
if (tonode)
|
|
|
|
|
nodeUpdate(ntree, tonode);
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
|
|
|
|
|
ED_node_tag_update_nodetree(G.main, ntree, ret->tonode);
|
|
|
|
|
ED_node_tag_update_nodetree(bmain, ntree, ret->tonode);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_NodeTree_link_remove(bNodeTree *ntree, ReportList *reports, PointerRNA *link_ptr)
|
|
|
|
|
static void rna_NodeTree_link_remove(bNodeTree *ntree, Main *bmain, ReportList *reports, PointerRNA *link_ptr)
|
|
|
|
|
{
|
|
|
|
|
bNodeLink *link = link_ptr->data;
|
|
|
|
|
|
|
|
|
|
@@ -852,11 +852,11 @@ static void rna_NodeTree_link_remove(bNodeTree *ntree, ReportList *reports, Poin
|
|
|
|
|
nodeRemLink(ntree, link);
|
|
|
|
|
RNA_POINTER_INVALIDATE(link_ptr);
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_NodeTree_link_clear(bNodeTree *ntree, ReportList *reports)
|
|
|
|
|
static void rna_NodeTree_link_clear(bNodeTree *ntree, Main *bmain, ReportList *reports)
|
|
|
|
|
{
|
|
|
|
|
bNodeLink *link = ntree->links.first;
|
|
|
|
|
|
|
|
|
|
@@ -870,7 +870,7 @@ static void rna_NodeTree_link_clear(bNodeTree *ntree, ReportList *reports)
|
|
|
|
|
|
|
|
|
|
link = next_link;
|
|
|
|
|
}
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
@@ -933,7 +933,7 @@ static void rna_NodeTree_active_output_set(PointerRNA *ptr, int value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bNodeSocket *rna_NodeTree_inputs_new(bNodeTree *ntree, ReportList *reports, const char *type, const char *name)
|
|
|
|
|
static bNodeSocket *rna_NodeTree_inputs_new(bNodeTree *ntree, Main *bmain, ReportList *reports, const char *type, const char *name)
|
|
|
|
|
{
|
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
|
|
|
|
|
@@ -942,13 +942,13 @@ static bNodeSocket *rna_NodeTree_inputs_new(bNodeTree *ntree, ReportList *report
|
|
|
|
|
|
|
|
|
|
sock = ntreeAddSocketInterface(ntree, SOCK_IN, type, name);
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
|
|
|
|
|
return sock;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bNodeSocket *rna_NodeTree_outputs_new(bNodeTree *ntree, ReportList *reports, const char *type, const char *name)
|
|
|
|
|
static bNodeSocket *rna_NodeTree_outputs_new(bNodeTree *ntree, Main *bmain, ReportList *reports, const char *type, const char *name)
|
|
|
|
|
{
|
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
|
|
|
|
|
@@ -957,13 +957,13 @@ static bNodeSocket *rna_NodeTree_outputs_new(bNodeTree *ntree, ReportList *repor
|
|
|
|
|
|
|
|
|
|
sock = ntreeAddSocketInterface(ntree, SOCK_OUT, type, name);
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
|
|
|
|
|
return sock;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_NodeTree_socket_remove(bNodeTree *ntree, ReportList *reports, bNodeSocket *sock)
|
|
|
|
|
static void rna_NodeTree_socket_remove(bNodeTree *ntree, Main *bmain, ReportList *reports, bNodeSocket *sock)
|
|
|
|
|
{
|
|
|
|
|
if (!rna_NodeTree_check(ntree, reports))
|
|
|
|
|
return;
|
|
|
|
|
@@ -974,12 +974,12 @@ static void rna_NodeTree_socket_remove(bNodeTree *ntree, ReportList *reports, bN
|
|
|
|
|
else {
|
|
|
|
|
ntreeRemoveSocketInterface(ntree, sock);
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_NodeTree_inputs_clear(bNodeTree *ntree, ReportList *reports)
|
|
|
|
|
static void rna_NodeTree_inputs_clear(bNodeTree *ntree, Main *bmain, ReportList *reports)
|
|
|
|
|
{
|
|
|
|
|
bNodeSocket *sock, *nextsock;
|
|
|
|
|
|
|
|
|
|
@@ -991,11 +991,11 @@ static void rna_NodeTree_inputs_clear(bNodeTree *ntree, ReportList *reports)
|
|
|
|
|
ntreeRemoveSocketInterface(ntree, sock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_NodeTree_outputs_clear(bNodeTree *ntree, ReportList *reports)
|
|
|
|
|
static void rna_NodeTree_outputs_clear(bNodeTree *ntree, Main *bmain, ReportList *reports)
|
|
|
|
|
{
|
|
|
|
|
bNodeSocket *sock, *nextsock;
|
|
|
|
|
|
|
|
|
|
@@ -1007,11 +1007,11 @@ static void rna_NodeTree_outputs_clear(bNodeTree *ntree, ReportList *reports)
|
|
|
|
|
ntreeRemoveSocketInterface(ntree, sock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_NodeTree_inputs_move(bNodeTree *ntree, int from_index, int to_index)
|
|
|
|
|
static void rna_NodeTree_inputs_move(bNodeTree *ntree, Main *bmain, int from_index, int to_index)
|
|
|
|
|
{
|
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
|
|
|
|
|
@@ -1038,11 +1038,11 @@ static void rna_NodeTree_inputs_move(bNodeTree *ntree, int from_index, int to_in
|
|
|
|
|
|
|
|
|
|
ntree->update |= NTREE_UPDATE_GROUP_IN;
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_NodeTree_outputs_move(bNodeTree *ntree, int from_index, int to_index)
|
|
|
|
|
static void rna_NodeTree_outputs_move(bNodeTree *ntree, Main *bmain, int from_index, int to_index)
|
|
|
|
|
{
|
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
|
|
|
|
|
@@ -1069,16 +1069,18 @@ static void rna_NodeTree_outputs_move(bNodeTree *ntree, int from_index, int to_i
|
|
|
|
|
|
|
|
|
|
ntree->update |= NTREE_UPDATE_GROUP_OUT;
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_NodeTree_interface_update(bNodeTree *ntree, bContext *C)
|
|
|
|
|
{
|
|
|
|
|
Main *bmain = CTX_data_main(C);
|
|
|
|
|
|
|
|
|
|
ntree->update |= NTREE_UPDATE_GROUP;
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
|
|
|
|
|
ED_node_tag_update_nodetree(CTX_data_main(C), ntree, NULL);
|
|
|
|
|
ED_node_tag_update_nodetree(bmain, ntree, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1608,7 +1610,7 @@ static void rna_Node_name_set(PointerRNA *ptr, const char *value)
|
|
|
|
|
BKE_animdata_fix_paths_rename_all(NULL, "nodes", oldname, node->name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bNodeSocket *rna_Node_inputs_new(ID *id, bNode *node, ReportList *reports, const char *type, const char *name, const char *identifier)
|
|
|
|
|
static bNodeSocket *rna_Node_inputs_new(ID *id, bNode *node, Main *bmain, ReportList *reports, const char *type, const char *name, const char *identifier)
|
|
|
|
|
{
|
|
|
|
|
bNodeTree *ntree = (bNodeTree *)id;
|
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
@@ -1619,14 +1621,14 @@ static bNodeSocket *rna_Node_inputs_new(ID *id, bNode *node, ReportList *reports
|
|
|
|
|
BKE_report(reports, RPT_ERROR, "Unable to create socket");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return sock;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bNodeSocket *rna_Node_outputs_new(ID *id, bNode *node, ReportList *reports, const char *type, const char *name, const char *identifier)
|
|
|
|
|
static bNodeSocket *rna_Node_outputs_new(ID *id, bNode *node, Main *bmain, ReportList *reports, const char *type, const char *name, const char *identifier)
|
|
|
|
|
{
|
|
|
|
|
bNodeTree *ntree = (bNodeTree *)id;
|
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
@@ -1637,14 +1639,14 @@ static bNodeSocket *rna_Node_outputs_new(ID *id, bNode *node, ReportList *report
|
|
|
|
|
BKE_report(reports, RPT_ERROR, "Unable to create socket");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return sock;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Node_socket_remove(ID *id, bNode *node, ReportList *reports, bNodeSocket *sock)
|
|
|
|
|
static void rna_Node_socket_remove(ID *id, bNode *node, Main *bmain, ReportList *reports, bNodeSocket *sock)
|
|
|
|
|
{
|
|
|
|
|
bNodeTree *ntree = (bNodeTree *)id;
|
|
|
|
|
|
|
|
|
|
@@ -1654,12 +1656,12 @@ static void rna_Node_socket_remove(ID *id, bNode *node, ReportList *reports, bNo
|
|
|
|
|
else {
|
|
|
|
|
nodeRemoveSocket(ntree, node, sock);
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Node_inputs_clear(ID *id, bNode *node)
|
|
|
|
|
static void rna_Node_inputs_clear(ID *id, bNode *node, Main *bmain)
|
|
|
|
|
{
|
|
|
|
|
bNodeTree *ntree = (bNodeTree *)id;
|
|
|
|
|
bNodeSocket *sock, *nextsock;
|
|
|
|
|
@@ -1669,11 +1671,11 @@ static void rna_Node_inputs_clear(ID *id, bNode *node)
|
|
|
|
|
nodeRemoveSocket(ntree, node, sock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Node_outputs_clear(ID *id, bNode *node)
|
|
|
|
|
static void rna_Node_outputs_clear(ID *id, bNode *node, Main *bmain)
|
|
|
|
|
{
|
|
|
|
|
bNodeTree *ntree = (bNodeTree *)id;
|
|
|
|
|
bNodeSocket *sock, *nextsock;
|
|
|
|
|
@@ -1683,11 +1685,11 @@ static void rna_Node_outputs_clear(ID *id, bNode *node)
|
|
|
|
|
nodeRemoveSocket(ntree, node, sock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Node_inputs_move(ID *id, bNode *node, int from_index, int to_index)
|
|
|
|
|
static void rna_Node_inputs_move(ID *id, bNode *node, Main *bmain, int from_index, int to_index)
|
|
|
|
|
{
|
|
|
|
|
bNodeTree *ntree = (bNodeTree *)id;
|
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
@@ -1713,11 +1715,11 @@ static void rna_Node_inputs_move(ID *id, bNode *node, int from_index, int to_ind
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Node_outputs_move(ID *id, bNode *node, int from_index, int to_index)
|
|
|
|
|
static void rna_Node_outputs_move(ID *id, bNode *node, Main *bmain, int from_index, int to_index)
|
|
|
|
|
{
|
|
|
|
|
bNodeTree *ntree = (bNodeTree *)id;
|
|
|
|
|
bNodeSocket *sock;
|
|
|
|
|
@@ -1743,7 +1745,7 @@ static void rna_Node_outputs_move(ID *id, bNode *node, int from_index, int to_in
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2216,7 +2218,7 @@ static void rna_NodeSocketInterface_update(Main *bmain, Scene *UNUSED(scene), Po
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
ntree->update |= NTREE_UPDATE_GROUP;
|
|
|
|
|
ntreeUpdateTree(G.main, ntree);
|
|
|
|
|
ntreeUpdateTree(bmain, ntree);
|
|
|
|
|
|
|
|
|
|
ED_node_tag_update_nodetree(bmain, ntree, NULL);
|
|
|
|
|
}
|
|
|
|
|
@@ -5022,17 +5024,17 @@ static void rna_def_cmp_output_file_slots_api(BlenderRNA *brna, PropertyRNA *cpr
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "remove", "rna_Node_socket_remove");
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove a file slot from this node");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS);
|
|
|
|
|
parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "The socket to remove");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "clear", "rna_Node_inputs_clear");
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove all file slots from this node");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN);
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "move", "rna_Node_inputs_move");
|
|
|
|
|
RNA_def_function_ui_description(func, "Move a file slot to another position");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN);
|
|
|
|
|
parm = RNA_def_int(func, "from_index", -1, 0, INT_MAX, "From Index", "Index of the socket to move", 0, 10000);
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
parm = RNA_def_int(func, "to_index", -1, 0, INT_MAX, "To Index", "Target index for the socket", 0, 10000);
|
|
|
|
|
@@ -7765,7 +7767,7 @@ static void rna_def_node_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int i
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "new", newfunc);
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a socket to this node");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS);
|
|
|
|
|
parm = RNA_def_string(func, "type", NULL, MAX_NAME, "Type", "Data type");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
parm = RNA_def_string(func, "name", NULL, MAX_NAME, "Name", "");
|
|
|
|
|
@@ -7777,17 +7779,17 @@ static void rna_def_node_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int i
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "remove", "rna_Node_socket_remove");
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove a socket from this node");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS);
|
|
|
|
|
parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "The socket to remove");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "clear", clearfunc);
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove all sockets from this node");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN);
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "move", movefunc);
|
|
|
|
|
RNA_def_function_ui_description(func, "Move a socket to another position");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN);
|
|
|
|
|
parm = RNA_def_int(func, "from_index", -1, 0, INT_MAX, "From Index", "Index of the socket to move", 0, 10000);
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
parm = RNA_def_int(func, "to_index", -1, 0, INT_MAX, "To Index", "Target index for the socket", 0, 10000);
|
|
|
|
|
@@ -8158,14 +8160,14 @@ static void rna_def_nodetree_nodes_api(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove a node from this node tree");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
|
|
|
|
|
parm = RNA_def_pointer(func, "node", "Node", "", "The node to remove");
|
|
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "clear", "rna_NodeTree_node_clear");
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove all nodes from this node tree");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_struct_type(prop, "Node");
|
|
|
|
|
@@ -8188,7 +8190,7 @@ static void rna_def_nodetree_link_api(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "new", "rna_NodeTree_link_new");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a node link to this node tree");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
|
|
|
|
|
parm = RNA_def_pointer(func, "input", "NodeSocket", "", "The input socket");
|
|
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
|
|
|
|
|
parm = RNA_def_pointer(func, "output", "NodeSocket", "", "The output socket");
|
|
|
|
|
@@ -8200,14 +8202,14 @@ static void rna_def_nodetree_link_api(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "remove", "rna_NodeTree_link_remove");
|
|
|
|
|
RNA_def_function_ui_description(func, "remove a node link from the node tree");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
|
|
|
|
|
parm = RNA_def_pointer(func, "link", "NodeLink", "", "The node link to remove");
|
|
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "clear", "rna_NodeTree_link_clear");
|
|
|
|
|
RNA_def_function_ui_description(func, "remove all node links from the node tree");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_node_tree_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int in_out)
|
|
|
|
|
@@ -8228,7 +8230,7 @@ static void rna_def_node_tree_sockets_api(BlenderRNA *brna, PropertyRNA *cprop,
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "new", newfunc);
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a socket to this node tree");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
|
|
|
|
|
parm = RNA_def_string(func, "type", NULL, MAX_NAME, "Type", "Data type");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
parm = RNA_def_string(func, "name", NULL, MAX_NAME, "Name", "");
|
|
|
|
|
@@ -8239,16 +8241,17 @@ static void rna_def_node_tree_sockets_api(BlenderRNA *brna, PropertyRNA *cprop,
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "remove", "rna_NodeTree_socket_remove");
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove a socket from this node tree");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
|
|
|
|
|
parm = RNA_def_pointer(func, "socket", "NodeSocketInterface", "", "The socket to remove");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "clear", clearfunc);
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove all sockets from this node tree");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "move", movefunc);
|
|
|
|
|
RNA_def_function_ui_description(func, "Move a socket to another position");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_MAIN);
|
|
|
|
|
parm = RNA_def_int(func, "from_index", -1, 0, INT_MAX, "From Index", "Index of the socket to move", 0, 10000);
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
parm = RNA_def_int(func, "to_index", -1, 0, INT_MAX, "To Index", "Target index for the socket", 0, 10000);
|
|
|
|
|
|