1 # SPDX-License-Identifier: GPL-2.0-or-later
6 "name": "Hotkey: 'Shift Spacebar'",
7 "description": "Pie menu for Timeline controls",
8 "author": "pitiwazou, meta-androcto",
10 "blender": (2, 80, 0),
11 "location": "3D View",
14 "category": "Animation Pie"
18 from bpy
.types
import (
26 class PIE_MT_PieAnimation(Menu
):
27 bl_idname
= "PIE_MT_animation"
28 bl_label
= "Pie Animation"
30 def draw(self
, context
):
32 pie
= layout
.menu_pie()
34 pie
.operator("screen.frame_jump", text
="Jump REW", icon
='REW').end
= False
36 pie
.operator("screen.frame_jump", text
="Jump FF", icon
='FF').end
= True
38 pie
.operator("screen.animation_play", text
="Reverse", icon
='PLAY_REVERSE').reverse
= True
40 if not context
.screen
.is_animation_playing
: # Play / Pause
41 pie
.operator("screen.animation_play", text
="Play", icon
='PLAY')
43 pie
.operator("screen.animation_play", text
="Stop", icon
='PAUSE')
45 pie
.operator("screen.keyframe_jump", text
="Previous FR", icon
='PREV_KEYFRAME').next
= False
47 pie
.operator("screen.keyframe_jump", text
="Next FR", icon
='NEXT_KEYFRAME').next
= True
49 pie
.operator("insert.autokeyframe", text
="Auto Keyframe", icon
='REC')
51 pie
.menu("VIEW3D_MT_object_animation", text
="Keyframe Menu", icon
="KEYINGSET")
54 # Insert Auto Keyframe
55 class PIE_OT_InsertAutoKeyframe(Operator
):
56 bl_idname
= "insert.autokeyframe"
57 bl_label
= "Insert Auto Keyframe"
58 bl_description
= "Toggle Insert Auto Keyframe"
59 bl_options
= {'REGISTER', 'UNDO'}
61 def execute(self
, context
):
62 ts
= context
.tool_settings
64 ts
.use_keyframe_insert_auto ^
= 1
66 for area
in context
.screen
.areas
:
67 if area
.type == 'TIMELINE':
75 PIE_OT_InsertAutoKeyframe
83 bpy
.utils
.register_class(cls
)
85 wm
= bpy
.context
.window_manager
86 if wm
.keyconfigs
.addon
:
88 km
= wm
.keyconfigs
.addon
.keymaps
.new(name
='Object Non-modal')
89 kmi
= km
.keymap_items
.new('wm.call_menu_pie', 'SPACE', 'PRESS', shift
=True)
90 kmi
.properties
.name
= "PIE_MT_animation"
91 addon_keymaps
.append((km
, kmi
))
96 bpy
.utils
.unregister_class(cls
)
98 wm
= bpy
.context
.window_manager
99 kc
= wm
.keyconfigs
.addon
101 for km
, kmi
in addon_keymaps
:
102 km
.keymap_items
.remove(kmi
)
103 addon_keymaps
.clear()
106 if __name__
== "__main__":