diff options
author | Jeroen Bakker <jeroen@blender.org> | 2022-04-12 14:35:16 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-04-12 14:35:16 +0300 |
commit | 1ec0129cfa2ae4a26ade00bb89c694423e37570e (patch) | |
tree | ac0a1b2a65296d60f1727714b5ea0747b7432453 | |
parent | cf8b29950bf43fcccfcd8b2172cc8a166faab0a3 (diff) |
Fix quad data stored multiple times.
-rw-r--r-- | source/blender/blenkernel/BKE_pbvh.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_pixels.cc | 20 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 7 |
3 files changed, 8 insertions, 20 deletions
diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h index e6c591bb533..ea4a4efca87 100644 --- a/source/blender/blenkernel/BKE_pbvh.h +++ b/source/blender/blenkernel/BKE_pbvh.h @@ -143,7 +143,6 @@ void BKE_pbvh_build_bmesh(PBVH *pbvh, int cd_face_node_offset); void BKE_pbvh_build_pixels(PBVH *pbvh, - const struct MPoly *mpoly, const struct MLoop *mloop, struct CustomData *ldata, struct Image *image, diff --git a/source/blender/blenkernel/intern/pbvh_pixels.cc b/source/blender/blenkernel/intern/pbvh_pixels.cc index 1eae3fa5537..d9bd921865f 100644 --- a/source/blender/blenkernel/intern/pbvh_pixels.cc +++ b/source/blender/blenkernel/intern/pbvh_pixels.cc @@ -102,18 +102,14 @@ static void extract_barycentric_pixels(UDIMTilePixels &tile_data, } } -static void init_triangles( - PBVH *pbvh, PBVHNode *node, NodeData *node_data, const MPoly *mpoly, const MLoop *mloop) +static void init_triangles(PBVH *pbvh, PBVHNode *node, NodeData *node_data, const MLoop *mloop) { for (int i = 0; i < node->totprim; i++) { const MLoopTri *lt = &pbvh->looptri[node->prim_indices[i]]; - const MPoly *p = &mpoly[lt->poly]; - for (int l = 0; l < p->totloop - 2; l++) { - node_data->triangles.append( - int3(mloop[lt->tri[0]].v, mloop[lt->tri[1]].v, mloop[lt->tri[2]].v), - int3(lt->tri[0], lt->tri[1], lt->tri[2]), - lt->poly); - } + node_data->triangles.append( + int3(mloop[lt->tri[0]].v, mloop[lt->tri[1]].v, mloop[lt->tri[2]].v), + int3(lt->tri[0], lt->tri[1], lt->tri[2]), + lt->poly); } } @@ -295,7 +291,6 @@ static void apply_watertight_check(PBVH *pbvh, Image *image, ImageUser *image_us } static void update_pixels(PBVH *pbvh, - const struct MPoly *mpoly, const struct MLoop *mloop, struct CustomData *ldata, struct Image *image, @@ -314,7 +309,7 @@ static void update_pixels(PBVH *pbvh, for (PBVHNode *node : nodes_to_update) { NodeData *node_data = static_cast<NodeData *>(node->pixels.node_data); - init_triangles(pbvh, node, node_data, mpoly, mloop); + init_triangles(pbvh, node, node_data, mloop); } EncodePixelsUserData user_data; @@ -401,13 +396,12 @@ extern "C" { using namespace blender::bke::pbvh::pixels; void BKE_pbvh_build_pixels(PBVH *pbvh, - const struct MPoly *mpoly, const struct MLoop *mloop, struct CustomData *ldata, struct Image *image, struct ImageUser *image_user) { - update_pixels(pbvh, mpoly, mloop, ldata, image, image_user); + update_pixels(pbvh, mloop, ldata, image, image_user); } void pbvh_pixels_free(PBVHNode *node) diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 94dc5027710..fc1df1635bd 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -2781,12 +2781,7 @@ static void sculpt_pbvh_update_pixels(PaintModeSettings *paint_mode_settings, return; } - BKE_pbvh_build_pixels(ss->pbvh, - mesh->mpoly, - mesh->mloop, - &mesh->ldata, - image, - image_user); + BKE_pbvh_build_pixels(ss->pbvh, mesh->mloop, &mesh->ldata, image, image_user); } /** \} */ |