Added more dependencies to softbody, for correct recalc
For example; subsurfed softbody after play anim (ALT+A) didn't get cleared correctly. Darn where_is_object stuff!
This commit is contained in:
@@ -241,7 +241,7 @@ int mesh_modifier(Object *ob, char mode)
|
||||
else if(ob->effect.first); // weak... particles too
|
||||
else if(ob->parent && ob->parent->type==OB_LATTICE);
|
||||
else if(ob->parent && ob->partype==PARSKEL);
|
||||
else if(ob->softflag & 0x01);
|
||||
else if(ob->softflag & OB_SB_ENABLE);
|
||||
else return 0;
|
||||
|
||||
if(me->totvert==0) return 0;
|
||||
|
||||
@@ -2373,6 +2373,8 @@ void test_all_displists(void)
|
||||
freedisp= 1;
|
||||
else if ((ob->parent->type==OB_ARMATURE) && (ob->partype == PARSKEL))
|
||||
makedisp= 1;
|
||||
else if(ob->softflag & OB_SB_ENABLE)
|
||||
makedisp= 1;
|
||||
else if ((ob->parent->type==OB_CURVE) && (ob->partype == PARSKEL))
|
||||
freedisp= 1;
|
||||
else if(ob->partype==PARVERT1 || ob->partype==PARVERT3) {
|
||||
|
||||
@@ -1277,7 +1277,7 @@ void where_is_object_time(Object *ob, float ctime)
|
||||
|
||||
/* new version: correct parent+vertexparent and track+parent */
|
||||
/* this one only calculates direct attached parent and track */
|
||||
/* hij is sneller, maar moet wel de timeoffs in de gaten houden */
|
||||
/* is faster, but should keep track of timeoffs */
|
||||
|
||||
if(ob==0) return;
|
||||
|
||||
|
||||
@@ -653,7 +653,7 @@ static void mesh_update_softbody(Object *ob)
|
||||
if(ob->soft->bspring==NULL)
|
||||
if(object_has_edges(ob)) sbObjectToSoftbody(ob);
|
||||
|
||||
/* hrms .. do springs alter their lenght ?
|
||||
/* hrms .. do springs alter their lenght ? (yes, mesh keys would (ton))
|
||||
if(medge) {
|
||||
bs= ob->soft->bspring;
|
||||
bp= ob->soft->bpoint;
|
||||
@@ -966,8 +966,14 @@ void sbObjectReset(Object *ob)
|
||||
// origS is previous timestep
|
||||
VECCOPY(bp->origS, bp->origE);
|
||||
VECCOPY(bp->pos, bp->origE);
|
||||
VECCOPY(bp->origT, bp->origE);
|
||||
bp->vec[0]= bp->vec[1]= bp->vec[2]= 0.0f;
|
||||
|
||||
// no idea about the Heun stuff! (ton)
|
||||
VECCOPY(bp->prevpos, bp->vec);
|
||||
VECCOPY(bp->prevvec, bp->vec);
|
||||
VECCOPY(bp->prevdx, bp->vec);
|
||||
VECCOPY(bp->prevdv, bp->vec);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2348,6 +2348,7 @@ void inner_play_anim_loop(int init, int mode)
|
||||
* - 3: all view3d and seq areas, no replay */
|
||||
int play_anim(int mode)
|
||||
{
|
||||
Base *base;
|
||||
ScrArea *sa, *oldsa;
|
||||
int cfraont;
|
||||
unsigned short event=0;
|
||||
@@ -2410,7 +2411,13 @@ int play_anim(int mode)
|
||||
do_all_ipos();
|
||||
do_all_keys();
|
||||
do_all_actions();
|
||||
do_all_ikas();
|
||||
|
||||
/* set all objects on current frame... test_all_displists() needs it */
|
||||
base= G.scene->base.first;
|
||||
while(base) {
|
||||
if(G.vd->lay & base->lay) where_is_object(base->object);
|
||||
base= base->next;
|
||||
}
|
||||
test_all_displists();
|
||||
|
||||
audiostream_stop();
|
||||
|
||||
Reference in New Issue
Block a user