67 CLAMP(input, 0.0f, 1.0f);
84 for (const int vert : range) {
85 weights[vert] = evaluate_vertex_weight(&dverts[vert], &weight_state);
103 for (const int face_index : range) {
104 const BMFace &face = *BM_face_at_index(&const_cast<BMesh &>(bm), face_index);
105 const BMLoop *loop = BM_FACE_FIRST_LOOP(&face);
106 for ([[maybe_unused]] const int i : IndexRange(face.len)) {
107 const int index = BM_elem_index_get(loop);
108 vbo_data[index] = evaluate_vertex_weight(
109 static_cast<const MDeformVert *>(BM_ELEM_CD_GET_VOID_P(loop->v, offset)),
120 if (
format.attr_len == 0) {
128 if (weight_state.defgroup_active == -1) {
147 if (
format.attr_len == 0) {
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
@ OB_DRAW_GROUPUSER_ACTIVE
void GPU_vertbuf_init_build_on_device(blender::gpu::VertBuf &verts, const GPUVertFormat &format, uint v_len)
#define GPU_vertbuf_init_with_format(verts, format)
blender::gpu::VertBuf * GPU_vertbuf_calloc()
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
void GPU_vertbuf_discard(blender::gpu::VertBuf *)
ATTR_WARN_UNUSED_RESULT BMesh * bm
IndexRange index_range() 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 extract_weights(const MeshRenderData &mr, const MeshBatchCache &cache, gpu::VertBuf &vbo)
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)
void extract_weights_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, const MeshBatchCache &cache, gpu::VertBuf &vbo)
@ DRW_MESH_WEIGHT_STATE_MULTIPAINT
@ DRW_MESH_WEIGHT_STATE_LOCK_RELATIVE
@ DRW_MESH_WEIGHT_STATE_AUTO_NORMALIZE
void draw_subdiv_interp_custom_data(const DRWSubdivCache &cache, gpu::VertBuf &src_data, gpu::VertBuf &dst_data, int comp_type, int dimensions, int dst_offset)
static void extract_weights_mesh(const MeshRenderData &mr, const DRW_MeshWeightState &weight_state, MutableSpan< float > vbo_data)
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
eMRExtractType extract_type