diff options
author | Jacques Lucke <jacques@blender.org> | 2022-11-11 12:10:15 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-11-11 12:10:15 +0300 |
commit | 824d5984aab497e2914e99561f7f0a4bdafa4055 (patch) | |
tree | 6c6dea2f16f9481528ba7b4788cea667068d7e0d | |
parent | 6f1b5e10819a9e0e6d89442439372251d3a7285a (diff) | |
parent | 84c66fe9db932b82ebf445a63dfb629fb3c1b35c (diff) |
Merge branch 'blender-v3.4-release'
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index cfec020c739..14122ddb878 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2417,6 +2417,11 @@ static void rna_Node_name_set(PointerRNA *ptr, const char *value) BKE_animdata_fix_paths_rename_all(NULL, "nodes", oldname, node->name); } +static bool allow_changing_sockets(bNode *node) +{ + return ELEM(node->type, NODE_CUSTOM, SH_NODE_SCRIPT); +} + static bNodeSocket *rna_Node_inputs_new(ID *id, bNode *node, Main *bmain, @@ -2425,7 +2430,7 @@ static bNodeSocket *rna_Node_inputs_new(ID *id, const char *name, const char *identifier) { - if (node->type != NODE_CUSTOM) { + if (!allow_changing_sockets(node)) { BKE_report(reports, RPT_ERROR, "Cannot add socket to built-in node"); return NULL; } @@ -2452,7 +2457,7 @@ static bNodeSocket *rna_Node_outputs_new(ID *id, const char *name, const char *identifier) { - if (node->type != NODE_CUSTOM) { + if (!allow_changing_sockets(node)) { BKE_report(reports, RPT_ERROR, "Cannot add socket to built-in node"); return NULL; } @@ -2474,7 +2479,7 @@ static bNodeSocket *rna_Node_outputs_new(ID *id, static void rna_Node_socket_remove( ID *id, bNode *node, Main *bmain, ReportList *reports, bNodeSocket *sock) { - if (node->type != NODE_CUSTOM) { + if (!allow_changing_sockets(node)) { BKE_report(reports, RPT_ERROR, "Unable to remove socket from built-in node"); return; } @@ -2494,7 +2499,7 @@ static void rna_Node_socket_remove( static void rna_Node_inputs_clear(ID *id, bNode *node, Main *bmain, ReportList *reports) { - if (node->type != NODE_CUSTOM) { + if (!allow_changing_sockets(node)) { BKE_report(reports, RPT_ERROR, "Unable to remove sockets from built-in node"); return; } @@ -2513,7 +2518,7 @@ static void rna_Node_inputs_clear(ID *id, bNode *node, Main *bmain, ReportList * static void rna_Node_outputs_clear(ID *id, bNode *node, Main *bmain, ReportList *reports) { - if (node->type != NODE_CUSTOM) { + if (!allow_changing_sockets(node)) { BKE_report(reports, RPT_ERROR, "Unable to remove socket from built-in node"); return; } @@ -2533,7 +2538,7 @@ static void rna_Node_outputs_clear(ID *id, bNode *node, Main *bmain, ReportList static void rna_Node_inputs_move( ID *id, bNode *node, Main *bmain, ReportList *reports, int from_index, int to_index) { - if (node->type != NODE_CUSTOM) { + if (!allow_changing_sockets(node)) { BKE_report(reports, RPT_ERROR, "Unable to move sockets in built-in node"); return; } @@ -2571,7 +2576,7 @@ static void rna_Node_inputs_move( static void rna_Node_outputs_move( ID *id, bNode *node, Main *bmain, ReportList *reports, int from_index, int to_index) { - if (node->type != NODE_CUSTOM) { + if (!allow_changing_sockets(node)) { BKE_report(reports, RPT_ERROR, "Unable to move sockets in built-in node"); return; } |