diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-09-21 18:48:57 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-09-22 10:48:13 +0300 |
commit | d037ac315b4dba2278a77d2db7b3b98861b3d093 (patch) | |
tree | 83520728fbd12848b0153e0fa63d745a115ba196 /source/blender/modifiers | |
parent | 3cbc5dd90e3fc84dead86d2ae48176cf3beecc82 (diff) |
Fix T80996: Weight Proximity modifier: crash going to editmode on a
target in certain situations
Regression from rBdeaff945d0b96.
mesh_ensure_looptri_data would overflow.
Crash would only happen if a Data Transfer modifier (transferring
UVs) follows, so exact reason for this is not yet entirely clear. Also
there are edit-mode versions of the following BVH lookup functions so it
could be avoided (since this is a expensive operation), marking as TODO.
Similar fix as
- rB0945a79ed1eafae444d3021a5912cb39801a7209
- rB56d7e39b92997768b3db8ce2dbc262f869994145
Reviewers: mont29, campbellbarton
Maniphest Tasks: T80996
Differential Revision: https://developer.blender.org/D8973
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgproximity.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 994f2c04921..c857ac53022 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -45,6 +45,7 @@ #include "BKE_lib_id.h" #include "BKE_lib_query.h" #include "BKE_mesh.h" +#include "BKE_mesh_wrapper.h" #include "BKE_modifier.h" #include "BKE_screen.h" #include "BKE_texture.h" /* Texture masking. */ @@ -552,6 +553,11 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * /* We must check that we do have a valid target_mesh! */ if (target_mesh != NULL) { + + /* TODO: edit-mode versions of the BVH lookup functions are available so it could be + * avoided. */ + BKE_mesh_wrapper_ensure_mdata(target_mesh); + SpaceTransform loc2trgt; float *dists_v = use_trgt_verts ? MEM_malloc_arrayN(numIdx, sizeof(float), "dists_v") : NULL; |