[Bf-blender-cvs] [32a046def2f] temp-graph-select-changes: Cleanup: Clarify iterator visibility flag
Julian Eisel
noreply at git.blender.org
Fri Nov 15 17:07:33 CET 2019
Commit: 32a046def2f73455deaae6dee4a0a1fea856c4a7
Author: Julian Eisel
Date: Thu Nov 14 17:24:28 2019 +0100
Branches: temp-graph-select-changes
https://developer.blender.org/rB32a046def2f73455deaae6dee4a0a1fea856c4a7
Cleanup: Clarify iterator visibility flag
===================================================================
M source/blender/editors/animation/keyframes_edit.c
M source/blender/editors/include/ED_keyframes_edit.h
M source/blender/editors/space_graph/graph_select.c
===================================================================
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index 91ad25f6e20..dc413e936eb 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -502,7 +502,7 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac)
\
if (ked && (ked->iterflags & KEYFRAME_ITER_INCL_HANDLES)) { \
/* Only act on visible items, so check handle visiblity state. */ \
- const bool handles_visible = ((ked->iterflags & KEYFRAME_ITER_HANDLES_DEFAULT_HIDDEN) ? \
+ const bool handles_visible = ((ked->iterflags & KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE) ? \
(BEZT_ISSEL_ANY(bezt)) : \
true); \
if (handles_visible) { \
@@ -1460,7 +1460,7 @@ KeyframeEditFunc ANIM_editkeyframes_easing(short mode)
static short select_bezier_add(KeyframeEditData *ked, BezTriple *bezt)
{
/* Only act on visible items, so check handle visiblity state. */
- const bool handles_visible = ked && ((ked->iterflags & KEYFRAME_ITER_HANDLES_DEFAULT_HIDDEN) ?
+ const bool handles_visible = ked && ((ked->iterflags & KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE) ?
(BEZT_ISSEL_ANY(bezt)) :
true);
@@ -1486,7 +1486,7 @@ static short select_bezier_add(KeyframeEditData *ked, BezTriple *bezt)
static short select_bezier_subtract(KeyframeEditData *ked, BezTriple *bezt)
{
/* Only act on visible items, so check handle visiblity state. */
- const bool handles_visible = ked && ((ked->iterflags & KEYFRAME_ITER_HANDLES_DEFAULT_HIDDEN) ?
+ const bool handles_visible = ked && ((ked->iterflags & KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE) ?
(BEZT_ISSEL_ANY(bezt)) :
true);
diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h
index 9bc2b48db89..48fad5a4d49 100644
--- a/source/blender/editors/include/ED_keyframes_edit.h
+++ b/source/blender/editors/include/ED_keyframes_edit.h
@@ -142,9 +142,11 @@ typedef enum eKeyframeIterFlags {
/* Perform NLA time remapping (global -> strip) for the "f2" parameter */
KED_F2_NLA_UNMAP = (1 << 2),
- /* By default, the handles iterated over will be hidden. Additional checks are needed to get the
- * actual visibility state. */
- KEYFRAME_ITER_HANDLES_DEFAULT_HIDDEN = (1 << 3),
+ /* Set this when handles aren't visible by default and you want to perform additional checks to
+ * get the actual visibility state. E.g. in some cases handles are only drawn if either a handle
+ * or their control point is selected. The selection state will have to be checked in the
+ * iterator callbacks then. */
+ KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE = (1 << 3),
} eKeyframeIterFlags;
/* --- Generic Properties for Keyframe Edit Tools ----- */
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index 28460df7ab4..89da4ce26d2 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -553,7 +553,7 @@ static void box_select_graphkeys(bAnimContext *ac,
}
if (sipo->flag & SIPO_SELVHANDLESONLY) {
- ked.iterflags |= KEYFRAME_ITER_HANDLES_DEFAULT_HIDDEN;
+ ked.iterflags |= KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE;
}
/* treat handles separately? */
More information about the Bf-blender-cvs
mailing list