Blender V5.0
BKE_lattice.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
10
11#include <optional>
12
13#include "BLI_array.hh"
14#include "BLI_bounds_types.hh"
15#include "BLI_compiler_attrs.h"
18#include "BLI_span.hh"
19
20struct BMEditMesh;
21struct BPoint;
22struct Depsgraph;
23struct Lattice;
25struct Main;
26struct MDeformVert;
27struct Mesh;
28struct Object;
29struct Scene;
30
31void BKE_lattice_resize(Lattice *lt, int u_new, int v_new, int w_new, Object *lt_ob);
32Lattice *BKE_lattice_add(Main *bmain, const char *name);
33void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du);
34
35void outside_lattice(Lattice *lt);
36
44void BKE_lattice_modifiers_calc(Depsgraph *depsgraph, Scene *scene, Object *ob);
45
48
49std::optional<blender::Bounds<blender::float3>> BKE_lattice_minmax(const Lattice *lt);
50void BKE_lattice_center_median(Lattice *lt, float cent[3]);
51void BKE_lattice_translate(Lattice *lt, const float offset[3], bool do_keys);
52void BKE_lattice_transform(Lattice *lt, const float mat[4][4], bool do_keys);
53
55
56int BKE_lattice_index_from_uvw(const Lattice *lt, int u, int v, int w);
57void BKE_lattice_index_to_uvw(const Lattice *lt, int index, int *r_u, int *r_v, int *r_w);
58int BKE_lattice_index_flip(const Lattice *lt, int index, bool flip_u, bool flip_v, bool flip_w);
60 const Lattice *lt, unsigned int *bitmap, uint8_t flag, bool clear, bool respecthide);
61
62/* **** Depsgraph evaluation **** */
63
64void BKE_lattice_eval_geometry(Depsgraph *depsgraph, Lattice *latt);
65
66/* Draw Cache */
67enum {
70};
73
74extern void (*BKE_lattice_batch_cache_dirty_tag_cb)(Lattice *lt, int mode);
76
77/* -------------------------------------------------------------------- */
80
84 float co[3],
85 float weight);
86void BKE_lattice_deform_data_destroy(LatticeDeformData *lattice_deform_data);
87
88void BKE_lattice_deform_coords(const Object *ob_lattice,
89 const Object *ob_target,
90 float (*vert_coords)[3],
91 int vert_coords_len,
92 short flag,
93 const char *defgrp_name,
94 float fac);
95
96void BKE_lattice_deform_coords_with_mesh(const Object *ob_lattice,
97 const Object *ob_target,
98 float (*vert_coords)[3],
99 int vert_coords_len,
100 short flag,
101 const char *defgrp_name,
102 float fac,
103 const Mesh *me_target);
104
106 const Object *ob_target,
107 float (*vert_coords)[3],
108 int vert_coords_len,
109 short flag,
110 const char *defgrp_name,
111 float fac,
112 const BMEditMesh *em_target);
113
LatticeDeformData * BKE_lattice_deform_data_create(const Object *oblatt, const Object *ob) ATTR_WARN_UNUSED_RESULT
void outside_lattice(Lattice *lt)
Definition lattice.cc:401
@ BKE_LATTICE_BATCH_DIRTY_SELECT
@ BKE_LATTICE_BATCH_DIRTY_ALL
void BKE_lattice_transform(Lattice *lt, const float mat[4][4], bool do_keys)
Definition lattice.cc:631
void BKE_lattice_deform_coords(const Object *ob_lattice, const Object *ob_target, float(*vert_coords)[3], int vert_coords_len, short flag, const char *defgrp_name, float fac)
void BKE_lattice_batch_cache_dirty_tag(Lattice *lt, int mode)
Definition lattice.cc:704
void BKE_lattice_eval_geometry(Depsgraph *depsgraph, Lattice *latt)
Definition lattice.cc:697
void BKE_lattice_deform_coords_with_mesh(const Object *ob_lattice, const Object *ob_target, float(*vert_coords)[3], int vert_coords_len, short flag, const char *defgrp_name, float fac, const Mesh *me_target)
std::optional< blender::Bounds< blender::float3 > > BKE_lattice_minmax(const Lattice *lt)
Definition lattice.cc:611
void(* BKE_lattice_batch_cache_dirty_tag_cb)(Lattice *lt, int mode)
Definition lattice.cc:701
void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du)
Definition lattice.cc:256
void BKE_lattice_center_median(Lattice *lt, float cent[3])
Definition lattice.cc:593
BPoint * BKE_lattice_active_point_get(Lattice *lt)
Definition lattice.cc:576
void BKE_lattice_bitmap_from_flag(const Lattice *lt, unsigned int *bitmap, uint8_t flag, bool clear, bool respecthide)
Definition lattice.cc:234
void(* BKE_lattice_batch_cache_free_cb)(Lattice *lt)
Definition lattice.cc:702
void BKE_lattice_deform_data_destroy(LatticeDeformData *lattice_deform_data)
int BKE_lattice_index_flip(const Lattice *lt, int index, bool flip_u, bool flip_v, bool flip_w)
Definition lattice.cc:212
void BKE_lattice_index_to_uvw(const Lattice *lt, int index, int *r_u, int *r_v, int *r_w)
Definition lattice.cc:202
Lattice * BKE_lattice_add(Main *bmain, const char *name)
Definition lattice.cc:387
void BKE_lattice_deform_coords_with_editmesh(const Object *ob_lattice, const Object *ob_target, float(*vert_coords)[3], int vert_coords_len, short flag, const char *defgrp_name, float fac, const BMEditMesh *em_target)
int BKE_lattice_index_from_uvw(const Lattice *lt, int u, int v, int w)
Definition lattice.cc:194
void BKE_lattice_translate(Lattice *lt, const float offset[3], bool do_keys)
Definition lattice.cc:651
bool BKE_lattice_is_any_selected(const Lattice *lt)
Definition lattice.cc:679
MDeformVert * BKE_lattice_deform_verts_get(const Object *oblatt)
Definition lattice.cc:569
void BKE_lattice_vert_coords_apply(Lattice *lt, blender::Span< blender::float3 > vert_coordss)
void BKE_lattice_vert_coords_apply_with_mat4(Lattice *lt, blender::Span< blender::float3 > vert_coordss, const blender::float4x4 &transform)
void BKE_lattice_deform_data_eval_co(LatticeDeformData *lattice_deform_data, float co[3], float weight)
void BKE_lattice_vert_coords_get(const Lattice *lt, blender::MutableSpan< blender::float3 > vert_coordss)
void BKE_lattice_batch_cache_free(Lattice *lt)
Definition lattice.cc:710
void BKE_lattice_modifiers_calc(Depsgraph *depsgraph, Scene *scene, Object *ob)
Definition lattice.cc:514
void BKE_lattice_resize(Lattice *lt, int u_new, int v_new, int w_new, Object *lt_ob)
Definition lattice.cc:272
blender::Array< blender::float3 > BKE_lattice_vert_coords_alloc(const Lattice *lt)
Definition lattice.cc:488
#define ATTR_WARN_UNUSED_RESULT
ATTR_WARN_UNUSED_RESULT const BMVert * v
BPy_StructRNA * depsgraph
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
static void clear(Message &msg)
Definition msgfmt.cc:213
MatBase< float, 4, 4 > float4x4
const char * name
uint8_t flag
Definition wm_window.cc:145