diff options
Diffstat (limited to 'source/blender/blenkernel/intern/DerivedMesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index b2586d513d6..f0097c46a71 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2157,6 +2157,13 @@ DerivedMesh *mesh_get_derived_final( Mesh *mesh_get_eval_final( struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask) { + /* This function isn't thread-safe and can't be used during evaluation. */ + BLI_assert(DEG_debug_is_evaluating(depsgraph) == false); + + /* Evaluated meshes aren't supposed to be created on original instances. If you do, + * they aren't cleaned up properly on mode switch, causing crashes, e.g T58150. */ + BLI_assert(ob->id.tag & LIB_TAG_COPIED_ON_WRITE); + /* if there's no evaluated mesh or the last data mask used doesn't include * the data we need, rebuild the derived mesh */ @@ -2197,6 +2204,13 @@ DerivedMesh *mesh_get_derived_deform(struct Depsgraph *depsgraph, Scene *scene, #endif Mesh *mesh_get_eval_deform(struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask) { + /* This function isn't thread-safe and can't be used during evaluation. */ + BLI_assert(DEG_debug_is_evaluating(depsgraph) == false); + + /* Evaluated meshes aren't supposed to be created on original instances. If you do, + * they aren't cleaned up properly on mode switch, causing crashes, e.g T58150. */ + BLI_assert(ob->id.tag & LIB_TAG_COPIED_ON_WRITE); + /* if there's no derived mesh or the last data mask used doesn't include * the data we need, rebuild the derived mesh */ |