1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
22 "name": "Hotkey: 'Shift Spacebar'",
23 "description": "Pie menu for Timeline controls",
24 "author": "pitiwazou, meta-androcto",
26 "blender": (2, 80, 0),
27 "location": "3D View",
30 "category": "Animation Pie"
34 from bpy
.types
import (
42 class PIE_MT_PieAnimation(Menu
):
43 bl_idname
= "PIE_MT_animation"
44 bl_label
= "Pie Animation"
46 def draw(self
, context
):
48 pie
= layout
.menu_pie()
50 pie
.operator("screen.frame_jump", text
="Jump REW", icon
='REW').end
= False
52 pie
.operator("screen.frame_jump", text
="Jump FF", icon
='FF').end
= True
54 pie
.operator("screen.animation_play", text
="Reverse", icon
='PLAY_REVERSE').reverse
= True
56 if not context
.screen
.is_animation_playing
: # Play / Pause
57 pie
.operator("screen.animation_play", text
="Play", icon
='PLAY')
59 pie
.operator("screen.animation_play", text
="Stop", icon
='PAUSE')
61 pie
.operator("screen.keyframe_jump", text
="Previous FR", icon
='PREV_KEYFRAME').next
= False
63 pie
.operator("screen.keyframe_jump", text
="Next FR", icon
='NEXT_KEYFRAME').next
= True
65 pie
.operator("insert.autokeyframe", text
="Auto Keyframe", icon
='REC')
67 pie
.menu("VIEW3D_MT_object_animation", text
="Keyframe Menu", icon
="KEYINGSET")
70 # Insert Auto Keyframe
71 class PIE_OT_InsertAutoKeyframe(Operator
):
72 bl_idname
= "insert.autokeyframe"
73 bl_label
= "Insert Auto Keyframe"
74 bl_description
= "Toggle Insert Auto Keyframe"
75 bl_options
= {'REGISTER', 'UNDO'}
77 def execute(self
, context
):
78 ts
= context
.tool_settings
80 ts
.use_keyframe_insert_auto ^
= 1
82 for area
in context
.screen
.areas
:
83 if area
.type == 'TIMELINE':
91 PIE_OT_InsertAutoKeyframe
99 bpy
.utils
.register_class(cls
)
101 wm
= bpy
.context
.window_manager
102 if wm
.keyconfigs
.addon
:
104 km
= wm
.keyconfigs
.addon
.keymaps
.new(name
='Object Non-modal')
105 kmi
= km
.keymap_items
.new('wm.call_menu_pie', 'SPACE', 'PRESS', shift
=True)
106 kmi
.properties
.name
= "PIE_MT_animation"
107 addon_keymaps
.append((km
, kmi
))
112 bpy
.utils
.unregister_class(cls
)
114 wm
= bpy
.context
.window_manager
115 kc
= wm
.keyconfigs
.addon
117 for km
, kmi
in addon_keymaps
:
118 km
.keymap_items
.remove(kmi
)
119 addon_keymaps
.clear()
122 if __name__
== "__main__":