From ac344aae1f13ebcb4f5ea67e7d5df739a85e718a Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Fri, 26 Jul 2024 21:42:09 +0200 Subject: [PATCH] Subdiv: Add neighbor slicing helper methods Pull Request: https://projects.blender.org/blender/blender/pulls/125513 --- source/blender/blenkernel/BKE_subdiv_ccg.hh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/blender/blenkernel/BKE_subdiv_ccg.hh b/source/blender/blenkernel/BKE_subdiv_ccg.hh index 3cb9a8fa4e6..72cf129da80 100644 --- a/source/blender/blenkernel/BKE_subdiv_ccg.hh +++ b/source/blender/blenkernel/BKE_subdiv_ccg.hh @@ -15,6 +15,7 @@ #include "BLI_bit_span_ops.hh" #include "BLI_index_mask_fwd.hh" #include "BLI_offset_indices.hh" +#include "BLI_span.hh" #include "BLI_sys_types.h" #include "BLI_utility_mixins.hh" #include "BLI_vector.hh" @@ -248,6 +249,16 @@ void BKE_subdiv_ccg_topology_counters(const SubdivCCG &subdiv_ccg, struct SubdivCCGNeighbors { blender::Vector coords; int num_duplicates; + + blender::Span unique() const + { + return this->coords.as_span().drop_back(num_duplicates); + } + + blender::Span duplicate() const + { + return this->coords.as_span().take_back(num_duplicates); + } }; void BKE_subdiv_ccg_print_coord(const char *message, const SubdivCCGCoord &coord);