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-29 04:19:25 +0300
committerJoshua Leung <aligorith@gmail.com>2008-12-29 04:19:25 +0300
commit97a82102d4d24a94d8360a6f5f054e44f6fb1993 (patch)
treef204580537752d9aa602aaaae66246affe042f66 /source/blender/editors/space_action/action_select.c
parent87cae4caed35c50b2ef70fb104d6f057670eb94e (diff)
2.5 - Action Editor / Animation Stuff:
* Brought back clean (OKEY), sample (Shift-OKEY), and delete (XKEY/DELKEY) tools for the Action Editor. Currently clean uses a predefined threshold (as a rna-prop, though it's still lacking the popup to set this when it is called) * Added new file for 'destructive' keyframe operations/tools. * Got keyframing.c compiling. Now, some of these tools need to be operatorised. Also, the API there might change when enough of the system is stable for RNA-IPO work to take place (so that it can be tested).
Diffstat (limited to 'source/blender/editors/space_action/action_select.c')
-rw-r--r--source/blender/editors/space_action/action_select.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 46bf2549087..d356d7a7f42 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -88,31 +88,23 @@
/* ************************************************************************** */
/* GENERAL STUFF */
-#if 0
/* this function finds the channel that mouse is floating over */
-void *get_nearest_act_channel (short mval[], short *ret_type, void **owner)
+void *get_nearest_act_channel (bAnimContext *ac, int mval[2], short *ret_type, void **owner)
{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- void *data;
- short datatype;
+ ListBase anim_data = {NULL, NULL};
+ bAnimListElem *ale;
int filter;
+ View2D *v2d= &ac->ar->v2d;
int clickmin, clickmax;
- float x,y;
+ float x, y;
+ void *data= NULL;
/* init 'owner' return val */
*owner= NULL;
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) {
- *ret_type= ACTTYPE_NONE;
- return NULL;
- }
-
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- clickmin = (int) (((CHANNELHEIGHT/2) - y) / (CHANNELHEIGHT+CHANNELSKIP));
+ UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y);
+ clickmin = (int) ((ACHANNEL_HEIGHT_HALF - y) / (ACHANNEL_STEP));
clickmax = clickmin;
if (clickmax < 0) {
@@ -121,10 +113,10 @@ void *get_nearest_act_channel (short mval[], short *ret_type, void **owner)
}
/* filter data */
- filter= (ACTFILTER_FORDRAWING | ACTFILTER_VISIBLE | ACTFILTER_CHANNELS);
- actdata_filter(&act_data, filter, data, datatype);
+ filter= (ANIMFILTER_FORDRAWING | ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS);
+ ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype);
- for (ale= act_data.first; ale; ale= ale->next) {
+ for (ale= anim_data.first; ale; ale= ale->next) {
if (clickmax < 0)
break;
if (clickmin <= 0) {
@@ -133,7 +125,7 @@ void *get_nearest_act_channel (short mval[], short *ret_type, void **owner)
data= ale->data;
/* if an 'ID' has been set, this takes presidence as owner (for dopesheet) */
- if (datatype == ACTCONT_DOPESHEET) {
+ if (ac->datatype == ANIMCONT_DOPESHEET) {
/* return pointer to ID as owner instead */
if (ale->id)
*owner= ale->id;
@@ -145,7 +137,7 @@ void *get_nearest_act_channel (short mval[], short *ret_type, void **owner)
*owner= ale->owner;
}
- BLI_freelistN(&act_data);
+ BLI_freelistN(&anim_data);
return data;
}
@@ -154,12 +146,12 @@ void *get_nearest_act_channel (short mval[], short *ret_type, void **owner)
}
/* cleanup */
- BLI_freelistN(&act_data);
+ BLI_freelistN(&anim_data);
- *ret_type= ACTTYPE_NONE;
+ *ret_type= ANIMTYPE_NONE;
return NULL;
}
-#endif
+
/* used only by mouse_action. It is used to find the location of the nearest
* keyframe to where the mouse clicked,