83 for (const int vert : range) {
84 weights[vert] = evaluate_vertex_weight(&dverts[vert], &weight_state);
102 for (const int face_index : range) {
103 const BMFace &face = *BM_face_at_index(&const_cast<BMesh &>(bm), face_index);
104 const BMLoop *loop = BM_FACE_FIRST_LOOP(&face);
105 for ([[maybe_unused]] const int i : IndexRange(face.len)) {
106 const int index = BM_elem_index_get(loop);
107 vbo_data[index] = evaluate_vertex_weight(
108 static_cast<const MDeformVert *>(BM_ELEM_CD_GET_VOID_P(loop->v, offset)),
119 gpu::VertAttrType::SFLOAT_32);
126 if (weight_state.defgroup_active == -1) {
145 gpu::VertAttrType::SFLOAT_32);
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
@ OB_DRAW_GROUPUSER_ACTIVE
blender::gpu::VertBuf * GPU_vertbuf_create_on_device(const GPUVertFormat &format, uint v_len)
static blender::gpu::VertBuf * GPU_vertbuf_create_with_format(const GPUVertFormat &format)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
IndexRange index_range() const
constexpr T * data() const
constexpr void fill(const T &value) const
constexpr int64_t size() const
constexpr bool is_empty() const
void gather(const GVArray &src, const IndexMask &indices, GMutableSpan dst, int64_t grain_size=4096)
void draw_subdiv_interp_custom_data(const DRWSubdivCache &cache, gpu::VertBuf &src_data, gpu::VertBuf &dst_data, GPUVertCompType comp_type, int dimensions, int dst_offset)
static float evaluate_vertex_weight(const MDeformVert *dvert, const DRW_MeshWeightState *wstate)
static void extract_weights_bm(const MeshRenderData &mr, const DRW_MeshWeightState &weight_state, MutableSpan< float > vbo_data)
static void extract_weights_mesh(const MeshRenderData &mr, const DRW_MeshWeightState &weight_state, MutableSpan< float > vbo_data)
gpu::VertBufPtr extract_weights(const MeshRenderData &mr, const MeshBatchCache &cache)
gpu::VertBufPtr extract_weights_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, const MeshBatchCache &cache)
@ DRW_MESH_WEIGHT_STATE_MULTIPAINT
@ DRW_MESH_WEIGHT_STATE_LOCK_RELATIVE
@ DRW_MESH_WEIGHT_STATE_AUTO_NORMALIZE
std::unique_ptr< gpu::VertBuf, gpu::VertBufDeleter > VertBufPtr
bool is_normalized(const DualQuaternionBase< T > &dq)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
DRW_MeshWeightState weight_state
MeshExtractType extract_type