Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-01-07 14:27:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-01-07 14:32:40 +0300
commit581a5ee0cc7ea685cdb83f5260c3b1fbf3f977ab (patch)
tree71289f412a64c47743641239207aa608dfb6a1c4 /source/blender/editors/mesh
parentbcfa1c30516c0910169e0ebf9403aff14763defb (diff)
Edit Mesh: add comments to EDBM_op_finish
Was marked 'FIXME' however this only ever happens in exceptional cases. Also comment why tagging is needed in this case.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_utils.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index 96fa31e17e9..f7092a8c6ab 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -161,14 +161,14 @@ bool EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const bool
em->emcopyusers = 0;
em->emcopy = NULL;
- /* when copying, tessellation isn't to for faster copying,
- * but means we need to re-tessellate here */
- if (em->looptris == NULL) {
- BKE_editmesh_looptri_calc(em);
- }
-
+ /**
+ * Note, we could pass in the mesh, however this is an exceptional case, allow a slow lookup.
+ *
+ * This is needed because the COW mesh makes a full copy of the #BMEditMesh
+ * instead of sharing the pointer, tagging since this has been freed above,
+ * the #BMEditMesh.emcopy needs to be flushed to the COW edit-mesh, see T55457.
+ */
{
- /* FIXME: pass in mesh. */
Main *bmain = G_MAIN;
for (Mesh *mesh = bmain->meshes.first; mesh; mesh = mesh->id.next) {
if (mesh->edit_mesh == em) {
@@ -178,6 +178,12 @@ bool EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const bool
}
}
+ /* when copying, tessellation isn't to for faster copying,
+ * but means we need to re-tessellate here */
+ if (em->looptris == NULL) {
+ BKE_editmesh_looptri_calc(em);
+ }
+
return false;
}
else {