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:
authorJeroen Bakker <jbakker>2022-05-16 16:42:43 +0300
committerJeroen Bakker <jeroen@blender.org>2022-05-16 16:42:54 +0300
commit00eb7594b11a6dfd1f1957a7f037b6ea9a3b1a13 (patch)
tree1829685a2f9afaa2cb2bc676e4c1f859e17d35be /source/blender/blenkernel/intern/pbvh_pixels.cc
parent0d80c4a2a6ffcb6bfe7338588d85d5b56ee05afb (diff)
3D Texturing: Undo.
Blender can only support a single undo system per undo step. As sculpting/vertex colors are mutual exclusive operations out approach is just to switch the undo system when painting on an image. PBVHNodes contain a list of areas that needs to be pushed to the undo system. Currently the undo code is in sculpt_paint_image. We should eventually support undo for color filtering and other nodes. we might need to place it to its own compile unit so more brushes can invoke the same code. {F13048942} Reviewed By: brecht Maniphest Tasks: T97479 Differential Revision: https://developer.blender.org/D14821
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh_pixels.cc')
-rw-r--r--source/blender/blenkernel/intern/pbvh_pixels.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_pixels.cc b/source/blender/blenkernel/intern/pbvh_pixels.cc
index 40742ad36d5..49397797c0d 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels.cc
@@ -308,6 +308,12 @@ static void update_pixels(PBVH *pbvh, Mesh *mesh, Image *image, ImageUser *image
apply_watertight_check(pbvh, image, image_user);
}
+ /* Rebuild the undo regions. */
+ for (PBVHNode *node : nodes_to_update) {
+ NodeData *node_data = static_cast<NodeData *>(node->pixels.node_data);
+ node_data->rebuild_undo_regions();
+ }
+
/* Clear the UpdatePixels flag. */
for (PBVHNode *node : nodes_to_update) {
node->flag = static_cast<PBVHNodeFlags>(node->flag & ~PBVH_RebuildPixels);