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>2008-12-26 13:55:07 +0300
committerJoshua Leung <aligorith@gmail.com>2008-12-26 13:55:07 +0300
commit34baf51dcb730319a2cbb807f905571475b24e9a (patch)
tree6372f5f15fad76a0aae6597a6f2a1248157cf086 /source/blender/editors/include/ED_keyframes_edit.h
parent1dbbffb4be152f690eb4d6cb50241c33d88dae31 (diff)
2.5 - Action Editor: All Keyframe Selection Tools Ported
User Notes (for using tools whose behaviour has changed): * Mouse Selection Tools: 1) Click on keyframe to modify its selection. Holding the 'Shift' modifier when doing so, will result in keyframe selection being toggled instead of replacing existing selections. 2) Click on either side of the current frame indicator while holding the 'Alt' modifier. This will select only all the keyframes on the relevant side of the current frame indicator. 3) Click on a keyframe while holding the 'Ctrl' modifier. This will select all the keyframes that fall on that frame. * Borderselect Tools 1) BKEY selects all the keyframes within the specified range (as per normal) 2) ALT-BKEY will select either all the keyframes in the frame-range specified or the channel range specified, depending on which axis of the select region was larger. This method is prejudiced towards frame-range selection. Code Notes: * Finished porting over all of the remaining keyframe selection tools, and recoded the ported ones to make them easier to use (after running into some technical limitations) * Simplified the way to check if 'animation context' is valid by moving a necessary check into that function. * Refactored internal keyframe-looping tools to reduce the amount of code needed per tool to edit keyframes, removing a lot of the unnecessary bulk. Now, the ipo/icu_keys_bezier_loop functions recieve a few more arguments (1st arg is pointer to generic customdata, and another defines a validation callback which makes it easier to reuse some of the select callbacks). * Added 'totrect' adjustment for number of channels being shown in Action Editor, so that scrolling will be limited to where there is data (and also so that scroller displays more relevant context info). For this to work, filtering channels now returns the number of channels extracted. This may come into use for other tools if there's such a need. * I still need to port over some code for markers, which is required for some of the tools which use them. For now, those tools do nothing. * Grease-Pencil editing mode in Action Editor is currently non-functional (code is commented out due to missing dependencies). This is currently pending the re-implementation of Grease Pencil in 2.5
Diffstat (limited to 'source/blender/editors/include/ED_keyframes_edit.h')
-rw-r--r--source/blender/editors/include/ED_keyframes_edit.h41
1 files changed, 33 insertions, 8 deletions
diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h
index 1015de2e9e4..56a4cb6089c 100644
--- a/source/blender/editors/include/ED_keyframes_edit.h
+++ b/source/blender/editors/include/ED_keyframes_edit.h
@@ -47,6 +47,16 @@ struct Scene;
/* --------- Tool Flags ------------ */
+/* bezt validation */
+typedef enum eEditKeyframes_Validate {
+ BEZT_OK_FRAME = 1,
+ BEZT_OK_FRAMERANGE,
+ BEZT_OK_SELECTED,
+ BEZT_OK_VALUE,
+} eEditKeyframes_Validate;
+
+/* ------------ */
+
/* select tools */
typedef enum eEditKeyframes_Select {
SELECT_REPLACE = (1<<0),
@@ -71,32 +81,47 @@ typedef enum eEditKeyframes_Snap {
/* ************************************************ */
/* Editing API */
+/* --- Generic Properties for Bezier Edit Tools ----- */
+
+// XXX maybe a union would be more compact?
+typedef struct BeztEditData {
+ ListBase list; /* temp list for storing custom list of data to check */
+ struct Scene *scene; /* pointer to current scene - many tools need access to cfra/etc. */
+ void *data; /* pointer to custom data - not that useful? */
+ float f1, f2; /* storage of times/values as 'decimals' */
+ int i1, i2; /* storage of times/values as 'whole' numbers */
+} BeztEditData;
+
/* ------- Function Pointer Typedefs --------------- */
/* callback function that refreshes the IPO curve after use */
typedef void (*IcuEditFunc)(struct IpoCurve *icu);
-typedef short (*BeztEditFunc)(struct Scene *scene, struct BezTriple *bezt);
+ /* callback function that operates on the given BezTriple */
+typedef short (*BeztEditFunc)(BeztEditData *bed, struct BezTriple *bezt);
/* ------------- Looping API ------------------- */
-short icu_keys_bezier_loop(struct Scene *scene, struct IpoCurve *icu, BeztEditFunc bezt_cb, IcuEditFunc icu_cb);
-short ipo_keys_bezier_loop(struct Scene *scene, struct Ipo *ipo, BeztEditFunc bezt_cb, IcuEditFunc icu_cb);
+short icu_keys_bezier_loop(BeztEditData *bed, struct IpoCurve *icu, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, IcuEditFunc icu_cb);
+short ipo_keys_bezier_loop(BeztEditData *bed, struct Ipo *ipo, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, IcuEditFunc icu_cb);
/* ------------ BezTriple Callback Getters --------------- */
+/* accessories */
+BeztEditFunc ANIM_editkeyframes_ok(short mode);
+
+/* edit */
BeztEditFunc ANIM_editkeyframes_snap(short mode);
BeztEditFunc ANIM_editkeyframes_mirror(short mode);
BeztEditFunc ANIM_editkeyframes_select(short mode);
BeztEditFunc ANIM_editkeyframes_handles(short mode);
BeztEditFunc ANIM_editkeyframes_ipo(short mode);
-/* ------------ Helper Funcs -------------- */
-// XXX will these be needed to set globals for some funcs?
-
/* ************************************************ */
-void select_ipo_key(struct Scene *scene, struct Ipo *ipo, float selx, short selectmode);
-void select_icu_key(struct Scene *scene, struct IpoCurve *icu, float selx, short selectmode);
+// XXX all of these funcs will be depreceated!
+
+void select_ipo_key(BeztEditData *bed, struct Ipo *ipo, float selx, short selectmode);
+void select_icu_key(BeztEditData *bed, struct IpoCurve *icu, float selx, short selectmode);
short is_ipo_key_selected(struct Ipo *ipo);
void set_ipo_key_selection(struct Ipo *ipo, short sel);