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
This commit is contained in:
2013-08-19 10:11:48 +00:00
parent b9ae749480
commit c46cbc602e
13 changed files with 109 additions and 90 deletions

View File

@@ -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;