mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 14:20:59 +00:00
Skingroup images import order fix
This commit is contained in:
parent
4d1f05186b
commit
a13c382969
1 changed files with 5 additions and 2 deletions
|
@ -123,6 +123,7 @@ def setup_skins(mdl, uvs):
|
||||||
uvloop.data[k].uv = mdl_uv[j]
|
uvloop.data[k].uv = mdl_uv[j]
|
||||||
|
|
||||||
#Load all skins
|
#Load all skins
|
||||||
|
img_counter = 0
|
||||||
for i, skin in enumerate(mdl.skins):
|
for i, skin in enumerate(mdl.skins):
|
||||||
if skin.type:
|
if skin.type:
|
||||||
mat = setup_main_material(mdl)
|
mat = setup_main_material(mdl)
|
||||||
|
@ -132,7 +133,8 @@ def setup_skins(mdl, uvs):
|
||||||
|
|
||||||
for j, subskin in enumerate(skin.skins):
|
for j, subskin in enumerate(skin.skins):
|
||||||
tex_node = mat.node_tree.nodes.new("ShaderNodeTexImage")
|
tex_node = mat.node_tree.nodes.new("ShaderNodeTexImage")
|
||||||
tex_node.image = mdl.images[i + j]
|
tex_node.image = mdl.images[img_counter]
|
||||||
|
img_counter += 1
|
||||||
tex_node.interpolation = "Closest"
|
tex_node.interpolation = "Closest"
|
||||||
if j == 0:
|
if j == 0:
|
||||||
# connect only first texture (we'll need something smarter in the future)
|
# connect only first texture (we'll need something smarter in the future)
|
||||||
|
@ -150,7 +152,8 @@ def setup_skins(mdl, uvs):
|
||||||
mat.node_tree.nodes.remove(mat.node_tree.nodes["Principled BSDF"])
|
mat.node_tree.nodes.remove(mat.node_tree.nodes["Principled BSDF"])
|
||||||
|
|
||||||
tex_node = mat.node_tree.nodes.new("ShaderNodeTexImage")
|
tex_node = mat.node_tree.nodes.new("ShaderNodeTexImage")
|
||||||
tex_node.image = mdl.images[i]
|
tex_node.image = mdl.images[img_counter]
|
||||||
|
img_counter += 1
|
||||||
tex_node.interpolation = "Closest"
|
tex_node.interpolation = "Closest"
|
||||||
|
|
||||||
mat.node_tree.links.new(tex_node.outputs[0], emissionNode.inputs[0])
|
mat.node_tree.links.new(tex_node.outputs[0], emissionNode.inputs[0])
|
||||||
|
|
Loading…
Reference in a new issue