[Bf-blender-cvs] [054a169be04] master: Use appropriate context for the DopeSheet Action Custom Properties panel.

Alexander Gavrilov noreply at git.blender.org
Wed Jul 20 13:18:25 CEST 2022


Commit: 054a169be04850c9356917904e04cdf24a73e04c
Author: Alexander Gavrilov
Date:   Fri Jun 24 17:08:54 2022 +0300
Branches: master
https://developer.blender.org/rB054a169be04850c9356917904e04cdf24a73e04c

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

===================================================================

M	release/scripts/startup/bl_ui/space_dopesheet.py

===================================================================

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):



More information about the Bf-blender-cvs mailing list