diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-11-06 09:46:45 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-11-06 09:46:45 +0400 |
commit | 440c1c2c1745b6d4acd13f405643100cb913fb3b (patch) | |
tree | 79a6621f6a76b887b3aa78645758d214b5654a04 /source/blender/blenkernel | |
parent | 4c17f8e5de94f3abc65995e7a2964bb9e6ea7642 (diff) |
As discussed on the mailing list, removing the non-functional,
incompatible, and unmaintainable Time Offset cruft.
- Slow Parenting lives another day (just), although it now carries
appropriate cautionary disclaimers. It's only really for the Game
Engine nowadays, as that's the only place where it can possibly work
with any reliability.
- "Animation Hacks" panel is now "Relations Extras". I could've merged
the two panels, though I figured these options weren't that frequently
used to justify taking up screen-space by default along with the panel
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_object.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/group.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 46 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 2 |
4 files changed, 16 insertions, 43 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index d6139a680ec..725ebfaa645 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -86,7 +86,7 @@ void set_mblur_offs(float blur); void set_field_offs(float field); void disable_speed_curve(int val); -float bsystem_time(struct Scene *scene, struct Object *ob, float cfra, float ofs); +float bsystem_time(struct Scene *scene, struct Object *ob, float cfra, float ofs); // XXX: last arg unused? void object_scale_to_mat3(struct Object *ob, float mat[][3]); void object_rot_to_mat3(struct Object *ob, float mat[][3]); void object_mat3_to_rot(struct Object *ob, float mat[][3], short use_compat); @@ -118,7 +118,6 @@ void object_tfm_restore(struct Object *ob, void *obtfm_pt); void object_handle_update(struct Scene *scene, struct Object *ob); void object_sculpt_modifiers_changed(struct Object *ob); -float give_timeoffset(struct Object *ob); int give_obdata_texspace(struct Object *ob, short **texflag, float **loc, float **size, float **rot); int object_insert_ptcache(struct Object *ob); diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index cd025ecb559..76c3e6e5502 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -276,8 +276,9 @@ void group_tag_recalc(Group *group) int group_is_animated(Object *parent, Group *group) { GroupObject *go; - - if(give_timeoffset(parent) != 0.0f || parent->nlastrips.first) + + // XXX: old animsys depreceated... + if(parent->nlastrips.first) return 1; for(go= group->gobject.first; go; go= go->next) @@ -343,12 +344,11 @@ void group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group * but when its enabled at some point it will need to be changed so as not to update so much - campbell */ /* if animated group... */ - if(give_timeoffset(parent) != 0.0f || parent->nlastrips.first) { + if(parent->nlastrips.first) { int cfrao; /* switch to local time */ cfrao= scene->r.cfra; - scene->r.cfra -= (int)floor(give_timeoffset(parent) + 0.5f); /* we need a DAG per group... */ for(go= group->gobject.first; go; go= go->next) { diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index a78b010392e..5782ae5f2d7 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1431,15 +1431,7 @@ float bsystem_time(struct Scene *scene, Object *UNUSED(ob), float cfra, float of /* global time */ if (scene) - cfra*= scene->r.framelen; - -#if 0 // XXX old animation system - if (ob) { - /* ofset frames */ - if ((ob->ipoflag & OB_OFFS_PARENT) && (ob->partype & PARSLOW)==0) - cfra-= give_timeoffset(ob); - } -#endif // XXX old animation system + cfra *= scene->r.framelen; cfra-= ofs; @@ -1592,12 +1584,6 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4]) makeDispListCurveTypes(scene, par, 0); if(cu->path==NULL) return; - /* exception, timeoffset is regarded as distance offset */ - if(cu->flag & CU_OFFS_PATHDIST) { - timeoffs = give_timeoffset(ob); - SWAP(float, sf_orig, ob->sf); - } - /* catch exceptions: feature for nla stride editing */ if(ob->ipoflag & OB_DISABLE_PATH) { ctime= 0.0f; @@ -1618,7 +1604,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4]) CLAMP(ctime, 0.0f, 1.0f); } else { - ctime= scene->r.cfra - give_timeoffset(ob); + ctime= scene->r.cfra; if (IS_EQF(cu->pathlen, 0.0f) == 0) ctime /= cu->pathlen; @@ -1862,9 +1848,6 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime) if(ob->parent) { Object *par= ob->parent; - // XXX depreceated - animsys - if(ob->ipoflag & OB_OFFS_PARENT) ctime-= give_timeoffset(ob); - /* hurms, code below conflicts with depgraph... (ton) */ /* and even worse, it gives bad effects for NLA stride too (try ctime != par->ctime, with MBlur) */ if(no_parent_ipo==0 && stime != par->ctime) { @@ -1873,17 +1856,20 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime) if(par->proxy_from); // was a copied matrix, no where_is! bad... else where_is_object_time(scene, par, ctime); - + solve_parenting(scene, ob, par, ob->obmat, slowmat, 0); - + *par= tmp; } 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(give_timeoffset(ob))) ); + fac1= ( 1.0f / (1.0f + (float)fabs(ob->sf)) ); if(fac1 >= 1.0f) return; fac2= 1.0f-fac1; @@ -2006,7 +1992,6 @@ void where_is_object_simul(Scene *scene, Object *ob) for a lamp that is the child of another object */ { Object *par; - //Ipo *ipo; float *fp1, *fp2; float slowmat[4][4]; float fac1, fac2; @@ -2017,10 +2002,9 @@ for a lamp that is the child of another object */ par= ob->parent; solve_parenting(scene, ob, par, ob->obmat, slowmat, 1); - + if(ob->partype & PARSLOW) { - - fac1= (float)(1.0/(1.0+ fabs(give_timeoffset(ob)))); + fac1= (float)(1.0/(1.0+ fabs(ob->sf))); fac2= 1.0f-fac1; fp1= ob->obmat[0]; fp2= slowmat[0]; @@ -2028,7 +2012,6 @@ for a lamp that is the child of another object */ fp1[0]= fac1*fp1[0] + fac2*fp2[0]; } } - } else { object_to_mat4(ob, ob->obmat); @@ -2554,15 +2537,6 @@ void object_sculpt_modifiers_changed(Object *ob) } } -float give_timeoffset(Object *ob) -{ - if ((ob->ipoflag & OB_OFFS_PARENTADD) && ob->parent) { - return ob->sf + give_timeoffset(ob->parent); - } else { - return ob->sf; - } -} - int give_obdata_texspace(Object *ob, short **texflag, float **loc, float **size, float **rot) { diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index ae12ad8e66f..b327afa7df7 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -2163,7 +2163,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra * system timing. */ #if 0 if ((ob->partype & PARSLOW)==0) { - offset= give_timeoffset(ob); + offset= ob->sf; *startframe += (int)(offset+0.5f); *endframe += (int)(offset+0.5f); |