Commit: f967fbea6511346c2a0b5a174a81b6d7970ebf0c Author: Joseph Eagar Date: Thu Jun 2 03:22:27 2022 -0700 Branches: temp-pbvh-split https://developer.blender.org/rBf967fbea6511346c2a0b5a174a81b6d7970ebf0c
Merge branch 'master' into temp-pbvh-split =================================================================== =================================================================== diff --cc source/blender/blenkernel/BKE_pbvh_pixels.hh index 194cd7e3b07,e73950e6299..2d7f6c64b96 --- a/source/blender/blenkernel/BKE_pbvh_pixels.hh +++ b/source/blender/blenkernel/BKE_pbvh_pixels.hh @@@ -138,7 -147,8 +147,8 @@@ struct NodeData } flags; Vector<UDIMTilePixels> tiles; + Vector<UDIMTileUndo> undo_regions; - Triangles triangles; + Triangles *triangles = nullptr; NodeData() { diff --cc source/blender/blenkernel/intern/pbvh_pixels.cc index 457a7bc9af1,49397797c0d..9a0cea77369 --- a/source/blender/blenkernel/intern/pbvh_pixels.cc +++ b/source/blender/blenkernel/intern/pbvh_pixels.cc @@@ -642,12 -280,13 +642,13 @@@ static bool update_pixels(PBVH *pbvh, M Vector<PBVHNode *> nodes_to_update; if (!find_nodes_to_update(pbvh, nodes_to_update)) { - return; + return false; } - MLoopUV *ldata_uv = static_cast<MLoopUV *>(CustomData_get_layer(&mesh->ldata, CD_MLOOPUV)); + const MLoopUV *ldata_uv = static_cast<const MLoopUV *>( + CustomData_get_layer(&mesh->ldata, CD_MLOOPUV)); if (ldata_uv == nullptr) { - return; + return false; } for (PBVHNode *node : nodes_to_update) { diff --cc source/blender/editors/include/UI_interface.h index 0b507c6a4ab,a9a9c98cab8..9a7d42ec413 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@@ -1658,7 -1632,7 +1632,7 @@@ eAutoPropButsReturn uiDefAutoButsRNA(ui * callback returns true, the given buttons are considered to be matching and relevant state is * preserved (copied from the old to the new button). If it returns false, it's considered * non-matching and no further checks are done. -- * ++ *\ * If this is set, it is always executed instead of the default comparisons. However it is only * executed for buttons that have the same type and the same callback. So callbacks can assume the * button types match. diff --cc source/blender/editors/sculpt_paint/sculpt.c index 3336b18e7e3,2c6c4c82676..7a7534f2ecf --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@@ -3283,7 -3261,11 +3296,12 @@@ static void do_brush_action(Sculpt *sd } nodes = sculpt_pbvh_gather_generic(ob, sd, brush, use_original, radius_scale, &totnode); } + + const bool use_pixels = sculpt_needs_pbvh_pixels(paint_mode_settings, brush, ob); + if (use_pixels) { + sculpt_pbvh_update_pixels(paint_mode_settings, ss, ob); + } + /* Draw Face Sets in draw mode makes a single undo push, in alt-smooth mode deforms the * vertices and uses regular coords undo. */ /* It also assigns the paint_face_set here as it needs to be done regardless of the stroke type diff --cc source/blender/editors/sculpt_paint/sculpt_intern.h index 8c6e7075032,5fa115ed629..d7bddc6b8c6 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@@ -1649,16 -1649,14 +1649,16 @@@ void SCULPT_do_paint_brush(struct Paint Sculpt *sd, Object *ob, PBVHNode **nodes, - int totnode) ATTR_NONNULL(); + int totnode, + PBVHNode **texnodes, + int texnodes_num) ATTR_NONNULL(); /** - * @brief Get the image canvas for painting on the given object. + * \brief Get the image canvas for painting on the given object. * - * @return #true if an image is found. The #r_image and #r_image_user fields are filled with the + * \return #true if an image is found. The #r_image and #r_image_user fields are filled with the * image and image user. Returns false when the image isn't found. In the later case the r_image - * and r_image_user are set to nullptr/NULL. + * and r_image_user are set to NULL. */ bool SCULPT_paint_image_canvas_get(struct PaintModeSettings *paint_mode_settings, struct Object *ob, diff --cc source/blender/editors/sculpt_paint/sculpt_paint_image.cc index ba09a8f89ac,975a8f21aaf..7b807e218ec --- a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc +++ b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc @@@ -454,11 -501,12 +535,12 @@@ void SCULPT_do_paint_brush_image(PaintM } TaskParallelSettings settings; - BKE_pbvh_parallel_range_settings(&settings, true, totnode); - BLI_task_parallel_range(0, totnode, &data, do_push_undo_tile, &settings); - BLI_task_parallel_range(0, totnode, &data, do_paint_pixels, &settings); + BKE_pbvh_parallel_range_settings(&settings, true, texnodes_num); ++ BLI_task_parallel_range(0, texnodes_num, &data, do_push_undo_tile, &settings); + BLI_task_parallel_range(0, texnodes_num, &data, do_paint_pixels, &settings); 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); + BKE_pbvh_parallel_range_settings(&settings_flush, false, texnodes_num); + BLI_task_parallel_range(0, texnodes_num, &data, do_mark_dirty_regions, &settings_flush); } } _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs