Commit: 37b02b043246b416d66daf8aae60aaf9d9cd2506
Author: Miguel Pozo
Date:   Tue Dec 6 16:39:21 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rB37b02b043246b416d66daf8aae60aaf9d9cd2506

Fix T102965: Crash when compiling shader tree with undefined mix nodes

node_set_typeinfo leaves the bNode::type value as-is for nodes with undefined 
types.

===================================================================

M       source/blender/nodes/shader/node_shader_tree.cc

===================================================================

diff --git a/source/blender/nodes/shader/node_shader_tree.cc 
b/source/blender/nodes/shader/node_shader_tree.cc
index 7b5f150dfef..46ec1cff852 100644
--- a/source/blender/nodes/shader/node_shader_tree.cc
+++ b/source/blender/nodes/shader/node_shader_tree.cc
@@ -1038,10 +1038,10 @@ static void 
shader_node_disconnect_inactive_mix_branch(bNodeTree *ntree,
 static void ntree_shader_disconnect_inactive_mix_branches(bNodeTree *ntree)
 {
   LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
-    if (node->type == SH_NODE_MIX_SHADER) {
+    if (node->typeinfo->type == SH_NODE_MIX_SHADER) {
       shader_node_disconnect_inactive_mix_branch(ntree, node, 0, 1, 2, true);
     }
-    else if (node->type == SH_NODE_MIX) {
+    else if (node->typeinfo->type == SH_NODE_MIX) {
       const NodeShaderMix *storage = static_cast<NodeShaderMix 
*>(node->storage);
       if (storage->data_type == SOCK_FLOAT) {
         shader_node_disconnect_inactive_mix_branch(ntree, node, 0, 2, 3, 
storage->clamp_factor);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to