From 054a169be04850c9356917904e04cdf24a73e04c Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Fri, 24 Jun 2022 17:08:54 +0300 Subject: Use appropriate context for the DopeSheet Action Custom Properties panel. Refactor D14646 to use context.active_action for the Action Custom Properties panel, matching the already existing Action panel. This has the advantage that it allows access to the properties of any actions with channels visible in the Dope Sheet, e.g. Shape Keys, Materials etc; while using just the active object is limited to just the object animation. Also move both panels from Item to the Action tab. Differential Revision: https://developer.blender.org/D15288 --- release/scripts/startup/bl_ui/space_dopesheet.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 4d1514c2777..a2e691c2d9f 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -548,22 +548,20 @@ class DopesheetActionPanelBase: class DOPESHEET_PT_custom_props_action(PropertyPanel, Panel): bl_space_type = 'DOPESHEET_EDITOR' - bl_category = "Item" + bl_category = "Action" bl_region_type = 'UI' bl_context = 'data' - _context_path = "active_object.animation_data.action" + _context_path = "active_action" _property_type = bpy.types.Action @classmethod def poll(cls, context): - return context.active_object \ - and context.active_object.animation_data \ - and context.active_object.animation_data.action + return bool(context.active_action) class DOPESHEET_PT_action(DopesheetActionPanelBase, Panel): bl_space_type = 'DOPESHEET_EDITOR' - bl_category = "Item" + bl_category = "Action" @classmethod def poll(cls, context): -- cgit v1.2.3