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.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -1998,6 +1998,8 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object)
|
||||
OperationKey object_select_key(
|
||||
&object->id, NodeType::BATCH_CACHE, OperationCode::GEOMETRY_SELECT_UPDATE);
|
||||
add_relation(object_data_select_key, object_select_key, "Data Selection -> Object Selection");
|
||||
add_relation(
|
||||
geom_key, object_select_key, "Object Geometry -> Select Update", RELATION_FLAG_NO_FLUSH);
|
||||
}
|
||||
|
||||
void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata)
|
||||
|
||||
Reference in New Issue
Block a user