Revision: 19712
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19712
Author:   aligorith
Date:     2009-04-14 12:18:48 +0200 (Tue, 14 Apr 2009)

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

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/blenkernel/BKE_action.h
    branches/blender2.5/blender/source/blender/blenkernel/intern/action.c

Modified: branches/blender2.5/blender/source/blender/blenkernel/BKE_action.h
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/BKE_action.h  
2009-04-14 03:08:09 UTC (rev 19711)
+++ branches/blender2.5/blender/source/blender/blenkernel/BKE_action.h  
2009-04-14 10:18:48 UTC (rev 19712)
@@ -64,9 +64,8 @@
 
 // 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 ----------------- */

Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/action.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/action.c       
2009-04-14 03:08:09 UTC (rev 19711)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/action.c       
2009-04-14 10:18:48 UTC (rev 19712)
@@ -762,38 +762,27 @@
 /* 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 @@
                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);


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to