Fix T90798: calc_loop_triangles is not updated after joining objects

This commit is contained in:
Campbell Barton 2021-09-01 21:44:32 +10:00
parent f8dd0d0dba
commit baee000001
Notes: blender-bot 2023-02-14 05:44:22 +01:00
Referenced by issue #90798, calc_loop_triangles is not updated after joining objects
1 changed files with 5 additions and 0 deletions

View File

@ -424,6 +424,11 @@ int ED_mesh_join_objects_exec(bContext *C, wmOperator *op)
/* remove tessface to ensure we don't hold references to invalid faces */
BKE_mesh_tessface_clear(me);
/* Clear any run-time data.
* Even though this mesh wont typically have run-time data, the Python API can for e.g.
* create loop-triangle cache here, which is confusing when left in the mesh, see: T90798. */
BKE_mesh_runtime_clear_geometry(me);
/* new material indices and material array */
if (totmat) {
matar = MEM_callocN(sizeof(*matar) * totmat, "join_mesh matar");