Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2010-12-01 15:23:10 +0300
committerJanne Karhu <jhkarh@gmail.com>2010-12-01 15:23:10 +0300
commitb36ab837780c513ab38f56294092816e1fd67af9 (patch)
tree3e3848b8c893eb1cb46c31b146178efaad3c5b9c /source
parentbfe2447f570ecc8b03a1ab3d3a1a1e4ed0b58312 (diff)
Fix for [#24958] Cloth pinning not working
* Cloth now uses the original derived mesh for simulation and a new dm only for applying the simulation result. * Reverted Campbell's temporary workaround r33406.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/cloth.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 946d03d388a..be715fac352 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -447,11 +447,6 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
return dm;
}
- /* XXX, workaround for bug [#24958], see report for more info */
- if(CustomData_has_layer(&dm->vertData, CD_MDEFORMVERT) && !CustomData_has_layer(&result->vertData, CD_MDEFORMVERT)) {
- DM_add_vert_layer(result, CD_MDEFORMVERT, CD_DUPLICATE, dm->getVertDataArray(dm, CD_MDEFORMVERT));
- }
-
if(clmd->sim_parms->reset
|| (framenr == (startframe - clmd->sim_parms->preroll) && clmd->sim_parms->preroll != 0)
|| (clmd->clothObject && result->getNumVerts(result) != clmd->clothObject->numverts))
@@ -473,10 +468,10 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
BKE_ptcache_invalidate(cache);
/* do simulation */
- if(!do_init_cloth(ob, clmd, result, framenr))
+ if(!do_init_cloth(ob, clmd, dm, framenr))
return result;
- do_step_cloth(ob, clmd, result, framenr);
+ do_step_cloth(ob, clmd, dm, framenr);
cloth_to_object(ob, clmd, result);
return result;
@@ -497,12 +492,12 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
framedelta= -1;
/* initialize simulation data if it didn't exist already */
- if(!do_init_cloth(ob, clmd, result, framenr))
+ if(!do_init_cloth(ob, clmd, dm, framenr))
return result;
if((framenr == startframe) && (clmd->sim_parms->preroll == 0)) {
BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
- do_init_cloth(ob, clmd, result, framenr);
+ do_init_cloth(ob, clmd, dm, framenr);
BKE_ptcache_validate(cache, framenr);
cache->flag &= ~PTCACHE_REDO_NEEDED;
return result;
@@ -540,7 +535,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
/* do simulation */
BKE_ptcache_validate(cache, framenr);
- if(!do_step_cloth(ob, clmd, result, framenr)) {
+ if(!do_step_cloth(ob, clmd, dm, framenr)) {
BKE_ptcache_invalidate(cache);
}
else