diff options
Diffstat (limited to 'source/blender/nodes/shader')
4 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c index f79edcadbda..d44cb8c7de1 100644 --- a/source/blender/nodes/shader/node_shader_tree.c +++ b/source/blender/nodes/shader/node_shader_tree.c @@ -229,7 +229,7 @@ bNode *ntreeShaderOutputNode(bNodeTree *ntree, int target) * multiple, we prefer exact target match and active nodes. */ bNode *output_node = NULL; - for (bNode *node = ntree->nodes.first; node; node = node->next) { + LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { if (!ELEM(node->type, SH_NODE_OUTPUT_MATERIAL, SH_NODE_OUTPUT_WORLD, SH_NODE_OUTPUT_LIGHT)) { continue; } @@ -344,7 +344,7 @@ static void ntree_shader_unlink_hidden_value_sockets(bNode *group_node, bNodeSoc bool removed_link = false; for (node = group_ntree->nodes.first; node; node = node->next) { - for (bNodeSocket *sock = node->inputs.first; sock; sock = sock->next) { + LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) { if ((sock->flag & SOCK_HIDE_VALUE) == 0) { continue; } @@ -553,7 +553,7 @@ static void ntree_shader_relink_node_normal(bNodeTree *ntree, /* TODO(sergey): Can we do something smarter here than just a name-based * matching? */ - for (bNodeSocket *sock = node->inputs.first; sock; sock = sock->next) { + LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) { if (STREQ(sock->identifier, "Normal") && sock->link == NULL) { /* It's a normal input and nothing is connected to it. */ nodeAddLink(ntree, node_from, socket_from, node, sock); diff --git a/source/blender/nodes/shader/nodes/node_shader_displacement.c b/source/blender/nodes/shader/nodes/node_shader_displacement.c index 496b61c8c72..22fbe4e4da6 100644 --- a/source/blender/nodes/shader/nodes/node_shader_displacement.c +++ b/source/blender/nodes/shader/nodes/node_shader_displacement.c @@ -39,7 +39,7 @@ static void node_shader_init_displacement(bNodeTree *UNUSED(ntree), bNode *node) node->custom1 = SHD_SPACE_OBJECT; /* space */ /* Set default value here for backwards compatibility. */ - for (bNodeSocket *sock = node->inputs.first; sock; sock = sock->next) { + LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) { if (STREQ(sock->name, "Midlevel")) { ((bNodeSocketValueFloat *)sock->default_value)->value = 0.5f; } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_brick.c b/source/blender/nodes/shader/nodes/node_shader_tex_brick.c index eba9abc6e3c..1b802f1dfd7 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_brick.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_brick.c @@ -135,7 +135,7 @@ static void node_shader_init_tex_brick(bNodeTree *UNUSED(ntree), bNode *node) node->storage = tex; - for (bNodeSocket *sock = node->inputs.first; sock; sock = sock->next) { + LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) { if (STREQ(sock->name, "Mortar Smooth")) { ((bNodeSocketValueFloat *)sock->default_value)->value = 0.1f; } diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_principled.c b/source/blender/nodes/shader/nodes/node_shader_volume_principled.c index 92e1b3435c8..b581a4bd3a6 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_principled.c +++ b/source/blender/nodes/shader/nodes/node_shader_volume_principled.c @@ -44,7 +44,7 @@ static bNodeSocketTemplate sh_node_volume_principled_out[] = { static void node_shader_init_volume_principled(bNodeTree *UNUSED(ntree), bNode *node) { - for (bNodeSocket *sock = node->inputs.first; sock; sock = sock->next) { + LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) { if (STREQ(sock->name, "Density Attribute")) { strcpy(((bNodeSocketValueString *)sock->default_value)->value, "density"); } @@ -66,7 +66,7 @@ static int node_shader_gpu_volume_principled(GPUMaterial *mat, /* Get volume attributes. */ GPUNodeLink *density = NULL, *color = NULL, *temperature = NULL; - for (bNodeSocket *sock = node->inputs.first; sock; sock = sock->next) { + LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) { if (sock->typeinfo->type != SOCK_STRING) { continue; } |