Skingroup image export order based on texture node position (height) in shader editor. Nodes with higher position are exported first.

This commit is contained in:
khreathor 2019-01-11 01:40:05 +01:00 committed by Bill Currie
parent 4f29f57e77
commit 94c3c8c2cb

View file

@ -105,7 +105,9 @@ def make_skin(operator, mdl, mesh):
skingroup.type = 1
skingroup.skins = []
skingroup.times = []
for node in allNodes:
sortedNodes = list(allNodes)
sortedNodes.sort(key=lambda x: x.location[1], reverse=True)
for node in sortedNodes:
if node.type == "TEX_IMAGE":
image = node.image
mdl.skinwidth, mdl.skinheight = image.size