From 5df0fed47c5a94afddfe0aca307b518e8a51117e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 10 May 2018 19:28:27 +0200 Subject: Timeline Header Cleanup - Part 3: Consolidate options in a "Playback" popover The "Playback" popover now combines options from several old menus and scattered around in other places. --- release/scripts/startup/bl_ui/space_time.py | 105 ++++++++++++---------------- source/blender/makesrna/intern/rna_scene.c | 1 - 2 files changed, 44 insertions(+), 62 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index e6777dfd706..3a6fa40aebd 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -87,7 +87,6 @@ class TIME_HT_editor_buttons(Header): row = layout.row(align=True) row.prop(scene, "use_preview_range", text="", toggle=True) - #row.prop(scene, "lock_frame_selection_to_range", text="", toggle=True) sub = row.row(align=True) sub.scale_x = 0.8 if not scene.use_preview_range: @@ -109,7 +108,10 @@ class TIME_MT_editor_menus(Menu): def draw_menus(layout, context): layout.menu("TIME_MT_view") layout.menu("TIME_MT_marker") - layout.menu("TIME_MT_playback") + layout.popover(space_type='DOPESHEET_EDITOR', + region_type='HEADER', + panel_type="TIME_PT_playback", + text="Playback") class TIME_MT_marker(Menu): @@ -137,7 +139,6 @@ class TIME_MT_view(Menu): layout.prop(st, "show_frame_indicator") layout.prop(scene, "show_keys_from_selected_only") - layout.prop(scene, "show_subframe") layout.separator() @@ -178,61 +179,6 @@ class TIME_MT_cache(Menu): col.prop(st, "cache_rigidbody") -class TIME_MT_frame(Menu): - bl_label = "Frame" - - def draw(self, context): - layout = self.layout - - layout.operator("anim.previewrange_clear") - layout.operator("anim.previewrange_set") - layout.separator() - layout.operator("anim.end_frame_set") - layout.operator("anim.start_frame_set") - - layout.separator() - - layout.menu("TIME_MT_autokey") - - -class TIME_MT_playback(Menu): - bl_label = "Playback" - - def draw(self, context): - layout = self.layout - - screen = context.screen - scene = context.scene - - layout.prop(screen, "use_play_top_left_3d_editor") - layout.prop(screen, "use_play_3d_editors") - layout.prop(screen, "use_play_animation_editors") - layout.prop(screen, "use_play_properties_editors") - layout.prop(screen, "use_play_image_editors") - layout.prop(screen, "use_play_sequence_editors") - layout.prop(screen, "use_play_node_editors") - layout.prop(screen, "use_play_clip_editors") - - layout.separator() - layout.prop(screen, "use_follow") - layout.separator() - - layout.prop(scene, "use_audio") - layout.prop(scene, "use_audio_scrub") - layout.prop_menu_enum(scene, "sync_mode") - - -class TIME_MT_autokey(Menu): - bl_label = "Auto-Keyframing Mode" - - def draw(self, context): - layout = self.layout - toolsettings = context.tool_settings - - layout.prop_enum(toolsettings, "auto_keying_mode", 'ADD_REPLACE_KEYS') - layout.prop_enum(toolsettings, "auto_keying_mode", 'REPLACE_KEYS') - - def marker_menu_generic(layout): from bpy import context @@ -279,6 +225,45 @@ class TimelinePanelButtons: return context.space_data.mode == 'TIMELINE' +class TIME_PT_playback(TimelinePanelButtons, Panel): + bl_label = "Playback" + bl_region_type = 'HEADER' + + def draw(self, context): + layout = self.layout + + screen = context.screen + scene = context.scene + + layout.prop(scene, "sync_mode", text="") + layout.prop(scene, "use_audio_scrub") + layout.prop(scene, "use_audio", text="Mute Audio") + + layout.prop(scene, "show_subframe", text="Subframes") + + layout.prop(scene, "lock_frame_selection_to_range", text="Limit Playhead to Frame Range") + layout.prop(screen, "use_follow", text="Follow Playhead") + + layout.separator() + + col = layout.column() + col.label("Play Animation In:") + layout.prop(screen, "use_play_top_left_3d_editor", text="Active Editor Only") + layout.prop(screen, "use_play_3d_editors") + layout.prop(screen, "use_play_animation_editors") + layout.prop(screen, "use_play_properties_editors") + layout.prop(screen, "use_play_image_editors") + layout.prop(screen, "use_play_sequence_editors") + layout.prop(screen, "use_play_node_editors") + layout.prop(screen, "use_play_clip_editors") + + layout.separator() + + row = layout.row(align=True) + row.operator("anim.start_frame_set") + row.operator("anim.end_frame_set") + + class TIME_PT_keyframing_settings(TimelinePanelButtons, Panel): bl_label = "Keyframing Settings" bl_options = {'HIDE_HEADER'} @@ -323,9 +308,7 @@ classes = ( TIME_MT_marker, TIME_MT_view, TIME_MT_cache, - TIME_MT_frame, - TIME_MT_playback, - TIME_MT_autokey, + TIME_PT_playback, TIME_PT_keyframing_settings, ) diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 24829c9fda4..11bee28ed7a 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -5820,7 +5820,6 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Lock Frame Selection", "Don't allow frame to be selected with mouse outside of frame range"); RNA_def_property_update(prop, NC_SCENE | ND_FRAME, NULL); - RNA_def_property_ui_icon(prop, ICON_LOCKED, 0); /* Preview Range (frame-range for UI playback) */ prop = RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE); -- cgit v1.2.3