diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-03 12:52:56 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-03 12:54:56 +0300 |
commit | f990c23bcfb5cb72b53d2b3cc93062fd814eeebe (patch) | |
tree | f2d6e17dfa13118b512b119a2be93b4ecd5da382 /source/blender/blenkernel | |
parent | 055289a95f467a733c9affbe532f43569e46267c (diff) |
Fix T66366: Multi object edit makes blender crash
Two issues here:
- Evaluated object data is to only be updated for selection only after modifier
stack is done its job. Otherwise it's possible to have selection batch update
called on an input data, at the same time as original object data is being
evaluated.
- If object's modifier stack did not create its own evaluated mesh (in case
when there is no effective modifiers, for example) can not update selection
on object's data, as it might cause threading issues between objects sharing
same data.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/object_update.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index 2bb06c86120..b682e233888 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -31,6 +31,7 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLI_threads.h" #include "BLI_math.h" #include "BKE_animsys.h" @@ -396,7 +397,16 @@ void BKE_object_data_select_update(Depsgraph *depsgraph, ID *object_data) void BKE_object_select_update(Depsgraph *depsgraph, Object *object) { DEG_debug_print_eval(depsgraph, __func__, object->id.name, object); - BKE_object_data_select_update(depsgraph, object->data); + if (!object->runtime.is_mesh_eval_owned) { + Mesh *mesh_input = object->runtime.mesh_orig; + Mesh_Runtime *mesh_runtime = &mesh_input->runtime; + BLI_mutex_lock(mesh_runtime->eval_mutex); + BKE_object_data_select_update(depsgraph, object->data); + BLI_mutex_unlock(mesh_runtime->eval_mutex); + } + else { + BKE_object_data_select_update(depsgraph, object->data); + } } void BKE_object_eval_eval_base_flags(Depsgraph *depsgraph, |