[Bf-blender-cvs] [a027f4ea4bc] soc-2021-adaptive-cloth: adaptive_cloth: fix: Mesh: split edge: reference is broken

ishbosamiya noreply at git.blender.org
Mon Jul 19 17:35:43 CEST 2021


Commit: a027f4ea4bcc7597e531da49379ff2c5283ca2fd
Author: ishbosamiya
Date:   Thu Jul 15 09:38:45 2021 +0530
Branches: soc-2021-adaptive-cloth
https://developer.blender.org/rBa027f4ea4bcc7597e531da49379ff2c5283ca2fd

adaptive_cloth: fix: Mesh: split edge: reference is broken

The reference to the edge is broken because adding or deleting an edge
can realloc memory which means all the references are invalid. So just
need to recreate the references after a addition or deletion of an
element.

Would really appreciate a borrow checker to handle such
instances.

===================================================================

M	source/blender/blenkernel/BKE_cloth_remesh.hh

===================================================================

diff --git a/source/blender/blenkernel/BKE_cloth_remesh.hh b/source/blender/blenkernel/BKE_cloth_remesh.hh
index 782504dabf6..8b74b8774ad 100644
--- a/source/blender/blenkernel/BKE_cloth_remesh.hh
+++ b/source/blender/blenkernel/BKE_cloth_remesh.hh
@@ -1414,7 +1414,8 @@ template<typename END, typename EVD, typename EED, typename EFD> class Mesh {
         /* Ensure the faces are triangulated before calling this function */
         BLI_assert(face.verts.size() == 3);
 
-        auto &other_vert = this->get_checked_other_vert(edge_b, face);
+        auto &edge_c = this->get_checked_edge(edge_index);
+        auto &other_vert = this->get_checked_other_vert(edge_c, face);
 
         /* TODO(ish): Ordering of the verts and nodes needs to be found correctly */
         /* Handle new face and new edge creation */



More information about the Bf-blender-cvs mailing list