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-27 14:44:00 +0300
committerJoshua Leung <aligorith@gmail.com>2008-12-27 14:44:00 +0300
commit86886cbc55c036af44833fd861cfd276fbec256a (patch)
treea78d4c9ad57668c7dd15539858963a5bed0af65f /source/blender/editors/space_action/action_select.c
parent032adf70d9a839d99e1b80a97adc710a2b2d1b7d (diff)
2.5 - Action Editor
* Started porting back keyframe editing tools for the Action Editor/Dopesheet. Currently, only Snap (Shift-S) and Mirror (Shift-M) are functional. * Added keyframe-editing API method for ensuring that all IPO-curves are left in a valid state after modifiying the values of their keyframes. * Added operator-register flags for most of the operators. Only mouse-select doesn't have it for now (as there's not much useful info stored, and no exec callback).
Diffstat (limited to 'source/blender/editors/space_action/action_select.c')
-rw-r--r--source/blender/editors/space_action/action_select.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index de41b7e4604..46bf2549087 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -411,6 +411,9 @@ void ACT_OT_keyframes_deselectall (wmOperatorType *ot)
ot->exec= actkeys_deselectall_exec;
ot->poll= ED_operator_areaactive;
+ /* flags */
+ ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+
/* props */
RNA_def_property(ot->srna, "invert", PROP_BOOLEAN, PROP_NONE);
}
@@ -577,6 +580,10 @@ void ACT_OT_keyframes_borderselect(wmOperatorType *ot)
ot->poll= ED_operator_areaactive;
+ /* flags */
+ // XXX er...
+ ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+
/* rna */
RNA_def_property(ot->srna, "event_type", PROP_INT, PROP_NONE);
RNA_def_property(ot->srna, "xmin", PROP_INT, PROP_NONE);
@@ -809,6 +816,9 @@ void ACT_OT_keyframes_columnselect (wmOperatorType *ot)
ot->exec= actkeys_columnselect_exec;
ot->poll= ED_operator_areaactive;
+ /* flags */
+ ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+
/* props */
prop= RNA_def_property(ot->srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_column_select_types);
@@ -1007,21 +1017,29 @@ static void selectkeys_leftright (bAnimContext *ac, short leftright, short selec
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
+
+ BeztEditFunc ok_cb, select_cb;
+ BeztEditData bed;
Scene *scene= ac->scene;
- float min, max;
+ /* if select mode is replace, deselect all keyframes first */
if (select_mode==SELECT_REPLACE) {
select_mode=SELECT_ADD;
deselect_action_keys(ac, 0, 0);
}
+ /* set callbacks and editing data */
+ ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE);
+ select_cb= ANIM_editkeyframes_select(select_mode);
+
+ memset(&bed, 0, sizeof(BeztEditFunc));
if (leftright == ACTKEYS_LRSEL_LEFT) {
- min = -MAXFRAMEF;
- max = (float)(CFRA + 0.1f);
+ bed.f1 = -MAXFRAMEF;
+ bed.f2 = (float)(CFRA + 0.1f);
}
else {
- min = (float)(CFRA - 0.1f);
- max = MAXFRAMEF;
+ bed.f1 = (float)(CFRA - 0.1f);
+ bed.f2 = MAXFRAMEF;
}
/* filter data */
@@ -1037,13 +1055,13 @@ static void selectkeys_leftright (bAnimContext *ac, short leftright, short selec
if (nob) {
ANIM_nla_mapping_apply(nob, ale->key_data, 0, 1);
- borderselect_ipo_key(ale->key_data, min, max, SELECT_ADD);
+ ipo_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL);
ANIM_nla_mapping_apply(nob, ale->key_data, 1, 1);
}
//else if (ale->type == ANIMTYPE_GPLAYER)
// borderselect_gplayer_frames(ale->data, min, max, SELECT_ADD);
else
- borderselect_ipo_key(ale->key_data, min, max, SELECT_ADD);
+ ipo_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL);
}
/* Cleanup */