[Bf-extensions-cvs] [0e9032d6] blender2.8: Not link applink group node if not sure where to link it

Kalle-Samuli Riihikoski noreply at git.blender.org
Fri Dec 7 10:16:21 CET 2018


Commit: 0e9032d6776f77800498b50b76f80e91c36c0270
Author: Kalle-Samuli Riihikoski
Date:   Fri Dec 7 11:13:00 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBA0e9032d6776f77800498b50b76f80e91c36c0270

Not link applink group node if not sure where to link it

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

M	io_coat3D/tex.py

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

diff --git a/io_coat3D/tex.py b/io_coat3D/tex.py
index 1ebe21ca..4973bd4f 100644
--- a/io_coat3D/tex.py
+++ b/io_coat3D/tex.py
@@ -146,7 +146,7 @@ def createnodes(active_mat,texcoat): #luo nodes palikat ja linkittaa tekstuurit
         group_tree.outputs.new("NodeSocketColor", "Color")
         group_tree.outputs.new("NodeSocketColor", "Metallic")
         group_tree.outputs.new("NodeSocketColor", "Roughness")
-        group_tree.outputs.new("NodeSocketColor", "Normal map")
+        group_tree.outputs.new("NodeSocketVector", "Normal map")
         applink_tree = act_material.nodes.new('ShaderNodeGroup')
         applink_tree.name = '3DC_Applink'
         applink_tree.node_tree = group_tree
@@ -165,8 +165,6 @@ def createnodes(active_mat,texcoat): #luo nodes palikat ja linkittaa tekstuurit
             if(index == 1):
                 break
 
-
-
     if(out_mat.inputs['Surface'].is_linked == True):
         main_mat = out_mat.inputs['Surface'].links[0].from_node
         if(main_mat.inputs.find('Base Color') == -1):
@@ -201,7 +199,11 @@ def createnodes(active_mat,texcoat): #luo nodes palikat ja linkittaa tekstuurit
                 act_material.links.new(node.outputs[0], curvenode.inputs[1])
                 if(coat3D.creategroup):
                     act_material.links.new(huenode.outputs[0], notegroup.inputs[0])
-                    main_material.links.new(applink_tree.outputs[0],main_mat.inputs[input_color])
+                    if(main_mat.type != 'MIX_SHADER'):
+                        main_material.links.new(applink_tree.outputs[0],main_mat.inputs[input_color])
+                    else:
+                        location = main_mat.location
+                        applink_tree.location = main_mat.location[0], main_mat.location[1] + 200
                 else:
                     act_material.links.new(huenode.outputs[0], main_mat.inputs[input_color])
                 node.location = -990, 530
@@ -232,6 +234,9 @@ def createnodes(active_mat,texcoat): #luo nodes palikat ja linkittaa tekstuurit
                 huenode = act_material.nodes.new('ShaderNodeHueSaturation')
                 huenode.name = '3DC_HueSaturation'
 
+                act_material.links.new(curvenode.outputs[0], huenode.inputs[4])
+                act_material.links.new(node.outputs[0], curvenode.inputs[1])
+
                 if (coat3D.creategroup):
                     act_material.links.new(huenode.outputs[0], notegroup.inputs[1])
                     if (main_mat.type == 'BSDF_PRINCIPLED'):
@@ -269,6 +274,9 @@ def createnodes(active_mat,texcoat): #luo nodes palikat ja linkittaa tekstuurit
                 huenode = act_material.nodes.new('ShaderNodeHueSaturation')
                 huenode.name = '3DC_HueSaturation'
 
+                act_material.links.new(curvenode.outputs[0], huenode.inputs[4])
+                act_material.links.new(node.outputs[0], curvenode.inputs[1])
+
                 if (coat3D.creategroup):
                     act_material.links.new(huenode.outputs[0], notegroup.inputs[2])
                     if(main_mat.type == 'BSDF_PRINCIPLED'):



More information about the Bf-extensions-cvs mailing list