21# include <fmt/format.h>
38static void rna_LatticePoint_co_get(
PointerRNA *
ptr,
float *values)
42 int index = bp - lt->def;
47 values[0] = lt->fu + u * lt->du;
48 values[1] = lt->fv +
v * lt->dv;
49 values[2] = lt->fw +
w * lt->dw;
71 int tot = lt->pntsu * lt->pntsv * lt->pntsw;
73 if (lt->editlatt && lt->editlatt->latt->def) {
75 iter,
ptr, (
void *)lt->editlatt->latt->def,
sizeof(
BPoint), tot, 0,
nullptr);
87 ID *
id =
ptr->owner_id;
99 ID *
id =
ptr->owner_id;
104 lt_em->
typeu = lt->typeu;
105 lt_em->
typev = lt->typev;
106 lt_em->
typew = lt->typew;
107 lt_em->
flag = lt->flag;
119 int newu, newv, neww;
122 newu = (lt->opntsu > 0) ? lt->opntsu : lt->pntsu;
123 newv = (lt->opntsv > 0) ? lt->opntsv : lt->pntsv;
124 neww = (lt->opntsw > 0) ? lt->opntsw : lt->pntsw;
127 for (ob =
static_cast<Object *
>(bmain->objects.first); ob;
130 if (ob->
data == lt) {
147 rna_Lattice_update_data(bmain, scene,
ptr);
150static void rna_Lattice_use_outside_set(
PointerRNA *
ptr,
bool value)
175static int rna_Lattice_size_editable(
const PointerRNA *
ptr,
const char ** )
182static void rna_Lattice_points_u_set(
PointerRNA *
ptr,
int value)
186 lt->
opntsu = std::clamp(value, 1, 64);
189static void rna_Lattice_points_v_set(
PointerRNA *
ptr,
int value)
193 lt->
opntsv = std::clamp(value, 1, 64);
196static void rna_Lattice_points_w_set(
PointerRNA *
ptr,
int value)
200 lt->
opntsw = std::clamp(value, 1, 64);
203static void rna_Lattice_vg_name_set(
PointerRNA *
ptr,
const char *value)
214static std::optional<std::string> rna_LatticePoint_path(
const PointerRNA *
ptr)
217 const void *point =
ptr->data;
218 const BPoint *points =
nullptr;
227 if (points && point) {
231 if ((point >= (
void *)points) && (point < (
void *)(points + tot))) {
232 int pt_index = int((
BPoint *)point - points);
234 return fmt::format(
"points[{}]", pt_index);
270 "Original undeformed location used to calculate the strength of the deform effect "
271 "(edit/animate the Deformed Location instead)");
287 "rna_LatticePoint_groups_begin",
288 "rna_iterator_array_next",
289 "rna_iterator_array_end",
290 "rna_iterator_array_get",
297 prop,
"Groups",
"Weights for the vertex groups this point is member of");
307 srna,
"Lattice",
"Lattice data-block defining a grid for deforming other objects");
316 prop,
"U",
"Points in U direction (cannot be changed when there are shape keys)");
326 prop,
"V",
"Points in V direction (cannot be changed when there are shape keys)");
336 prop,
"W",
"Points in W direction (cannot be changed when there are shape keys)");
362 prop,
"Outside",
"Only display and take into account the outer vertices");
368 prop,
"Vertex Group",
"Vertex group to apply the influence of the lattice");
381 "rna_Lattice_points_begin",
382 "rna_iterator_array_next",
383 "rna_iterator_array_end",
384 "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, int itemsize, int 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)