Blender Git Commit Log
Git Commits -> Revision b8a8e4f
May 12, 2021, 04:14 (GMT) |
Today I ran outside screaming and an hour later came back in and made BMLog reference counted. This fixes various undo bugs caused by dyntopo needing to execute an undo push but not being able too (e.g. during file load, and I think it also happens sometimes with global undo). A much better way of fixing this would be to add unique IDs to mesh verts and faces, perhaps as a customdata layer. The root problem is that BMLog assigns unique IDs to mesh elements, which it does via a series of GHash's. I imagine this is a fairly serious violation of the undo system's design rules, since it means BMLogs are tied to specific instances of the bmesh in SculptSession->bm. There were some hacks to try and get around this, but they were buggy and needed to push the unstack stack to work, which wasn't possible in all cases (e.g. if G_MAIN->wm.first->undo_stack is NULL, as it is during file loading and apparently global undo). Anyway, long story short each chain of SculptUndoNodes needs some way to reconstruct their ID GHash's when exiting/entering the chain. The only way I could think to do this was to make BMLog reference counted, with BMLogEntry the users. Like I said, having a proper system to assign unique IDs to mesh elements would be *much* better. |
Commit Details:
Full Hash: b8a8e4f9b1872fca7da4adea4de8857475296453
Parent Commit: dbe767f
Lines Changed: +535, -134
11 Modified Paths:
/source/blender/blenkernel/BKE_pbvh.h (+4, -0) (Diff)
/source/blender/blenkernel/intern/paint.c (+11, -11) (Diff)
/source/blender/blenkernel/intern/pbvh.c (+11, -0) (Diff)
/source/blender/bmesh/intern/bmesh_log.c (+59, -3) (Diff)
/source/blender/bmesh/intern/bmesh_log.h (+4, -2) (Diff)
/source/blender/editors/sculpt_paint/sculpt.c (+17, -1) (Diff)
/source/blender/editors/sculpt_paint/sculpt_dyntopo.c (+78, -6) (Diff)
/source/blender/editors/sculpt_paint/sculpt_expand.c (+170, -38) (Diff)
/source/blender/editors/sculpt_paint/sculpt_face_set.c (+124, -54) (Diff)
/source/blender/editors/sculpt_paint/sculpt_intern.h (+20, -6) (Diff)
/source/blender/editors/sculpt_paint/sculpt_undo.c (+37, -13) (Diff)
/source/blender/blenkernel/intern/paint.c (+11, -11) (Diff)
/source/blender/blenkernel/intern/pbvh.c (+11, -0) (Diff)
/source/blender/bmesh/intern/bmesh_log.c (+59, -3) (Diff)
/source/blender/bmesh/intern/bmesh_log.h (+4, -2) (Diff)
/source/blender/editors/sculpt_paint/sculpt.c (+17, -1) (Diff)
/source/blender/editors/sculpt_paint/sculpt_dyntopo.c (+78, -6) (Diff)
/source/blender/editors/sculpt_paint/sculpt_expand.c (+170, -38) (Diff)
/source/blender/editors/sculpt_paint/sculpt_face_set.c (+124, -54) (Diff)
/source/blender/editors/sculpt_paint/sculpt_intern.h (+20, -6) (Diff)
/source/blender/editors/sculpt_paint/sculpt_undo.c (+37, -13) (Diff)