[Bf-blender-cvs] [7fd11d9c7f5] master: T95386: Add Discontinuity (Euler) filter to Dope Sheet.

Demeter Dzadik noreply at git.blender.org
Fri Apr 29 15:17:54 CEST 2022


Commit: 7fd11d9c7f5b14106e1252289ccbcd8dd55ac087
Author: Demeter Dzadik
Date:   Fri Apr 29 14:53:14 2022 +0200
Branches: master
https://developer.blender.org/rB7fd11d9c7f5b14106e1252289ccbcd8dd55ac087

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

===================================================================

M	release/scripts/startup/bl_ui/space_dopesheet.py
M	source/blender/editors/space_graph/graph_utils.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 8e328e7cf2b..437f20b9473 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -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"
diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c
index 6470fa65c39..d8baa4c643d 100644
--- a/source/blender/editors/space_graph/graph_utils.c
+++ b/source/blender/editors/space_graph/graph_utils.c
@@ -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;
   }



More information about the Bf-blender-cvs mailing list