21# include <fmt/format.h>
40static void rna_LatticePoint_co_get(
PointerRNA *
ptr,
float *values)
44 int index = bp - lt->def;
49 values[0] = lt->fu + u * lt->du;
50 values[1] = lt->fv +
v * lt->dv;
51 values[2] = lt->fw +
w * lt->dw;
73 int tot = lt->pntsu * lt->pntsv * lt->pntsw;
75 if (lt->editlatt && lt->editlatt->latt->def) {
77 iter,
ptr, (
void *)lt->editlatt->latt->def,
sizeof(
BPoint), tot, 0,
nullptr);
89 ID *
id =
ptr->owner_id;
101 ID *
id =
ptr->owner_id;
106 lt_em->
typeu = lt->typeu;
107 lt_em->
typev = lt->typev;
108 lt_em->
typew = lt->typew;
109 lt_em->
flag = lt->flag;
121 int newu, newv, neww;
124 newu = (lt->opntsu > 0) ? lt->opntsu : lt->pntsu;
125 newv = (lt->opntsv > 0) ? lt->opntsv : lt->pntsv;
126 neww = (lt->opntsw > 0) ? lt->opntsw : lt->pntsw;
129 for (ob =
static_cast<Object *
>(bmain->objects.first); ob;
132 if (ob->
data == lt) {
149 rna_Lattice_update_data(bmain, scene,
ptr);
152static void rna_Lattice_use_outside_set(
PointerRNA *
ptr,
bool value)
177static int rna_Lattice_size_editable(
const PointerRNA *
ptr,
const char ** )
184static void rna_Lattice_points_u_set(
PointerRNA *
ptr,
int value)
188 lt->
opntsu = std::clamp(value, 1, 64);
191static void rna_Lattice_points_v_set(
PointerRNA *
ptr,
int value)
195 lt->
opntsv = std::clamp(value, 1, 64);
198static void rna_Lattice_points_w_set(
PointerRNA *
ptr,
int value)
202 lt->
opntsw = std::clamp(value, 1, 64);
205static void rna_Lattice_vg_name_set(
PointerRNA *
ptr,
const char *value)
216static std::optional<std::string> rna_LatticePoint_path(
const PointerRNA *
ptr)
219 const void *point =
ptr->data;
220 const BPoint *points =
nullptr;
229 if (points && point) {
233 if ((point >= (
void *)points) && (point < (
void *)(points + tot))) {
234 int pt_index = int((
BPoint *)point - points);
236 return fmt::format(
"points[{}]", pt_index);
272 "Original undeformed location used to calculate the strength of the deform effect "
273 "(edit/animate the Deformed Location instead)");
289 "rna_LatticePoint_groups_begin",
290 "rna_iterator_array_next",
291 "rna_iterator_array_end",
292 "rna_iterator_array_get",
299 prop,
"Groups",
"Weights for the vertex groups this point is member of");
309 srna,
"Lattice",
"Lattice data-block defining a grid for deforming other objects");
318 prop,
"U",
"Points in U direction (cannot be changed when there are shape keys)");
328 prop,
"V",
"Points in V direction (cannot be changed when there are shape keys)");
338 prop,
"W",
"Points in W direction (cannot be changed when there are shape keys)");
364 prop,
"Outside",
"Only display and take into account the outer vertices");
370 prop,
"Vertex Group",
"Vertex group to apply the influence of the lattice");
383 "rna_Lattice_points_begin",
384 "rna_iterator_array_next",
385 "rna_iterator_array_end",
386 "rna_iterator_array_get",
void outside_lattice(Lattice *lt)
void BKE_lattice_index_to_uvw(const Lattice *lt, int index, int *r_u, int *r_v, int *r_w)
void BKE_lattice_resize(Lattice *lt, int u_new, int v_new, int w_new, Object *lt_ob)
char * STRNCPY(char(&dst)[N], const char *src)
void DEG_id_tag_update(ID *id, unsigned int flags)
Object is a sort of wrapper for general info.
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
void rna_def_animdata_common(StructRNA *srna)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_api_lattice(StructRNA *srna)
const EnumPropertyItem rna_enum_keyblock_type_items[]
static void rna_def_lattice(BlenderRNA *brna)
void RNA_def_lattice(BlenderRNA *brna)
static void rna_def_latticepoint(BlenderRNA *brna)
struct EditLatt * editlatt
void WM_main_add_notifier(uint type, void *reference)