diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-04-15 21:49:53 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-05-05 18:14:30 +0300 |
commit | e6fab27d6a3476a08cadb7ff4ecbd467a1c0db74 (patch) | |
tree | f1289f56af410010b69fb8b3e8fd217df5cff9ae /source/blender/editors/sculpt_paint/sculpt_undo.c | |
parent | 9d8a5834829c3a30048dffde2346878f71cbd5fb (diff) |
Fix T75743: Implement restore for brushes that modify their own data
This implements the restore function for Draw Face Sets and Layer, which
don't affect coordinates or masks directly. This is needed for the
anchored and dot brush strokes.
Layer frees the current displacement and a new one is created on each
stroke sample. Draw Face Sets copies the data back from the first undo
node to the mesh datalayer.
Also fixes T75727
Reviewed By: jbakker
Maniphest Tasks: T75727
Differential Revision: https://developer.blender.org/D7442
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_undo.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 414a6101071..ef25c23d7d3 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -892,6 +892,17 @@ SculptUndoNode *SCULPT_undo_get_node(PBVHNode *node) return BLI_findptr(&usculpt->nodes, node, offsetof(SculptUndoNode, node)); } +SculptUndoNode *SCULPT_undo_get_first_node() +{ + UndoSculpt *usculpt = sculpt_undo_get_nodes(); + + if (usculpt == NULL) { + return NULL; + } + + return usculpt->nodes.first; +} + static void sculpt_undo_alloc_and_store_hidden(PBVH *pbvh, SculptUndoNode *unode) { PBVHNode *node = unode->node; |