Blender V5.3
transform_mode_translate.cc
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
8
9#include <cstdlib>
10
11#include "MEM_guardedalloc.h"
12
13#include "BLI_math_matrix.hh"
14#include "BLI_math_matrix_c.hh"
16#include "BLI_math_vector_c.hh"
17#include "BLI_string_utf8.hh"
18#include "BLI_string_utils.hh"
19#include "BLI_task.hh"
20
21#include "BKE_image.hh"
22#include "BKE_report.hh"
23#include "BKE_unit.hh"
24
25#include "ED_screen.hh"
26
27#include "BLT_translation.hh"
28
29#include "UI_interface_types.hh"
30#include "UI_view2d.hh"
31
32#include "transform.hh"
34#include "transform_convert.hh"
35#include "transform_mode.hh"
36#include "transform_snap.hh"
37
38namespace blender::ed::transform {
39
40/* -------------------------------------------------------------------- */
43
51
63
65
66/* -------------------------------------------------------------------- */
69
71 const TransDataContainer *tc,
72 TransData *td,
73 TransDataExtension *td_ext,
74 const float3 &snap_source_local,
75 const float3 &vec,
76 enum eTranslateRotateMode rotate_mode)
77{
78 float rotate_offset[3] = {0};
79 bool use_rotate_offset = false;
80
81 /* Handle snapping rotation before doing the translation. */
82 if (rotate_mode != TRANSLATE_ROTATE_OFF) {
83 float mat[3][3];
84
85 if (rotate_mode == TRANSLATE_ROTATE_RESET) {
86 unit_m3(mat);
87 }
88 else {
89 BLI_assert(rotate_mode == TRANSLATE_ROTATE_ON);
90
91 float3 original_normal;
92
93 /* In pose mode, we want to align normals with Y axis of bones. */
94 if (t->options & CTX_POSE_BONE) {
95 original_normal = td->axismtx[1];
96 }
97 else {
98 original_normal = td->axismtx[2];
99 }
100
101 if (t->flag & T_POINTS) {
102 /* Convert to Global Space since #ElementRotation_ex operates with the matrix in global
103 * space. */
104 original_normal = math::transform_direction(float3x3(td->mtx), original_normal);
105 }
106
107 rotation_between_vecs_to_mat3(mat, original_normal, t->tsnap.snapNormal);
108 }
109
110 ElementRotation_ex(t, tc, td, td_ext, mat, snap_source_local);
111
112 if (td->loc) {
113 use_rotate_offset = true;
114 sub_v3_v3v3(rotate_offset, td->loc, td->iloc);
115 }
116 }
117
118 float tvec[3];
119
120 if (t->con.applyVec) {
121 t->con.applyVec(t, tc, td, vec, tvec);
122 }
123 else {
124 copy_v3_v3(tvec, vec);
125 }
126
127 mul_m3_v3(td->smtx, tvec);
128
129 if (use_rotate_offset) {
130 add_v3_v3(tvec, rotate_offset);
131 }
132
133 if (t->options & CTX_GPENCIL_STROKES) {
134 /* Grease pencil multi-frame falloff. */
135 float *gp_falloff = static_cast<float *>(td->extra);
136 if (gp_falloff != nullptr) {
137 mul_v3_fl(tvec, td->factor * *gp_falloff);
138 }
139 else {
140 mul_v3_fl(tvec, td->factor);
141 }
142 }
143 else {
144 /* Proportional editing falloff. */
145 mul_v3_fl(tvec, td->factor);
146 }
147
149
150 if (td->loc) {
151 add_v3_v3v3(td->loc, td->iloc, tvec);
152 }
153
154 constraintTransLim(t, tc, td);
155}
156
158
159/* -------------------------------------------------------------------- */
162
163static void translate_dist_to_str(char *r_str,
164 const int r_str_maxncpy,
165 const float val,
166 const UnitSettings &unit,
167 const bool high_precision)
168{
169 const int precision = high_precision ? 6 : 4;
171 r_str, r_str_maxncpy, val, precision * -1, B_UNIT_LENGTH, unit, false, true);
172}
173
174static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_DRAW_STR])
175{
176 size_t ofs = 0;
177 char dvec_str[3][NUM_STR_REP_LEN];
178 char dist_str[NUM_STR_REP_LEN];
179 float dist;
180
181 UnitSettings unit = t->scene->unit;
182 if ((t->flag & T_2D_EDIT)) {
183 unit.system = USER_UNIT_NONE;
184 }
185
186 if (hasNumInput(&t->num)) {
187 outputNumInput(&(t->num), dvec_str[0], t->scene->unit);
188 dist = len_v3(t->num.val);
189 }
190 else {
191 float dvec[3];
192 copy_v3_v3(dvec, vec);
193 if (t->spacetype == SPACE_GRAPH) {
194 /* WORKAROUND:
195 * Special case where snapping is done in #recalData.
196 * Update the header based on the #center_local. */
197 eSnapMode autosnap = t->tsnap.mode;
198 float ival = TRANS_DATA_CONTAINER_FIRST_OK(t)->center_local[0];
199 float val = ival + dvec[0];
200 snapFrameTransform(t, autosnap, ival, val, &val);
201 dvec[0] = val - ival;
202 }
203
204 if (t->flag & T_2D_EDIT) {
205 applyAspectRatio(t, dvec);
206 }
207
208 if (t->con.mode & CON_APPLY) {
209 int i = 0;
210 if (t->con.mode & CON_AXIS0) {
211 dvec[i++] = dvec[0];
212 }
213 if (t->con.mode & CON_AXIS1) {
214 dvec[i++] = dvec[1];
215 }
216 if (t->con.mode & CON_AXIS2) {
217 dvec[i++] = dvec[2];
218 }
219 while (i != 3) {
220 dvec[i++] = 0.0f;
221 }
222 }
223
224 dist = len_v3(dvec);
225
226 for (int i = 0; i < 3; i++) {
227 char temp_vec_str[NUM_STR_REP_LEN];
228
230 temp_vec_str, sizeof(temp_vec_str), dvec[i], unit, t->modifiers & MOD_PRECISION);
231 STRNCPY_UTF8(dvec_str[i], BLI_string_pad_number_sign(temp_vec_str).c_str());
232 }
233 }
234
235 translate_dist_to_str(dist_str, sizeof(dist_str), dist, unit, t->modifiers & MOD_PRECISION);
236
237 if (t->flag & T_PROP_EDIT_ALL) {
238 char prop_str[NUM_STR_REP_LEN];
240 prop_str, sizeof(prop_str), t->prop_size, unit, t->modifiers & MOD_PRECISION);
241
242 ofs += BLI_snprintf_utf8_rlen(str + ofs,
243 UI_MAX_DRAW_STR - ofs,
244 "%s %s: %s ",
245 IFACE_("Proportional Size"),
246 t->proptext,
247 prop_str);
248 }
249
250 if (t->flag & T_AUTOIK) {
251 short chainlen = t->settings->autoik_chainlen;
252 if (chainlen) {
254 str + ofs, UI_MAX_DRAW_STR - ofs, IFACE_("Auto IK Length: %d"), chainlen);
255 ofs += BLI_strncpy_utf8_rlen(str + ofs, " ", UI_MAX_DRAW_STR - ofs);
256 }
257 }
258
259 if (t->con.mode & CON_APPLY) {
260 switch (t->num.idx_max) {
261 case 0:
263 str + ofs, UI_MAX_DRAW_STR - ofs, "D: %s (%s)%s", dvec_str[0], dist_str, t->con.text);
264 break;
265 case 1:
266 ofs += BLI_snprintf_utf8_rlen(str + ofs,
267 UI_MAX_DRAW_STR - ofs,
268 "D: %s D: %s (%s)%s",
269 dvec_str[0],
270 dvec_str[1],
271 dist_str,
272 t->con.text);
273 break;
274 case 2:
275 ofs += BLI_snprintf_utf8_rlen(str + ofs,
276 UI_MAX_DRAW_STR - ofs,
277 "D: %s D: %s D: %s (%s)%s",
278 dvec_str[0],
279 dvec_str[1],
280 dvec_str[2],
281 dist_str,
282 t->con.text);
283 break;
284 }
285 }
286 else {
287 if (t->spacetype == SPACE_NODE) {
288 SpaceNode *snode = t->area->spacedata.first_as<SpaceNode>();
289 if (U.uiflag & USER_NODE_AUTO_OFFSET) {
290 const char *str_dir = (snode->insert_ofs_dir == SNODE_INSERTOFS_DIR_RIGHT) ?
291 IFACE_("right") :
292 IFACE_("left");
294 str, UI_MAX_DRAW_STR, IFACE_("Auto-offset direction: %s"), str_dir);
295 }
296 }
297 else {
298 if (t->flag & T_2D_EDIT) {
299 ofs += BLI_snprintf_utf8_rlen(str + ofs,
300 UI_MAX_DRAW_STR - ofs,
301 "Dx: %s Dy: %s (%s)%s",
302 dvec_str[0],
303 dvec_str[1],
304 dist_str,
305 t->con.text);
306 }
307 else {
308 ofs += BLI_snprintf_utf8_rlen(str + ofs,
309 UI_MAX_DRAW_STR - ofs,
310 "Dx: %s Dy: %s Dz: %s (%s)%s",
311 dvec_str[0],
312 dvec_str[1],
313 dvec_str[2],
314 dist_str,
315 t->con.text);
316 }
317 }
318 }
319}
320
322
323/* -------------------------------------------------------------------- */
326
327static void ApplySnapTranslation(TransInfo *t, float vec[3])
328{
329 float point[3];
330 getSnapPoint(t, point);
331
332 if (t->spacetype == SPACE_SEQ) {
335 }
336 else {
338 }
339 }
340 else {
341 if (t->spacetype == SPACE_VIEW3D) {
342 if (t->options & CTX_PAINT_CURVE) {
345 {
346 zero_v3(point); /* No good answer here... */
347 }
348 }
349 }
350
351 sub_v3_v3v3(vec, point, t->tsnap.snap_source);
352 }
353}
355{
356 if (!(t->tsnap.flag & SCE_SNAP_ABS_GRID)) {
357 return;
358 }
359
360 TranslateCustomData *custom_data = static_cast<TranslateCustomData *>(t->custom.mode.data);
362 /* Use a fallback when transforming the cursor.
363 * In this case the center is _not_ derived from the cursor which is being transformed. */
364 custom_data->snap_target_grid = TRANS_DATA_CONTAINER_FIRST_SINGLE(t)->data->iloc;
365 }
366 else if (t->around == V3D_AROUND_CURSOR) {
367 /* Use a fallback for cursor selection,
368 * this isn't useful as a global center for absolute grid snapping
369 * since its not based on the position of the selection. */
371 }
372 else {
373 custom_data->snap_target_grid = t->center_global;
374 }
375}
376
377static bool translate_snap_increment(const TransInfo *t, float *r_val)
378{
379 if (!transform_snap_increment_ex(t, (t->con.mode & CON_APPLY) != 0, r_val)) {
380 return false;
381 }
382
383 if (t->tsnap.flag & SCE_SNAP_ABS_GRID) {
384 TranslateCustomData *custom_data = static_cast<TranslateCustomData *>(t->custom.mode.data);
385
386 float3 absolute_grid_snap_offset = custom_data->snap_target_grid;
387 transform_snap_increment_ex(t, (t->con.mode & CON_APPLY) != 0, absolute_grid_snap_offset);
388 absolute_grid_snap_offset -= custom_data->snap_target_grid;
389 add_v3_v3(r_val, absolute_grid_snap_offset);
390
391 if (t->con.mode & CON_APPLY) {
392 t->con.applyVec(t, nullptr, nullptr, r_val, r_val);
393 }
394 }
395 return true;
396}
397
399
400/* -------------------------------------------------------------------- */
403
404static void applyTranslationValue(TransInfo *t, const float vec[3])
405{
406 TranslateCustomData *custom_data = static_cast<TranslateCustomData *>(t->custom.mode.data);
407
409
411 rotate_mode = TRANSLATE_ROTATE_ON;
412 }
413
414 /* Check to see if this needs to be re-enabled. */
415 if (rotate_mode == TRANSLATE_ROTATE_OFF) {
416 if (t->flag & T_POINTS) {
417 /* When transforming points, only use rotation when snapping is enabled
418 * since re-applying translation without rotation removes rotation. */
419 }
420 else {
421 /* When transforming data that itself stores rotation (objects, bones etc),
422 * apply rotation if it was applied (with the snap normal) previously.
423 * This is needed because failing to rotate will leave the rotation at the last
424 * value used before snapping was disabled. */
425 if (custom_data->prev.rotate_mode == TRANSLATE_ROTATE_ON) {
426 rotate_mode = TRANSLATE_ROTATE_RESET;
427 }
428 }
429 }
430
432 float3 snap_source_local(0);
433 if (rotate_mode != TRANSLATE_ROTATE_OFF) {
434 snap_source_local = t->tsnap.snap_source;
435 if (tc->use_local_mat) {
436 /* The pivot has to be in local-space (see #49494). */
437 snap_source_local = math::transform_point(float4x4(tc->imat), snap_source_local);
438 }
439 }
440
441 threading::parallel_for(IndexRange(tc->data_len), 1024, [&](const IndexRange range) {
442 for (const int i : range) {
443 TransData *td = &tc->data[i];
444 TransDataExtension *td_ext = tc->data_ext ? &tc->data_ext[i] : nullptr;
445 if (td->flag & TD_SKIP) {
446 continue;
447 }
448 transdata_elem_translate(t, tc, td, td_ext, snap_source_local, vec, rotate_mode);
449 }
450 });
451 }
452
453 custom_data->prev.rotate_mode = rotate_mode;
454}
455
456static bool clip_uv_transform_translation(TransInfo *t, float vec[2])
457{
458 /* Stores the coordinates of the closest UDIM tile.
459 * Also acts as an offset to the tile from the origin of UV space. */
460 float base_offset[2] = {0.0f, 0.0f};
461
462 /* If tiled image then constrain to correct/closest UDIM tile, else 0-1 UV space. */
463 const SpaceImage *sima = t->area->spacedata.first_as<SpaceImage>();
465
466 float min[2], max[2];
467 min[0] = min[1] = FLT_MAX;
468 max[0] = max[1] = -FLT_MAX;
469
471 for (TransData *td = tc->data; td < tc->data + tc->data_len; td++) {
472 minmax_v2v2_v2(min, max, td->loc);
473 }
474 }
475
476 bool result = false;
477 if (min[0] < base_offset[0]) {
478 vec[0] += base_offset[0] - min[0];
479 result = true;
480 }
481 else if (max[0] > base_offset[0] + t->aspect[0]) {
482 vec[0] -= max[0] - base_offset[0] - t->aspect[0];
483 result = true;
484 }
485
486 if (min[1] < base_offset[1]) {
487 vec[1] += base_offset[1] - min[1];
488 result = true;
489 }
490 else if (max[1] > base_offset[1] + t->aspect[1]) {
491 vec[1] -= max[1] - base_offset[1] - t->aspect[1];
492 result = true;
493 }
494
495 return result;
496}
497
499{
500 char str[UI_MAX_DRAW_STR] = "";
501 float global_dir[3] = {0.0f};
502
503 if (t->flag & T_INPUT_IS_VALUES_FINAL) {
504 mul_v3_m3v3(global_dir, t->spacemtx, t->values);
505 }
506 else if (applyNumInput(&t->num, global_dir)) {
507 if (t->con.mode & CON_APPLY) {
508 constraintNumInput(t, global_dir);
509 mul_v3_m3v3(global_dir, t->spacemtx, global_dir);
510 }
511 if (t->flag & T_2D_EDIT) {
512 removeAspectRatio(t, global_dir);
513 }
514 }
515 else {
516 copy_v3_v3(global_dir, t->values);
518 float values_ofs[3];
519 mul_v3_m3v3(values_ofs, t->spacemtx, t->values_modal_offset);
520 add_v3_v3(global_dir, values_ofs);
521 }
522
523 transform_snap_mixed_apply(t, global_dir);
524
525 if (t->con.mode & CON_APPLY) {
526 float in[3];
527 copy_v3_v3(in, global_dir);
528 t->con.applyVec(t, nullptr, nullptr, in, global_dir);
529 }
530
531 float incr_dir[3];
532 copy_v3_v3(incr_dir, global_dir);
533 if (!(transform_snap_is_active(t) && validSnap(t)) && translate_snap_increment(t, incr_dir)) {
534
535 /* Test for mixed snap with grid. */
536 float snap_dist_sq = FLT_MAX;
538 snap_dist_sq = len_squared_v3v3(t->values, global_dir);
539 }
540 if ((snap_dist_sq == FLT_MAX) || (len_squared_v3v3(global_dir, incr_dir) < snap_dist_sq)) {
541 copy_v3_v3(global_dir, incr_dir);
542 }
543 }
544 }
545
546 applyTranslationValue(t, global_dir);
547
548 /* Evil hack - redo translation if clipping needed. */
549 if (t->flag & T_CLIP_UV && clip_uv_transform_translation(t, global_dir)) {
550 applyTranslationValue(t, global_dir);
551
552 /* Not ideal, see #clipUVData code-comment. */
553 if (t->flag & T_PROP_EDIT) {
554 clipUVData(t);
555 }
556 }
557
558 /* Set the redo value. */
559 mul_v3_m3v3(t->values_final, t->spacemtx_inv, global_dir);
560 headerTranslation(t, (t->con.mode & CON_APPLY) ? t->values_final : global_dir, str);
561
562 recalc_data(t);
563 ED_area_status_text(t->area, (str[0] == '\0') ? nullptr : str);
564}
565
566static void applyTranslationMatrix(TransInfo *t, float mat_xform[4][4])
567{
568 float delta[3];
569 mul_v3_m3v3(delta, t->spacemtx, t->values_final);
570 add_v3_v3(mat_xform[3], delta);
571}
572
573static void initTranslation(TransInfo *t, wmOperator * /*op*/)
574{
575 if (t->spacetype == SPACE_ACTION) {
576 /* This space uses time translate. */
578 RPT_ERROR,
579 "Use 'Time_Translate' transform mode instead of 'Translation' mode "
580 "for translating keyframes in Dope Sheet Editor");
581 t->state = TRANS_CANCEL;
582 return;
583 }
584
586
587 t->idx_max = (t->flag & T_2D_EDIT) ? 1 : 2;
588 t->num.flag = 0;
589 t->num.idx_max = t->idx_max;
590
591 float3 aspect = t->aspect;
592 /* Custom aspect for fcurve. */
593 if ((t->spacetype == SPACE_GRAPH) && (t->region != nullptr)) {
594 View2D *v2d = &t->region->v2d;
595 Scene *scene = t->scene;
596 SpaceGraph *sipo = t->area->spacedata.first_as<SpaceGraph>();
597 const bool display_seconds = (sipo->mode == SIPO_MODE_ANIMATION) &&
598 (sipo->flag & SIPO_DRAWTIME);
599 aspect[0] = ui::view2d_grid_resolution_x(v2d, scene, display_seconds);
600 aspect[1] = ui::view2d_grid_resolution_y__values(v2d, 10);
601 }
602
603 t->increment = t->snap_spatial * aspect;
605
606 copy_v3_fl(t->num.val_inc, t->increment[0]);
607 t->num.unit_sys = t->scene->unit.system;
608 if (t->spacetype == SPACE_VIEW3D) {
609 /* Handling units makes only sense in 3Dview... See #38877. */
613 }
614 else {
615 /* SPACE_GRAPH, SPACE_ACTION, etc. could use some time units, when we have them... */
616 t->num.unit_type[0] = B_UNIT_NONE;
617 t->num.unit_type[1] = B_UNIT_NONE;
618 t->num.unit_type[2] = B_UNIT_NONE;
619 }
620
623
625 custom_data->prev.rotate_mode = TRANSLATE_ROTATE_OFF;
626 t->custom.mode.data = custom_data;
627 t->custom.mode.use_free = true;
628
630}
631
633
635 /*flags*/ 0,
636 /*init_fn*/ initTranslation,
637 /*transform_fn*/ applyTranslation,
638 /*transform_matrix_fn*/ applyTranslationMatrix,
639 /*handle_event_fn*/ nullptr,
640 /*snap_distance_fn*/ transform_snap_distance_len_squared_fn,
641 /*snap_apply_fn*/ ApplySnapTranslation,
642 /*draw_fn*/ nullptr,
643 /*status_fn*/ nullptr,
644};
645
646} // namespace blender::ed::transform
#define STRNCPY_UTF8(dst, src)
#define IFACE_(msgid)
#define NUM_STR_REP_LEN
Read Blender memory allocation and freeing.
#define UI_MAX_DRAW_STR
btScalar max
constexpr IndexRange()=default
#define str(s)
#define FLT_MAX
void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
static void transdata_elem_translate(const TransInfo *t, const TransDataContainer *tc, TransData *td, TransDataExtension *td_ext, const float3 &snap_source_local, const float3 &vec, enum eTranslateRotateMode rotate_mode)
void recalc_data(TransInfo *t)
void clipUVData(TransInfo *t)
void getSnapPoint(const TransInfo *t, float vec[3])
static void applyTranslation(TransInfo *t)
bool validSnappingNormal(const TransInfo *t)
bool usingSnappingNormal(const TransInfo *t)
void transform_snap_mixed_apply(TransInfo *t, float *vec)
static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_DRAW_STR])
static void translate_snap_increment_init(const TransInfo *t)
bool validSnap(const TransInfo *t)
void protectedTransBits(short protectflag, float vec[3])
void snap_sequencer_apply_seqslide(TransInfo *t, float *vec)
float transform_snap_distance_len_squared_fn(TransInfo *, const float p1[3], const float p2[3])
void snap_sequencer_image_apply_translate(TransInfo *t, float vec[2])
void ElementRotation_ex(const TransInfo *t, const TransDataContainer *tc, TransData *td, TransDataExtension *td_ext, const float mat[3][3], const float *center)
void transform_mode_default_modal_orientation_set(TransInfo *t, int type)
bool transform_snap_is_active(const TransInfo *t)
void tranform_snap_target_median_calc(const TransInfo *t, float r_median[3])
void snapFrameTransform(TransInfo *t, eSnapMode snap_mode, float val_initial, float val_final, float *r_val_final)
void removeAspectRatio(TransInfo *t, float vec[2])
static void applyTranslationMatrix(TransInfo *t, float mat_xform[4][4])
void constraintNumInput(TransInfo *t, float vec[3])
static void translate_dist_to_str(char *r_str, const int r_str_maxncpy, const float val, const UnitSettings &unit, const bool high_precision)
static bool translate_snap_increment(const TransInfo *t, float *r_val)
void constraintTransLim(const TransInfo *t, const TransDataContainer *tc, TransData *td)
bool transform_snap_increment_ex(const TransInfo *t, bool use_local_space, float *r_val)
void applyAspectRatio(TransInfo *t, float vec[2])
static void applyTranslationValue(TransInfo *t, const float vec[3])
static void ApplySnapTranslation(TransInfo *t, float vec[3])
static void initTranslation(TransInfo *t, wmOperator *)
TransConvertTypeInfo TransConvertType_Cursor3D
static bool clip_uv_transform_translation(TransInfo *t, float vec[2])
VecBase< T, 3 > transform_direction(const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &direction)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
Definition BLI_task.hh:69
float view2d_grid_resolution_y__values(const View2D *v2d, int base)
float view2d_grid_resolution_x(const View2D *v2d, const Scene *scene, bool display_seconds)
UserDef U
Definition blender.cc:58
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void mul_m3_v3(const float M[3][3], float r[3])
@ V3D_PROJ_RET_OK
Definition ED_view3d.hh:273
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
char size_t BLI_strncpy_utf8_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
bool hasNumInput(const NumInput *n)
Definition numinput.cc:188
MatBase< float, 4, 4 > float4x4
std::string BLI_string_pad_number_sign(blender::StringRef str)
MINLINE void mul_v3_fl(float r[3], float f)
int BKE_image_find_nearest_tile_with_offset(const Image *image, const float co[2], float r_uv_offset[2]) ATTR_NONNULL(2
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
BMesh const char void * data
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
void ED_area_status_text(ScrArea *area, const char *str)
Definition area.cc:975
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
size_t BKE_unit_value_as_string_scaled(char *str, int str_maxncpy, double value, int prec, int type, const UnitSettings &settings, bool pad, bool do_unit_suffix)
Definition unit.cc:1944
MINLINE void zero_v3(float r[3])
MatBase< float, 3, 3 > float3x3
bool applyNumInput(NumInput *n, float *vec)
Definition numinput.cc:207
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void unit_m3(float m[3][3])
MINLINE void copy_v3_fl(float r[3], float f)
void outputNumInput(NumInput *n, char *str, const UnitSettings &unit_settings)
Definition numinput.cc:104
@ V3D_PROJ_TEST_NOP
Definition ED_view3d.hh:295
@ SNODE_INSERTOFS_DIR_RIGHT
VecBase< float, 3 > float3
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
@ B_UNIT_LENGTH
Definition BKE_unit.hh:166
@ B_UNIT_NONE
Definition BKE_unit.hh:165
size_t BLI_snprintf_utf8_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
void rotation_between_vecs_to_mat3(float m[3][3], const float v1[3], const float v2[3])
#define min(a, b)
Definition sort.cc:38
eRegion_Type regiontype
float val[NUM_MAX_ELEMENTS]
int unit_type[NUM_MAX_ELEMENTS]
float val_inc[NUM_MAX_ELEMENTS]
struct UnitSettings unit
ListBaseT< SpaceLink > spacedata
eGraphEdit_Flag flag
eGraphEdit_Mode mode
eSpaceNode_InsertOffsetDir insert_ofs_dir
void(*) applyVec(const TransInfo *t, const TransDataContainer *tc, const TransData *td, const float in[3], float r_out[3])
Definition transform.hh:606
TransConvertTypeInfo * data_type
Definition transform.hh:836
TransCustomDataContainer custom
struct blender::ed::transform::TranslateCustomData::@311253041043021253326321366016222211030317162316 prev
#define TRANS_DATA_CONTAINER_FIRST_OK(t)
Definition transform.hh:43
#define TRANS_DATA_CONTAINER_FIRST_SINGLE(t)
Definition transform.hh:45
#define T_PROP_EDIT_ALL
Definition transform.hh:34
#define FOREACH_TRANS_DATA_CONTAINER(t, th)
Definition transform.hh:48
conversion and adaptation of different datablocks to a common struct.
transform modes used by different operators.