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-05-04 16:02:55 +0300
committerJacques Lucke <jacques@blender.org>2022-05-04 16:02:55 +0300
commita52fbeadb1bc5df88856c26c6a81e30fae90065a (patch)
tree5e571d5db738a999c77fb04d4d9ad2f810ac5a72 /source/blender/nodes
parent82bf11e73fa27297b46051404983fb4ef1df5cbc (diff)
parent54b293237ea92f29aef05268836cab54c420d7ad (diff)
Merge branch 'blender-v3.2-release'
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_map_range.cc26
1 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_map_range.cc b/source/blender/nodes/shader/nodes/node_shader_map_range.cc
index 9ba9a279c57..a487e07bd5a 100644
--- a/source/blender/nodes/shader/nodes/node_shader_map_range.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_map_range.cc
@@ -66,24 +66,32 @@ static void node_shader_update_map_range(bNodeTree *ntree, bNode *node)
const CustomDataType data_type = static_cast<CustomDataType>(storage.data_type);
const int type = (data_type == CD_PROP_FLOAT) ? SOCK_FLOAT : SOCK_VECTOR;
- LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) {
- nodeSetSocketAvailability(ntree, socket, socket->type == type);
- }
+ Array<bool> new_input_availability(BLI_listbase_count(&node->inputs));
+ Array<bool> new_output_availability(BLI_listbase_count(&node->outputs));
- LISTBASE_FOREACH (bNodeSocket *, socket, &node->outputs) {
- nodeSetSocketAvailability(ntree, socket, socket->type == type);
+ int index;
+ LISTBASE_FOREACH_INDEX (bNodeSocket *, socket, &node->inputs, index) {
+ new_input_availability[index] = socket->type == type;
+ }
+ LISTBASE_FOREACH_INDEX (bNodeSocket *, socket, &node->outputs, index) {
+ new_output_availability[index] = socket->type == type;
}
if (storage.interpolation_type != NODE_MAP_RANGE_STEPPED) {
if (type == SOCK_FLOAT) {
- bNodeSocket *sockSteps = (bNodeSocket *)BLI_findlink(&node->inputs, 5);
- nodeSetSocketAvailability(ntree, sockSteps, false);
+ new_input_availability[5] = false;
}
else {
- bNodeSocket *sockSteps = (bNodeSocket *)BLI_findlink(&node->inputs, 11);
- nodeSetSocketAvailability(ntree, sockSteps, false);
+ new_input_availability[11] = false;
}
}
+
+ LISTBASE_FOREACH_INDEX (bNodeSocket *, socket, &node->inputs, index) {
+ nodeSetSocketAvailability(ntree, socket, new_input_availability[index]);
+ }
+ LISTBASE_FOREACH_INDEX (bNodeSocket *, socket, &node->outputs, index) {
+ nodeSetSocketAvailability(ntree, socket, new_output_availability[index]);
+ }
}
static void node_shader_init_map_range(bNodeTree *UNUSED(ntree), bNode *node)