diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-08 19:30:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-08 19:30:00 +0400 |
commit | f9d07ff3ee312a9ea7d93ef53bfebe327fa058ee (patch) | |
tree | 99487b11a3d53d3758d7d438266ebda44b34973c /source/blender/editors/animation/keyframes_general.c | |
parent | 817d308803dc1234e9e7b4cab782c0f52a4ebaca (diff) |
style cleanup: animation + buttons
Diffstat (limited to 'source/blender/editors/animation/keyframes_general.c')
-rw-r--r-- | source/blender/editors/animation/keyframes_general.c | 250 |
1 files changed, 125 insertions, 125 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index c54f8c5bd25..05c87e98f9b 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -90,13 +90,13 @@ void delete_fcurve_key(FCurve *fcu, int index, short do_recalc) index += fcu->totvert; /* Delete this keyframe */ - memmove(&fcu->bezt[index], &fcu->bezt[index+1], sizeof(BezTriple)*(fcu->totvert-index-1)); + memmove(&fcu->bezt[index], &fcu->bezt[index + 1], sizeof(BezTriple) * (fcu->totvert - index - 1)); fcu->totvert--; if (fcu->totvert == 0) { if (fcu->bezt) MEM_freeN(fcu->bezt); - fcu->bezt= NULL; + fcu->bezt = NULL; } /* recalc handles - only if it won't cause problems */ @@ -109,13 +109,13 @@ void delete_fcurve_keys(FCurve *fcu) { int i; - if (fcu->bezt==NULL) /* ignore baked curves */ + if (fcu->bezt == NULL) /* ignore baked curves */ return; /* Delete selected BezTriples */ - for (i=0; i < fcu->totvert; i++) { + for (i = 0; i < fcu->totvert; i++) { if (fcu->bezt[i].f2 & SELECT) { - memmove(&fcu->bezt[i], &fcu->bezt[i+1], sizeof(BezTriple)*(fcu->totvert-i-1)); + memmove(&fcu->bezt[i], &fcu->bezt[i + 1], sizeof(BezTriple) * (fcu->totvert - i - 1)); fcu->totvert--; i--; } @@ -131,9 +131,9 @@ void clear_fcurve_keys(FCurve *fcu) { if (fcu->bezt) MEM_freeN(fcu->bezt); - fcu->bezt= NULL; + fcu->bezt = NULL; - fcu->totvert= 0; + fcu->totvert = 0; } /* ---------------- */ @@ -148,20 +148,20 @@ void duplicate_fcurve_keys(FCurve *fcu) if (ELEM(NULL, fcu, fcu->bezt)) return; - for (i=0; i < fcu->totvert; i++) { + for (i = 0; i < fcu->totvert; i++) { /* If a key is selected */ if (fcu->bezt[i].f2 & SELECT) { /* Expand the list */ - newbezt = MEM_callocN(sizeof(BezTriple) * (fcu->totvert+1), "beztriple"); + newbezt = MEM_callocN(sizeof(BezTriple) * (fcu->totvert + 1), "beztriple"); - memcpy(newbezt, fcu->bezt, sizeof(BezTriple) * (i+1)); - memcpy(newbezt+i+1, fcu->bezt+i, sizeof(BezTriple)); - memcpy(newbezt+i+2, fcu->bezt+i+1, sizeof (BezTriple) *(fcu->totvert-(i+1))); + memcpy(newbezt, fcu->bezt, sizeof(BezTriple) * (i + 1)); + memcpy(newbezt + i + 1, fcu->bezt + i, sizeof(BezTriple)); + memcpy(newbezt + i + 2, fcu->bezt + i + 1, sizeof (BezTriple) * (fcu->totvert - (i + 1))); fcu->totvert++; /* reassign pointers... (free old, and add new) */ MEM_freeN(fcu->bezt); - fcu->bezt=newbezt; + fcu->bezt = newbezt; /* Unselect the current key */ BEZ_DESEL(&fcu->bezt[i]); @@ -200,20 +200,20 @@ void clean_fcurve(FCurve *fcu, float thresh) /* Loop through BezTriples, comparing them. Skip any that do * not fit the criteria for "ok" points. */ - for (i=1; i<totCount; i++) { + for (i = 1; i < totCount; i++) { float prev[2], cur[2], next[2]; /* get BezTriples and their values */ if (i < (totCount - 1)) { - beztn = (old_bezts + (i+1)); - next[0]= beztn->vec[1][0]; next[1]= beztn->vec[1][1]; + beztn = (old_bezts + (i + 1)); + next[0] = beztn->vec[1][0]; next[1] = beztn->vec[1][1]; } else { beztn = NULL; next[0] = next[1] = 0.0f; } - lastb= (fcu->bezt + (fcu->totvert - 1)); - bezt= (old_bezts + i); + lastb = (fcu->bezt + (fcu->totvert - 1)); + bezt = (old_bezts + i); /* get references for quicker access */ prev[0] = lastb->vec[1][0]; prev[1] = lastb->vec[1][1]; @@ -226,7 +226,7 @@ void clean_fcurve(FCurve *fcu, float thresh) * current is further away than the next one is to the previous. */ if (beztn && (IS_EQT(cur[0], next[0], thresh)) && - (IS_EQT(next[1], prev[1], thresh)==0)) + (IS_EQT(next[1], prev[1], thresh) == 0)) { /* only add if current is further away from previous */ if (cur[1] > next[1]) { @@ -276,8 +276,8 @@ void clean_fcurve(FCurve *fcu, float thresh) /* temp struct used for smooth_fcurve */ typedef struct tSmooth_Bezt { - float *h1, *h2, *h3; /* bezt->vec[0,1,2][1] */ - float y1, y2, y3; /* averaged before/new/after y-values */ + float *h1, *h2, *h3; /* bezt->vec[0,1,2][1] */ + float y1, y2, y3; /* averaged before/new/after y-values */ } tSmooth_Bezt; /* Use a weighted moving-means method to reduce intensity of fluctuations */ @@ -288,8 +288,8 @@ void smooth_fcurve(FCurve *fcu) int i, x, totSel = 0; /* first loop through - count how many verts are selected */ - bezt= fcu->bezt; - for (i=0; i < fcu->totvert; i++, bezt++) { + bezt = fcu->bezt; + for (i = 0; i < fcu->totvert; i++, bezt++) { if (BEZSELECTED(bezt)) totSel++; } @@ -299,11 +299,11 @@ void smooth_fcurve(FCurve *fcu) tSmooth_Bezt *tarray, *tsb; /* allocate memory in one go */ - tsb= tarray= MEM_callocN(totSel*sizeof(tSmooth_Bezt), "tSmooth_Bezt Array"); + tsb = tarray = MEM_callocN(totSel * sizeof(tSmooth_Bezt), "tSmooth_Bezt Array"); /* populate tarray with data of selected points */ - bezt= fcu->bezt; - for (i=0, x=0; (i < fcu->totvert) && (x < totSel); i++, bezt++) { + bezt = fcu->bezt; + for (i = 0, x = 0; (i < fcu->totvert) && (x < totSel); i++, bezt++) { if (BEZSELECTED(bezt)) { /* tsb simply needs pointer to vec, and index */ tsb->h1 = &bezt->vec[0][1]; @@ -311,7 +311,7 @@ void smooth_fcurve(FCurve *fcu) tsb->h3 = &bezt->vec[2][1]; /* advance to the next tsb to populate */ - if (x < totSel-1) + if (x < totSel - 1) tsb++; else break; @@ -321,19 +321,19 @@ void smooth_fcurve(FCurve *fcu) /* calculate the new smoothed F-Curve's with weighted averages: * - this is done with two passes to avoid progressive corruption errors * - uses 5 points for each operation (which stores in the relevant handles) - * - previous: w/a ratio = 3:5:2:1:1 - * - next: w/a ratio = 1:1:2:5:3 + * - previous: w/a ratio = 3:5:2:1:1 + * - next: w/a ratio = 1:1:2:5:3 */ /* round 1: calculate smoothing deltas and new values */ - tsb= tarray; - for (i=0; i < totSel; i++, tsb++) { + tsb = tarray; + for (i = 0; i < totSel; i++, tsb++) { /* don't touch end points (otherwise, curves slowly explode, as we don't have enough data there) */ - if (ELEM(i, 0, (totSel-1)) == 0) { + if (ELEM(i, 0, (totSel - 1)) == 0) { const tSmooth_Bezt *tP1 = tsb - 1; - const tSmooth_Bezt *tP2 = (i-2 > 0) ? (tsb - 2) : (NULL); + const tSmooth_Bezt *tP2 = (i - 2 > 0) ? (tsb - 2) : (NULL); const tSmooth_Bezt *tN1 = tsb + 1; - const tSmooth_Bezt *tN2 = (i+2 < totSel) ? (tsb + 2) : (NULL); + const tSmooth_Bezt *tN2 = (i + 2 < totSel) ? (tsb + 2) : (NULL); const float p1 = *tP1->h2; const float p2 = (tP2) ? (*tP2->h2) : (*tP1->h2); @@ -342,18 +342,18 @@ void smooth_fcurve(FCurve *fcu) const float n2 = (tN2) ? (*tN2->h2) : (*tN1->h2); /* calculate previous and next, then new position by averaging these */ - tsb->y1= (3*p2 + 5*p1 + 2*c1 + n1 + n2) / 12; - tsb->y3= (p2 + p1 + 2*c1 + 5*n1 + 3*n2) / 12; + tsb->y1 = (3 * p2 + 5 * p1 + 2 * c1 + n1 + n2) / 12; + tsb->y3 = (p2 + p1 + 2 * c1 + 5 * n1 + 3 * n2) / 12; tsb->y2 = (tsb->y1 + tsb->y3) / 2; } } /* round 2: apply new values */ - tsb= tarray; - for (i=0; i < totSel; i++, tsb++) { + tsb = tarray; + for (i = 0; i < totSel; i++, tsb++) { /* don't touch end points, as their values were't touched above */ - if (ELEM(i, 0, (totSel-1)) == 0) { + if (ELEM(i, 0, (totSel - 1)) == 0) { /* y2 takes the average of the 2 points */ *tsb->h2 = tsb->y2; @@ -382,42 +382,42 @@ typedef struct tempFrameValCache { /* Evaluates the curves between each selected keyframe on each frame, and keys the value */ void sample_fcurve(FCurve *fcu) { - BezTriple *bezt, *start=NULL, *end=NULL; + BezTriple *bezt, *start = NULL, *end = NULL; tempFrameValCache *value_cache, *fp; int sfra, range; int i, n, nIndex; - if (fcu->bezt==NULL) /* ignore baked */ + if (fcu->bezt == NULL) /* ignore baked */ return; /* find selected keyframes... once pair has been found, add keyframes */ - for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { + for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) { /* check if selected, and which end this is */ if (BEZSELECTED(bezt)) { if (start) { /* set end */ - end= bezt; + end = bezt; /* cache values then add keyframes using these values, as adding * keyframes while sampling will affect the outcome... * - only start sampling+adding from index=1, so that we don't overwrite original keyframe */ - range= (int)( ceil(end->vec[1][0] - start->vec[1][0]) ); - sfra= (int)( floor(start->vec[1][0]) ); + range = (int)(ceil(end->vec[1][0] - start->vec[1][0]) ); + sfra = (int)(floor(start->vec[1][0]) ); if (range) { - value_cache= MEM_callocN(sizeof(tempFrameValCache)*range, "IcuFrameValCache"); + value_cache = MEM_callocN(sizeof(tempFrameValCache) * range, "IcuFrameValCache"); - /* sample values */ - for (n=1, fp=value_cache; n<range && fp; n++, fp++) { - fp->frame= (float)(sfra + n); - fp->val= evaluate_fcurve(fcu, fp->frame); + /* sample values */ + for (n = 1, fp = value_cache; n < range && fp; n++, fp++) { + fp->frame = (float)(sfra + n); + fp->val = evaluate_fcurve(fcu, fp->frame); } - /* add keyframes with these, tagging as 'breakdowns' */ - for (n=1, fp=value_cache; n<range && fp; n++, fp++) { - nIndex= insert_vert_fcurve(fcu, fp->frame, fp->val, 1); - BEZKEYTYPE(fcu->bezt + nIndex)= BEZT_KEYTYPE_BREAKDOWN; + /* add keyframes with these, tagging as 'breakdowns' */ + for (n = 1, fp = value_cache; n < range && fp; n++, fp++) { + nIndex = insert_vert_fcurve(fcu, fp->frame, fp->val, 1); + BEZKEYTYPE(fcu->bezt + nIndex) = BEZT_KEYTYPE_BREAKDOWN; } /* free temp cache */ @@ -429,13 +429,13 @@ void sample_fcurve(FCurve *fcu) } /* bezt was selected, so it now marks the start of a whole new chain to search */ - start= bezt; - end= NULL; + start = bezt; + end = NULL; } else { /* just set start keyframe */ - start= bezt; - end= NULL; + start = bezt; + end = NULL; } } } @@ -455,23 +455,23 @@ void sample_fcurve(FCurve *fcu) /* globals for copy/paste data (like for other copy/paste buffers) */ static ListBase animcopybuf = {NULL, NULL}; -static float animcopy_firstframe= 999999999.0f; -static float animcopy_lastframe= -999999999.0f; -static float animcopy_cfra= 0.0; +static float animcopy_firstframe = 999999999.0f; +static float animcopy_lastframe = -999999999.0f; +static float animcopy_cfra = 0.0; /* datatype for use in copy/paste buffer */ typedef struct tAnimCopybufItem { struct tAnimCopybufItem *next, *prev; - ID *id; /* ID which owns the curve */ - bActionGroup *grp; /* Action Group */ - char *rna_path; /* RNA-Path */ - int array_index; /* array index */ + ID *id; /* ID which owns the curve */ + bActionGroup *grp; /* Action Group */ + char *rna_path; /* RNA-Path */ + int array_index; /* array index */ - int totvert; /* number of keyframes stored for this channel */ - BezTriple *bezt; /* keyframes in buffer */ + int totvert; /* number of keyframes stored for this channel */ + BezTriple *bezt; /* keyframes in buffer */ - short id_type; /* Result of GS(id->name)*/ + short id_type; /* Result of GS(id->name)*/ } tAnimCopybufItem; @@ -482,8 +482,8 @@ void free_anim_copybuf(void) tAnimCopybufItem *aci, *acn; /* free each buffer element */ - for (aci= animcopybuf.first; aci; aci= acn) { - acn= aci->next; + for (aci = animcopybuf.first; aci; aci = acn) { + acn = aci->next; /* free keyframes */ if (aci->bezt) @@ -498,9 +498,9 @@ void free_anim_copybuf(void) } /* restore initial state */ - animcopybuf.first= animcopybuf.last= NULL; - animcopy_firstframe= 999999999.0f; - animcopy_lastframe= -999999999.0f; + animcopybuf.first = animcopybuf.last = NULL; + animcopy_firstframe = 999999999.0f; + animcopy_lastframe = -999999999.0f; } /* ------------------- */ @@ -509,14 +509,14 @@ void free_anim_copybuf(void) short copy_animedit_keys(bAnimContext *ac, ListBase *anim_data) { bAnimListElem *ale; - Scene *scene= ac->scene; + Scene *scene = ac->scene; /* clear buffer first */ free_anim_copybuf(); /* assume that each of these is an F-Curve */ - for (ale= anim_data->first; ale; ale= ale->next) { - FCurve *fcu= (FCurve *)ale->key_data; + for (ale = anim_data->first; ale; ale = ale->next) { + FCurve *fcu = (FCurve *)ale->key_data; tAnimCopybufItem *aci; BezTriple *bezt, *nbezt, *newbuf; int i; @@ -529,42 +529,42 @@ short copy_animedit_keys(bAnimContext *ac, ListBase *anim_data) continue; /* init copybuf item info */ - aci= MEM_callocN(sizeof(tAnimCopybufItem), "AnimCopybufItem"); - aci->id= ale->id; - aci->id_type= GS(ale->id->name); - aci->grp= fcu->grp; - aci->rna_path= MEM_dupallocN(fcu->rna_path); - aci->array_index= fcu->array_index; + aci = MEM_callocN(sizeof(tAnimCopybufItem), "AnimCopybufItem"); + aci->id = ale->id; + aci->id_type = GS(ale->id->name); + aci->grp = fcu->grp; + aci->rna_path = MEM_dupallocN(fcu->rna_path); + aci->array_index = fcu->array_index; BLI_addtail(&animcopybuf, aci); /* add selected keyframes to buffer */ // TODO: currently, we resize array everytime we add a new vert - this works ok as long as it is assumed only a few keys are copied - for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { + for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) { if (BEZSELECTED(bezt)) { /* add to buffer */ - newbuf= MEM_callocN(sizeof(BezTriple)*(aci->totvert+1), "copybuf beztriple"); + newbuf = MEM_callocN(sizeof(BezTriple) * (aci->totvert + 1), "copybuf beztriple"); /* assume that since we are just re-sizing the array, just copy all existing data across */ if (aci->bezt) - memcpy(newbuf, aci->bezt, sizeof(BezTriple)*(aci->totvert)); + memcpy(newbuf, aci->bezt, sizeof(BezTriple) * (aci->totvert)); /* copy current beztriple across too */ - nbezt= &newbuf[aci->totvert]; - *nbezt= *bezt; + nbezt = &newbuf[aci->totvert]; + *nbezt = *bezt; /* ensure copy buffer is selected so pasted keys are selected */ BEZ_SEL(nbezt); /* free old array and set the new */ if (aci->bezt) MEM_freeN(aci->bezt); - aci->bezt= newbuf; + aci->bezt = newbuf; aci->totvert++; /* check if this is the earliest frame encountered so far */ if (bezt->vec[1][0] < animcopy_firstframe) - animcopy_firstframe= bezt->vec[1][0]; + animcopy_firstframe = bezt->vec[1][0]; if (bezt->vec[1][0] > animcopy_lastframe) - animcopy_lastframe= bezt->vec[1][0]; + animcopy_lastframe = bezt->vec[1][0]; } } @@ -575,7 +575,7 @@ short copy_animedit_keys(bAnimContext *ac, ListBase *anim_data) return -1; /* in case 'relative' paste method is used */ - animcopy_cfra= CFRA; + animcopy_cfra = CFRA; /* everything went fine */ return 0; @@ -588,7 +588,7 @@ static tAnimCopybufItem *pastebuf_match_path_full(FCurve *fcu, const short from_ { tAnimCopybufItem *aci; - for (aci= animcopybuf.first; aci; aci= aci->next) { + for (aci = animcopybuf.first; aci; aci = aci->next) { /* check that paths exist */ if (to_simple || (aci->rna_path && fcu->rna_path)) { if (to_simple || (strcmp(aci->rna_path, fcu->rna_path) == 0)) { @@ -606,7 +606,7 @@ static tAnimCopybufItem *pastebuf_match_path_property(FCurve *fcu, const short f { tAnimCopybufItem *aci; - for (aci= animcopybuf.first; aci; aci= aci->next) { + for (aci = animcopybuf.first; aci; aci = aci->next) { /* check that paths exist */ if (aci->rna_path && fcu->rna_path) { /* find the property of the fcurve and compare against the end of the tAnimCopybufItem @@ -627,12 +627,12 @@ static tAnimCopybufItem *pastebuf_match_path_property(FCurve *fcu, const short f RNA_path_resolve(&id_ptr, aci->rna_path, &rptr, &prop); if (prop) { - const char *identifier= RNA_property_identifier(prop); + const char *identifier = RNA_property_identifier(prop); int len_id = strlen(identifier); int len_path = strlen(fcu->rna_path); if (len_id <= len_path) { /* note, paths which end with "] will fail with this test - Animated ID Props */ - if (strcmp(identifier, fcu->rna_path + (len_path-len_id))==0) { + if (strcmp(identifier, fcu->rna_path + (len_path - len_id)) == 0) { if ((from_single) || (aci->array_index == fcu->array_index)) break; } @@ -653,7 +653,7 @@ static tAnimCopybufItem *pastebuf_match_index_only(FCurve *fcu, const short from { tAnimCopybufItem *aci; - for (aci= animcopybuf.first; aci; aci= aci->next) { + for (aci = animcopybuf.first; aci; aci = aci->next) { /* check that paths exist */ if ((from_single) || (aci->array_index == fcu->array_index)) { break; @@ -672,7 +672,7 @@ static void paste_animedit_keys_fcurve(FCurve *fcu, tAnimCopybufItem *aci, float int i; /* First de-select existing FCuvre */ - for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { + for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) { bezt->f2 &= ~SELECT; } @@ -693,19 +693,19 @@ static void paste_animedit_keys_fcurve(FCurve *fcu, tAnimCopybufItem *aci, float float f_min; float f_max; - if (merge_mode==KEYFRAME_PASTE_MERGE_OVER_RANGE) { - f_min= aci->bezt[0].vec[1][0] + offset; - f_max= aci->bezt[aci->totvert-1].vec[1][0] + offset; + if (merge_mode == KEYFRAME_PASTE_MERGE_OVER_RANGE) { + f_min = aci->bezt[0].vec[1][0] + offset; + f_max = aci->bezt[aci->totvert - 1].vec[1][0] + offset; } else { /* Entire Range */ - f_min= animcopy_firstframe + offset; - f_max= animcopy_lastframe + offset; + f_min = animcopy_firstframe + offset; + f_max = animcopy_lastframe + offset; } /* remove keys in range */ if (f_min < f_max) { /* select verts in range for removal */ - for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { + for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) { if ((f_min < bezt[0].vec[1][0]) && (bezt[0].vec[1][0] < f_max)) { bezt->f2 |= SELECT; } @@ -719,7 +719,7 @@ static void paste_animedit_keys_fcurve(FCurve *fcu, tAnimCopybufItem *aci, float } /* just start pasting, with the the first keyframe on the current frame, and so on */ - for (i=0, bezt=aci->bezt; i < aci->totvert; i++, bezt++) { + for (i = 0, bezt = aci->bezt; i < aci->totvert; i++, bezt++) { /* temporarily apply offset to src beztriple while copying */ bezt->vec[0][0] += offset; bezt->vec[1][0] += offset; @@ -765,10 +765,10 @@ short paste_animedit_keys(bAnimContext *ac, ListBase *anim_data, { bAnimListElem *ale; - const Scene *scene= (ac->scene); + const Scene *scene = (ac->scene); - const short from_single= (animcopybuf.first == animcopybuf.last); - const short to_simple= (anim_data->first == anim_data->last); + const short from_single = (animcopybuf.first == animcopybuf.last); + const short to_simple = (anim_data->first == anim_data->last); float offset = 0.0f; int pass; @@ -787,16 +787,16 @@ short paste_animedit_keys(bAnimContext *ac, ListBase *anim_data, /* mathods of offset */ switch (offset_mode) { case KEYFRAME_PASTE_OFFSET_CFRA_START: - offset= (float)(CFRA - animcopy_firstframe); + offset = (float)(CFRA - animcopy_firstframe); break; case KEYFRAME_PASTE_OFFSET_CFRA_END: - offset= (float)(CFRA - animcopy_lastframe); + offset = (float)(CFRA - animcopy_lastframe); break; case KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE: - offset= (float)(CFRA - animcopy_cfra); + offset = (float)(CFRA - animcopy_cfra); break; case KEYFRAME_PASTE_OFFSET_NONE: - offset= 0.0f; + offset = 0.0f; break; } @@ -805,44 +805,44 @@ short paste_animedit_keys(bAnimContext *ac, ListBase *anim_data, FCurve *fcu; tAnimCopybufItem *aci; - ale= anim_data->first; - fcu= (FCurve *)ale->data; /* destination F-Curve */ - aci= animcopybuf.first; + ale = anim_data->first; + fcu = (FCurve *)ale->data; /* destination F-Curve */ + aci = animcopybuf.first; paste_animedit_keys_fcurve(fcu, aci, offset, merge_mode); } else { /* from selected channels - * This "passes" system aims to try to find "matching" channels to paste keyframes - * into with increasingly loose matching heuristics. The process finishes when at least - * one F-Curve has been pasted into. + * This "passes" system aims to try to find "matching" channels to paste keyframes + * into with increasingly loose matching heuristics. The process finishes when at least + * one F-Curve has been pasted into. */ - for (pass= 0; pass < 3; pass++) { - unsigned int totmatch= 0; + for (pass = 0; pass < 3; pass++) { + unsigned int totmatch = 0; - for (ale= anim_data->first; ale; ale= ale->next) { + for (ale = anim_data->first; ale; ale = ale->next) { /* find buffer item to paste from * - if names don't matter (i.e. only 1 channel in buffer), don't check id/group * - if names do matter, only check if id-type is ok for now (group check is not that important) * - most importantly, rna-paths should match (array indices are unimportant for now) */ - FCurve *fcu = (FCurve *)ale->data; /* destination F-Curve */ - tAnimCopybufItem *aci= NULL; + FCurve *fcu = (FCurve *)ale->data; /* destination F-Curve */ + tAnimCopybufItem *aci = NULL; switch (pass) { case 0: /* most strict, must be exact path match data_path & index */ - aci= pastebuf_match_path_full(fcu, from_single, to_simple); + aci = pastebuf_match_path_full(fcu, from_single, to_simple); break; case 1: /* less strict, just compare property names */ - aci= pastebuf_match_path_property(fcu, from_single, to_simple); + aci = pastebuf_match_path_property(fcu, from_single, to_simple); break; case 2: /* Comparing properties gave no results, so just do index comparisons */ - aci= pastebuf_match_index_only(fcu, from_single, to_simple); + aci = pastebuf_match_index_only(fcu, from_single, to_simple); break; } |