Merging r41564 through r41596 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 6 Nov 2011 18:38:20 +0000 (18:38 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 6 Nov 2011 18:38:20 +0000 (18:38 +0000)
1  2 
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/object.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/makesdna/DNA_scene_types.h

@@@ -1845,30 -1810,11 +1811,30 @@@ void set_no_parent_ipo(int val
        no_parent_ipo= val;
  }
  
 -void where_is_object_time(Scene *scene, Object *ob, float ctime)
 +static int where_is_object_parslow(Object *ob, float obmat[4][4], float slowmat[4][4])
  {
 -      float *fp1, *fp2, slowmat[4][4] = MAT4_UNITY;
 -      float stime=ctime, fac1, fac2;
 +      float *fp1, *fp2;
 +      float fac1, fac2;
        int a;
-       fac1= ( 1.0f / (1.0f + (float)fabs(give_timeoffset(ob))) );
 +
 +      // include framerate
++      fac1= ( 1.0f / (1.0f + (float)fabs(ob->sf)) );
 +      if(fac1 >= 1.0f) return 0;
 +      fac2= 1.0f-fac1;
 +
 +      fp1= obmat[0];
 +      fp2= slowmat[0];
 +      for(a=0; a<16; a++, fp1++, fp2++) {
 +              fp1[0]= fac1*fp1[0] + fac2*fp2[0];
 +      }
 +
 +      return 1;
 +}
 +
 +void where_is_object_time(Scene *scene, Object *ob, float ctime)
 +{
 +      float slowmat[4][4] = MAT4_UNITY;
 +      float stime=ctime;
        
        /* new version: correct parent+vertexparent and track+parent */
        /* this one only calculates direct attached parent and track */
                else
                        solve_parenting(scene, ob, par, ob->obmat, slowmat, 0);
                
+               /* "slow parent" is definitely not threadsafe, and may also give bad results jumping around 
+                * An old-fashioned hack which probably doesn't really cut it anymore
+                */
                if(ob->partype & PARSLOW) {
 -                      // include framerate
 -                      fac1= ( 1.0f / (1.0f + (float)fabs(ob->sf)) );
 -                      if(fac1 >= 1.0f) return;
 -                      fac2= 1.0f-fac1;
 -                      
 -                      fp1= ob->obmat[0];
 -                      fp2= slowmat[0];
 -                      for(a=0; a<16; a++, fp1++, fp2++) {
 -                              fp1[0]= fac1*fp1[0] + fac2*fp2[0];
 -                      }
 +                      if(!where_is_object_parslow(ob, ob->obmat, slowmat))
 +                              return;
                }
        }
        else {
  #include "BKE_paint.h"
  #include "BKE_particle.h"
  #include "BKE_pointcache.h"
+ #include "BKE_scene.h"
  #include "BKE_unit.h"
 +#include "BKE_movieclip.h"
 +#include "BKE_tracking.h"
  
  #include "smoke_API.h"