26 for (const int face_index : range) {
27 const IndexRange face = faces[face_index];
28 const auto corner = std::find_if(face.begin(), face.end(), [&](const int corner) {
29 return facedot_tags[corner_verts[corner]].test();
31 if (corner == face.end()) {
32 vbo_data[face_index] = float2(0);
35 vbo_data[face_index] = uv_map[*corner];
53 for (const int face_index : range) {
54 const BMFace &face = *BM_face_at_index(&const_cast<BMesh &>(bm), face_index);
55 const BMLoop *loop = BM_FACE_FIRST_LOOP(&face);
56 vbo_data[face_index] = float2(0);
57 for ([[maybe_unused]] const int i : IndexRange(face.len)) {
58 vbo_data[face_index] += *BM_ELEM_CD_GET_FLOAT2_P(loop, offset);
61 vbo_data[face_index] /= face.len;
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
const char * CustomData_get_active_layer_name(const CustomData *data, eCustomDataType type)
static blender::gpu::VertBuf * GPU_vertbuf_create_with_format(const GPUVertFormat &format)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
constexpr T * data() const
void materialize(MutableSpan< T > r_span) const
GAttributeReader lookup(const StringRef attribute_id) const
static void extract_face_dots_uv_mesh(const MeshRenderData &mr, MutableSpan< float2 > vbo_data)
static void extract_face_dots_uv_bm(const MeshRenderData &mr, MutableSpan< float2 > vbo_data)
gpu::VertBufPtr extract_face_dots_uv(const MeshRenderData &mr)
std::unique_ptr< gpu::VertBuf, gpu::VertBufDeleter > VertBufPtr
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
VecBase< float, 2 > float2
MeshRuntimeHandle * runtime
MeshExtractType extract_type
OffsetIndices< int > faces