mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-23 10:50:58 +00:00
Proper node positioning after import
This commit is contained in:
parent
a13c382969
commit
4f29f57e77
1 changed files with 13 additions and 0 deletions
|
@ -131,11 +131,20 @@ def setup_skins(mdl, uvs):
|
|||
shaderOut = mat.node_tree.nodes["Material Output"]
|
||||
mat.node_tree.nodes.remove(mat.node_tree.nodes["Principled BSDF"])
|
||||
|
||||
emissionNode.location = (0, 0)
|
||||
shaderOut.location = (200, 0)
|
||||
|
||||
yPos = 0
|
||||
|
||||
for j, subskin in enumerate(skin.skins):
|
||||
tex_node = mat.node_tree.nodes.new("ShaderNodeTexImage")
|
||||
tex_node.image = mdl.images[img_counter]
|
||||
img_counter += 1
|
||||
tex_node.interpolation = "Closest"
|
||||
|
||||
tex_node.location = (-300, yPos)
|
||||
yPos -= 280
|
||||
|
||||
if j == 0:
|
||||
# connect only first texture (we'll need something smarter in the future)
|
||||
mat.node_tree.links.new(tex_node.outputs[0], emissionNode.inputs[0])
|
||||
|
@ -156,6 +165,10 @@ def setup_skins(mdl, uvs):
|
|||
img_counter += 1
|
||||
tex_node.interpolation = "Closest"
|
||||
|
||||
emissionNode.location = (0, 0)
|
||||
shaderOut.location = (200, 0)
|
||||
tex_node.location = (-300, 0)
|
||||
|
||||
mat.node_tree.links.new(tex_node.outputs[0], emissionNode.inputs[0])
|
||||
mat.node_tree.links.new(emissionNode.outputs[0], shaderOut.inputs[0])
|
||||
mdl.mesh.materials.append(mat)
|
||||
|
|
Loading…
Reference in a new issue