Skip to content

Commit ace1d5a

Browse files
committed
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.
1 parent 75c6e14 commit ace1d5a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

_functions_.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ def mesh_export(eport, sk_meshes, st_meshes):
445445

446446
def run_export(eport):
447447
unit_scaling = eport.export_scale * bpy.context.scene.unit_settings.scale_length
448+
# we don't want to be auto keyframing anything on export, so switch it off...
449+
is_auto_keying = bpy.context.scene.tool_settings.use_keyframe_insert_auto
450+
bpy.context.scene.tool_settings.use_keyframe_insert_auto = False
448451
# get the meshes we want to export...
449452
st_meshes = [ob for ob in bpy.context.selected_objects if ob.type == 'MESH' and not ob.find_armature()]
450453
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):
480483
# if we are batch/cluster exporting meshes, export them...
481484
if eport.meshes:
482485
mesh_export(eport, sk_meshes, st_meshes)
486+
# set auto keying back to whatever it was...
487+
bpy.context.scene.tool_settings.use_keyframe_insert_auto = is_auto_keying
483488

484489
#------------------------------------------------------------------------------------------------------------------------------------------------------#
485490

@@ -799,7 +804,10 @@ def import_meshes(iport, sk_meshes, st_meshes, active):
799804
sk_mesh.parent = active
800805

801806
def run_import(iport):
802-
# unit_scaling = 1.0 / (100 * unit_scale)
807+
# we don't want to be auto keyframing anything on export, so switch it off...
808+
is_auto_keying = bpy.context.scene.tool_settings.use_keyframe_insert_auto
809+
bpy.context.scene.tool_settings.use_keyframe_insert_auto = False
810+
# get some references...
803811
active = bpy.context.view_layer.objects.active
804812
existing_objects = {ob : ob.type for ob in bpy.data.objects}
805813
existing_actions = {ac : ac.frame_range for ac in bpy.data.actions}
@@ -899,6 +907,8 @@ def run_import(iport):
899907
# then re-apply parenting...
900908
for child, parent in parenting.items():
901909
child.parent = parent
910+
# set auto keying back to whatever it was...
911+
bpy.context.scene.tool_settings.use_keyframe_insert_auto = is_auto_keying
902912

903913
#------------------------------------------------------------------------------------------------------------------------------------------------------#
904914

0 commit comments

Comments
 (0)