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