1 # SPDX-License-Identifier: GPL-2.0-or-later
4 "name": "Hotkey: 'Shift Spacebar'",
5 "description": "Pie menu for Timeline controls",
6 "author": "pitiwazou, meta-androcto",
12 "category": "Animation Pie"
16 from bpy
.types
import (
24 class PIE_MT_PieAnimation(Menu
):
25 bl_idname
= "PIE_MT_animation"
26 bl_label
= "Pie Animation"
28 def draw(self
, context
):
30 pie
= layout
.menu_pie()
32 pie
.operator("screen.frame_jump", text
="Jump REW", icon
='REW').end
= False
34 pie
.operator("screen.frame_jump", text
="Jump FF", icon
='FF').end
= True
36 pie
.operator("screen.animation_play", text
="Reverse", icon
='PLAY_REVERSE').reverse
= True
38 if not context
.screen
.is_animation_playing
: # Play / Pause
39 pie
.operator("screen.animation_play", text
="Play", icon
='PLAY')
41 pie
.operator("screen.animation_play", text
="Stop", icon
='PAUSE')
43 pie
.operator("screen.keyframe_jump", text
="Previous FR", icon
='PREV_KEYFRAME').next
= False
45 pie
.operator("screen.keyframe_jump", text
="Next FR", icon
='NEXT_KEYFRAME').next
= True
47 pie
.operator("insert.autokeyframe", text
="Auto Keyframe", icon
='REC')
49 pie
.menu("VIEW3D_MT_object_animation", text
="Keyframe Menu", icon
="KEYINGSET")
52 # Insert Auto Keyframe
53 class PIE_OT_InsertAutoKeyframe(Operator
):
54 bl_idname
= "insert.autokeyframe"
55 bl_label
= "Insert Auto Keyframe"
56 bl_description
= "Toggle Insert Auto Keyframe"
57 bl_options
= {'REGISTER', 'UNDO'}
59 def execute(self
, context
):
60 ts
= context
.tool_settings
62 ts
.use_keyframe_insert_auto ^
= 1
64 for area
in context
.screen
.areas
:
65 if area
.type == 'TIMELINE':
73 PIE_OT_InsertAutoKeyframe
81 bpy
.utils
.register_class(cls
)
83 wm
= bpy
.context
.window_manager
84 if wm
.keyconfigs
.addon
:
86 km
= wm
.keyconfigs
.addon
.keymaps
.new(name
='Object Non-modal')
87 kmi
= km
.keymap_items
.new('wm.call_menu_pie', 'SPACE', 'PRESS', shift
=True)
88 kmi
.properties
.name
= "PIE_MT_animation"
89 addon_keymaps
.append((km
, kmi
))
94 bpy
.utils
.unregister_class(cls
)
96 wm
= bpy
.context
.window_manager
97 kc
= wm
.keyconfigs
.addon
99 for km
, kmi
in addon_keymaps
:
100 km
.keymap_items
.remove(kmi
)
101 addon_keymaps
.clear()
104 if __name__
== "__main__":