Fix T57488: crash in Shrinkwrap constraint due to unsafe multi-threading.
- Constraints must not use mesh_get_eval_final as it isn't thread-safe. - Depsgraph should keep lastDataMask when re-running COW.
This commit is contained in:
parent
bd7cb42f3d
commit
62e2bbd068
|
@ -3411,7 +3411,7 @@ static void shrinkwrap_flush_tars(bConstraint *con, ListBase *list, bool no_copy
|
|||
}
|
||||
|
||||
|
||||
static void shrinkwrap_get_tarmat(struct Depsgraph *depsgraph, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float UNUSED(ctime))
|
||||
static void shrinkwrap_get_tarmat(struct Depsgraph *UNUSED(depsgraph), bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float UNUSED(ctime))
|
||||
{
|
||||
bShrinkwrapConstraint *scon = (bShrinkwrapConstraint *) con->data;
|
||||
|
||||
|
@ -3423,7 +3423,7 @@ static void shrinkwrap_get_tarmat(struct Depsgraph *depsgraph, bConstraint *con,
|
|||
float track_no[3] = {0.0f, 0.0f, 0.0f};
|
||||
|
||||
SpaceTransform transform;
|
||||
Mesh *target_eval = mesh_get_eval_final(depsgraph, DEG_get_input_scene(depsgraph), ct->tar, CD_MASK_BAREMESH);
|
||||
Mesh *target_eval = ct->tar->runtime.mesh_eval;
|
||||
|
||||
copy_m4_m4(ct->matrix, cob->matrix);
|
||||
|
||||
|
@ -4156,8 +4156,7 @@ static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase
|
|||
|
||||
if (data->depth_ob) {
|
||||
Object *depth_ob = data->depth_ob;
|
||||
Mesh *target_eval = mesh_get_eval_final(
|
||||
depsgraph, DEG_get_input_scene(depsgraph), depth_ob, CD_MASK_BAREMESH);
|
||||
Mesh *target_eval = depth_ob->runtime.mesh_eval;
|
||||
if (target_eval) {
|
||||
BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh;
|
||||
BVHTreeRayHit hit;
|
||||
|
|
|
@ -725,6 +725,7 @@ static void deg_update_copy_on_write_animation(const Depsgraph *depsgraph,
|
|||
typedef struct ObjectRuntimeBackup {
|
||||
Object_Runtime runtime;
|
||||
short base_flag;
|
||||
CustomDataMask lastDataMask;
|
||||
} ObjectRuntimeBackup;
|
||||
|
||||
/* Make a backup of object's evaluation runtime data, additionally
|
||||
|
@ -748,6 +749,7 @@ static void deg_backup_object_runtime(
|
|||
}
|
||||
/* Make a backup of base flags. */
|
||||
object_runtime_backup->base_flag = object->base_flag;
|
||||
object_runtime_backup->lastDataMask = object->lastDataMask;
|
||||
}
|
||||
|
||||
static void deg_restore_object_runtime(
|
||||
|
@ -782,6 +784,7 @@ static void deg_restore_object_runtime(
|
|||
}
|
||||
}
|
||||
object->base_flag = object_runtime_backup->base_flag;
|
||||
object->lastDataMask = object_runtime_backup->lastDataMask;
|
||||
}
|
||||
|
||||
ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph,
|
||||
|
|
Loading…
Reference in New Issue