Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2010-04-05 07:37:28 +0400
committerJoshua Leung <aligorith@gmail.com>2010-04-05 07:37:28 +0400
commit76e483edef060de768a55dc3ded93458deb23240 (patch)
tree3c3f3362a4b5bc3b12912cd3f44e926f82e09705 /source/blender/editors/include/ED_keyframes_edit.h
parentd3293882456abb77ca6af198c6a1ed0ae8812c23 (diff)
Durian Feature Request for Graph Editor: Border Select (optionally) considers handles
Early when implementing the Graph Editor in 2.5, a key complaint that was levelled at the old 'IPO Editor' was that it was a constant annoyance that adjacent handles were getting selected in addition to the keyframes, when only the keyframes were intended. I solved this by making this default to only selecting keyframes and ignoring the handles, but this means that it isn't possible to batch move several handles at once. I've now improved this situation by adding an option to the border select operator (involved using Ctrl-B instead of B) which makes the handles get treated separately (as if they were separate verts, as in 2.4x). The default is still to only select keyframes, to have consistency with the DopeSheet... Also performed some more renaming work in the code...
Diffstat (limited to 'source/blender/editors/include/ED_keyframes_edit.h')
-rw-r--r--source/blender/editors/include/ED_keyframes_edit.h44
1 files changed, 36 insertions, 8 deletions
diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h
index 29f92fff001..60f2526191c 100644
--- a/source/blender/editors/include/ED_keyframes_edit.h
+++ b/source/blender/editors/include/ED_keyframes_edit.h
@@ -60,10 +60,14 @@ typedef enum eEditKeyframes_Validate {
/* select modes */
typedef enum eEditKeyframes_Select {
+ /* SELECT_SUBTRACT for all, followed by SELECT_ADD for some */
SELECT_REPLACE = (1<<0),
+ /* add ok keyframes to selection */
SELECT_ADD = (1<<1),
+ /* remove ok keyframes from selection */
SELECT_SUBTRACT = (1<<2),
- SELECT_INVERT = (1<<4),
+ /* flip ok status of keyframes based on key status */
+ SELECT_INVERT = (1<<3),
} eEditKeyframes_Select;
/* "selection map" building modes */
@@ -94,7 +98,7 @@ typedef enum eEditKeyframes_Mirror {
/* ************************************************ */
/* Non-Destuctive Editing API (keyframes_edit.c) */
-/* --- Generic Properties for Bezier Edit Tools ----- */
+/* --- Generic Properties for Keyframe Edit Tools ----- */
typedef struct KeyframeEditData {
/* generic properties/data access */
@@ -107,6 +111,10 @@ typedef struct KeyframeEditData {
/* current iteration data */
struct FCurve *fcu; /* F-Curve that is being iterated over */
int curIndex; /* index of current keyframe being iterated over */
+
+ /* flags */
+ short curflags; /* current flags for the keyframe we're reached in the iteration process */
+ short iterflags; /* settings for iteration process */ // XXX: unused...
} KeyframeEditData;
/* ------- Function Pointer Typedefs ---------------- */
@@ -116,27 +124,47 @@ typedef void (*FcuEditFunc)(struct FCurve *fcu);
/* callback function that operates on the given BezTriple */
typedef short (*KeyframeEditFunc)(KeyframeEditData *ked, struct BezTriple *bezt);
+/* ---------- Defines for 'OK' polls ----------------- */
+
+/* which verts of a keyframe is active (after polling) */
+typedef enum eKeyframeVertOk {
+ /* 'key' itself is ok */
+ KEYFRAME_OK_KEY = (1<<0),
+ /* 'handle 1' is ok */
+ KEYFRAME_OK_H1 = (1<<1),
+ /* 'handle 2' is ok */
+ KEYFRAME_OK_H2 = (1<<2),
+ /* all flags */
+ KEYFRAME_OK_ALL = (KEYFRAME_OK_KEY|KEYFRAME_OK_H1|KEYFRAME_OK_H2)
+} eKeyframeVertOk;
+
+/* Flags for use during iteration */
+typedef enum eKeyframeIterFlags {
+ /* consider handles in addition to key itself */
+ KEYFRAME_ITER_INCL_HANDLES = (1<<0),
+} eKeyframeIterFlags;
+
/* ------- Custom Data Type Defines ------------------ */
/* Custom data for remapping one range to another in a fixed way */
-typedef struct BeztEditCD_Remap {
+typedef struct KeyframeEditCD_Remap {
float oldMin, oldMax; /* old range */
float newMin, newMax; /* new range */
-} BeztEditCD_Remap;
+} KeyframeEditCD_Remap;
/* ---------------- Looping API --------------------- */
/* functions for looping over keyframes */
/* function for working with F-Curve data only (i.e. when filters have been chosen to explicitly use this) */
-short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, struct FCurve *fcu, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb);
+short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, struct FCurve *fcu, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb);
/* function for working with any type (i.e. one of the known types) of animation channel
* - filterflag is bDopeSheet->flag (DOPESHEET_FILTERFLAG)
*/
-short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked, struct bAnimListElem *ale, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag);
+short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked, struct bAnimListElem *ale, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb, int filterflag);
/* same as above, except bAnimListElem wrapper is not needed...
* - keytype is eAnim_KeyType
*/
-short ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked, void *data, int keytype, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag);
+short ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked, void *data, int keytype, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb, int filterflag);
/* functions for making sure all keyframes are in good order */
void ANIM_editkeyframes_refresh(struct bAnimContext *ac);
@@ -175,7 +203,7 @@ short bezt_calc_average(KeyframeEditData *ked, struct BezTriple *bezt);
short bezt_to_cfraelem(KeyframeEditData *ked, struct BezTriple *bezt);
/* used to remap times from one range to another
- * requires: ked->custom = BeztEditCD_Remap
+ * requires: ked->custom = KeyframeEditCD_Remap
*/
void bezt_remap_times(KeyframeEditData *ked, struct BezTriple *bezt);