diff options
Diffstat (limited to 'source/blender/blenkernel/intern/cloth.c')
-rw-r--r-- | source/blender/blenkernel/intern/cloth.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 5cfbd5c18dc..74f88a77e63 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -153,6 +153,9 @@ void cloth_init ( ClothModifierData *clmd ) clmd->sim_parms->defgoal = 0.0f; clmd->sim_parms->goalspring = 1.0f; clmd->sim_parms->goalfrict = 0.0f; + + if(!clmd->sim_parms->effector_weights) + clmd->sim_parms->effector_weights = BKE_add_effector_weights(NULL); } static BVHTree *bvhselftree_build_from_cloth (ClothModifierData *clmd, float epsilon) @@ -402,6 +405,8 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul VECCOPY(verts->xconst, mvert[i].co); Mat4MulVecfl(ob->obmat, verts->xconst); } + + effectors = pdInitEffectors(clmd->scene, ob, NULL, clmd->sim_parms->effector_weights); tstart(); @@ -411,6 +416,8 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul tend(); + pdEndEffectors(&effectors); + // printf ( "%f\n", ( float ) tval() ); return ret; |