Page MenuHome

Gizmos: enable gizmos for the action space
ClosedPublic

Authored by Yann Lanthony (yann-lty) on Feb 2 2022, 11:50 PM.
Tokens
"Doubloon" token, awarded by duarteframos."Love" token, awarded by Juangra_Membata."Love" token, awarded by werwack."Love" token, awarded by hamza.elbarmaki."Pterodactyl" token, awarded by Gavriel5578."Like" token, awarded by AndyCuccaro."Like" token, awarded by PratikPB2123."Love" token, awarded by Baardaap.

Details

Summary

Support gizmos for the the action space type based on how it is done for other types of spaces in Blender (e.g: view3d, image).

See patch submission for sample code.


Summary
Blender's Python API allows developers to indicate the space type a GizmoGroup should be registered to, by specifying the bl_space_type in its class definition.
The issue is that when using the DOPESHEET_EDITOR space type, the GizmoGroup gets properly registered but never actually shows in the UI.

The proposal
This patch adds what is missing to display and interact with gizmos within the action space type. Based on how it is done for other types of spaces in Blender (e.g: view3d, image), it consists in:

  • setting the ED_KEYMAP_GIZMO flag to the action region keymap flag
  • drawing the gizmo map within the action_main_region_draw function

Having access to gizmos in dopesheet-like editors opens possibilities for new types of contextual tools. In order to demonstrate what can be done, a sample Python script is attached. It adds handles to interactively adjust the scene start and end frames.


Diff Detail

Repository
rB Blender

Event Timeline

Yann Lanthony (yann-lty) requested review of this revision.Feb 2 2022, 11:50 PM
Yann Lanthony (yann-lty) created this revision.

This was discussed in the last Animation & Rigging module meeting. The decision was that, although the example of dragging the scene start/end marks is too error-prone, the patch itself is fine, and non-invasive enough to accept. We're curious what kind of interfaces will be made with this :)

Of course @Campbell Barton (campbellbarton) should still evaluate this from a gyzmo point of view -- we just looked from the animators' point of view.

Campbell Barton (campbellbarton) retitled this revision from Enable action space gizmos to Gizmos: enable gizmos for the action space .
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Apr 5 2022, 9:12 AM

Thanks for the patch & the comprehensive example script, committed rB7cf3e713f7a42f0ba31b23593beb96e4b9643360.