[Bf-extensions-cvs] [339ebe6] master: materials utils, Fix for node trees

meta-androcto noreply at git.blender.org
Fri Aug 12 09:28:48 CEST 2016


Commit: 339ebe682f188601186da485507b80d8de55fed8
Author: meta-androcto
Date:   Fri Aug 12 17:28:16 2016 +1000
Branches: master
https://developer.blender.org/rBA339ebe682f188601186da485507b80d8de55fed8

materials utils, Fix for node trees

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

M	materials_utils/materials_cycles_converter.py

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

diff --git a/materials_utils/materials_cycles_converter.py b/materials_utils/materials_cycles_converter.py
index 600de7e..838c555 100644
--- a/materials_utils/materials_cycles_converter.py
+++ b/materials_utils/materials_cycles_converter.py
@@ -241,6 +241,8 @@ def AutoNode(active=False, operator=None):
                 TreeNodes.nodes.remove(n)
 
             # Starting point is diffuse BSDF and output material
+            shader = TreeNodes.nodes.new('ShaderNodeValToRGB')
+            shader.location = 0, 270
             shader = TreeNodes.nodes.new('ShaderNodeBsdfDiffuse')
             shader.location = 0, 470
             shout = TreeNodes.nodes.new('ShaderNodeOutputMaterial')
@@ -447,8 +449,15 @@ def AutoNode(active=False, operator=None):
 
                     if sT:
                         if tex.use_map_color_diffuse:
+                            coordout = 2
+                            map = TreeNodes.nodes.new('ShaderNodeMapping')
+                            map.location = -500, 570
+                            map.width = 240
+                            coord = TreeNodes.nodes.new('ShaderNodeTexCoord')
+                            coord.location = -800, 570
                             links.new(shtext.outputs[0], shader.inputs[0])
-
+                            links.new(map.outputs[0], shtext.inputs[0])
+                            links.new(coord.outputs[coordout], map.inputs[0])
                         if tex.use_map_emit:
                             if not Add_Emission:
                                 collect_report("INFO: Mix EMISSION + Texture shader node for: " + cmat.name)
@@ -565,7 +574,7 @@ def AutoNode(active=False, operator=None):
                             t = TreeNodes.nodes.new('ShaderNodeRGBToBW')
                             t.location = -0, 300
                             links.new(t.outputs[0], shout.inputs[2])
-                            links.new(shtext.outputs[0], t.inputs[0])
+                            links.new(shtext.outputs[1], t.inputs[0])
             else:
                 collect_report("No textures in the Scene, no Image Nodes to add")



More information about the Bf-extensions-cvs mailing list