diff options
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_dopesheet.py | 32 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_nla.py | 17 |
2 files changed, 49 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 9b8f1cfeb0d..6e5eba7b734 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -539,6 +539,37 @@ class DOPESHEET_MT_key_transform(Menu): layout.operator("transform.transform", text="Scale").mode = 'TIME_SCALE' +class DopesheetActionPanelBase: + bl_region_type = 'UI' + bl_label = "Action" + + @classmethod + def draw_generic_panel(cls, context, layout, action): + layout.label(text=action.name, icon='ACTION') + + layout.prop(action, "use_frame_range") + + col = layout.column() + col.active = action.use_frame_range + + row = col.row(align=True) + row.prop(action, "frame_start", text="Start") + row.prop(action, "frame_end", text="End") + + +class DOPESHEET_PT_action(DopesheetActionPanelBase, Panel): + bl_space_type = 'DOPESHEET_EDITOR' + bl_category = "Item" + + @classmethod + def poll(cls, context): + return bool(context.selected_visible_actions) + + def draw(self, context): + action = context.selected_visible_actions[0] + self.draw_generic_panel(context, self.layout, action) + + ####################################### # Grease Pencil Editing @@ -792,6 +823,7 @@ classes = ( DOPESHEET_MT_snap_pie, DOPESHEET_MT_view_pie, DOPESHEET_PT_filters, + DOPESHEET_PT_action, DOPESHEET_PT_gpencil_mode, DOPESHEET_PT_gpencil_layer_masks, DOPESHEET_PT_gpencil_layer_transform, diff --git a/release/scripts/startup/bl_ui/space_nla.py b/release/scripts/startup/bl_ui/space_nla.py index 9507d8296a9..62c02799a9f 100644 --- a/release/scripts/startup/bl_ui/space_nla.py +++ b/release/scripts/startup/bl_ui/space_nla.py @@ -22,6 +22,7 @@ from bpy.types import Header, Menu, Panel from bpy.app.translations import contexts as i18n_contexts from bl_ui.space_dopesheet import ( DopesheetFilterPopoverBase, + DopesheetActionPanelBase, dopesheet_filter, ) @@ -66,6 +67,21 @@ class NLA_PT_filters(DopesheetFilterPopoverBase, Panel): DopesheetFilterPopoverBase.draw_standard_filters(context, layout) +class NLA_PT_action(DopesheetActionPanelBase, Panel): + bl_space_type = 'NLA_EDITOR' + bl_category = "Strip" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + strip = context.active_nla_strip + return strip and strip.type == 'CLIP' and strip.action + + def draw(self, context): + action = context.active_nla_strip.action + self.draw_generic_panel(context, self.layout, action) + + class NLA_MT_editor_menus(Menu): bl_idname = "NLA_MT_editor_menus" bl_label = "" @@ -316,6 +332,7 @@ classes = ( NLA_MT_context_menu, NLA_MT_channel_context_menu, NLA_PT_filters, + NLA_PT_action, ) if __name__ == "__main__": # only for live edit. |