Page MenuHome

Fix T91237: Wrong Editors could sync animation 'Visible Range'
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Sep 16 2021, 12:41 PM.

Details

Summary

This was reported for the Outliner.

It was possible to set 'show_locked_time' on any space (via python, not
sure if there are other ways to achieve this).
Navigating in an animation editor obviously ruined the layout in certain
Editors that are not made for this.

Now restrict syncing to editors that support it well (the ones that have
this setting exposed in their menus) and prevent setting this in RNA.

Diff Detail

Repository
rB Blender
Branch
T91237 (branched from master)
Build Status
Buildable 17050
Build 17050: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Sep 16 2021, 12:41 PM
Philipp Oeser (lichtwerk) created this revision.
Sybren A. Stüvel (sybren) requested changes to this revision.Sep 28 2021, 12:55 PM
Sybren A. Stüvel (sybren) added inline comments.
source/blender/editors/interface/view2d.c
906–909

The responsibility of determining which space-type supports time syncing should be moved into a separate function. That function can then be called from both places.

This revision now requires changes to proceed.Sep 28 2021, 12:55 PM
  • follow single responsibility principle

Much better! Just one small nag, after that the patch can be committed without re-reviewing it.

source/blender/editors/interface/view2d.c
871–874

if (condition) return true; else return false; is just return condition;
In other words, you can just write:

return ELEM(area->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_SEQ, SPACE_CLIP, SPACE_GRAPH);
This revision is now accepted and ready to land.Sep 28 2021, 6:14 PM