diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-19 14:11:48 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-19 14:11:48 +0400 |
commit | c46cbc602e1007a15c6d9824ec34c41f124faeaa (patch) | |
tree | 3cc89f89a2601d7a8de18ef39b7207803b5f75fd /source/blender/modifiers/intern | |
parent | b9ae749480aeeb7e77f16ebe667ddfcf8b63650e (diff) |
Make lattice deform safe for threading
Lattice deformation used to store some runtime data
inside of lattice datablock itself. It's something
which is REALLY bad. Ideally DNA shouldn't contain
and runtime data.
For now solved it in a way that initialization of
lattice deform will create a structure which contains
lattice object for which deformation is calculating
and that runtime data which used to be stored in
lattice datablock itself.
It works really fine for mesh deform modifier, but
there's still runtime data stored in particle system
DNA, It didn't look something easy to be solved, so
leaving this as-is for now.
--
svn merge -r58277:58278 -r58795:58796 ^/branches/soc-2013-depsgraph_mt
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r-- | source/blender/modifiers/intern/MOD_explode.c | 8 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_particleinstance.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index fe680041197..c4aa41cd566 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -869,7 +869,7 @@ static DerivedMesh *explodeMesh(ExplodeModifierData *emd, /* getting back to object space */ invert_m4_m4(imat, ob->obmat); - psmd->psys->lattice = psys_get_lattice(&sim); + psmd->psys->lattice_deform_data = psys_create_lattice_deform_data(&sim); /* duplicate & displace vertices */ ehi = BLI_edgehashIterator_new(vertpahash); @@ -973,9 +973,9 @@ static DerivedMesh *explodeMesh(ExplodeModifierData *emd, CDDM_tessfaces_to_faces(explode); explode->dirty |= DM_DIRTY_NORMALS; - if (psmd->psys->lattice) { - end_latt_deform(psmd->psys->lattice); - psmd->psys->lattice = NULL; + if (psmd->psys->lattice_deform_data) { + end_latt_deform(psmd->psys->lattice_deform_data); + psmd->psys->lattice_deform_data = NULL; } return explode; diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c index e846ce11262..c51fa329df2 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.c +++ b/source/blender/modifiers/intern/MOD_particleinstance.c @@ -261,7 +261,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, maxloop += totloop; } - psys->lattice = psys_get_lattice(&sim); + psys->lattice_deform_data = psys_create_lattice_deform_data(&sim); if (psys->flag & (PSYS_HAIR_DONE | PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED) { float min_r[3], max_r[3]; @@ -378,9 +378,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, CDDM_calc_edges(result); - if (psys->lattice) { - end_latt_deform(psys->lattice); - psys->lattice = NULL; + if (psys->lattice_deform_data) { + end_latt_deform(psys->lattice_deform_data); + psys->lattice_deform_data = NULL; } if (size) |