37 if (u <= 0 ||
v <= 0 ||
w <= 0) {
45 if (u <= 0 ||
v <= 0 ||
w <= 0) {
48 return (((((u - 1) *
v) + ((
v - 1) * u)) *
w) + ((
w - 1) * (u *
v)));
57 const int u = lt->
pntsu;
75 const int u = lt->
pntsu;
118 rdata->
types = types;
139 rdata->
dvert =
nullptr;
165 if (rdata->loose_verts) {
166 MEM_delete(rdata->loose_verts);
188 return &rdata->
bp[vert_idx];
220 if (cache ==
nullptr) {
250 memset(cache, 0,
sizeof(*cache));
279 if (cache ==
nullptr) {
324 if (cache->
pos ==
nullptr) {
337 cache->
pos = GPU_vertbuf_create_with_format(format);
339 for (
int i = 0; i < vert_len; i++) {
344 const float no_active_weight = 666.0f;
360 if (cache->
edges ==
nullptr) {
373#define LATT_INDEX(u, v, w) ((((w) * rdata->dims.v_len + (v)) * rdata->dims.u_len) + (u))
375 for (
int w = 0;
w < rdata->
dims.w_len;
w++) {
376 int wxt =
ELEM(
w, 0, rdata->
dims.w_len - 1);
377 for (
int v = 0;
v < rdata->
dims.v_len;
v++) {
378 int vxt =
ELEM(
v, 0, rdata->
dims.v_len - 1);
379 for (
int u = 0; u < rdata->
dims.u_len; u++) {
380 int uxt =
ELEM(u, 0, rdata->
dims.u_len - 1);
431 gpu::VertBuf *vbo = GPU_vertbuf_create_with_format(format);
433 for (
int i = 0; i < vert_len; i++) {
438 if (i == rdata->
actbp) {
#define GPU_batch_create(primitive_type, vertex_buf, index_buf)
#define GPU_BATCH_DISCARD_SAFE(batch)
#define GPU_INDEXBUF_DISCARD_SAFE(elem)
#define GPU_VERTBUF_DISCARD_SAFE(verts)
Read Blender memory allocation and freeing.
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
CCL_NAMESPACE_BEGIN struct Options options
#define LATT_INDEX(u, v, w)
gpu::Batch * DRW_lattice_batch_cache_get_all_verts(Lattice *lt)
void DRW_lattice_batch_cache_validate(Lattice *lt)
static int edge_len_calc(int u, int v, int w)
gpu::Batch * DRW_lattice_batch_cache_get_all_edges(Lattice *lt, bool use_weight, int actdef)
void DRW_lattice_batch_cache_dirty_tag(Lattice *lt, int mode)
gpu::Batch * DRW_lattice_batch_cache_get_edit_verts(Lattice *lt)
void DRW_lattice_batch_cache_free(Lattice *lt)
static void lattice_batch_cache_init(Lattice *lt)
static void lattice_batch_cache_clear(Lattice *lt)
static gpu::IndexBuf * lattice_batch_cache_get_edges(LatticeRenderData *rdata, LatticeBatchCache *cache)
static int lattice_render_data_edges_len_get(const LatticeRenderData *rdata)
static const BPoint * lattice_render_data_vert_bpoint(const LatticeRenderData *rdata, const int vert_idx)
static LatticeBatchCache * lattice_batch_cache_get(Lattice *lt)
static int lattice_render_data_verts_len_get(const LatticeRenderData *rdata)
static LatticeRenderData * lattice_render_data_create(Lattice *lt, const int types)
static void lattice_batch_cache_create_overlay_batches(Lattice *lt)
static bool lattice_batch_cache_valid(Lattice *lt)
static void lattice_render_data_free(LatticeRenderData *rdata)
static gpu::VertBuf * lattice_batch_cache_get_pos(LatticeRenderData *rdata, LatticeBatchCache *cache, bool use_weight, const int actdef)
static int lattice_render_verts_len_get(Lattice *lt)
static int lattice_render_edges_len_get(Lattice *lt)
static int vert_len_calc(int u, int v, int w)
VecBase< uint32_t, 2 > uint2
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, gpu::VertBuf *vertex_buf, gpu::IndexBuf *index_buf, GPUBatchFlag owns_flag)
void GPU_indexbuf_init(GPUIndexBufBuilder *, GPUPrimType, uint prim_len, uint vertex_len)
@ BKE_LATTICE_BATCH_DIRTY_ALL
@ BKE_LATTICE_BATCH_DIRTY_SELECT
ATTR_WARN_UNUSED_RESULT const BMVert * v
float BKE_defvert_find_weight(const MDeformVert *dvert, int defgroup)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
BMesh const char void * data
void GPU_vertbuf_attr_set(gpu::VertBuf *, uint a_idx, uint v_idx, const void *data)
MutableSpan< uint32_t > GPU_indexbuf_get_data(GPUIndexBufBuilder *)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
void GPU_vertbuf_data_alloc(gpu::VertBuf &verts, uint v_len)
gpu::IndexBuf * GPU_indexbuf_build_ex(GPUIndexBufBuilder *builder, uint index_min, uint index_max, bool uses_restart_indices)
struct EditLatt * editlatt
draw::LatticeBatchCache * batch_cache
struct MDeformVert * dvert
gpu::Batch * overlay_verts
struct blender::draw::LatticeBatchCache::@154210265044357056026136226074313224321012116221 dims
struct blender::draw::LatticeRenderData::@212026052261026166321007063232025254241217305361 dims
const MDeformVert * dvert