Update key set with world pose paste

1.5.2

- changed: key and jump now use keying set `LocRotScale` instead of `Available`
- changed: paste always add a key (`LocRotScale`) even if not in auto-key
master
Pullusb 2022-05-05 15:39:23 +02:00
parent a9fb804a22
commit 0d465c84d4
3 changed files with 40 additions and 11 deletions

View File

@ -1,5 +1,11 @@
# Changelog
1.5.2
- changed: key and jump now use keying set `LocRotScale` instead of `Available`
- changed: paste always add a key (`LocRotScale`) even if not in autokey
1.5.1
- fixed: also key rotation when creating curve

View File

@ -20,7 +20,7 @@ class AW_OT_world_space_copy(bpy.types.Operator):
class AW_OT_world_space_paste(bpy.types.Operator):
bl_idname = "pose.world_space_paste"
bl_label = "World Paste"
bl_description = "Paste world space transforms. Apply stored matrix to active bone"
bl_description = "Paste world space transforms. Apply stored matrix to active bone and key LocRotScale"
bl_options = {"REGISTER", "UNDO"}
@classmethod
@ -34,15 +34,22 @@ class AW_OT_world_space_paste(bpy.types.Operator):
def execute(self, context):
context.active_pose_bone.matrix = context.object.matrix_world.inverted() @ bpy.context.view_layer.world_space_store
if context.scene.tool_settings.use_keyframe_insert_auto:
bpy.ops.anim.keyframe_insert_menu(type='Available')
## only if autokey is On
# if context.scene.tool_settings.use_keyframe_insert_auto:
# bpy.ops.anim.keyframe_insert_menu(type='LocRotScale') # Available
## always paste location rotation scale
bpy.ops.anim.keyframe_insert(type='LocRotScale')
return {"FINISHED"}
class AW_OT_world_space_paste_next(bpy.types.Operator):
bl_idname = "pose.world_space_paste_next"
bl_label = "World Paste Jump"
bl_description = "Paste world space transforms and keyframe available chanels\nThen jump to prev/next key"
bl_description = "Paste world space transforms and keyframe available chanels\
\nThen jump to prev/next key\
\nKey Loc rot scale only"
bl_options = {"REGISTER", "UNDO"}
@classmethod
@ -59,8 +66,7 @@ class AW_OT_world_space_paste_next(bpy.types.Operator):
context.active_pose_bone.matrix = context.object.matrix_world.inverted() @ bpy.context.view_layer.world_space_store
# insert keyframe at value
# context.object.keyframe_insert(data_path, index=-1, frame=bpy.context.scene.frame_current, group="", options={'INSERTKEY_AVAILABLE'})
bpy.ops.anim.keyframe_insert_menu(type='Available')
bpy.ops.anim.keyframe_insert(type='LocRotScale') # delete args to use default
# jump to next key
act = fn.get_obj_action(context.object)
@ -94,7 +100,9 @@ class AW_OT_world_space_paste_next(bpy.types.Operator):
class AW_OT_world_space_paste_next_frame(bpy.types.Operator):
bl_idname = "pose.world_space_paste_next_frame"
bl_label = "World Paste Jump Frame"
bl_description = "Paste world space transforms and keyframe available chanels\nThen jump to prev/next frame"
bl_description = "Paste world space transforms and keyframe available chanels\
\nThen jump to prev/next frame\
\nKey Loc rot scale only"
bl_options = {"REGISTER", "UNDO"}
@classmethod
@ -109,10 +117,25 @@ class AW_OT_world_space_paste_next_frame(bpy.types.Operator):
def execute(self, context):
# apply matrix
context.active_pose_bone.matrix = context.object.matrix_world.inverted() @ bpy.context.view_layer.world_space_store
# insert keyframe at value
# context.object.keyframe_insert(data_path, index=-1, frame=bpy.context.scene.frame_current, group="", options={'INSERTKEY_AVAILABLE'})
bpy.ops.anim.keyframe_insert_menu(type='Available')
## bpy.ops.anim.keyframe_insert(type='DEFAULT')
## possible type :
# 'Location', 'Rotation', 'Scaling', 'BUILTIN_KSI_LocRot', 'LocRotScale', 'LocRotScaleCProp',
# 'BUILTIN_KSI_LocScale', 'BUILTIN_KSI_RotScale',
# 'BUILTIN_KSI_DeltaLocation', 'BUILTIN_KSI_DeltaRotation', 'BUILTIN_KSI_DeltaScale',
# 'BUILTIN_KSI_VisualLoc', 'BUILTIN_KSI_VisualRot', 'BUILTIN_KSI_VisualScaling',
# 'BUILTIN_KSI_VisualLocRot', 'BUILTIN_KSI_VisualLocRotScale', 'BUILTIN_KSI_VisualLocScale', 'BUILTIN_KSI_VisualRotScale'
## insert keyframe at value
## Insert Keyframes for specified Keying Set, with menu of available Keying Sets if undefined
# bpy.ops.anim.keyframe_insert_menu(type='Available', always_prompt=False)
## Insert keyframes on the current frame for all properties in the specified Keying Set
bpy.ops.anim.keyframe_insert(type='LocRotScale')
# jump to next frame
act = fn.get_obj_action(context.object)

View File

@ -4,7 +4,7 @@ bl_info = {
"name": "Auto Walk",
"description": "Develop a walk/run cycles along a curve and pin feets",
"author": "Samuel Bernou",
"version": (1, 5, 1),
"version": (1, 5, 2),
"blender": (3, 0, 0),
"location": "View3D",
"warning": "",