Blender  V2.93
transform.h
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 #pragma once
25 
26 #include "ED_numinput.h"
27 #include "ED_transform.h"
28 #include "ED_view3d.h"
29 
30 #include "RE_engine.h"
31 
32 #include "DNA_listBase.h"
33 #include "DNA_object_enums.h"
34 
35 #include "DEG_depsgraph.h"
36 
37 #include "transform_data.h"
38 
39 /* use node center for transform instead of upper-left corner.
40  * disabled since it makes absolute snapping not work so nicely
41  */
42 // #define USE_NODE_CENTER
43 
44 /* -------------------------------------------------------------------- */
48 struct ARegion;
49 struct Depsgraph;
50 struct NumInput;
51 struct Object;
52 struct RNG;
53 struct ReportList;
54 struct Scene;
55 struct ScrArea;
56 struct SnapObjectContext;
57 struct TransDataContainer;
58 struct TransInfo;
59 struct TransSnap;
60 struct ViewLayer;
61 struct bContext;
62 struct wmEvent;
63 struct wmKeyConfig;
64 struct wmKeyMap;
65 struct wmOperator;
66 struct wmTimer;
67 
70 /* -------------------------------------------------------------------- */
75 typedef enum {
76  CTX_NONE = 0,
77 
78  /* These are similar to TransInfo::data_type. */
79  CTX_CAMERA = (1 << 0),
80  CTX_CURSOR = (1 << 1),
81  CTX_EDGE_DATA = (1 << 2),
82  CTX_GPENCIL_STROKES = (1 << 3),
83  CTX_MASK = (1 << 4),
84  CTX_MOVIECLIP = (1 << 5),
85  CTX_OBJECT = (1 << 6),
86  CTX_PAINT_CURVE = (1 << 7),
87  CTX_POSE_BONE = (1 << 8),
88  CTX_TEXTURE_SPACE = (1 << 9),
89 
90  CTX_NO_PET = (1 << 10),
91  CTX_NO_MIRROR = (1 << 11),
92  CTX_AUTOCONFIRM = (1 << 12),
97 } eTContext;
98 
100 typedef enum {
102  T_EDIT = 1 << 0,
104  T_POINTS = 1 << 1,
106  T_NO_CONSTRAINT = 1 << 2,
107  T_NULL_ONE = 1 << 3,
108  T_NO_ZERO = 1 << 4,
110 
111  T_PROP_EDIT = 1 << 5,
115 
116  T_V3D_ALIGN = 1 << 8,
118  T_2D_EDIT = 1 << 9,
119  T_CLIP_UV = 1 << 10,
120 
122  T_AUTOIK = 1 << 11,
123 
125  T_NO_MIRROR = 1 << 12,
126 
130 
132  T_MODAL = 1 << 14,
133 
135  T_NO_PROJECT = 1 << 15,
136 
137  T_RELEASE_CONFIRM = 1 << 16,
138 
140  T_ALT_TRANSFORM = 1 << 17,
141 
143  T_OVERRIDE_CENTER = 1 << 18,
144 
146 
147  T_CLNOR_REBUILD = 1 << 20,
148 
150  T_AUTOMERGE = 1 << 21,
152  T_AUTOSPLIT = 1 << 22,
153 } eTFlag;
154 
156 typedef enum {
158  MOD_PRECISION = 1 << 1,
159  MOD_SNAP = 1 << 2,
160  MOD_SNAP_INVERT = 1 << 3,
162 } eTModifier;
163 
165 typedef enum {
166  SNAP_FORCED = 1 << 0,
167  TARGET_INIT = 1 << 1,
168  /* Special flag for snap to grid. */
170  POINT_INIT = 1 << 3,
171  MULTI_POINTS = 1 << 4,
172 } eTSnap;
173 
175 typedef enum {
177  CON_APPLY = 1 << 0,
179  CON_AXIS0 = 1 << 1,
180  CON_AXIS1 = 1 << 2,
181  CON_AXIS2 = 1 << 3,
182  CON_SELECT = 1 << 4,
184  CON_NOFLIP = 1 << 5,
185  CON_USER = 1 << 6,
186 } eTConstraint;
187 
189 typedef enum {
194 } eTState;
195 
197 typedef enum {
201 } eRedrawFlag;
202 
204 typedef enum {
205  HLP_NONE = 0,
212 } eTHelpline;
213 
214 typedef enum {
215  TC_NONE = 0,
240 } eTConvertType;
241 
244 /* -------------------------------------------------------------------- */
250 enum {
268 
269  /* 18 and 19 used by number-input, defined in `ED_numinput.h`. */
270  // NUM_MODAL_INCREMENT_UP = 18,
271  // NUM_MODAL_INCREMENT_DOWN = 19,
272 
277 
280 
285 
288 
290 };
291 
294 typedef struct TransSnapPoint {
296  float co[3];
298 
299 typedef struct TransSnap {
300  short mode;
301  short target;
302  short modePoint;
303  short modeSelect;
304  bool align;
305  bool project;
306  bool snap_self;
307  bool peel;
310  /* Snapped Element Type (currently for objects only). */
311  char snapElem;
313  float snapPoint[3];
315  float snapTarget[3];
316  float snapTargetGrid[3];
317  float snapNormal[3];
321  double last;
322  void (*applySnap)(struct TransInfo *, float *);
323  void (*calcSnap)(struct TransInfo *, float *);
324  void (*targetSnap)(struct TransInfo *);
331  float (*distance)(struct TransInfo *t, const float p1[3], const float p2[3]);
332 
338 
339 typedef struct TransCon {
341  char text[50];
343  float pmtx[3][3];
346  int imval[2];
349  void (*drawExtra)(struct TransInfo *t);
350 
351  /* Note: if 'tc' is NULL, 'td' must also be NULL.
352  * For constraints that needs to draw differently from the other
353  * uses this instead of the generic draw function. */
354 
357  void (*applyVec)(struct TransInfo *t,
358  struct TransDataContainer *tc,
359  struct TransData *td,
360  const float in[3],
361  float out[3]);
363  void (*applySize)(struct TransInfo *t,
364  struct TransDataContainer *tc,
365  struct TransData *td,
366  float smat[3][3]);
368  void (*applyRot)(struct TransInfo *t,
369  struct TransDataContainer *tc,
370  struct TransData *td,
371  float vec[3],
372  float *angle);
374 
375 typedef struct MouseInput {
376  void (*apply)(struct TransInfo *t, struct MouseInput *mi, const double mval[2], float output[3]);
377  void (*post)(struct TransInfo *t, float values[3]);
378 
380  int imval[2];
381  bool precision;
383  float center[2];
384  float factor;
386  void *data;
387 
397  struct {
398  double prev[2];
399  double accum[2];
402 
403 typedef struct TransCustomData {
404  void *data;
405  void (*free_cb)(struct TransInfo *,
406  struct TransDataContainer *tc,
407  struct TransCustomData *custom_data);
408  unsigned int use_free : 1;
410 
411 typedef struct TransCenterData {
412  float global[3];
413  unsigned int is_set : 1;
415 
423 typedef struct TransCustomDataContainer {
425  union {
427  };
430 #define TRANS_CUSTOM_DATA_ELEM_MAX (sizeof(TransCustomDataContainer) / sizeof(TransCustomData))
431 
446 typedef struct TransDataContainer {
455 
457  int data_len;
460 
461  struct Object *obedit;
462 
463  float mat[4][4];
464  float imat[4][4];
466  float mat3[3][3];
467  float imat3[3][3];
468 
470  float mat3_unit[3][3];
471 
473  struct Object *poseobj;
474 
476  float center_local[3];
477 
482  bool is_active;
483 
489 
491  union {
492  struct {
496  };
497  /* For easy checking. */
499  };
500 
503 
504 typedef struct TransInfo {
507 
511 
514 
529 
531  void (*transform)(struct TransInfo *, const int[2]);
532  /* Event handler function that determines whether the viewport needs to be redrawn. */
533  eRedrawFlag (*handleEvent)(struct TransInfo *, const struct wmEvent *);
534 
537 
540 
543 
546 
548  float prop_size;
550  char proptext[20];
555  float aspect[3];
557  float center_global[3];
559  float center2d[2];
561  short idx_max;
563  float snap[2];
565  float snap_spatial[2];
568 
570  float viewmat[4][4];
572  float viewinv[4][4];
574  float persmat[4][4];
575  float persinv[4][4];
576  short persp;
577  short around;
579  char spacetype;
581  short obedit_type;
582 
584  float vec[3];
586  float mat[3][3];
587 
589  float spacemtx[3][3];
590  float spacemtx_inv[3][3];
592  char spacename[64];
593 
594  /*************** NEW STUFF *********************/
600 
602 
603  struct {
604  short type;
605  float matrix[3][3];
606  } orient[3];
607 
608  enum {
613 
615  short gizmo_flag;
616 
617  short prop_mode;
618 
620  float values[4];
621 
624 
628  float values_final[4];
629 
630  /* Axis members for modes that use an axis separate from the orientation (rotate & shear). */
631 
636 
639 
640  void *view;
642  struct bContext *context;
643  struct wmMsgBus *mbus;
644  struct ScrArea *area;
645  struct ARegion *region;
647  struct Scene *scene;
652  struct wmKeyMap *keymap;
656  int mval[2];
658  float zfac;
663 
665  struct RNG *rng;
666 
670 
673 /* -------------------------------------------------------------------- */
677 bool initTransform(struct bContext *C,
678  struct TransInfo *t,
679  struct wmOperator *op,
680  const struct wmEvent *event,
681  int mode);
682 void saveTransform(struct bContext *C, struct TransInfo *t, struct wmOperator *op);
683 int transformEvent(TransInfo *t, const struct wmEvent *event);
684 void transformApply(struct bContext *C, TransInfo *t);
685 int transformEnd(struct bContext *C, TransInfo *t);
686 
688 void setTransformViewAspect(TransInfo *t, float r_aspect[3]);
689 void convertViewVec(TransInfo *t, float r_vec[3], double dx, double dy);
690 void projectIntViewEx(TransInfo *t, const float vec[3], int adr[2], const eV3DProjTest flag);
691 void projectIntView(TransInfo *t, const float vec[3], int adr[2]);
692 void projectFloatViewEx(TransInfo *t, const float vec[3], float adr[2], const eV3DProjTest flag);
693 void projectFloatView(TransInfo *t, const float vec[3], float adr[2]);
694 
695 void applyAspectRatio(TransInfo *t, float vec[2]);
696 void removeAspectRatio(TransInfo *t, float vec[2]);
697 
698 struct wmKeyMap *transform_modal_keymap(struct wmKeyConfig *keyconf);
699 
702 /* -------------------------------------------------------------------- */
706 /* transform_gizmo.c */
707 #define GIZMO_AXIS_LINE_WIDTH 2.0f
708 
709 bool gimbal_axis(struct Object *ob, float gmat[3][3]);
710 void drawDial3d(const TransInfo *t);
711 
714 /* -------------------------------------------------------------------- */
718 bool transdata_check_local_islands(TransInfo *t, short around);
719 
722 /* -------------------------------------------------------------------- */
726 typedef enum {
742 
744  TransInfo *t, MouseInput *mi, const float center[2], const int mval[2], const bool precision);
746 void applyMouseInput(struct TransInfo *t,
747  struct MouseInput *mi,
748  const int mval[2],
749  float output[3]);
750 
751 void setCustomPoints(TransInfo *t, MouseInput *mi, const int start[2], const int end[2]);
752 void setCustomPointsFromDirection(TransInfo *t, MouseInput *mi, const float dir[2]);
753 void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *t, float values[3]));
754 
757 /* -------------------------------------------------------------------- */
761 void initTransInfo(struct bContext *C,
762  TransInfo *t,
763  struct wmOperator *op,
764  const struct wmEvent *event);
766 void postTrans(struct bContext *C, TransInfo *t);
769 
770 void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis, short options);
771 
772 /* DRAWLINE options flags */
773 #define DRAWLIGHT 1
774 
777 void recalcData(TransInfo *t);
778 
780 void calculateCenterLocal(TransInfo *t, const float center_global[3]);
781 
783 
784 /* API functions for getting center points */
785 void calculateCenterBound(TransInfo *t, float r_center[3]);
786 void calculateCenterMedian(TransInfo *t, float r_center[3]);
787 void calculateCenterCursor(TransInfo *t, float r_center[3]);
788 void calculateCenterCursor2D(TransInfo *t, float r_center[2]);
789 void calculateCenterCursorGraph2D(TransInfo *t, float r_center[2]);
790 bool calculateCenterActive(TransInfo *t, bool select_only, float r_center[3]);
791 
793 
794 void transform_data_ext_rotate(TransData *td, float mat[3][3], bool use_drot);
795 
797 
799 
800 /* TODO. transform_query.c */
802 
803 #define TRANSFORM_SNAP_MAX_PX 100.0f
804 #define TRANSFORM_DIST_INVALID -FLT_MAX
805 
806 /* Temp macros. */
807 
808 #define TRANS_DATA_CONTAINER_FIRST_OK(t) (&(t)->data_container[0])
809 /* For cases we _know_ there is only one handle. */
810 #define TRANS_DATA_CONTAINER_FIRST_SINGLE(t) \
811  (BLI_assert((t)->data_container_len == 1), (&(t)->data_container[0]))
812 
813 #define FOREACH_TRANS_DATA_CONTAINER(t, th) \
814  for (TransDataContainer *tc = (t)->data_container, \
815  *tc_end = (t)->data_container + (t)->data_container_len; \
816  th != tc_end; \
817  th++)
818 
819 #define FOREACH_TRANS_DATA_CONTAINER_INDEX(t, th, i) \
820  for (TransDataContainer *tc = ((i = 0), (t)->data_container), \
821  *tc_end = (t)->data_container + (t)->data_container_len; \
822  th != tc_end; \
823  th++, i++)
824 
typedef float(TangentPoint)[2]
unsigned int uint
Definition: BLI_sys_types.h:83
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
These structs are the foundation for all linked lists in the library system.
eTfmMode
Definition: ED_transform.h:43
eV3DProjTest
Definition: ED_view3d.h:192
NSNotificationCenter * center
_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
#define C
Definition: RandGen.cpp:39
#define output
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
CCL_NAMESPACE_BEGIN struct Options options
bool use_virtual_mval
Definition: transform.h:396
double accum[2]
Definition: transform.h:399
struct MouseInput::@563 virtual_mval
void(* apply)(struct TransInfo *t, struct MouseInput *mi, const double mval[2], float output[3])
Definition: transform.h:376
double prev[2]
Definition: transform.h:398
float center[2]
Definition: transform.h:383
int imval[2]
Definition: transform.h:380
void(* post)(struct TransInfo *t, float values[3])
Definition: transform.h:377
float precision_factor
Definition: transform.h:382
float factor
Definition: transform.h:384
void * data
Definition: transform.h:386
bool precision
Definition: transform.h:381
Definition: rand.cc:48
float global[3]
Definition: transform.h:412
unsigned int is_set
Definition: transform.h:413
void(* applyVec)(struct TransInfo *t, struct TransDataContainer *tc, struct TransData *td, const float in[3], float out[3])
Definition: transform.h:357
char text[50]
Definition: transform.h:341
void(* applySize)(struct TransInfo *t, struct TransDataContainer *tc, struct TransData *td, float smat[3][3])
Definition: transform.h:363
float pmtx[3][3]
Definition: transform.h:343
void(* drawExtra)(struct TransInfo *t)
Definition: transform.h:349
void(* applyRot)(struct TransInfo *t, struct TransDataContainer *tc, struct TransData *td, float vec[3], float *angle)
Definition: transform.h:368
int imval[2]
Definition: transform.h:346
eTConstraint mode
Definition: transform.h:348
TransCustomData type
Definition: transform.h:428
TransCustomData mode
Definition: transform.h:426
TransCustomData first_elem
Definition: transform.h:426
unsigned int use_free
Definition: transform.h:408
void(* free_cb)(struct TransInfo *, struct TransDataContainer *tc, struct TransCustomData *custom_data)
Definition: transform.h:405
float mat3_unit[3][3]
Definition: transform.h:470
TransCustomDataContainer custom
Definition: transform.h:501
float mat3[3][3]
Definition: transform.h:466
struct Object * obedit
Definition: transform.h:461
float mat[4][4]
Definition: transform.h:463
float center_local[3]
Definition: transform.h:476
char use_mirror_axis_any
Definition: transform.h:498
TransData * data
Definition: transform.h:448
TransDataExtension * data_ext
Definition: transform.h:450
float imat3[3][3]
Definition: transform.h:467
TransDataMirror * data_mirror
Definition: transform.h:454
float imat[4][4]
Definition: transform.h:464
TransData2D * data_2d
Definition: transform.h:452
struct Object * poseobj
Definition: transform.h:473
struct ToolSettings * settings
Definition: transform.h:649
eTfmMode mode
Definition: transform.h:528
short around
Definition: transform.h:577
void * view
Definition: transform.h:640
int mval[2]
Definition: transform.h:656
char spacetype
Definition: transform.h:579
enum TransInfo::@571 orient_curr
float viewinv[4][4]
Definition: transform.h:572
int orient_axis
Definition: transform.h:633
short persp
Definition: transform.h:576
float snap[2]
Definition: transform.h:563
eRedrawFlag redraw
Definition: transform.h:524
int data_len_all
Definition: transform.h:510
float spacemtx_inv[3][3]
Definition: transform.h:590
struct Depsgraph * depsgraph
Definition: transform.h:646
float prop_size
Definition: transform.h:548
void * draw_handle_cursor
Definition: transform.h:662
float center2d[2]
Definition: transform.h:559
char frame_side
Definition: transform.h:567
float values[4]
Definition: transform.h:620
char proptext[20]
Definition: transform.h:550
struct ScrArea * area
Definition: transform.h:644
TransSnap tsnap
Definition: transform.h:539
float zfac
Definition: transform.h:658
short idx_max
Definition: transform.h:561
struct ARegion * region
Definition: transform.h:645
float values_modal_offset[4]
Definition: transform.h:623
struct wmMsgBus * mbus
Definition: transform.h:643
eTState state
Definition: transform.h:522
struct ReportList * reports
Definition: transform.h:654
struct wmKeyMap * keymap
Definition: transform.h:652
struct ViewLayer * view_layer
Definition: transform.h:648
eTModifier modifiers
Definition: transform.h:520
float snap_spatial[2]
Definition: transform.h:565
NumInput num
Definition: transform.h:542
eTConvertType data_type
Definition: transform.h:513
TransCustomDataContainer custom
Definition: transform.h:668
eRedrawFlag(* handleEvent)(struct TransInfo *, const struct wmEvent *)
Definition: transform.h:533
float aspect[3]
Definition: transform.h:555
short prop_mode
Definition: transform.h:617
void(* transform)(struct TransInfo *, const int[2])
Definition: transform.h:531
float vec[3]
Definition: transform.h:584
eTHelpline helpline
Definition: transform.h:526
struct wmTimer * animtimer
Definition: transform.h:650
struct bContext * context
Definition: transform.h:642
bool remove_on_cancel
Definition: transform.h:638
int data_container_len
Definition: transform.h:506
eTFlag flag
Definition: transform.h:518
MouseInput mouse
Definition: transform.h:545
float persmat[4][4]
Definition: transform.h:574
short obedit_type
Definition: transform.h:581
TransDataContainer * data_container
Definition: transform.h:505
float viewmat[4][4]
Definition: transform.h:570
char spacename[64]
Definition: transform.h:592
struct TransInfo::@570 orient[3]
void * draw_handle_pixel
Definition: transform.h:661
float values_final[4]
Definition: transform.h:628
bool is_orient_default_overwrite
Definition: transform.h:601
float mat[3][3]
Definition: transform.h:586
struct Scene * scene
Definition: transform.h:647
struct RNG * rng
Definition: transform.h:665
float matrix[3][3]
Definition: transform.h:605
TransCon con
Definition: transform.h:536
short gizmo_flag
Definition: transform.h:615
short launch_event
Definition: transform.h:596
float center_global[3]
Definition: transform.h:557
bool is_launch_event_tweak
Definition: transform.h:599
float spacemtx[3][3]
Definition: transform.h:589
int orient_axis_ortho
Definition: transform.h:635
eTContext options
Definition: transform.h:516
float persinv[4][4]
Definition: transform.h:575
short type
Definition: transform.h:604
void * draw_handle_view
Definition: transform.h:660
void * draw_handle_apply
Definition: transform.h:659
float co[3]
Definition: transform.h:296
struct TransSnapPoint * next
Definition: transform.h:295
struct TransSnapPoint * prev
Definition: transform.h:295
short target
Definition: transform.h:301
struct SnapObjectContext * object_context
Definition: transform.h:336
float snapNormal[3]
Definition: transform.h:317
TransSnapPoint * selectedPoint
Definition: transform.h:320
eTSnap status
Definition: transform.h:309
ListBase points
Definition: transform.h:319
void(* calcSnap)(struct TransInfo *, float *)
Definition: transform.h:323
short modeSelect
Definition: transform.h:303
bool snap_self
Definition: transform.h:306
char snapElem
Definition: transform.h:311
float snapTargetGrid[3]
Definition: transform.h:316
float(* distance)(struct TransInfo *t, const float p1[3], const float p2[3])
Definition: transform.h:331
short mode
Definition: transform.h:300
bool align
Definition: transform.h:304
char snapNodeBorder
Definition: transform.h:318
float snapPoint[3]
Definition: transform.h:313
void(* targetSnap)(struct TransInfo *)
Definition: transform.h:324
bool use_backface_culling
Definition: transform.h:308
double last
Definition: transform.h:321
bool project
Definition: transform.h:305
float snapTarget[3]
Definition: transform.h:315
void(* applySnap)(struct TransInfo *, float *)
Definition: transform.h:322
bool peel
Definition: transform.h:307
short modePoint
Definition: transform.h:302
bool gimbal_axis(struct Object *ob, float gmat[3][3])
void calculateCenter(TransInfo *t)
MouseInputMode
Definition: transform.h:726
@ INPUT_TRACKBALL
Definition: transform.h:734
@ INPUT_VERTICAL_ABSOLUTE
Definition: transform.h:738
@ INPUT_SPRING
Definition: transform.h:729
@ INPUT_VECTOR
Definition: transform.h:728
@ INPUT_ANGLE_SPRING
Definition: transform.h:733
@ INPUT_CUSTOM_RATIO_FLIP
Definition: transform.h:740
@ INPUT_HORIZONTAL_RATIO
Definition: transform.h:735
@ INPUT_VERTICAL_RATIO
Definition: transform.h:737
@ INPUT_CUSTOM_RATIO
Definition: transform.h:739
@ INPUT_HORIZONTAL_ABSOLUTE
Definition: transform.h:736
@ INPUT_SPRING_DELTA
Definition: transform.h:731
@ INPUT_NONE
Definition: transform.h:727
@ INPUT_ANGLE
Definition: transform.h:732
@ INPUT_SPRING_FLIP
Definition: transform.h:730
bool calculateCenterActive(TransInfo *t, bool select_only, float r_center[3])
void transform_data_ext_rotate(TransData *td, float mat[3][3], bool use_drot)
eTSnap
Definition: transform.h:165
@ TARGET_GRID_INIT
Definition: transform.h:169
@ POINT_INIT
Definition: transform.h:170
@ MULTI_POINTS
Definition: transform.h:171
@ SNAP_FORCED
Definition: transform.h:166
@ TARGET_INIT
Definition: transform.h:167
void projectFloatViewEx(TransInfo *t, const float vec[3], float adr[2], const eV3DProjTest flag)
Definition: transform.c:348
struct TransCenterData TransCenterData
eTConstraint
Definition: transform.h:175
@ CON_NOFLIP
Definition: transform.h:184
@ CON_APPLY
Definition: transform.h:177
@ CON_SELECT
Definition: transform.h:182
@ CON_AXIS1
Definition: transform.h:180
@ CON_USER
Definition: transform.h:185
@ CON_AXIS0
Definition: transform.h:179
@ CON_AXIS2
Definition: transform.h:181
void calculateCenterCursor2D(TransInfo *t, float r_center[2])
int transformEnd(struct bContext *C, TransInfo *t)
Definition: transform.c:1925
void recalcData(TransInfo *t)
eTContext
Definition: transform.h:75
@ CTX_MOVIECLIP
Definition: transform.h:84
@ CTX_PAINT_CURVE
Definition: transform.h:86
@ CTX_AUTOCONFIRM
Definition: transform.h:92
@ CTX_CURSOR
Definition: transform.h:80
@ CTX_OBMODE_XFORM_OBDATA
Definition: transform.h:94
@ CTX_POSE_BONE
Definition: transform.h:87
@ CTX_OBMODE_XFORM_SKIP_CHILDREN
Definition: transform.h:96
@ CTX_OBJECT
Definition: transform.h:85
@ CTX_EDGE_DATA
Definition: transform.h:81
@ CTX_NONE
Definition: transform.h:76
@ CTX_GPENCIL_STROKES
Definition: transform.h:82
@ CTX_MASK
Definition: transform.h:83
@ CTX_TEXTURE_SPACE
Definition: transform.h:88
@ CTX_NO_MIRROR
Definition: transform.h:91
@ CTX_NO_PET
Definition: transform.h:90
@ CTX_CAMERA
Definition: transform.h:79
eTModifier
Definition: transform.h:156
@ MOD_SNAP_INVERT
Definition: transform.h:160
@ MOD_CONSTRAINT_SELECT_AXIS
Definition: transform.h:157
@ MOD_PRECISION
Definition: transform.h:158
@ MOD_CONSTRAINT_SELECT_PLANE
Definition: transform.h:161
@ MOD_SNAP
Definition: transform.h:159
bool checkUseAxisMatrix(TransInfo *t)
Definition: transform.c:1965
void resetTransRestrictions(TransInfo *t)
struct TransInfo TransInfo
struct Object * transform_object_deform_pose_armature_get(const TransInfo *t, struct Object *ob)
void postTrans(struct bContext *C, TransInfo *t)
void calculateCenter2D(TransInfo *t)
struct TransSnapPoint TransSnapPoint
void calculateCenterCursorGraph2D(TransInfo *t, float r_center[2])
void transformApply(struct bContext *C, TransInfo *t)
Definition: transform.c:1891
eRedrawFlag
Definition: transform.h:197
@ TREDRAW_NOTHING
Definition: transform.h:198
@ TREDRAW_SOFT
Definition: transform.h:200
@ TREDRAW_HARD
Definition: transform.h:199
void applyMouseInput(struct TransInfo *t, struct MouseInput *mi, const int mval[2], float output[3])
void freeCustomNormalArray(TransInfo *t, TransDataContainer *tc, TransCustomData *custom_data)
void setCustomPoints(TransInfo *t, MouseInput *mi, const int start[2], const int end[2])
void calculateCenterMedian(TransInfo *t, float r_center[3])
void setTransformViewAspect(TransInfo *t, float r_aspect[3])
Definition: transform.c:113
struct TransCustomData TransCustomData
eTFlag
Definition: transform.h:100
@ T_OVERRIDE_CENTER
Definition: transform.h:143
@ T_PROP_EDIT_ALL
Definition: transform.h:114
@ T_RELEASE_CONFIRM
Definition: transform.h:137
@ T_CLNOR_REBUILD
Definition: transform.h:147
@ T_MODAL
Definition: transform.h:132
@ T_AUTOSPLIT
Definition: transform.h:152
@ T_AUTOIK
Definition: transform.h:122
@ T_PROP_CONNECTED
Definition: transform.h:112
@ T_ALT_TRANSFORM
Definition: transform.h:140
@ T_NO_PROJECT
Definition: transform.h:135
@ T_AUTOMERGE
Definition: transform.h:150
@ T_NO_MIRROR
Definition: transform.h:125
@ T_ALL_RESTRICTIONS
Definition: transform.h:109
@ T_PROP_EDIT
Definition: transform.h:111
@ T_INPUT_IS_VALUES_FINAL
Definition: transform.h:129
@ T_V3D_ALIGN
Definition: transform.h:116
@ T_2D_EDIT
Definition: transform.h:118
@ T_POINTS
Definition: transform.h:104
@ T_NO_CONSTRAINT
Definition: transform.h:106
@ T_NULL_ONE
Definition: transform.h:107
@ T_CLIP_UV
Definition: transform.h:119
@ T_NO_ZERO
Definition: transform.h:108
@ T_EDIT
Definition: transform.h:102
@ T_MODAL_CURSOR_SET
Definition: transform.h:145
@ T_PROP_PROJECTED
Definition: transform.h:113
struct TransCon TransCon
void calculateCenterCursor(TransInfo *t, float r_center[3])
void resetTransModal(TransInfo *t)
bool transdata_check_local_islands(TransInfo *t, short around)
Definition: transform.c:79
int transformEvent(TransInfo *t, const struct wmEvent *event)
void restoreTransObjects(TransInfo *t)
struct MouseInput MouseInput
eTState
Definition: transform.h:189
@ TRANS_CONFIRM
Definition: transform.h:192
@ TRANS_STARTING
Definition: transform.h:190
@ TRANS_RUNNING
Definition: transform.h:191
@ TRANS_CANCEL
Definition: transform.h:193
void projectIntViewEx(TransInfo *t, const float vec[3], int adr[2], const eV3DProjTest flag)
Definition: transform.c:230
struct TransSnap TransSnap
void convertViewVec(TransInfo *t, float r_vec[3], double dx, double dy)
Definition: transform.c:180
void drawDial3d(const TransInfo *t)
void setInputPostFct(MouseInput *mi, void(*post)(struct TransInfo *t, float values[3]))
void removeAspectRatio(TransInfo *t, float vec[2])
Definition: transform.c:406
@ TFM_MODAL_AUTOIK_LEN_INC
Definition: transform.h:275
@ TFM_MODAL_PROPSIZE
Definition: transform.h:282
@ TFM_MODAL_AXIS_Y
Definition: transform.h:260
@ TFM_MODAL_RESIZE
Definition: transform.h:255
@ TFM_MODAL_AUTOCONSTRAINT
Definition: transform.h:286
@ TFM_MODAL_CONFIRM
Definition: transform.h:252
@ TFM_MODAL_EDGESLIDE_UP
Definition: transform.h:278
@ TFM_MODAL_ADD_SNAP
Definition: transform.h:266
@ TFM_MODAL_SNAP_TOGGLE
Definition: transform.h:258
@ TFM_MODAL_PLANE_X
Definition: transform.h:262
@ TFM_MODAL_EDGESLIDE_DOWN
Definition: transform.h:279
@ TFM_MODAL_REMOVE_SNAP
Definition: transform.h:267
@ TFM_MODAL_CONS_OFF
Definition: transform.h:265
@ TFM_MODAL_AUTOCONSTRAINTPLANE
Definition: transform.h:287
@ TFM_MODAL_AXIS_X
Definition: transform.h:259
@ TFM_MODAL_ROTATE
Definition: transform.h:254
@ TFM_MODAL_AUTOIK_LEN_DEC
Definition: transform.h:276
@ TFM_MODAL_PROPSIZE_UP
Definition: transform.h:273
@ TFM_MODAL_PLANE_Y
Definition: transform.h:263
@ TFM_MODAL_SNAP_INV_ON
Definition: transform.h:256
@ TFM_MODAL_AXIS_Z
Definition: transform.h:261
@ TFM_MODAL_INSERTOFS_TOGGLE_DIR
Definition: transform.h:284
@ TFM_MODAL_PLANE_Z
Definition: transform.h:264
@ TFM_MODAL_CANCEL
Definition: transform.h:251
@ TFM_MODAL_PROPSIZE_DOWN
Definition: transform.h:274
@ TFM_MODAL_PRECISION
Definition: transform.h:289
@ TFM_MODAL_TRANSLATE
Definition: transform.h:253
@ TFM_MODAL_SNAP_INV_OFF
Definition: transform.h:257
void saveTransform(struct bContext *C, struct TransInfo *t, struct wmOperator *op)
Definition: transform.c:1426
void calculatePropRatio(TransInfo *t)
bool initTransform(struct bContext *C, struct TransInfo *t, struct wmOperator *op, const struct wmEvent *event, int mode)
void applyTransObjects(TransInfo *t)
struct wmKeyMap * transform_modal_keymap(struct wmKeyConfig *keyconf)
Definition: transform.c:657
void setTransformViewMatrices(TransInfo *t)
Definition: transform.c:89
void setCustomPointsFromDirection(TransInfo *t, MouseInput *mi, const float dir[2])
void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis, short options)
void initTransInfo(struct bContext *C, TransInfo *t, struct wmOperator *op, const struct wmEvent *event)
struct TransDataContainer TransDataContainer
void calculateCenterLocal(TransInfo *t, const float center_global[3])
void freeTransCustomDataForMode(TransInfo *t)
void projectFloatView(TransInfo *t, const float vec[3], float adr[2])
Definition: transform.c:376
void initMouseInput(TransInfo *t, MouseInput *mi, const float center[2], const int mval[2], const bool precision)
struct TransCustomDataContainer TransCustomDataContainer
void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
eTHelpline
Definition: transform.h:204
@ HLP_HARROW
Definition: transform.h:208
@ HLP_ANGLE
Definition: transform.h:207
@ HLP_SPRING
Definition: transform.h:206
@ HLP_CARROW
Definition: transform.h:210
@ HLP_TRACKBALL
Definition: transform.h:211
@ HLP_NONE
Definition: transform.h:205
@ HLP_VARROW
Definition: transform.h:209
void projectIntView(TransInfo *t, const float vec[3], int adr[2])
Definition: transform.c:343
eTConvertType
Definition: transform.h:214
@ TC_NONE
Definition: transform.h:215
@ TC_PARTICLE_VERTS
Definition: transform.h:236
@ TC_ACTION_DATA
Definition: transform.h:216
@ TC_GRAPH_EDIT_DATA
Definition: transform.h:222
@ TC_POSE
Definition: transform.h:217
@ TC_LATTICE_VERTS
Definition: transform.h:224
@ TC_MASKING_DATA
Definition: transform.h:225
@ TC_CURSOR_IMAGE
Definition: transform.h:219
@ TC_CURVE_VERTS
Definition: transform.h:221
@ TC_PAINT_CURVE_VERTS
Definition: transform.h:235
@ TC_CURSOR_VIEW3D
Definition: transform.h:220
@ TC_MBALL_VERTS
Definition: transform.h:226
@ TC_MESH_EDGES
Definition: transform.h:228
@ TC_NLA_DATA
Definition: transform.h:231
@ TC_MESH_VERTS
Definition: transform.h:227
@ TC_OBJECT_TEXSPACE
Definition: transform.h:234
@ TC_SCULPT
Definition: transform.h:237
@ TC_NODE_DATA
Definition: transform.h:232
@ TC_MESH_SKIN
Definition: transform.h:229
@ TC_TRACKING_DATA
Definition: transform.h:239
@ TC_MESH_UV
Definition: transform.h:230
@ TC_SEQ_DATA
Definition: transform.h:238
@ TC_GPENCIL
Definition: transform.h:223
@ TC_OBJECT
Definition: transform.h:233
@ TC_ARMATURE_VERTS
Definition: transform.h:218
void applyAspectRatio(TransInfo *t, float vec[2])
Definition: transform.c:381
void calculateCenterBound(TransInfo *t, float r_center[3])