Bugfixes for frame number boost:
authorPeter Schlaile <peter@schlaile.de>
Sun, 7 May 2006 08:23:51 +0000 (08:23 +0000)
committerPeter Schlaile <peter@schlaile.de>
Sun, 7 May 2006 08:23:51 +0000 (08:23 +0000)
- Found several places, where people explicitly casted the frame number
  to short.
- Fixed the crash in BPY_interface by adding an empty line (to make it
  recompile everywhere, make clean doesn't help...)

  For the build system maintainers:

  Problem was: The change in makesdna changed the position of the
  scriptlink structure. BPY_interface.c somehow didn't get recompiled
  (not even after a make clean!!!) which triggered crashes on adding
  scriptlinks.

source/blender/blenkernel/intern/effect.c
source/blender/python/BPY_interface.c
source/blender/python/api2_2x/Lattice.c
source/blender/python/api2_2x/NMesh.c
source/blender/python/api2_2x/Pose.c
source/blender/src/editipo.c
source/blender/src/transform_conversions.c

index 46777921859cd96b0144b070f66b956e967a4ac4..b23c654a2ade9f017eef58518331631bd4c9064e 100644 (file)
@@ -475,7 +475,7 @@ void pdDoEffectors(ListBase *lb, float *opco, float *force, float *speed, float
        float *obloc;
        float distance, force_val, ffall_val;
        float guidecollect[3], guidedist= 0.0f;
-       short cur_frame;
+       int cur_frame;
        
        guidecollect[0]= guidecollect[1]= guidecollect[2]=0.0f;
 
@@ -501,7 +501,7 @@ void pdDoEffectors(ListBase *lb, float *opco, float *force, float *speed, float
                /* Need to set r.cfra for paths (investigate, ton) (uses ob->ctime now, ton) */
                if(ob->ctime!=cur_time) {
                        cur_frame = G.scene->r.cfra;
-                       G.scene->r.cfra = (short)cur_time;
+                       G.scene->r.cfra = (int)cur_time;
                        where_is_object_time(ob, cur_time);
                        G.scene->r.cfra = cur_frame;
                }
@@ -702,7 +702,7 @@ static int pdDoDeflection(RNG *rng, float opco[3], float npco[3], float opno[3],
        int a, deflected=0, deflected_now=0;
        float t,t2, min_t;
        float mat[3][3], obloc[3];
-       short cur_frame;
+       int cur_frame;
        float time_before, time_after;
        float force_mag_norm;
        int d_object=0, d_face=0, ds_object=0, ds_face=0;
@@ -734,7 +734,7 @@ static int pdDoDeflection(RNG *rng, float opco[3], float npco[3], float opno[3],
                                else {
                                        /*Find out where the object is at this time*/
                                        cur_frame = G.scene->r.cfra;
-                                       G.scene->r.cfra = (short)cur_time;
+                                       G.scene->r.cfra = (int)cur_time;
                                        where_is_object_time(ob, cur_time);
                                        G.scene->r.cfra = cur_frame;
                                        
index bffb8f7be8a69d5a39538a9d48bb7a09534bd606..e6514fca7bf1619ba35d2cb4cf5b41d9778b8cba 100644 (file)
@@ -1325,6 +1325,7 @@ void BPY_do_pyscript( ID * id, short event )
        }
 }
 
+
 /* SPACE HANDLERS */
 
 /* These are special script links that can be assigned to ScrArea's to
index 05f9b03cd19e99a786c689d902535c3e4f0ff463..117699adeb7a1ddb4859721d5942d7998092ce3b 100644 (file)
@@ -752,7 +752,7 @@ static PyObject *Lattice_insertKey( BPy_Lattice * self, PyObject * args )
        if( frame > 0 ) {
                frame = EXPP_ClampInt( frame, 1, MAXFRAME );
                oldfra = G.scene->r.cfra;
-               G.scene->r.cfra = (short)frame;
+               G.scene->r.cfra = (int)frame;
        }
 //      else just use current frame, then
 //              return (EXPP_ReturnPyObjError (PyExc_RuntimeError,
@@ -763,7 +763,7 @@ static PyObject *Lattice_insertKey( BPy_Lattice * self, PyObject * args )
        allspace(REMAKEIPO, 0);
 
        if( frame > 0 )
-               G.scene->r.cfra = (short)oldfra;
+               G.scene->r.cfra = (int)oldfra;
 
        Py_INCREF( Py_None );
        return Py_None;
index 29242934228c2fb4309f2a86f50c6eecbf7a0e3d..9fa0c9c44356c5acc6b90272884e7f92971f1c39 100644 (file)
@@ -1248,7 +1248,7 @@ static PyObject *NMesh_insertKey( PyObject * self, PyObject * args )
        if( fra > 0 ) {
                fra = EXPP_ClampInt( fra, 1, NMESH_FRAME_MAX );
                oldfra = G.scene->r.cfra;
-               G.scene->r.cfra = (short)fra;
+               G.scene->r.cfra = (int)fra;
        }
 
        if( !mesh )
@@ -1259,7 +1259,7 @@ static PyObject *NMesh_insertKey( PyObject * self, PyObject * args )
        allspace(REMAKEIPO, 0);
 
        if( fra > 0 )
-               G.scene->r.cfra = (short)oldfra;
+               G.scene->r.cfra = (int)oldfra;
 
        return EXPP_incr_ret( Py_None );
 }
index 1fef31ed7966a22cb0b6f4696043c5f8b722a773..f19e7b366c6598dd16fc2b371ef99675dc666589 100644 (file)
@@ -463,7 +463,7 @@ static PyObject *PoseBone_insertKey(BPy_PoseBone *self, PyObject *args)
 
        //set the frame we want insertion on
        oldframe = G.scene->r.cfra;
-       G.scene->r.cfra = (short)frame;
+       G.scene->r.cfra = frame;
 
        //add the action channel if it's not there
        verify_action_channel(((BPy_Object*)parent_object)->object->action, 
@@ -498,7 +498,7 @@ static PyObject *PoseBone_insertKey(BPy_PoseBone *self, PyObject *args)
        }
 
        //flip the frame back
-       G.scene->r.cfra = (short)oldframe;
+       G.scene->r.cfra = oldframe;
 
        //update the IPOs
        remake_action_ipos (((BPy_Object*)parent_object)->object->action);
index 52734faa99c1959617adfc5af190f14bce79588b..4be25767f3d2f26552807782445b08cb7f23ba70 100644 (file)
@@ -4642,7 +4642,7 @@ void move_to_frame(void)
                                                                        cfra+= ob->sf/G.scene->r.framelen;
                                                                }
                                                        }
-                                                       CFRA= (short)floor(cfra+0.5);
+                                                       CFRA= (int)floor(cfra+0.5);
                                                        
                                                        if(CFRA < 1) CFRA= 1;
                                                        update_for_newframe();
index b144771c2ff111e4a2cdb6e3ab59b0aafd8d6c24..e37cd17028c425000066c197c067180482d23e99 100755 (executable)
@@ -2340,7 +2340,7 @@ static void createTransObject(TransInfo *t)
                                popfirst(&elems);       // bring back pushed listbase
                                
                                if(elems.first) {
-                                       float cfraont;
+                                       int cfraont;
                                        int ipoflag;
                                        
                                        base->flag |= BA_DO_IPO+BA_WAS_SEL;
@@ -2356,7 +2356,7 @@ static void createTransObject(TransInfo *t)
                                        for(ik= elems.first; ik; ik= ik->next) {
                                                
                                                /* weak... this doesn't correct for floating values, giving small errors */
-                                               CFRA= (short)(ik->val/G.scene->r.framelen);
+                                               CFRA= (int)(ik->val/G.scene->r.framelen);
                                                
                                                do_ob_ipo(ob);
                                                ObjectToTransData(td, ob);      // does where_is_object()
@@ -2376,7 +2376,7 @@ static void createTransObject(TransInfo *t)
                                        poplast(ob->loc);
                                        set_no_parent_ipo(0);
                                        
-                                       CFRA= (short)cfraont;
+                                       CFRA= cfraont;
                                        ob->ipoflag= ipoflag;
                                        
                                        where_is_object(ob);    // restore