[Bf-extensions-cvs] [e9aee3ac] master: alpha node bux fixed.

Kalle-Samuli Riihikoski noreply at git.blender.org
Wed Mar 13 12:41:44 CET 2019


Commit: e9aee3ac28e0f7c15b35b2fdf410c1e2c19057eb
Author: Kalle-Samuli Riihikoski
Date:   Wed Mar 13 13:40:42 2019 +0200
Branches: master
https://developer.blender.org/rBAe9aee3ac28e0f7c15b35b2fdf410c1e2c19057eb

alpha node bux fixed.

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

M	io_coat3D/tex.py

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

diff --git a/io_coat3D/tex.py b/io_coat3D/tex.py
index b7e1f1b1..48908606 100644
--- a/io_coat3D/tex.py
+++ b/io_coat3D/tex.py
@@ -502,7 +502,7 @@ def CreateTextureLine(type, act_material, main_mat, texcoat, coat3D, notegroup,
                 texture_tree.links.new(tex_img_node.outputs[0], notegroupend.inputs[0])
                 texture_tree.links.new(tex_img_node.outputs[1], notegroupend.inputs[1])
 
-            if(index > 0):
+            if(index == 1):
                 mix_node = texture_tree.nodes.new('ShaderNodeMixRGB')
                 mix_node.blend_type = 'ADD'
                 mix_node.inputs[0].default_value = 1
@@ -510,15 +510,13 @@ def CreateTextureLine(type, act_material, main_mat, texcoat, coat3D, notegroup,
                 mix_loc[1] -= 300
                 texture_tree.links.new(tex_img_node.outputs[0], mix_node.inputs[2])
                 texture_tree.links.new(texture_tree.nodes[nodes[0]].outputs[0], mix_node.inputs[1])
-
-                mix_node_alpha = texture_tree.nodes.new('ShaderNodeMixRGB')
-                mix_node_alpha.blend_type = 'ADD'
-                mix_node_alpha.inputs[0].default_value = 1
+                mix_node_alpha = texture_tree.nodes.new('ShaderNodeMath')
                 mix_node_alpha.location = mix_loc
                 mix_loc[1] -= 200
-                texture_tree.links.new(tex_img_node.outputs[1], mix_node_alpha.inputs[2])
-                texture_tree.links.new(texture_tree.nodes[nodes[0]].outputs[0], mix_node_alpha.inputs[1])
+                texture_tree.links.new(tex_img_node.outputs[1], mix_node_alpha.inputs[1])
+                texture_tree.links.new(texture_tree.nodes[nodes[0]].outputs[1], mix_node_alpha.inputs[0])
                 nodes.clear()
+                nodes.append(tex_img_node.name)
                 nodes.append(mix_node.name)
                 nodes.append(mix_node_alpha.name)
 
@@ -529,20 +527,18 @@ def CreateTextureLine(type, act_material, main_mat, texcoat, coat3D, notegroup,
                 mix_node.inputs[0].default_value = 1
                 mix_node.location = mix_loc
                 mix_loc[1] -= 300
-                texture_tree.links.new(texture_tree.nodes[nodes[0]].outputs[0], mix_node.inputs[1])
+                texture_tree.links.new(texture_tree.nodes[nodes[1]].outputs[0], mix_node.inputs[1])
                 texture_tree.links.new(tex_img_node.outputs[0], mix_node.inputs[2])
-
-                mix_node_alpha = texture_tree.nodes.new('ShaderNodeMixRGB')
-                mix_node_alpha.blend_type = 'ADD'
-                mix_node_alpha.inputs[0].default_value = 1
+                mix_node_alpha = texture_tree.nodes.new('ShaderNodeMath')
                 mix_node_alpha.location = mix_loc
                 mix_loc[1] -= 200
-                texture_tree.links.new(texture_tree.nodes[nodes[0]].outputs[1], mix_node_alpha.inputs[1])
-                texture_tree.links.new(tex_img_node.outputs[1], mix_node_alpha.inputs[2])
+                texture_tree.links.new(texture_tree.nodes[nodes[2]].outputs[0], mix_node_alpha.inputs[0])
+                texture_tree.links.new(tex_img_node.outputs[1], mix_node_alpha.inputs[1])
 
                 nodes.clear()
                 nodes.append(tex_img_node.name)
                 nodes.append(mix_node.name)
+                nodes.append(mix_node_alpha.name)
 
             tex_loc[1] -= 300
             uv_loc[1] -=  300



More information about the Bf-extensions-cvs mailing list