Page MenuHome

Fix panel pinning showing for instanced panels (e.g. FCurve modifiers)
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Oct 22 2021, 1:14 PM.

Details

Summary

This was reported for FCurve modifiers, but was also true (in theory) for
other instanced panels (regular modifiers, spreadsheet filters, ...),
these would not show pinning for other reasons (no caterories).

So in the case of the Graph Editor the follwing happens:

graph_buttons_register only registers GRAPH_PT_modifiers, the panel
itself has no header (PANEL_TYPE_NO_HEADER), further panels for
individual modifiers are added dynamically in graph_panel_modifiers.
So when pinning a particular modifier, we would pin e.g. GRAPH_PT_noise
(not GRAPH_PT_modifiers).
ED_region_panels_layout_ex would only collect panels known to
graph_buttons_register (so is not aware of the specific panels of
modifiers). So while I think it should be possible to pin
GRAPH_PT_modifiers on top of an individual modifier's panel this would
result in all modifiers being shown in other categories [which would also
be weird]. Panel header layout was also not correct (drawing the pin
icon over the modifier delete icon).

So to resolve this, just dont use pinning for these type of panels by
checking PANEL_TYPE_INSTANCED.

part of T92293.

Diff Detail

Repository
rB Blender

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Oct 22 2021, 1:14 PM
Philipp Oeser (lichtwerk) created this revision.

I'm fine with this in principle. But I'd suggest adding a function ui_panel_can_be_pinned() doing the "is instanced" and "is child panel" checks, as it makes the semantics much more clear.

A function like Julian suggests sounds nice. Either way though, this patch looks good to me. Thanks for the thorough description.

This revision is now accepted and ready to land.Oct 22 2021, 4:32 PM

introduce utility functions