T95386: Add Discontinuity (Euler) filter to Dope Sheet.

Add the Discontinuity (Euler) Filter operator to the Dope Sheet->Key
menu, so it's not only available from the Graph Editor->Key menu. On
request of @pablico, see T95386.

This required changing a poll function which is used by a bunch of other
operators, which seemed scary at first, but my thinking is that if an
operator can execute in the Graph Editor, then it should also be able to
execute in the Dope Sheet. I think the only reason this wouldn't be true
is if we were storing animation data in the UI itself, which of course
we don't. So I hope this is okay.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D14015
This commit is contained in:
Demeter Dzadik 2022-04-29 14:53:14 +02:00 committed by Sybren A. Stüvel
parent 3d877c8a0d
commit 7fd11d9c7f
2 changed files with 5 additions and 2 deletions

View File

@ -510,6 +510,9 @@ class DOPESHEET_MT_key(Menu):
layout.operator("action.clean", text="Clean Channels").channels = True
layout.operator("action.sample")
layout.separator()
layout.operator("graph.euler_filter", text="Discontinuity (Euler) Filter")
class DOPESHEET_MT_key_transform(Menu):
bl_label = "Transform"

View File

@ -169,9 +169,9 @@ bool graphop_editable_keyframes_poll(bContext *C)
int filter;
bool found = false;
/* firstly, check if in Graph Editor */
/* firstly, check if in Graph Editor or Dopesheet */
/* TODO: also check for region? */
if ((area == NULL) || (area->spacetype != SPACE_GRAPH)) {
if (area == NULL || !ELEM(area->spacetype, SPACE_GRAPH, SPACE_ACTION)) {
return found;
}