Blender  V3.3
transform_mode_translate.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #include <stdlib.h>
9 
10 #include "MEM_guardedalloc.h"
11 
12 #include "DNA_gpencil_types.h"
13 
14 #include "BLI_math.h"
15 #include "BLI_string.h"
16 #include "BLI_task.h"
17 
18 #include "BKE_context.h"
19 #include "BKE_image.h"
20 #include "BKE_report.h"
21 #include "BKE_unit.h"
22 
23 #include "ED_node.h"
24 #include "ED_screen.h"
25 
26 #include "WM_api.h"
27 
28 #include "UI_interface.h"
29 
30 #include "BLT_translation.h"
31 
32 #include "transform.h"
33 #include "transform_convert.h"
34 #include "transform_mode.h"
35 #include "transform_snap.h"
36 
37 /* -------------------------------------------------------------------- */
49 };
50 
56  struct {
58  } prev;
59 };
60 
63 /* -------------------------------------------------------------------- */
71  const TransInfo *t;
73  const float pivot_local[3];
74  const float vec[3];
76 };
77 
79  const TransDataContainer *tc,
80  TransData *td,
81  const float pivot_local[3],
82  const float vec[3],
83  enum eTranslateRotateMode rotate_mode)
84 {
85  float rotate_offset[3] = {0};
86  bool use_rotate_offset = false;
87 
88  /* Handle snapping rotation before doing the translation. */
89  if (rotate_mode != TRANSLATE_ROTATE_OFF) {
90  float mat[3][3];
91 
92  if (rotate_mode == TRANSLATE_ROTATE_RESET) {
93  unit_m3(mat);
94  }
95  else {
96  BLI_assert(rotate_mode == TRANSLATE_ROTATE_ON);
97 
98  const float *original_normal;
99 
100  /* In pose mode, we want to align normals with Y axis of bones. */
101  if (t->options & CTX_POSE_BONE) {
102  original_normal = td->axismtx[1];
103  }
104  else {
105  original_normal = td->axismtx[2];
106  }
107 
108  rotation_between_vecs_to_mat3(mat, original_normal, t->tsnap.snapNormal);
109  }
110 
111  ElementRotation_ex(t, tc, td, mat, pivot_local);
112 
113  if (td->loc) {
114  use_rotate_offset = true;
115  sub_v3_v3v3(rotate_offset, td->loc, td->iloc);
116  }
117  }
118 
119  float tvec[3];
120 
121  if (t->con.applyVec) {
122  t->con.applyVec(t, tc, td, vec, tvec);
123  }
124  else {
125  copy_v3_v3(tvec, vec);
126  }
127 
128  mul_m3_v3(td->smtx, tvec);
129 
130  if (use_rotate_offset) {
131  add_v3_v3(tvec, rotate_offset);
132  }
133 
134  if (t->options & CTX_GPENCIL_STROKES) {
135  /* Grease pencil multi-frame falloff. */
136  bGPDstroke *gps = (bGPDstroke *)td->extra;
137  if (gps != NULL) {
138  mul_v3_fl(tvec, td->factor * gps->runtime.multi_frame_falloff);
139  }
140  else {
141  mul_v3_fl(tvec, td->factor);
142  }
143  }
144  else {
145  /* Proportional editing falloff. */
146  mul_v3_fl(tvec, td->factor);
147  }
148 
149  protectedTransBits(td->protectflag, tvec);
150 
151  if (td->loc) {
152  add_v3_v3v3(td->loc, td->iloc, tvec);
153  }
154 
155  constraintTransLim(t, td);
156 }
157 
158 static void transdata_elem_translate_fn(void *__restrict iter_data_v,
159  const int iter,
160  const TaskParallelTLS *__restrict UNUSED(tls))
161 {
162  struct TransDataArgs_Translate *data = iter_data_v;
163  TransData *td = &data->tc->data[iter];
164  if (td->flag & TD_SKIP) {
165  return;
166  }
167  transdata_elem_translate(data->t, data->tc, td, data->pivot_local, data->vec, data->rotate_mode);
168 }
169 
172 /* -------------------------------------------------------------------- */
176 static void translate_dist_to_str(char *r_str,
177  const int len_max,
178  const float val,
179  const UnitSettings *unit)
180 {
181  if (unit) {
183  r_str, len_max, val * unit->scale_length, 4, B_UNIT_LENGTH, unit, false);
184  }
185  else {
186  /* Check range to prevent string buffer overflow. */
187  BLI_snprintf(r_str, len_max, IN_RANGE_INCL(val, -1e10f, 1e10f) ? "%.4f" : "%.4e", val);
188  }
189 }
190 
191 static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_DRAW_STR])
192 {
193  size_t ofs = 0;
194  char dvec_str[3][NUM_STR_REP_LEN];
195  char dist_str[NUM_STR_REP_LEN];
196  float dist;
197 
198  UnitSettings *unit = NULL;
199  if (!(t->flag & T_2D_EDIT)) {
200  unit = &t->scene->unit;
201  }
202 
203  if (hasNumInput(&t->num)) {
204  outputNumInput(&(t->num), dvec_str[0], &t->scene->unit);
205  dist = len_v3(t->num.val);
206  }
207  else {
208  float dvec[3];
209  copy_v3_v3(dvec, vec);
210  if (t->spacetype == SPACE_GRAPH) {
211  /* WORKAROUND:
212  * Special case where snapping is done in #recalData.
213  * Update the header based on the #center_local. */
214  const short autosnap = getAnimEdit_SnapMode(t);
215  float ival = TRANS_DATA_CONTAINER_FIRST_OK(t)->center_local[0];
216  float val = ival + dvec[0];
217  snapFrameTransform(t, autosnap, ival, val, &val);
218  dvec[0] = val - ival;
219  }
220 
221  if (t->con.mode & CON_APPLY) {
222  int i = 0;
223  if (t->con.mode & CON_AXIS0) {
224  dvec[i++] = dvec[0];
225  }
226  if (t->con.mode & CON_AXIS1) {
227  dvec[i++] = dvec[1];
228  }
229  if (t->con.mode & CON_AXIS2) {
230  dvec[i++] = dvec[2];
231  }
232  while (i != 3) {
233  dvec[i++] = 0.0f;
234  }
235  }
236 
237  if (t->flag & T_2D_EDIT) {
238  applyAspectRatio(t, dvec);
239  }
240 
241  dist = len_v3(dvec);
242 
243  for (int i = 0; i < 3; i++) {
244  translate_dist_to_str(dvec_str[i], sizeof(dvec_str[i]), dvec[i], unit);
245  }
246  }
247 
248  translate_dist_to_str(dist_str, sizeof(dist_str), dist, unit);
249 
250  if (t->flag & T_PROP_EDIT_ALL) {
251  char prop_str[NUM_STR_REP_LEN];
252  translate_dist_to_str(prop_str, sizeof(prop_str), t->prop_size, unit);
253 
254  ofs += BLI_snprintf_rlen(str + ofs,
255  UI_MAX_DRAW_STR - ofs,
256  "%s %s: %s ",
257  TIP_("Proportional Size"),
258  t->proptext,
259  prop_str);
260  }
261 
262  if (t->flag & T_AUTOIK) {
263  short chainlen = t->settings->autoik_chainlen;
264  if (chainlen) {
265  ofs += BLI_snprintf_rlen(
266  str + ofs, UI_MAX_DRAW_STR - ofs, TIP_("Auto IK Length: %d"), chainlen);
267  ofs += BLI_strncpy_rlen(str + ofs, " ", UI_MAX_DRAW_STR - ofs);
268  }
269  }
270 
271  if (t->con.mode & CON_APPLY) {
272  switch (t->num.idx_max) {
273  case 0:
274  ofs += BLI_snprintf_rlen(
275  str + ofs, UI_MAX_DRAW_STR - ofs, "D: %s (%s)%s", dvec_str[0], dist_str, t->con.text);
276  break;
277  case 1:
278  ofs += BLI_snprintf_rlen(str + ofs,
279  UI_MAX_DRAW_STR - ofs,
280  "D: %s D: %s (%s)%s",
281  dvec_str[0],
282  dvec_str[1],
283  dist_str,
284  t->con.text);
285  break;
286  case 2:
287  ofs += BLI_snprintf_rlen(str + ofs,
288  UI_MAX_DRAW_STR - ofs,
289  "D: %s D: %s D: %s (%s)%s",
290  dvec_str[0],
291  dvec_str[1],
292  dvec_str[2],
293  dist_str,
294  t->con.text);
295  break;
296  }
297  }
298  else {
299  if (t->flag & T_2D_EDIT) {
300  ofs += BLI_snprintf_rlen(str + ofs,
301  UI_MAX_DRAW_STR - ofs,
302  "Dx: %s Dy: %s (%s)%s",
303  dvec_str[0],
304  dvec_str[1],
305  dist_str,
306  t->con.text);
307  }
308  else {
309  ofs += BLI_snprintf_rlen(str + ofs,
310  UI_MAX_DRAW_STR - ofs,
311  "Dx: %s Dy: %s Dz: %s (%s)%s",
312  dvec_str[0],
313  dvec_str[1],
314  dvec_str[2],
315  dist_str,
316  t->con.text);
317  }
318  }
319 
320  if (t->spacetype == SPACE_NODE) {
321  SpaceNode *snode = (SpaceNode *)t->area->spacedata.first;
322 
323  if ((snode->flag & SNODE_SKIP_INSOFFSET) == 0) {
324  const char *str_old = BLI_strdup(str);
325  const char *str_dir = (snode->insert_ofs_dir == SNODE_INSERTOFS_DIR_RIGHT) ? TIP_("right") :
326  TIP_("left");
327  char str_km[64];
328 
330  t->keymap, TFM_MODAL_INSERTOFS_TOGGLE_DIR, true, str_km, sizeof(str_km));
331 
332  ofs += BLI_snprintf_rlen(str,
334  TIP_("Auto-offset set to %s - press %s to toggle direction | %s"),
335  str_dir,
336  str_km,
337  str_old);
338 
339  MEM_freeN((void *)str_old);
340  }
341  }
342 }
343 
344 static void ApplySnapTranslation(TransInfo *t, float vec[3])
345 {
346  float point[3];
347  getSnapPoint(t, point);
348 
349  if (t->spacetype == SPACE_NODE) {
350  char border = t->tsnap.snapNodeBorder;
351  if (border & (NODE_LEFT | NODE_RIGHT)) {
352  vec[0] = point[0] - t->tsnap.snapTarget[0];
353  }
354  if (border & (NODE_BOTTOM | NODE_TOP)) {
355  vec[1] = point[1] - t->tsnap.snapTarget[1];
356  }
357  }
358  else if (t->spacetype == SPACE_SEQ) {
360  }
361  else {
362  if (t->spacetype == SPACE_VIEW3D) {
363  if (t->options & CTX_PAINT_CURVE) {
365  V3D_PROJ_RET_OK) {
366  zero_v3(point); /* no good answer here... */
367  }
368  }
369  }
370 
371  sub_v3_v3v3(vec, point, t->tsnap.snapTarget);
372  }
373 }
374 
375 static void applyTranslationValue(TransInfo *t, const float vec[3])
376 {
377  struct TranslateCustomData *custom_data = t->custom.mode.data;
378 
380 
383  }
384 
385  /* Check to see if this needs to be re-enabled. */
387  if (t->flag & T_POINTS) {
388  /* When transforming points, only use rotation when snapping is enabled
389  * since re-applying translation without rotation removes rotation. */
390  }
391  else {
392  /* When transforming data that itself stores rotation (objects, bones etc),
393  * apply rotation if it was applied (with the snap normal) previously.
394  * This is needed because failing to rotate will leave the rotation at the last
395  * value used before snapping was disabled. */
396  if (custom_data->prev.rotate_mode == TRANSLATE_ROTATE_ON) {
398  }
399  }
400  }
401 
403  float pivot_local[3];
405  copy_v3_v3(pivot_local, t->tsnap.snapTarget);
406  /* The pivot has to be in local-space (see T49494) */
407  if (tc->use_local_mat) {
408  mul_m4_v3(tc->imat, pivot_local);
409  }
410  }
411 
412  if (tc->data_len < TRANSDATA_THREAD_LIMIT) {
413  TransData *td = tc->data;
414  for (int i = 0; i < tc->data_len; i++, td++) {
415  if (td->flag & TD_SKIP) {
416  continue;
417  }
418  transdata_elem_translate(t, tc, td, pivot_local, vec, rotate_mode);
419  }
420  }
421  else {
422  struct TransDataArgs_Translate data = {
423  .t = t,
424  .tc = tc,
425  .pivot_local = {UNPACK3(pivot_local)},
426  .vec = {UNPACK3(vec)},
427  .rotate_mode = rotate_mode,
428  };
429  TaskParallelSettings settings;
432  }
433  }
434 
435  custom_data->prev.rotate_mode = rotate_mode;
436 }
437 
439 {
440  /* Check if the current image in UV editor is a tiled image or not. */
441  const SpaceImage *sima = t->area->spacedata.first;
442  const Image *image = sima->image;
443  const bool is_tiled_image = image && (image->source == IMA_SRC_TILED);
444 
445  /* Stores the coordinates of the closest UDIM tile.
446  * Also acts as an offset to the tile from the origin of UV space. */
447  float base_offset[2] = {0.0f, 0.0f};
448 
449  /* If tiled image then constrain to correct/closest UDIM tile, else 0-1 UV space. */
450  if (is_tiled_image) {
451  BKE_image_find_nearest_tile_with_offset(image, t->center_global, base_offset);
452  }
453 
454  float min[2], max[2];
455  min[0] = min[1] = FLT_MAX;
456  max[0] = max[1] = -FLT_MAX;
457 
459  for (TransData *td = tc->data; td < tc->data + tc->data_len; td++) {
460  minmax_v2v2_v2(min, max, td->loc);
461  }
462  }
463 
464  bool result = false;
465  if (min[0] < base_offset[0]) {
466  vec[0] += base_offset[0] - min[0];
467  result = true;
468  }
469  else if (max[0] > base_offset[0] + t->aspect[0]) {
470  vec[0] -= max[0] - base_offset[0] - t->aspect[0];
471  result = true;
472  }
473 
474  if (min[1] < base_offset[1]) {
475  vec[1] += base_offset[1] - min[1];
476  result = true;
477  }
478  else if (max[1] > base_offset[1] + t->aspect[1]) {
479  vec[1] -= max[1] - base_offset[1] - t->aspect[1];
480  result = true;
481  }
482 
483  return result;
484 }
485 
486 static void applyTranslation(TransInfo *t, const int UNUSED(mval[2]))
487 {
488  char str[UI_MAX_DRAW_STR];
489  float global_dir[3] = {0.0f};
490 
491  if (t->flag & T_INPUT_IS_VALUES_FINAL) {
492  mul_v3_m3v3(global_dir, t->spacemtx, t->values);
493  }
494  else if (applyNumInput(&t->num, global_dir)) {
495  if (t->con.mode & CON_APPLY) {
496  if (t->con.mode & CON_AXIS0) {
497  mul_v3_v3fl(global_dir, t->spacemtx[0], global_dir[0]);
498  }
499  else if (t->con.mode & CON_AXIS1) {
500  mul_v3_v3fl(global_dir, t->spacemtx[1], global_dir[0]);
501  }
502  else if (t->con.mode & CON_AXIS2) {
503  mul_v3_v3fl(global_dir, t->spacemtx[2], global_dir[0]);
504  }
505  }
506  else {
507  mul_v3_m3v3(global_dir, t->spacemtx, global_dir);
508  }
509  if (t->flag & T_2D_EDIT) {
510  removeAspectRatio(t, global_dir);
511  }
512  }
513  else {
514  copy_v3_v3(global_dir, t->values);
515  if (!is_zero_v3(t->values_modal_offset)) {
516  float values_ofs[3];
517  mul_v3_m3v3(values_ofs, t->spacemtx, t->values_modal_offset);
518  add_v3_v3(global_dir, values_ofs);
519  }
520 
521  t->tsnap.snapElem = SCE_SNAP_MODE_NONE;
522  applySnappingAsGroup(t, global_dir);
523  transform_snap_grid(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, NULL, NULL, in, global_dir);
529  }
530 
531  float incr_dir[3];
532  copy_v3_v3(incr_dir, global_dir);
533  if (!(activeSnap(t) && validSnap(t)) &&
534  transform_snap_increment_ex(t, (t->con.mode & CON_APPLY) != 0, incr_dir)) {
535 
536  /* Test for mixed snap with grid. */
537  float snap_dist_sq = FLT_MAX;
538  if (t->tsnap.snapElem != SCE_SNAP_MODE_NONE) {
539  snap_dist_sq = len_squared_v3v3(t->values, global_dir);
540  }
541  if ((snap_dist_sq == FLT_MAX) || (len_squared_v3v3(global_dir, incr_dir) < snap_dist_sq)) {
542  copy_v3_v3(global_dir, incr_dir);
543  }
544  }
545  }
546 
547  applyTranslationValue(t, global_dir);
548 
549  /* evil hack - redo translation if clipping needed */
550  if (t->flag & T_CLIP_UV && clip_uv_transform_translation(t, global_dir)) {
551  applyTranslationValue(t, global_dir);
552 
553  /* In proportional edit it can happen that */
554  /* vertices in the radius of the brush end */
555  /* outside the clipping area */
556  /* XXX HACK - dg */
557  if (t->flag & T_PROP_EDIT) {
558  clipUVData(t);
559  }
560  }
561 
562  /* Set the redo value. */
563  mul_v3_m3v3(t->values_final, t->spacemtx_inv, global_dir);
564  headerTranslation(t, (t->con.mode & CON_APPLY) ? t->values_final : global_dir, str);
565 
566  recalcData(t);
567  ED_area_status_text(t->area, str);
568 }
569 
570 static void applyTranslationMatrix(TransInfo *t, float mat_xform[4][4])
571 {
572  float delta[3];
573  mul_v3_m3v3(delta, t->spacemtx, t->values_final);
574  add_v3_v3(mat_xform[3], delta);
575 }
576 
578 {
579  if (t->spacetype == SPACE_ACTION) {
580  /* this space uses time translate */
581  BKE_report(t->reports,
582  RPT_ERROR,
583  "Use 'Time_Translate' transform mode instead of 'Translation' mode "
584  "for translating keyframes in Dope Sheet Editor");
585  t->state = TRANS_CANCEL;
586  }
587 
588  t->transform = applyTranslation;
589  t->transform_matrix = applyTranslationMatrix;
590  t->tsnap.applySnap = ApplySnapTranslation;
591  t->tsnap.distance = transform_snap_distance_len_squared_fn;
592 
593  initMouseInputMode(t, &t->mouse, INPUT_VECTOR);
594 
595  t->idx_max = (t->flag & T_2D_EDIT) ? 1 : 2;
596  t->num.flag = 0;
597  t->num.idx_max = t->idx_max;
598 
599  copy_v2_v2(t->snap, t->snap_spatial);
600 
601  copy_v3_fl(t->num.val_inc, t->snap[0]);
602  t->num.unit_sys = t->scene->unit.system;
603  if (t->spacetype == SPACE_VIEW3D) {
604  /* Handling units makes only sense in 3Dview... See T38877. */
605  t->num.unit_type[0] = B_UNIT_LENGTH;
606  t->num.unit_type[1] = B_UNIT_LENGTH;
607  t->num.unit_type[2] = B_UNIT_LENGTH;
608  }
609  else {
610  /* SPACE_GRAPH, SPACE_ACTION, etc. could use some time units, when we have them... */
611  t->num.unit_type[0] = B_UNIT_NONE;
612  t->num.unit_type[1] = B_UNIT_NONE;
613  t->num.unit_type[2] = B_UNIT_NONE;
614  }
615 
617  t, (t->options & CTX_CAMERA) ? V3D_ORIENT_VIEW : V3D_ORIENT_GLOBAL);
618 
619  struct TranslateCustomData *custom_data = MEM_callocN(sizeof(*custom_data), __func__);
620  custom_data->prev.rotate_mode = TRANSLATE_ROTATE_OFF;
621  t->custom.mode.data = custom_data;
622  t->custom.mode.use_free = true;
623 }
624 
int BKE_image_find_nearest_tile_with_offset(const struct Image *image, const float co[2], float r_uv_offset[2]) ATTR_NONNULL(1
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition: report.c:83
@ B_UNIT_LENGTH
Definition: BKE_unit.h:101
@ B_UNIT_NONE
Definition: BKE_unit.h:100
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:46
void mul_m3_v3(const float M[3][3], float r[3])
Definition: math_matrix.c:926
void unit_m3(float m[3][3])
Definition: math_matrix.c:40
void mul_m4_v3(const float M[4][4], float r[3])
Definition: math_matrix.c:729
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
Definition: math_matrix.c:897
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 bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
Definition: math_vector.c:890
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
size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: string.c:120
size_t BLI_snprintf_rlen(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:42
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
void BLI_task_parallel_range(int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
Definition: task_range.cc:94
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
Definition: BLI_task.h:293
#define UNUSED(x)
#define UNPACK3(a)
#define IN_RANGE_INCL(a, b, c)
#define TIP_(msgid)
@ IMA_SRC_TILED
@ SCE_SNAP_MODE_NONE
@ SNODE_SKIP_INSOFFSET
@ SNODE_INSERTOFS_DIR_RIGHT
@ SPACE_ACTION
@ SPACE_NODE
@ SPACE_SEQ
@ SPACE_GRAPH
@ SPACE_VIEW3D
@ V3D_ORIENT_GLOBAL
@ V3D_ORIENT_VIEW
@ NODE_LEFT
Definition: ED_node.h:32
@ NODE_RIGHT
Definition: ED_node.h:33
@ NODE_BOTTOM
Definition: ED_node.h:31
@ NODE_TOP
Definition: ED_node.h:30
void outputNumInput(NumInput *n, char *str, struct UnitSettings *unit_settings)
Definition: numinput.c:87
#define NUM_STR_REP_LEN
Definition: ED_numinput.h:13
bool applyNumInput(NumInput *n, float *vec)
Definition: numinput.c:189
bool hasNumInput(const NumInput *n)
Definition: numinput.c:170
void ED_area_status_text(ScrArea *area, const char *str)
Definition: area.c:792
@ V3D_PROJ_TEST_NOP
Definition: ED_view3d.h:234
eV3DProjStatus ED_view3d_project_float_global(const struct ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
@ V3D_PROJ_RET_OK
Definition: ED_view3d.h:217
_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.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
#define UI_MAX_DRAW_STR
Definition: UI_interface.h:91
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
#define str(s)
IconTextureDrawCall border
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
#define min(a, b)
Definition: sort.c:35
#define TRANS_DATA_CONTAINER_FIRST_OK(t)
void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
#define FOREACH_TRANS_DATA_CONTAINER(t, th)
struct Image * image
const TransDataContainer * tc
enum eTranslateRotateMode rotate_mode
float smtx[3][3]
short protectflag
float axismtx[3][3]
struct TranslateCustomData::@618 prev
enum eTranslateRotateMode rotate_mode
bGPDstroke_Runtime runtime
void removeAspectRatio(TransInfo *t, float vec[2])
Definition: transform.c:396
void applyAspectRatio(TransInfo *t, float vec[2])
Definition: transform.c:371
void recalcData(TransInfo *t)
void clipUVData(TransInfo *t)
conversion and adaptation of different datablocks to a common struct.
@ TD_SKIP
#define TRANSDATA_THREAD_LIMIT
float max
void protectedTransBits(short protectflag, float vec[3])
void constraintTransLim(const TransInfo *t, TransData *td)
void ElementRotation_ex(const TransInfo *t, const 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 transdata_elem_translate_fn(void *__restrict iter_data_v, const int iter, const TaskParallelTLS *__restrict UNUSED(tls))
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])
@ TRANSLATE_ROTATE_ON
@ TRANSLATE_ROTATE_OFF
@ TRANSLATE_ROTATE_RESET
static void transdata_elem_translate(const TransInfo *t, const TransDataContainer *tc, TransData *td, const float pivot_local[3], const float vec[3], enum eTranslateRotateMode rotate_mode)
static void translate_dist_to_str(char *r_str, const int len_max, const float val, const UnitSettings *unit)
static bool clip_uv_transform_translation(TransInfo *t, float vec[2])
static void applyTranslationValue(TransInfo *t, const float vec[3])
static void applyTranslationMatrix(TransInfo *t, float mat_xform[4][4])
bool usingSnappingNormal(const TransInfo *t)
bool transform_snap_grid(TransInfo *t, float *val)
float transform_snap_distance_len_squared_fn(TransInfo *UNUSED(t), const float p1[3], const float p2[3])
bool validSnap(const TransInfo *t)
void applySnappingAsGroup(TransInfo *t, float *vec)
void getSnapPoint(const TransInfo *t, float vec[3])
bool transform_snap_increment_ex(const TransInfo *t, bool use_local_space, float *r_val)
bool validSnappingNormal(const TransInfo *t)
bool activeSnap(const TransInfo *t)
void snapFrameTransform(TransInfo *t, eAnimEdit_AutoSnap autosnap, float val_initial, float val_final, float *r_val_final)
short getAnimEdit_SnapMode(TransInfo *t)
void transform_snap_sequencer_apply_translate(TransInfo *t, float *vec)
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