[Bf-blender-cvs] [d6821995556] soc-2021-knife-tools: Cleanup: Added comment to clarify limitation of undo implementation

Cian Jinks noreply at git.blender.org
Mon Jul 19 13:54:57 CEST 2021


Commit: d6821995556afc2864892c816eca7b125b707b46
Author: Cian Jinks
Date:   Mon Jul 19 12:54:20 2021 +0100
Branches: soc-2021-knife-tools
https://developer.blender.org/rBd6821995556afc2864892c816eca7b125b707b46

Cleanup: Added comment to clarify limitation of undo implementation

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

M	source/blender/editors/mesh/editmesh_knife.c

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

diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 2b9c2feb89d..6cd91563a0f 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -3347,6 +3347,12 @@ static bool knife_snap_update_from_mval(bContext *C, KnifeTool_OpData *kcd, cons
   return kcd->curr.vert || kcd->curr.edge || (kcd->curr.bmface && !kcd->curr.is_space);
 }
 
+/**
+ * TODO: Undo currently assumes that the most recent cut segment added is
+ * the last valid KnifeEdge in the kcd->kedges mempool. This could break in
+ * the future so it may be better to store the KnifeEdges for each KnifeUndoFrame
+ * on a stack. This stack could then be used instead of iterating over the mempool.
+ */
 static void knifetool_undo(KnifeTool_OpData *kcd)
 {
   Ref *ref;



More information about the Bf-blender-cvs mailing list