[#18650] fbx export assigning textures to wrong materials...
also fixed an error that made this script fail when python wasnt found.
This commit is contained in:
@@ -511,7 +511,7 @@ def write(filename, batch_objects = None, \
|
|||||||
if time:
|
if time:
|
||||||
curtime = time.localtime()[0:6]
|
curtime = time.localtime()[0:6]
|
||||||
else:
|
else:
|
||||||
curtime = [0,0,0,0,0,0]
|
curtime = (0,0,0,0,0,0)
|
||||||
#
|
#
|
||||||
file.write(\
|
file.write(\
|
||||||
'''FBXHeaderExtension: {
|
'''FBXHeaderExtension: {
|
||||||
@@ -1538,11 +1538,11 @@ def write(filename, batch_objects = None, \
|
|||||||
if len(my_mesh.blenTextures) == 1:
|
if len(my_mesh.blenTextures) == 1:
|
||||||
file.write('0')
|
file.write('0')
|
||||||
else:
|
else:
|
||||||
#texture_mapping_local = {None:0}
|
|
||||||
texture_mapping_local = {None:-1}
|
texture_mapping_local = {None:-1}
|
||||||
|
|
||||||
i = 0 # 1 for dummy
|
i = 0 # 1 for dummy
|
||||||
for tex in my_mesh.blenTextures:
|
for tex in my_mesh.blenTextures:
|
||||||
|
if tex: # None is set above
|
||||||
texture_mapping_local[tex] = i
|
texture_mapping_local[tex] = i
|
||||||
i+=1
|
i+=1
|
||||||
|
|
||||||
@@ -1856,11 +1856,6 @@ def write(filename, batch_objects = None, \
|
|||||||
armob = BPyObject.getObjectArmature(ob)
|
armob = BPyObject.getObjectArmature(ob)
|
||||||
blenParentBoneName = None
|
blenParentBoneName = None
|
||||||
|
|
||||||
# Note - Fixed in BPyObject but for now just copy the function because testers wont have up to date modukes,
|
|
||||||
# TODO - remove this for 2.45 release since getObjectArmature has been fixed
|
|
||||||
if (not armob) and ob.parent and ob.parent.type == 'Armature' and ob.parentType == Blender.Object.ParentTypes.ARMATURE:
|
|
||||||
armob = ob.parent
|
|
||||||
|
|
||||||
# parent bone - special case
|
# parent bone - special case
|
||||||
if (not armob) and ob.parent and ob.parent.type == 'Armature' and ob.parentType == Blender.Object.ParentTypes.BONE:
|
if (not armob) and ob.parent and ob.parent.type == 'Armature' and ob.parentType == Blender.Object.ParentTypes.BONE:
|
||||||
armob = ob.parent
|
armob = ob.parent
|
||||||
|
|||||||
Reference in New Issue
Block a user