[Bf-blender-cvs] [c9b40d8af05] temp-T101739-fix-seam-bleeding-non-manifold: First pixels being copied.

Jeroen Bakker noreply at git.blender.org
Tue Jan 10 14:19:58 CET 2023


Commit: c9b40d8af05985214ffe0a1c5ba2df642dd9d7b2
Author: Jeroen Bakker
Date:   Tue Jan 10 12:50:53 2023 +0100
Branches: temp-T101739-fix-seam-bleeding-non-manifold
https://developer.blender.org/rBc9b40d8af05985214ffe0a1c5ba2df642dd9d7b2

First pixels being copied.

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

M	source/blender/blenkernel/intern/pbvh_pixels_copy.cc
M	source/blender/editors/sculpt_paint/sculpt_paint_image.cc

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

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_copy.cc b/source/blender/blenkernel/intern/pbvh_pixels_copy.cc
index c8eca17606a..7c8243a1ebc 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_copy.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_copy.cc
@@ -385,7 +385,7 @@ struct Rows {
       return last_command;
     }
 
-    void pack_into(Vector<PixelCopyGroup> groups) const
+    void pack_into(Vector<PixelCopyGroup> &groups) const
     {
       for (const Elem &elem : pixels) {
         if (elem.type == PixelType::CopyFromClosestEdge) {
@@ -490,6 +490,7 @@ void BKE_pbvh_pixels_copy_pixels(PBVH &pbvh,
   std::optional<std::reference_wrapper<PixelCopyTile>> pixel_tile =
       pbvh_data.tiles_copy_pixels.find_tile(tile_number);
   if (!pixel_tile.has_value()) {
+    printf("%s: found no pixels to copy for tile %d\n", __func__, tile_number);
     return;
   }
 
@@ -497,6 +498,7 @@ void BKE_pbvh_pixels_copy_pixels(PBVH &pbvh,
   tile_user.tile = tile_number;
   ImBuf *tile_buffer = BKE_image_acquire_ibuf(&image, &tile_user, nullptr);
   if (tile_buffer == nullptr) {
+    printf("%s: found no tile buffer for tile %d\n", __func__, tile_number);
     return;
   }
   pixel_tile->get().copy_pixels(*tile_buffer);
diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
index 6244cf8e33d..cae5c0c283e 100644
--- a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
@@ -539,5 +539,9 @@ void SCULPT_do_paint_brush_image(
   TaskParallelSettings settings_flush;
   BKE_pbvh_parallel_range_settings(&settings_flush, false, totnode);
   BLI_task_parallel_range(0, totnode, &data, do_mark_dirty_regions, &settings_flush);
+
+  /* TODO: should be done at the end of the stroke.*/
+  BKE_pbvh_pixels_copy_pixels(
+      *ob->sculpt->pbvh, *data.image_data.image, *data.image_data.image_user, 1001);
 }
 }



More information about the Bf-blender-cvs mailing list