Dopesheet: Add Custom Properties panel

Adds a custom property panel for the active `Action` to the Dopesheet
editor. There was previously no way to edit these properties outside of
the Python API.

This panel will show up when
`context.active_object.animation_data.action` is set.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D14646
This commit is contained in:
Colin Basnett 2022-06-23 11:11:53 +02:00 committed by Sybren A. Stüvel
parent d8e9647ae2
commit 57816a6435
Notes: blender-bot 2023-02-14 08:25:14 +01:00
Referenced by commit 1cf05f17eb, UI: define category for the dope-sheet properties panel
1 changed files with 17 additions and 0 deletions

View File

@ -15,6 +15,8 @@ from bl_ui.properties_grease_pencil_common import (
GreasePencilLayerDisplayPanel,
)
from rna_prop_ui import PropertyPanel
#######################################
# DopeSheet Filtering - Header Buttons
@ -544,6 +546,20 @@ class DopesheetActionPanelBase:
col.prop(action, "use_cyclic")
class DOPESHEET_PT_custom_props_action(PropertyPanel, Panel):
bl_space_type = 'DOPESHEET_EDITOR'
bl_region_type = 'UI'
bl_context = 'data'
_context_path = "active_object.animation_data.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
class DOPESHEET_PT_action(DopesheetActionPanelBase, Panel):
bl_space_type = 'DOPESHEET_EDITOR'
bl_category = "Item"
@ -817,6 +833,7 @@ classes = (
DOPESHEET_PT_gpencil_layer_adjustments,
DOPESHEET_PT_gpencil_layer_relations,
DOPESHEET_PT_gpencil_layer_display,
DOPESHEET_PT_custom_props_action,
)
if __name__ == "__main__": # only for live edit.