diff options
Diffstat (limited to 'source/blender/blenkernel/intern/cloth.c')
-rw-r--r-- | source/blender/blenkernel/intern/cloth.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index dbc94571cad..e98d7bb01a4 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -157,7 +157,7 @@ BVHTree *bvhselftree_build_from_cloth (ClothModifierData *clmd, float epsilon) { unsigned int i; BVHTree *bvhtree; - Cloth *cloth = clmd->clothObject; + Cloth *cloth; ClothVertex *verts; MFace *mfaces; float co[12]; @@ -198,7 +198,7 @@ BVHTree *bvhtree_build_from_cloth (ClothModifierData *clmd, float epsilon) { unsigned int i; BVHTree *bvhtree; - Cloth *cloth = clmd->clothObject; + Cloth *cloth; ClothVertex *verts; MFace *mfaces; float co[12]; @@ -479,7 +479,7 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul /************************************************ * clothModifier_do - main simulation function ************************************************/ -DerivedMesh *clothModifier_do(ClothModifierData *clmd, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) +DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) { DerivedMesh *result; PointCache *cache; @@ -487,12 +487,13 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Object *ob, DerivedMesh * float timescale; int framedelta, framenr, startframe, endframe; - framenr= (int)G.scene->r.cfra; + clmd->scene= scene; /* nice to pass on later :) */ + framenr= (int)scene->r.cfra; cache= clmd->point_cache; result = CDDM_copy(dm); BKE_ptcache_id_from_cloth(&pid, ob, clmd); - BKE_ptcache_id_time(&pid, framenr, &startframe, &endframe, ×cale); + BKE_ptcache_id_time(&pid, scene, framenr, &startframe, &endframe, ×cale); clmd->sim_parms->timescale= timescale; if(!result) { @@ -786,15 +787,14 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm ) int j = 0; MDeformVert *dvert = NULL; Cloth *clothObj = NULL; - int numverts = dm->getNumVerts ( dm ); + int numverts; float goalfac = 0; ClothVertex *verts = NULL; + if (!clmd || !dm) return; + clothObj = clmd->clothObject; - if ( !dm ) - return; - numverts = dm->getNumVerts ( dm ); verts = clothObj->verts; |