diff options
author | Joshua Leung <aligorith@gmail.com> | 2018-05-10 19:33:41 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2018-05-10 20:28:36 +0300 |
commit | 176cb0c3f84dfc07bafea9a7add57d5322e84326 (patch) | |
tree | b6cfcedc8395ae776f9bb0547adcf85b57e79050 /release/scripts/startup/bl_ui | |
parent | e4c7cef7482d828b33e799d0ccf3bdd27da680a8 (diff) |
Timeline Header Cleanup - Part 1: Move Keying Set + Autokeying Settings to Properties Region (NKEY)
Now all Keying Set and Auto Keyframing settings can be found the in NKEY
Properties Region (right-hand-side hidden tab/drawer).
This way, we have more room to display the full names of the settings,
without clogging up the timeline header.
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/space_time.py | 65 |
1 files changed, 50 insertions, 15 deletions
diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index 6710ed634b9..03e01be2b83 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -18,7 +18,7 @@ # <pep8 compliant> import bpy -from bpy.types import Header, Menu +from bpy.types import Header, Menu, Panel # Header buttons for timeline header (play, etc.) @@ -35,7 +35,6 @@ class TIME_HT_editor_buttons(Header): scene = context.scene toolsettings = context.tool_settings screen = context.screen - userprefs = context.user_preferences row = layout.row(align=True) row.prop(scene, "use_preview_range", text="", toggle=True) @@ -81,19 +80,6 @@ class TIME_HT_editor_buttons(Header): row = layout.row(align=True) row.prop(toolsettings, "use_keyframe_insert_auto", text="", toggle=True) - if toolsettings.use_keyframe_insert_auto: - row.prop(toolsettings, "use_keyframe_insert_keyingset", text="", toggle=True) - - if screen.is_animation_playing and not userprefs.edit.use_keyframe_insert_available: - subsub = row.row(align=True) - subsub.prop(toolsettings, "use_record_with_nla", toggle=True) - - layout.prop(toolsettings, "keyframe_type", text="", icon_only=True) - - row = layout.row(align=True) - row.prop_search(scene.keying_sets_all, "active", scene, "keying_sets_all", text="") - row.operator("anim.keyframe_insert", text="", icon='KEY_HLT') - row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT') class TIME_MT_editor_menus(Menu): @@ -267,6 +253,54 @@ def marker_menu_generic(layout): ts = context.tool_settings layout.prop(ts, "lock_markers") +################################### + +class TimelinePanelButtons: + bl_space_type = 'DOPESHEET_EDITOR' + bl_region_type = 'UI' + + @staticmethod + def has_timeline(context): + return context.space_data.mode == 'TIMELINE' + + +class TIME_PT_keyframing_settings(TimelinePanelButtons, Panel): + bl_label = "Keyframing Settings" + bl_options = {'HIDE_HEADER'} + + @classmethod + def poll(cls, context): + # only for timeline editor + return cls.has_timeline(context) + + def draw(self, context): + layout = self.layout + + scene = context.scene + toolsettings = context.tool_settings + userprefs = context.user_preferences + + col = layout.column(align=True) + col.label("Active Keying Set:") + row = col.row(align=True) + row.prop_search(scene.keying_sets_all, "active", scene, "keying_sets_all", text="") + row.operator("anim.keyframe_insert", text="", icon='KEY_HLT') + row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT') + + col = layout.column(align=True) + col.label("New Keyframe Type:") + col.prop(toolsettings, "keyframe_type", text="") + + col = layout.column(align=True) + col.label("Auto Keyframing:") + row = col.row() + row.prop(toolsettings, "auto_keying_mode", text="") + row.prop(toolsettings, "use_keyframe_insert_keyingset", text="") + if not userprefs.edit.use_keyframe_insert_available: + col.prop(toolsettings, "use_record_with_nla", text="Layered Recording") + + +################################### classes = ( TIME_HT_editor_buttons, @@ -277,6 +311,7 @@ classes = ( TIME_MT_frame, TIME_MT_playback, TIME_MT_autokey, + TIME_PT_keyframing_settings, ) if __name__ == "__main__": # only for live edit. |