From ace1d5a41534b9c16af814b52fe2a5e48a21d08d Mon Sep 17 00:00:00 2001 From: Jim Kroovy <56791237+Jim-Kroovy@users.noreply.github.com> Date: Tue, 13 Apr 2021 12:41:20 +0100 Subject: [PATCH] I forgot about auto-keyframing... Yeah, i totally forgot about export/import and the rest pose getting inserted by Blenders auto keyframing, it should be fine now. --- _functions_.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/_functions_.py b/_functions_.py index 91b9f69..dd92d09 100644 --- a/_functions_.py +++ b/_functions_.py @@ -445,6 +445,9 @@ def mesh_export(eport, sk_meshes, st_meshes): def run_export(eport): unit_scaling = eport.export_scale * bpy.context.scene.unit_settings.scale_length + # we don't want to be auto keyframing anything on export, so switch it off... + is_auto_keying = bpy.context.scene.tool_settings.use_keyframe_insert_auto + bpy.context.scene.tool_settings.use_keyframe_insert_auto = False # get the meshes we want to export... st_meshes = [ob for ob in bpy.context.selected_objects if ob.type == 'MESH' and not ob.find_armature()] sk_meshes = [ob for ob in bpy.context.selected_objects if ob.type == 'MESH' and ob.find_armature()] @@ -480,6 +483,8 @@ def run_export(eport): # if we are batch/cluster exporting meshes, export them... if eport.meshes: mesh_export(eport, sk_meshes, st_meshes) + # set auto keying back to whatever it was... + bpy.context.scene.tool_settings.use_keyframe_insert_auto = is_auto_keying #------------------------------------------------------------------------------------------------------------------------------------------------------# @@ -799,7 +804,10 @@ def import_meshes(iport, sk_meshes, st_meshes, active): sk_mesh.parent = active def run_import(iport): - # unit_scaling = 1.0 / (100 * unit_scale) + # we don't want to be auto keyframing anything on export, so switch it off... + is_auto_keying = bpy.context.scene.tool_settings.use_keyframe_insert_auto + bpy.context.scene.tool_settings.use_keyframe_insert_auto = False + # get some references... active = bpy.context.view_layer.objects.active existing_objects = {ob : ob.type for ob in bpy.data.objects} existing_actions = {ac : ac.frame_range for ac in bpy.data.actions} @@ -899,6 +907,8 @@ def run_import(iport): # then re-apply parenting... for child, parent in parenting.items(): child.parent = parent + # set auto keying back to whatever it was... + bpy.context.scene.tool_settings.use_keyframe_insert_auto = is_auto_keying #------------------------------------------------------------------------------------------------------------------------------------------------------#