diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-04-15 16:36:24 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-04-15 16:37:41 +0400 |
commit | 97881d06b221fbe5db98c5e5b3d2b9ecd0a22b38 (patch) | |
tree | a00c12f29eb1678ad66ba350039a50d5826dd757 /source/blender/modifiers/intern/MOD_meshdeform.c | |
parent | 9f17300d378f1905dbeeceb25a49a17fd256f9f2 (diff) |
Fix T39610: Shared mesh used for Mesh Deform causes crash
For now disable using linked edit mesh in the meshdeform modifier.
This is because editbmesh_get_derived_cage_and_final() might easily
conflict with the thread which evaluates object which is in the edit
mode for this mesh.
We'll support this case once granular dependency graph is landed.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_meshdeform.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshdeform.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c index 63e60d4b898..9ca89553a54 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.c +++ b/source/blender/modifiers/intern/MOD_meshdeform.c @@ -35,6 +35,7 @@ #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" +#include "DNA_scene_types.h" #include "BLI_math.h" #include "BLI_utildefines.h" @@ -187,8 +188,6 @@ static void meshdeformModifier_do( float (*vertexCos)[3], int numVerts) { MeshDeformModifierData *mmd = (MeshDeformModifierData *) md; - struct Mesh *me = (mmd->object) ? mmd->object->data : NULL; - BMEditMesh *em = me ? me->edit_btmesh : NULL; DerivedMesh *tmpdm, *cagedm; MDeformVert *dvert = NULL; MDefInfluence *influences; @@ -201,8 +200,18 @@ static void meshdeformModifier_do( if (!mmd->object || (!mmd->bindcagecos && !mmd->bindfunc)) return; - /* get cage derivedmesh */ - if (em) { + /* Get cage derivedmesh. + * + * Only do this is the target object is in edit mode by itself, meaning + * we don't allow linked edit meshes here. + * This is because editbmesh_get_derived_cage_and_final() might easily + * conflict with the thread which evaluates object which is in the edit + * mode for this mesh. + * + * We'll support this case once granular dependency graph is landed. + */ + if (mmd->object == md->scene->obedit) { + BMEditMesh *em = BKE_editmesh_from_object(mmd->object); tmpdm = editbmesh_get_derived_cage_and_final(md->scene, mmd->object, em, &cagedm, 0); if (tmpdm) tmpdm->release(tmpdm); |