static int do_init_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *result, int framenr) { PointCache *cache; cache= clmd->point_cache; /* initialize simulation data if it didn't exist already */ if(clmd->clothObject == NULL) { if(!cloth_from_object(ob, clmd, result, framenr, 1)) { BKE_ptcache_invalidate(cache); return 0; } if(clmd->clothObject == NULL) { BKE_ptcache_invalidate(cache); return 0; } implicit_set_positions(clmd); clmd->clothObject->last_frame= MINFRAME-1; } return 1; }
static int do_init_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *result, int framenr) { PointCache *cache; cache= clmd->point_cache; /* initialize simulation data if it didn't exist already */ if(clmd->clothObject == NULL) { if(!cloth_from_object(ob, clmd, result, framenr, 1)) { cache->flag &= ~PTCACHE_SIMULATION_VALID; cache->simframe= 0; return 0; } if(clmd->clothObject == NULL) { cache->flag &= ~PTCACHE_SIMULATION_VALID; cache->simframe= 0; return 0; } implicit_set_positions(clmd); } return 1; }