Blender  V2.93
transform_mode_translate.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #include <stdlib.h>
25 
26 #include "MEM_guardedalloc.h"
27 
28 #include "DNA_gpencil_types.h"
29 
30 #include "BLI_math.h"
31 #include "BLI_string.h"
32 
33 #include "BKE_context.h"
34 #include "BKE_report.h"
35 #include "BKE_unit.h"
36 
37 #include "ED_node.h"
38 #include "ED_screen.h"
39 
40 #include "WM_api.h"
41 
42 #include "UI_interface.h"
43 
44 #include "BLT_translation.h"
45 
46 #include "transform.h"
47 #include "transform_convert.h"
48 #include "transform_mode.h"
49 #include "transform_snap.h"
50 
51 /* -------------------------------------------------------------------- */
60  struct {
63  } prev;
64 };
65 
68 /* -------------------------------------------------------------------- */
72 static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_DRAW_STR])
73 {
74  size_t ofs = 0;
75  char tvec[NUM_STR_REP_LEN * 3];
76  char distvec[NUM_STR_REP_LEN];
77  char autoik[NUM_STR_REP_LEN];
78  float dist;
79 
80  UnitSettings *unit = NULL;
81  if (!(t->flag & T_2D_EDIT)) {
82  unit = &t->scene->unit;
83  }
84 
85  if (hasNumInput(&t->num)) {
86  outputNumInput(&(t->num), tvec, &t->scene->unit);
87  dist = len_v3(t->num.val);
88  }
89  else {
90  float dvec[3];
91  if (t->con.mode & CON_APPLY) {
92  int i = 0;
93  zero_v3(dvec);
94  if (t->con.mode & CON_AXIS0) {
95  dvec[i++] = vec[0];
96  }
97  if (t->con.mode & CON_AXIS1) {
98  dvec[i++] = vec[1];
99  }
100  if (t->con.mode & CON_AXIS2) {
101  dvec[i++] = vec[2];
102  }
103  }
104  else {
105  copy_v3_v3(dvec, vec);
106  }
107 
108  if (t->flag & T_2D_EDIT) {
109  applyAspectRatio(t, dvec);
110  }
111 
112  dist = len_v3(dvec);
113 
114  if (unit) {
115  for (int i = 0; i < 3; i++) {
118  dvec[i] * unit->scale_length,
119  4,
121  unit,
122  true);
123  }
124  }
125  else {
126  BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.4f", dvec[0]);
127  BLI_snprintf(&tvec[NUM_STR_REP_LEN], NUM_STR_REP_LEN, "%.4f", dvec[1]);
128  BLI_snprintf(&tvec[NUM_STR_REP_LEN * 2], NUM_STR_REP_LEN, "%.4f", dvec[2]);
129  }
130  }
131 
132  if (unit) {
134  distvec, sizeof(distvec), dist * unit->scale_length, 4, B_UNIT_LENGTH, unit, false);
135  }
136  else if (dist > 1e10f || dist < -1e10f) {
137  /* prevent string buffer overflow */
138  BLI_snprintf(distvec, NUM_STR_REP_LEN, "%.4e", dist);
139  }
140  else {
141  BLI_snprintf(distvec, NUM_STR_REP_LEN, "%.4f", dist);
142  }
143 
144  if (t->flag & T_AUTOIK) {
145  short chainlen = t->settings->autoik_chainlen;
146 
147  if (chainlen) {
148  BLI_snprintf(autoik, NUM_STR_REP_LEN, TIP_("AutoIK-Len: %d"), chainlen);
149  }
150  else {
151  autoik[0] = '\0';
152  }
153  }
154  else {
155  autoik[0] = '\0';
156  }
157 
158  if (t->con.mode & CON_APPLY) {
159  switch (t->num.idx_max) {
160  case 0:
161  ofs += BLI_snprintf(str + ofs,
162  UI_MAX_DRAW_STR - ofs,
163  "D: %s (%s)%s %s %s",
164  &tvec[0],
165  distvec,
166  t->con.text,
167  t->proptext,
168  autoik);
169  break;
170  case 1:
171  ofs += BLI_snprintf(str + ofs,
172  UI_MAX_DRAW_STR - ofs,
173  "D: %s D: %s (%s)%s %s %s",
174  &tvec[0],
175  &tvec[NUM_STR_REP_LEN],
176  distvec,
177  t->con.text,
178  t->proptext,
179  autoik);
180  break;
181  case 2:
182  ofs += BLI_snprintf(str + ofs,
183  UI_MAX_DRAW_STR - ofs,
184  "D: %s D: %s D: %s (%s)%s %s %s",
185  &tvec[0],
186  &tvec[NUM_STR_REP_LEN],
187  &tvec[NUM_STR_REP_LEN * 2],
188  distvec,
189  t->con.text,
190  t->proptext,
191  autoik);
192  break;
193  }
194  }
195  else {
196  if (t->flag & T_2D_EDIT) {
197  ofs += BLI_snprintf(str + ofs,
198  UI_MAX_DRAW_STR - ofs,
199  "Dx: %s Dy: %s (%s)%s %s",
200  &tvec[0],
201  &tvec[NUM_STR_REP_LEN],
202  distvec,
203  t->con.text,
204  t->proptext);
205  }
206  else {
207  ofs += BLI_snprintf(str + ofs,
208  UI_MAX_DRAW_STR - ofs,
209  "Dx: %s Dy: %s Dz: %s (%s)%s %s %s",
210  &tvec[0],
211  &tvec[NUM_STR_REP_LEN],
212  &tvec[NUM_STR_REP_LEN * 2],
213  distvec,
214  t->con.text,
215  t->proptext,
216  autoik);
217  }
218  }
219 
220  if (t->flag & T_PROP_EDIT_ALL) {
221  ofs += BLI_snprintf(
222  str + ofs, UI_MAX_DRAW_STR - ofs, TIP_(" Proportional size: %.2f"), t->prop_size);
223  }
224 
225  if (t->spacetype == SPACE_NODE) {
226  SpaceNode *snode = (SpaceNode *)t->area->spacedata.first;
227 
228  if ((snode->flag & SNODE_SKIP_INSOFFSET) == 0) {
229  const char *str_old = BLI_strdup(str);
230  const char *str_dir = (snode->insert_ofs_dir == SNODE_INSERTOFS_DIR_RIGHT) ? TIP_("right") :
231  TIP_("left");
232  char str_km[64];
233 
235  t->keymap, TFM_MODAL_INSERTOFS_TOGGLE_DIR, true, str_km, sizeof(str_km));
236 
237  ofs += BLI_snprintf(str,
239  TIP_("Auto-offset set to %s - press %s to toggle direction | %s"),
240  str_dir,
241  str_km,
242  str_old);
243 
244  MEM_freeN((void *)str_old);
245  }
246  }
247 }
248 
249 static void ApplySnapTranslation(TransInfo *t, float vec[3])
250 {
251  float point[3];
252  getSnapPoint(t, point);
253 
254  if (t->spacetype == SPACE_NODE) {
255  char border = t->tsnap.snapNodeBorder;
256  if (border & (NODE_LEFT | NODE_RIGHT)) {
257  vec[0] = point[0] - t->tsnap.snapTarget[0];
258  }
259  if (border & (NODE_BOTTOM | NODE_TOP)) {
260  vec[1] = point[1] - t->tsnap.snapTarget[1];
261  }
262  }
263  else {
264  if (t->spacetype == SPACE_VIEW3D) {
265  if (t->options & CTX_PAINT_CURVE) {
266  if (ED_view3d_project_float_global(t->region, point, point, V3D_PROJ_TEST_NOP) !=
267  V3D_PROJ_RET_OK) {
268  zero_v3(point); /* no good answer here... */
269  }
270  }
271  }
272 
273  sub_v3_v3v3(vec, point, t->tsnap.snapTarget);
274  }
275 }
276 
277 static void applyTranslationValue(TransInfo *t, const float vec[3])
278 {
279  struct TranslateCustomData *custom_data = t->custom.mode.data;
280 
281  bool apply_snap_align_rotation = false;
282  bool is_valid_snapping_normal = false;
283 
287  }
288 
289  /* Check to see if this needs to be re-enabled. */
290  if (apply_snap_align_rotation == false) {
291  if (t->flag & T_POINTS) {
292  /* When transforming points, only use rotation when snapping is enabled
293  * since re-applying translation without rotation removes rotation. */
294  }
295  else {
296  /* When transforming data that it's self stores rotation (objects, bones etc),
297  * apply rotation if it was applied (with the snap normal) previously.
298  * This is needed because failing to rotate will leave the rotation at the last
299  * value used before snapping was disabled. */
300  if (custom_data->prev.apply_snap_align_rotation &&
301  custom_data->prev.is_valid_snapping_normal) {
304  }
305  }
306  }
307 
308  float tvec[3];
309 
310  /* The ideal would be "apply_snap_align_rotation" only when a snap point is found
311  * so, maybe inside this function is not the best place to apply this rotation.
312  * but you need "handle snapping rotation before doing the translation" (really?) */
314 
315  float pivot[3];
317  copy_v3_v3(pivot, t->tsnap.snapTarget);
318  /* The pivot has to be in local-space (see T49494) */
319  if (tc->use_local_mat) {
320  mul_m4_v3(tc->imat, pivot);
321  }
322  }
323 
324  TransData *td = tc->data;
325  for (int i = 0; i < tc->data_len; i++, td++) {
326  if (td->flag & TD_SKIP) {
327  continue;
328  }
329 
330  float rotate_offset[3] = {0};
331  bool use_rotate_offset = false;
332 
333  /* handle snapping rotation before doing the translation */
335  float mat[3][3];
336 
338  const float *original_normal;
339 
340  /* In pose mode, we want to align normals with Y axis of bones... */
341  if (t->options & CTX_POSE_BONE) {
342  original_normal = td->axismtx[1];
343  }
344  else {
345  original_normal = td->axismtx[2];
346  }
347 
348  rotation_between_vecs_to_mat3(mat, original_normal, t->tsnap.snapNormal);
349  }
350  else {
351  unit_m3(mat);
352  }
353 
354  ElementRotation_ex(t, tc, td, mat, pivot);
355 
356  if (td->loc) {
357  use_rotate_offset = true;
358  sub_v3_v3v3(rotate_offset, td->loc, td->iloc);
359  }
360  }
361 
362  if (t->con.applyVec) {
363  t->con.applyVec(t, tc, td, vec, tvec);
364  }
365  else {
366  copy_v3_v3(tvec, vec);
367  }
368 
369  mul_m3_v3(td->smtx, tvec);
370 
371  if (use_rotate_offset) {
372  add_v3_v3(tvec, rotate_offset);
373  }
374 
375  if (t->options & CTX_GPENCIL_STROKES) {
376  /* grease pencil multiframe falloff */
377  bGPDstroke *gps = (bGPDstroke *)td->extra;
378  if (gps != NULL) {
379  mul_v3_fl(tvec, td->factor * gps->runtime.multi_frame_falloff);
380  }
381  else {
382  mul_v3_fl(tvec, td->factor);
383  }
384  }
385  else {
386  /* proportional editing falloff */
387  mul_v3_fl(tvec, td->factor);
388  }
389 
390  protectedTransBits(td->protectflag, tvec);
391 
392  if (td->loc) {
393  add_v3_v3v3(td->loc, td->iloc, tvec);
394  }
395 
396  constraintTransLim(t, td);
397  }
398  }
399 
402 }
403 
404 static void applyTranslation(TransInfo *t, const int UNUSED(mval[2]))
405 {
406  char str[UI_MAX_DRAW_STR];
407  float global_dir[3] = {0.0f};
408 
409  if (t->flag & T_INPUT_IS_VALUES_FINAL) {
410  mul_v3_m3v3(global_dir, t->spacemtx, t->values);
411  }
412  else if (applyNumInput(&t->num, global_dir)) {
413  if (t->con.mode & CON_APPLY) {
414  if (t->con.mode & CON_AXIS0) {
415  mul_v3_v3fl(global_dir, t->spacemtx[0], global_dir[0]);
416  }
417  else if (t->con.mode & CON_AXIS1) {
418  mul_v3_v3fl(global_dir, t->spacemtx[1], global_dir[0]);
419  }
420  else if (t->con.mode & CON_AXIS2) {
421  mul_v3_v3fl(global_dir, t->spacemtx[2], global_dir[0]);
422  }
423  }
424  else {
425  mul_v3_m3v3(global_dir, t->spacemtx, global_dir);
426  }
427  if (t->flag & T_2D_EDIT) {
428  removeAspectRatio(t, global_dir);
429  }
430  }
431  else {
432  copy_v3_v3(global_dir, t->values);
433 
434  t->tsnap.snapElem = 0;
435  applySnapping(t, global_dir);
436  transform_snap_grid(t, global_dir);
437 
438  if (t->con.mode & CON_APPLY) {
439  float in[3];
440  copy_v3_v3(in, global_dir);
441  t->con.applyVec(t, NULL, NULL, in, global_dir);
442  }
443 
444  float incr_dir[3];
445  copy_v3_v3(incr_dir, global_dir);
446  if (!(activeSnap(t) && validSnap(t)) &&
447  transform_snap_increment_ex(t, (t->con.mode & CON_APPLY) != 0, incr_dir)) {
448 
449  /* Test for mixed snap with grid. */
450  float snap_dist_sq = FLT_MAX;
451  if (t->tsnap.snapElem != 0) {
452  snap_dist_sq = len_squared_v3v3(t->values, global_dir);
453  }
454  if ((snap_dist_sq == FLT_MAX) || (len_squared_v3v3(global_dir, incr_dir) < snap_dist_sq)) {
455  copy_v3_v3(global_dir, incr_dir);
456  }
457  }
458  }
459 
460  applyTranslationValue(t, global_dir);
461 
462  /* evil hack - redo translation if clipping needed */
463  if (t->flag & T_CLIP_UV && clipUVTransform(t, global_dir, 0)) {
464  applyTranslationValue(t, global_dir);
465 
466  /* In proportional edit it can happen that */
467  /* vertices in the radius of the brush end */
468  /* outside the clipping area */
469  /* XXX HACK - dg */
470  if (t->flag & T_PROP_EDIT) {
471  clipUVData(t);
472  }
473  }
474 
475  /* Set the redo value. */
476  mul_v3_m3v3(t->values_final, t->spacemtx_inv, global_dir);
477  headerTranslation(t, (t->con.mode & CON_APPLY) ? t->values_final : global_dir, str);
478 
479  recalcData(t);
480  ED_area_status_text(t->area, str);
481 }
482 
484 {
485  if (t->spacetype == SPACE_ACTION) {
486  /* this space uses time translate */
487  BKE_report(t->reports,
488  RPT_ERROR,
489  "Use 'Time_Translate' transform mode instead of 'Translation' mode "
490  "for translating keyframes in Dope Sheet Editor");
491  t->state = TRANS_CANCEL;
492  }
493 
494  t->transform = applyTranslation;
495  t->tsnap.applySnap = ApplySnapTranslation;
496  t->tsnap.distance = transform_snap_distance_len_squared_fn;
497 
498  initMouseInputMode(t, &t->mouse, INPUT_VECTOR);
499 
500  t->idx_max = (t->flag & T_2D_EDIT) ? 1 : 2;
501  t->num.flag = 0;
502  t->num.idx_max = t->idx_max;
503 
504  copy_v2_v2(t->snap, t->snap_spatial);
505 
506  copy_v3_fl(t->num.val_inc, t->snap[0]);
507  t->num.unit_sys = t->scene->unit.system;
508  if (t->spacetype == SPACE_VIEW3D) {
509  /* Handling units makes only sense in 3Dview... See T38877. */
510  t->num.unit_type[0] = B_UNIT_LENGTH;
511  t->num.unit_type[1] = B_UNIT_LENGTH;
512  t->num.unit_type[2] = B_UNIT_LENGTH;
513  }
514  else {
515  /* SPACE_GRAPH, SPACE_ACTION, etc. could use some time units, when we have them... */
516  t->num.unit_type[0] = B_UNIT_NONE;
517  t->num.unit_type[1] = B_UNIT_NONE;
518  t->num.unit_type[2] = B_UNIT_NONE;
519  }
520 
522  t, (t->options & CTX_CAMERA) ? V3D_ORIENT_VIEW : V3D_ORIENT_GLOBAL);
523 
524  struct TranslateCustomData *custom_data = MEM_callocN(sizeof(*custom_data), __func__);
525  custom_data->prev.apply_snap_align_rotation = false;
526  custom_data->prev.is_valid_snapping_normal = false;
527  t->custom.mode.data = custom_data;
528  t->custom.mode.use_free = true;
529 }
void BKE_report(ReportList *reports, ReportType type, const char *message)
Definition: report.c:104
@ B_UNIT_LENGTH
Definition: BKE_unit.h:79
@ B_UNIT_NONE
Definition: BKE_unit.h:78
size_t BKE_unit_value_as_string(char *str, int len_max, double value, int prec, int type, const struct UnitSettings *settings, bool pad)
#define BLI_assert(a)
Definition: BLI_assert.h:58
void mul_m3_v3(const float M[3][3], float r[3])
Definition: math_matrix.c:930
void unit_m3(float m[3][3])
Definition: math_matrix.c:58
void mul_m4_v3(const float M[4][4], float r[3])
Definition: math_matrix.c:732
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
Definition: math_matrix.c:901
void rotation_between_vecs_to_mat3(float m[3][3], const float v1[3], const float v2[3])
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
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])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:70
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
#define UNUSED(x)
#define TIP_(msgid)
@ SNODE_SKIP_INSOFFSET
@ SPACE_ACTION
@ SPACE_NODE
@ SPACE_VIEW3D
@ SNODE_INSERTOFS_DIR_RIGHT
@ V3D_ORIENT_GLOBAL
@ V3D_ORIENT_VIEW
@ NODE_LEFT
Definition: ED_node.h:47
@ NODE_RIGHT
Definition: ED_node.h:48
@ NODE_BOTTOM
Definition: ED_node.h:46
@ NODE_TOP
Definition: ED_node.h:45
void outputNumInput(NumInput *n, char *str, struct UnitSettings *unit_settings)
Definition: numinput.c:102
#define NUM_STR_REP_LEN
Definition: ED_numinput.h:27
bool applyNumInput(NumInput *n, float *vec)
Definition: numinput.c:207
bool hasNumInput(const NumInput *n)
Definition: numinput.c:185
void ED_area_status_text(ScrArea *area, const char *str)
Definition: area.c:815
@ V3D_PROJ_TEST_NOP
Definition: ED_view3d.h:193
@ V3D_PROJ_RET_OK
Definition: ED_view3d.h:176
eV3DProjStatus ED_view3d_project_float_global(const struct ARegion *region, const float co[3], float r_co[2], const eV3DProjTest flag)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Read Guarded memory(de)allocation.
#define UI_MAX_DRAW_STR
Definition: UI_interface.h:90
#define str(s)
IconTextureDrawCall border
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
float smtx[3][3]
short protectflag
float axismtx[3][3]
struct TranslateCustomData::@588 prev
bGPDstroke_Runtime runtime
void removeAspectRatio(TransInfo *t, float vec[2])
Definition: transform.c:406
void applyAspectRatio(TransInfo *t, float vec[2])
Definition: transform.c:381
@ INPUT_VECTOR
Definition: transform.h:728
@ CON_APPLY
Definition: transform.h:177
@ CON_AXIS1
Definition: transform.h:180
@ CON_AXIS0
Definition: transform.h:179
@ CON_AXIS2
Definition: transform.h:181
void recalcData(TransInfo *t)
@ CTX_PAINT_CURVE
Definition: transform.h:86
@ CTX_POSE_BONE
Definition: transform.h:87
@ CTX_GPENCIL_STROKES
Definition: transform.h:82
@ CTX_CAMERA
Definition: transform.h:79
@ T_PROP_EDIT_ALL
Definition: transform.h:114
@ T_AUTOIK
Definition: transform.h:122
@ T_PROP_EDIT
Definition: transform.h:111
@ T_INPUT_IS_VALUES_FINAL
Definition: transform.h:129
@ T_2D_EDIT
Definition: transform.h:118
@ T_POINTS
Definition: transform.h:104
@ T_CLIP_UV
Definition: transform.h:119
@ TRANS_CANCEL
Definition: transform.h:193
@ TFM_MODAL_INSERTOFS_TOGGLE_DIR
Definition: transform.h:284
void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
#define FOREACH_TRANS_DATA_CONTAINER(t, th)
Definition: transform.h:813
void clipUVData(TransInfo *t)
bool clipUVTransform(TransInfo *t, float vec[2], const bool resize)
conversion and adaptation of different datablocks to a common struct.
@ TD_SKIP
void protectedTransBits(short protectflag, float vec[3])
void constraintTransLim(TransInfo *t, TransData *td)
void ElementRotation_ex(TransInfo *t, TransDataContainer *tc, TransData *td, const float mat[3][3], const float *center)
void transform_mode_default_modal_orientation_set(TransInfo *t, int type)
transform modes used by different operators.
static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_DRAW_STR])
static void applyTranslation(TransInfo *t, const int UNUSED(mval[2]))
void initTranslation(TransInfo *t)
static void ApplySnapTranslation(TransInfo *t, float vec[3])
static void applyTranslationValue(TransInfo *t, const float vec[3])
bool usingSnappingNormal(const TransInfo *t)
bool transform_snap_grid(TransInfo *t, float *val)
void applySnapping(TransInfo *t, float *vec)
float transform_snap_distance_len_squared_fn(TransInfo *UNUSED(t), const float p1[3], const float p2[3])
bool validSnap(const TransInfo *t)
bool transform_snap_increment_ex(TransInfo *t, bool use_local_space, float *r_val)
void getSnapPoint(const TransInfo *t, float vec[3])
bool validSnappingNormal(const TransInfo *t)
bool activeSnap(const TransInfo *t)
int WM_modalkeymap_items_to_string(const wmKeyMap *km, const int propvalue, const bool compact, char *result, const int result_len)
Definition: wm_keymap.c:1230