Page MenuHome

Added Custom Properties panel for Actions in the dopesheet editor
ClosedPublic

Authored by Colin Basnett (cmbasnett) on Apr 14 2022, 10:40 AM.

Details

Summary

The adds the 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.

Diff Detail

Repository
rB Blender

Event Timeline

Colin Basnett (cmbasnett) requested review of this revision.Apr 14 2022, 10:40 AM
Colin Basnett (cmbasnett) created this revision.
Colin Basnett (cmbasnett) retitled this revision from Added Custom Property panel for Actions in the dopesheet editor to Added Custom Properties panel for Actions in the dopesheet editor.
Sybren A. Stüvel (sybren) requested changes to this revision.Apr 29 2022, 3:31 PM

It doesn't seem to work for me:

This is on current master (rB7fd11d9c7f5b14106e1252289ccbcd8dd55ac087), with an Action selected in the Action Editor.

There are no errors on the console or anything. The panel just doesn't have any contents, only a title.

This revision now requires changes to proceed.Apr 29 2022, 3:31 PM
Colin Basnett (cmbasnett) planned changes to this revision.Apr 30 2022, 7:11 AM

Looks like this PR was broken because of 2e9e2715efac89084afd276f1447499c304a6c5c.

It worked previously because the context_path was being evaluated using eval. Now it uses context.path_resolve. I'll see what I can do about fixing this.

Updated _context_path to use "active_object.animation_data.action".

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

Small simplification: you can just return bool(context.selected_visible_actions and context.active_object.animation_data.action)

572

Question: why does this need to check for both selected+visible actions and the action of the active object? Wouldn't one or the other be enough?

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

It doesn't actually, it was just a paranoid check (verifying that the context path is going to be valid). It functions fine without it.

Removed redundant check for context path validity

Colin Basnett (cmbasnett) marked an inline comment as done.May 28 2022, 2:51 AM
This revision is now accepted and ready to land.Jun 14 2022, 12:06 PM
Sybren A. Stüvel (sybren) requested changes to this revision.Jun 14 2022, 12:08 PM

I accepted too fast (I just want this to be in ;-) ). The poll() function now checks one RNA path, but the _context_path is set to another.

This revision now requires changes to proceed.Jun 14 2022, 12:08 PM

Updated the poll function to check the validity of the _context_path

This revision is now accepted and ready to land.Jun 23 2022, 10:58 AM

Why is this using context.active_object in Dopesheet of all places? The whole point of selected_visible_actions is to provide actions actually relevant to the current selection.