30 if (!sync_selection) {
42 for (const int face : range) {
43 r_offset_data[face] = BM_face_at_index(&const_cast<BMesh &>(bm), face)->len;
76 faces, selection, selected_face_offset_data);
98 const bool sync_selection)
107 faces.index_range(),
GrainSize(4096), memory, [&](
const int face) {
120 selection =
faces.index_range();
133 faces, selection, selected_face_offset_data);
146 corner_tris[tris[
i]][0], corner_tris[tris[
i]][1], corner_tris[tris[
i]][2]);
165 const int tris_num = selection.
size() * 2;
172 const uint corner_start = subdiv_quad_index * 4;
173 data[
mask * 2 + 0] =
uint3(corner_start, corner_start + 1, corner_start + 2);
174 data[
mask * 2 + 1] =
uint3(corner_start, corner_start + 2, corner_start + 3);
183 const bool sync_selection)
194 [&](
const int subdiv_quad_index) {
195 const uint corner_start = subdiv_quad_index * 4;
196 const int coarse_face = subdiv_loop_face_index[corner_start];
206 const bool sync_selection)
216 [&](
const int subdiv_quad_index) {
217 const uint corner_start = subdiv_quad_index * 4;
218 const int coarse_face = subdiv_loop_face_index[corner_start];
249 const bool sync_selection)
275 const bool sync_selection)
289 for (
const int face_index :
faces.index_range()) {
298 for (
const int corner : face) {
299 const int edge = corner_edges[corner];
313 if (!sync_selection) {
323 for (
const int corner : face) {
324 const int edge = corner_edges[corner];
338 bool sync_selection =
false;
341 sync_selection =
true;
347 sync_selection =
false;
359 const bool sync_selection)
373 const int coarse_face = subdiv_loop_face_index[subdiv_quad * 4];
378 const IndexRange subdiv_face(subdiv_quad * 4, 4);
379 for (
const int subdiv_corner : subdiv_face) {
380 const int coarse_edge = subdiv_loop_edge_index[subdiv_corner];
381 if (coarse_edge == -1) {
394 const bool sync_selection)
408 const int coarse_face = subdiv_loop_face_index[subdiv_quad * 4];
421 if (!sync_selection) {
427 const IndexRange subdiv_face(subdiv_quad * 4, 4);
428 for (
const int subdiv_corner : subdiv_face) {
429 const int coarse_edge = subdiv_loop_edge_index[subdiv_corner];
430 if (coarse_edge == -1) {
445 bool sync_selection =
false;
448 sync_selection =
true;
454 sync_selection =
false;
471 const bool sync_selection,
490 const bool sync_selection,
498 for (
const int face_index :
faces.index_range()) {
506 for (
const int corner :
faces[face_index]) {
507 const int vert = corner_verts[corner];
533 const bool sync_selection,
542 const int coarse_face = subdiv_loop_face_index[subdiv_quad * 4];
547 for (
const int subdiv_corner :
IndexRange(subdiv_quad * 4, 4)) {
548 const int coarse_vert = subdiv_loop_vert_index[subdiv_corner];
549 if (coarse_vert == -1) {
559 const bool sync_selection,
567 const int coarse_face = subdiv_loop_face_index[subdiv_quad * 4];
575 for (
const int subdiv_corner :
IndexRange(subdiv_quad * 4, 4)) {
576 const int coarse_vert = subdiv_loop_vert_index[subdiv_corner];
577 if (coarse_vert == -1) {
609 const bool sync_selection)
625 const bool sync_selection)
645 return std::any_of(face_verts.
begin(), face_verts.
end(), [&](
const int vert) {
646 return facedot_tags[vert];
MINLINE int poly_to_tri_count(int poly_count, int corner_count)
blender::MutableSpan< uint32_t > GPU_indexbuf_get_data(GPUIndexBufBuilder *)
void GPU_indexbuf_init(GPUIndexBufBuilder *, GPUPrimType, uint prim_len, uint vertex_len)
blender::gpu::IndexBuf * GPU_indexbuf_build_ex(GPUIndexBufBuilder *builder, uint index_min, uint index_max, bool uses_restart_indices)
void GPU_indexbuf_add_point_vert(GPUIndexBufBuilder *, uint v)
blender::gpu::IndexBuf * GPU_indexbuf_build(GPUIndexBufBuilder *)
#define BM_FACE_FIRST_LOOP(p)
#define BM_elem_index_get(ele)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_test_bool(ele, hflag)
#define BM_ITER_MESH(ele, iter, bm, itype)
BMesh const char void * data
BLI_INLINE BMFace * BM_face_at_index(BMesh *bm, const int index)
static IndexMask from_predicate(const IndexMask &universe, GrainSize grain_size, IndexMaskMemory &memory, Fn &&predicate)
static IndexMask from_bools(Span< bool > bools, IndexMaskMemory &memory)
static IndexMask from_bools_inverse(const VArray< bool > &bools, IndexMaskMemory &memory)
constexpr bool is_empty() const
void reinitialize(const int64_t new_size)
constexpr IndexRange index_range() const
constexpr Span slice(int64_t start, int64_t size) const
constexpr const T * end() const
constexpr const T * begin() const
constexpr bool is_empty() const
void to_indices(MutableSpan< T > r_indices) const
void foreach_index(Fn &&fn) const
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
IndexRange face_triangles_range(OffsetIndices< int > faces, int face_i)
BLI_INLINE BMFace * bm_original_face_get(const MeshRenderData &mr, int idx)
gpu::IndexBufPtr extract_edituv_lines_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, UvExtractionMode mode)
static OffsetIndices< int > gather_or_reference_offsets(const OffsetIndices< int > faces, const IndexMask &selection, Array< int > &r_offset_data)
gpu::IndexBufPtr extract_edituv_face_dots(const MeshRenderData &mr)
static gpu::IndexBufPtr extract_edituv_face_dots_bm(const MeshRenderData &mr, const bool sync_selection)
static gpu::IndexBufPtr extract_edituv_lines_subdiv_mesh(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, const bool sync_selection)
static OffsetIndices< int > build_bmesh_face_offsets(const BMesh &bm, Array< int > &r_offset_data)
gpu::IndexBufPtr extract_edituv_tris(const MeshRenderData &mr, bool edit_uvs)
static gpu::IndexBufPtr build_tris_from_subdiv_quad_selection(const DRWSubdivCache &subdiv_cache, const IndexMask &selection)
gpu::IndexBufPtr extract_edituv_points(const MeshRenderData &mr)
gpu::IndexBufPtr extract_edituv_tris_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache)
static gpu::IndexBufPtr extract_edituv_tris_subdiv_mesh(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, const bool sync_selection)
uint2 edge_from_corners(const IndexRange face, const int corner)
static gpu::IndexBufPtr extract_edituv_tris_subdiv_bm(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, const bool sync_selection)
static void extract_edituv_points_subdiv_bm(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, const bool sync_selection, GPUIndexBufBuilder &builder)
gpu::IndexBufPtr extract_edituv_points_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache)
static gpu::IndexBufPtr extract_edituv_tris_mesh(const MeshRenderData &mr, const bool sync_selection)
static void extract_edituv_points_subdiv_mesh(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, const bool sync_selection, GPUIndexBufBuilder &builder)
static gpu::IndexBufPtr extract_edituv_face_dots_mesh(const MeshRenderData &mr, const bool sync_selection)
static void extract_edituv_points_mesh(const MeshRenderData &mr, const bool sync_selection, GPUIndexBufBuilder &builder)
gpu::IndexBufPtr extract_edituv_lines(const MeshRenderData &mr, UvExtractionMode mode)
static gpu::IndexBufPtr extract_edituv_lines_bm(const MeshRenderData &mr, const bool sync_selection)
static void extract_edituv_points_bm(const MeshRenderData &mr, const bool sync_selection, GPUIndexBufBuilder &builder)
static gpu::IndexBufPtr extract_edituv_tris_bm(const MeshRenderData &mr, const bool sync_selection)
static gpu::IndexBufPtr extract_edituv_lines_subdiv_bm(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, const bool sync_selection)
bool skip_bm_face(const BMFace &face, const bool sync_selection)
static gpu::IndexBufPtr extract_edituv_lines_mesh(const MeshRenderData &mr, const bool sync_selection)
std::unique_ptr< IndexBuf, IndexBufDeleter > IndexBufPtr
OffsetIndices< int > accumulate_counts_to_offsets(MutableSpan< int > counts_to_offsets, int start_offset=0)
OffsetIndices< int > gather_selected_offsets(OffsetIndices< int > src_offsets, const IndexMask &selection, int start_offset, MutableSpan< int > dst_offsets)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
VecBase< uint32_t, 2 > uint2
VecBase< uint32_t, 3 > uint3
blender::Array< std::array< BMLoop *, 3 > > looptris
MeshRuntimeHandle * runtime
gpu::VertBuf * verts_orig_index
gpu::VertBuf * edges_orig_index
int * subdiv_loop_face_index
const int * orig_index_vert
const ToolSettings * toolsettings
MeshExtractType extract_type
const int * orig_index_face
VArraySpan< bool > select_poly
const int * orig_index_edge
VArraySpan< bool > hide_poly
OffsetIndices< int > faces