Action Code - Tidied up some code that wasn't working yet

This commit is contained in:
Joshua Leung
2009-04-14 10:18:48 +00:00
parent cf6a1630cf
commit 2d17d86239
2 changed files with 18 additions and 28 deletions

View File

@@ -64,9 +64,8 @@ void free_action(struct bAction *act);
// XXX is this needed?
void make_local_action(struct bAction *act);
/* Some kind of bounding box operation on the action */
// XXX depreceated..
void calc_action_range(const struct bAction *act, float *start, float *end, int incl_hidden);
/* Action Groups API ----------------- */

View File

@@ -762,38 +762,27 @@ float get_action_frame_inv(Object *ob, float cframe)
/* Calculate the extents of given action */
void calc_action_range(const bAction *act, float *start, float *end, int incl_hidden)
{
// FCurve *fcu;
FCurve *fcu;
float min=999999999.0f, max=-999999999.0f;
int foundvert=0;
short foundvert=0;
if (act) {
#if 0 // XXX old animation system
for (chan=act->chanbase.first; chan; chan=chan->next) {
if ((incl_hidden) || (chan->flag & ACHAN_HIDDEN)==0) {
if (chan->ipo) {
for (icu=chan->ipo->curve.first; icu; icu=icu->next) {
if (icu->totvert) {
min= MIN2(min, icu->bezt[0].vec[1][0]);
max= MAX2(max, icu->bezt[icu->totvert-1].vec[1][0]);
foundvert=1;
}
}
}
for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next) {
if (conchan->ipo) {
for (icu=conchan->ipo->curve.first; icu; icu=icu->next) {
if (icu->totvert) {
min= MIN2(min, icu->bezt[0].vec[1][0]);
max= MAX2(max, icu->bezt[icu->totvert-1].vec[1][0]);
foundvert=1;
}
}
}
}
for (fcu= act->curves.first; fcu; fcu= fcu->next) {
if (fcu->totvert) {
float nmin, nmax;
/* get extents for this curve */
calc_fcurve_range(fcu, &nmin, &nmax);
/* compare to the running tally */
min= MIN2(min, nmin);
max= MAX2(max, nmax);
foundvert= 1;
}
}
#endif // XXX old animation system
}
if (foundvert) {
if(min==max) max+= 1.0f;
*start= min;
@@ -869,9 +858,11 @@ void copy_pose_result(bPose *to, bPose *from)
if(pchanto) {
Mat4CpyMat4(pchanto->pose_mat, pchanfrom->pose_mat);
Mat4CpyMat4(pchanto->chan_mat, pchanfrom->chan_mat);
/* used for local constraints */
VECCOPY(pchanto->loc, pchanfrom->loc);
QUATCOPY(pchanto->quat, pchanfrom->quat);
VECCOPY(pchanto->eul, pchanfrom->eul);
VECCOPY(pchanto->size, pchanfrom->size);
VECCOPY(pchanto->pose_head, pchanfrom->pose_head);