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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-09-10 11:27:50 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-09-10 11:33:24 +0300
commit1d1b8bb1968a96dc594c62aacab6e9b82256c346 (patch)
treec2287489f835a2c445a1e91ffb37f0165665f653 /source/blender
parentac0e51161960dda52dc20ceb7e07f20d935145aa (diff)
Fix T46067: ShrinkWrap + Threaded depsgraph crash
Note that allocating DM arrays from an editmesh is currently not threadsafe, however even if were resolved, its more efficient to avoid having to do it in the first place.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index 5ecd2fc74e8..7d492586b7d 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -50,6 +50,7 @@
#include "BKE_lattice.h"
#include "BKE_deform.h"
+#include "BKE_editmesh.h"
#include "BKE_mesh.h" /* for OMP limits. */
#include "BKE_subsurf.h"
@@ -278,6 +279,14 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, bool for
BLI_SPACE_TRANSFORM_SETUP(&local2aux, calc->ob, calc->smd->auxTarget);
}
+ /* use editmesh to avoid array allocation */
+ if (calc->smd->target && calc->target->type == DM_TYPE_EDITBMESH) {
+ treeData.em_evil = BKE_editmesh_from_object(calc->smd->target);
+ }
+ if (calc->smd->auxTarget && auxMesh->type == DM_TYPE_EDITBMESH) {
+ auxData.em_evil = BKE_editmesh_from_object(calc->smd->auxTarget);
+ }
+
/* After sucessufuly build the trees, start projection vertexs */
if (bvhtree_from_mesh_looptri(&treeData, calc->target, 0.0, 4, 6) &&
(auxMesh == NULL || bvhtree_from_mesh_looptri(&auxData, auxMesh, 0.0, 4, 6)))