Trim whitespace
This commit is contained in:
parent
c816a964b7
commit
a507e93f73
14
materials.py
14
materials.py
@ -21,7 +21,7 @@ for mat in bpy.data.materials:
|
|||||||
tex = nodes["Image Texture"]
|
tex = nodes["Image Texture"]
|
||||||
tex.interpolation = "Closest"
|
tex.interpolation = "Closest"
|
||||||
tex.location = 0, 0
|
tex.location = 0, 0
|
||||||
|
|
||||||
# Create texture coordinate node
|
# Create texture coordinate node
|
||||||
coord = nodes.new("ShaderNodeTexCoord")
|
coord = nodes.new("ShaderNodeTexCoord")
|
||||||
coord.location = -600, 0
|
coord.location = -600, 0
|
||||||
@ -29,11 +29,11 @@ for mat in bpy.data.materials:
|
|||||||
# Create mapping node
|
# Create mapping node
|
||||||
map = nodes.new("ShaderNodeMapping")
|
map = nodes.new("ShaderNodeMapping")
|
||||||
map.location = -400, 0
|
map.location = -400, 0
|
||||||
|
|
||||||
# Create diffuse shader
|
# Create diffuse shader
|
||||||
diff = nodes.new("ShaderNodeBsdfDiffuse")
|
diff = nodes.new("ShaderNodeBsdfDiffuse")
|
||||||
diff.location = 200, 0
|
diff.location = 200, 0
|
||||||
|
|
||||||
# Create transparent shader
|
# Create transparent shader
|
||||||
trans = nodes.new("ShaderNodeBsdfTransparent")
|
trans = nodes.new("ShaderNodeBsdfTransparent")
|
||||||
trans.location = 200, -150
|
trans.location = 200, -150
|
||||||
@ -45,21 +45,21 @@ for mat in bpy.data.materials:
|
|||||||
# Create output
|
# Create output
|
||||||
out = nodes.new("ShaderNodeOutputMaterial")
|
out = nodes.new("ShaderNodeOutputMaterial")
|
||||||
out.location = 600, 0
|
out.location = 600, 0
|
||||||
|
|
||||||
# Link everything
|
# Link everything
|
||||||
links.new(coord.outputs[2], map.inputs[0]) # Coord > Map
|
links.new(coord.outputs[2], map.inputs[0]) # Coord > Map
|
||||||
links.new(map.outputs[0], tex.inputs[0]) # Map > Texture
|
links.new(map.outputs[0], tex.inputs[0]) # Map > Texture
|
||||||
links.new(tex.outputs[0], diff.inputs[0]) # Texture > Diffuse
|
links.new(tex.outputs[0], diff.inputs[0]) # Texture > Diffuse
|
||||||
links.new(diff.outputs[0], mix.inputs[2]) # Diffuse > Mix
|
links.new(diff.outputs[0], mix.inputs[2]) # Diffuse > Mix
|
||||||
|
|
||||||
links.new(trans.outputs[0], mix.inputs[1]) # Transparent > Mix
|
links.new(trans.outputs[0], mix.inputs[1]) # Transparent > Mix
|
||||||
links.new(tex.outputs[1], mix.inputs[0]) # Texture alpha > Mix factor
|
links.new(tex.outputs[1], mix.inputs[0]) # Texture alpha > Mix factor
|
||||||
|
|
||||||
links.new(mix.outputs[0], out.inputs[0]) # Mix > Output
|
links.new(mix.outputs[0], out.inputs[0]) # Mix > Output
|
||||||
|
|
||||||
# Deselect all
|
# Deselect all
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
node.select = False
|
node.select = False
|
||||||
|
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user