61 for (
Object *ob : objects) {
98 ot->name =
"Make Regular";
99 ot->description =
"Set UVW control points a uniform distance apart";
100 ot->idname =
"LATTICE_OT_make_regular";
151 int numU = lt->
pntsu;
152 int numV = lt->
pntsv;
153 int numW = lt->
pntsw;
203 bool changed =
false;
208 for (
Object *obedit : objects) {
211 int numU, numV, numW;
228 totP = numU * numV * numW;
244 printf(
"lattice_flip(): Unknown flipping axis (%d)\n", axis);
250 float avgInv = 1.0f /
float(totP);
254 for (
i = 0, bp = lt->
def;
i < totP;
i++, bp++) {
255 mid += bp->
vec[axis] * avgInv;
265 for (
w = 0;
w < numW;
w++) {
266 for (
v = 0;
v < numV;
v++) {
268 for (u = 0; u < (numU / 2); u++) {
285 for (
w = 0;
w < numW;
w++) {
286 for (u = 0; u < numU; u++) {
288 for (
v = 0;
v < (numV / 2);
v++) {
304 for (
v = 0;
v < numV;
v++) {
305 for (u = 0; u < numU; u++) {
307 for (
w = 0;
w < (numW / 2);
w++) {
339 {0,
nullptr, 0,
nullptr,
nullptr},
343 ot->name =
"Flip (Distortion Free)";
344 ot->description =
"Mirror all control points without inverting the lattice deform";
345 ot->idname =
"LATTICE_OT_flip";
361 "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)
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
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
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)