Merge pull request #2382 from Skehmatics/fix/morph_targets_linux

Fix morph target exporting on Unix-based systems
This commit is contained in:
Lubos Lenco 2021-11-08 09:07:13 +01:00 committed by GitHub
commit 946610c793
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -985,7 +985,7 @@ class ArmoryExporter:
for _o in sel:
_o.select_set(False)
skelobj.select_set(True)
bpy.ops.nla.bake(frame_start=action.frame_range[0], frame_end=action.frame_range[1], step=1, only_selected=False, visual_keying=True)
bpy.ops.nla.bake(frame_start=int(action.frame_range[0]), frame_end=int(action.frame_range[1]), step=1, only_selected=False, visual_keying=True)
action = skelobj.animation_data.action
skelobj.select_set(False)
for _o in sel:
@ -1138,7 +1138,7 @@ class ArmoryExporter:
# Max shape keys supported
max_shape_keys = 32
# Path to store shape key textures
output_dir = bpy.path.abspath('//') + "MorphTargets\\"
output_dir = bpy.path.abspath('//') + "MorphTargets"
name = bobject.data.name
vert_pos = []
vert_nor = []
@ -1259,7 +1259,8 @@ class ArmoryExporter:
image = bpy.data.images.new(name, width = img_size, height = img_size, is_data = True)
image.pixels = pixel_list
image.save_render(output_dir + name + ".png", scene= bpy.context.scene)
output_path = os.path.join(output_dir, name + ".png")
image.save_render(output_path, scene= bpy.context.scene)
bpy.data.images.remove(image)
def get_best_image_size(self, size):