Cloth: Bugfix: 1. Kicking esc again, 2. Collision modifier needed to be updated when going backward in time, 3. GUI change when no bullet there

This commit is contained in:
Daniel Genrich 2008-01-30 02:05:37 +00:00
parent 7a7a52226f
commit 4ed28a99a7
4 changed files with 15 additions and 11 deletions

@ -526,6 +526,9 @@ int cloth_read_cache(Object *ob, ClothModifierData *clmd, float framenr)
if(G.rt > 0) if(G.rt > 0)
printf("cloth_read_cache problem: lnex - f#: %f, lastCF: %d\n", framenr, clmd->sim_parms->lastcachedframe); printf("cloth_read_cache problem: lnex - f#: %f, lastCF: %d\n", framenr, clmd->sim_parms->lastcachedframe);
} }
if(G.rt > 0)
printf("cloth_read_cache: %f successfully \n", framenr);
} }
if(G.rt > 0) if(G.rt > 0)
@ -647,7 +650,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd,Object *ob, DerivedMesh *d
/* we're getting called two times during file load, /* we're getting called two times during file load,
resulting in a not valid G.relbase on the first time (cache makes problems) resulting in a not valid G.relbase on the first time (cache makes problems)
--> just return back */ --> just return back */
if((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_LOADED)&& (!G.relbase_valid)) if((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_LOADED) && (!G.relbase_valid))
{ {
clmd->sim_parms->flags &= ~CLOTH_SIMSETTINGS_FLAG_LOADED; clmd->sim_parms->flags &= ~CLOTH_SIMSETTINGS_FLAG_LOADED;
return dm; return dm;
@ -732,8 +735,6 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd,Object *ob, DerivedMesh *d
// only be active during a specific period: // only be active during a specific period:
// that's "first frame" and "last frame" on GUI // that's "first frame" and "last frame" on GUI
// TODO: enable later again after refactoring
if ( current_time < clmd->sim_parms->firstframe ) if ( current_time < clmd->sim_parms->firstframe )
{ {
return result; return result;

@ -1416,7 +1416,7 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
} }
} }
} }
while(step < tf) while(step < tf)
{ {
effectors= pdInitEffectors(ob,NULL); effectors= pdInitEffectors(ob,NULL);
@ -1531,8 +1531,11 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
if(effectors) pdEndEffectors(effectors); if(effectors) pdEndEffectors(effectors);
/* ask for user break */ /* ask for user break */
/*
don't work very well, gives problems with ctrl-a + esc
if (CT_localInterruptCallBack && CT_localInterruptCallBack()) if (CT_localInterruptCallBack && CT_localInterruptCallBack())
return 0; return 0;
*/
} }
for(i = 0; i < numverts; i++) for(i = 0; i < numverts; i++)

@ -5212,8 +5212,8 @@ static void collisionModifier_deformVerts(
collmd->time = current_time; collmd->time = current_time;
} }
else else
{ {
collmd->time = current_time; collisionModifier_freeData((ModifierData *)collmd);
} }
} }

@ -2419,7 +2419,7 @@ void do_object_panels(unsigned short event)
if(clmd) if(clmd)
{ {
clmd->sim_parms->flags |= CLOTH_SIMSETTINGS_FLAG_RESET; clmd->sim_parms->flags |= CLOTH_SIMSETTINGS_FLAG_RESET;
DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
allqueue(REDRAWBUTSOBJECT, 0); allqueue(REDRAWBUTSOBJECT, 0);
allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWVIEW3D, 0);
} }
@ -5123,9 +5123,6 @@ static void object_panel_cloth(Object *ob)
int defCount; int defCount;
char *clvg1, *clvg2; char *clvg1, *clvg2;
char clmvg [] = "Vertex Groups%t|"; char clmvg [] = "Vertex Groups%t|";
clmdSetInterruptCallBack(blender_test_break); // make softbody module ESC aware
G.afbreek=0; // init global break system
val2=0; val2=0;
@ -5262,7 +5259,7 @@ static void object_panel_cloth_II(Object *ob)
else else
uiDefBut(block, LABEL, 0, " ", 10,80,145,20, NULL, 0.0, 0, 0, 0, ""); uiDefBut(block, LABEL, 0, " ", 10,80,145,20, NULL, 0.0, 0, 0, 0, "");
*/ */
#if WITH_BULLET == 1
uiDefButBitI(block, TOG, CLOTH_COLLSETTINGS_FLAG_ENABLED, B_CLOTH_RENEW, "Enable collisions", 10,60,150,20, &clmd->coll_parms->flags, 0, 0, 0, 0, "Enable collisions with this object"); uiDefButBitI(block, TOG, CLOTH_COLLSETTINGS_FLAG_ENABLED, B_CLOTH_RENEW, "Enable collisions", 10,60,150,20, &clmd->coll_parms->flags, 0, 0, 0, 0, "Enable collisions with this object");
if (clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED) if (clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED)
{ {
@ -5272,6 +5269,9 @@ static void object_panel_cloth_II(Object *ob)
} }
else else
uiDefBut(block, LABEL, 0, "",160,60,150,20, NULL, 0.0, 0, 0, 0, ""); uiDefBut(block, LABEL, 0, "",160,60,150,20, NULL, 0.0, 0, 0, 0, "");
#else
uiDefBut(block, LABEL, 0, "No collisions available (compile with bullet).",10,60,300,20, NULL, 0.0, 0, 0, 0, "");
#endif
} }
uiBlockEndAlign(block); uiBlockEndAlign(block);