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:
authorJacques Lucke <jacques@blender.org>2022-11-11 12:08:49 +0300
committerJacques Lucke <jacques@blender.org>2022-11-11 12:08:49 +0300
commit84c66fe9db932b82ebf445a63dfb629fb3c1b35c (patch)
tree2503f4c2210c2973484b0788ea40371671fb6912
parent88c956c13be40aeaaf3828369ab63801413fef82 (diff)
Fix T102406: OSL script node no longer updates its in and outputs
This special case was missing in rB52bd198153ede3c7131df.
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c19
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;
}