64 for (
Object *ob : objects) {
101 ot->
name =
"Make Regular";
102 ot->
description =
"Set UVW control points a uniform distance apart";
103 ot->
idname =
"LATTICE_OT_make_regular";
154 int numU = lt->
pntsu;
155 int numV = lt->
pntsv;
156 int numW = lt->
pntsw;
206 bool changed =
false;
211 for (
Object *obedit : objects) {
214 int numU, numV, numW;
231 totP = numU * numV * numW;
247 printf(
"lattice_flip(): Unknown flipping axis (%d)\n", axis);
253 float avgInv = 1.0f /
float(totP);
257 for (i = 0, bp = lt->
def; i < totP; i++, bp++) {
258 mid += bp->
vec[axis] * avgInv;
268 for (
w = 0;
w < numW;
w++) {
269 for (
v = 0;
v < numV;
v++) {
271 for (u = 0; u < (numU / 2); u++) {
288 for (
w = 0;
w < numW;
w++) {
289 for (u = 0; u < numU; u++) {
291 for (
v = 0;
v < (numV / 2);
v++) {
307 for (
v = 0;
v < numV;
v++) {
308 for (u = 0; u < numU; u++) {
310 for (
w = 0;
w < (numW / 2);
w++) {
342 {0,
nullptr, 0,
nullptr,
nullptr},
346 ot->
name =
"Flip (Distortion Free)";
347 ot->
description =
"Mirror all control points without inverting the lattice deform";
364 "Coordinates along this axis get flipped");
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
int BKE_lattice_index_from_uvw(const Lattice *lt, int u, int v, int w)
void BKE_lattice_resize(Lattice *lt, int u_new, int v_new, int w_new, Object *lt_ob)
#define FOREACH_SELECTED_OBJECT_BEGIN(_view_layer, _v3d, _instance)
#define FOREACH_SELECTED_OBJECT_END
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
MINLINE void swap_v3_v3(float a[3], float b[3])
void DEG_id_tag_update(ID *id, unsigned int flags)
Object is a sort of wrapper for general info.
bool ED_operator_editlattice(bContext *C)
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
draw_view in_light_buf[] float
IMETHOD Vector diff(const Vector &a, const Vector &b, double dt)
bool shape_key_report_if_locked(const Object *obedit, ReportList *reports)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
struct EditLatt * editlatt
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)