Blender  V3.3
Classes
source/blender/editors/transform/transform.h File Reference
#include "ED_numinput.h"
#include "ED_transform.h"
#include "ED_view3d.h"
#include "DNA_listBase.h"
#include "DNA_object_enums.h"
#include "DNA_scene_types.h"
#include "DEG_depsgraph.h"
#include "transform_data.h"

Go to the source code of this file.

Classes

struct  TransSnapPoint
 
struct  TransSnap
 
struct  TransCon
 
struct  MouseInput
 
struct  TransCustomData
 
struct  TransCenterData
 
struct  TransCustomDataContainer
 
struct  TransDataContainer
 
struct  TransInfo
 

Enumerations

Keymap Modal Items
Note
these values are saved in key-map files, do not change then but just add new ones.
enum  {
  TFM_MODAL_CANCEL = 1 , TFM_MODAL_CONFIRM = 2 , TFM_MODAL_TRANSLATE = 3 , TFM_MODAL_ROTATE = 4 ,
  TFM_MODAL_RESIZE = 5 , TFM_MODAL_SNAP_INV_ON = 6 , TFM_MODAL_SNAP_INV_OFF = 7 , TFM_MODAL_SNAP_TOGGLE = 8 ,
  TFM_MODAL_AXIS_X = 9 , TFM_MODAL_AXIS_Y = 10 , TFM_MODAL_AXIS_Z = 11 , TFM_MODAL_PLANE_X = 12 ,
  TFM_MODAL_PLANE_Y = 13 , TFM_MODAL_PLANE_Z = 14 , TFM_MODAL_CONS_OFF = 15 , TFM_MODAL_ADD_SNAP = 16 ,
  TFM_MODAL_REMOVE_SNAP = 17 , TFM_MODAL_PROPSIZE_UP = 20 , TFM_MODAL_PROPSIZE_DOWN = 21 , TFM_MODAL_AUTOIK_LEN_INC = 22 ,
  TFM_MODAL_AUTOIK_LEN_DEC = 23 , TFM_MODAL_EDGESLIDE_UP = 24 , TFM_MODAL_EDGESLIDE_DOWN = 25 , TFM_MODAL_PROPSIZE = 26 ,
  TFM_MODAL_INSERTOFS_TOGGLE_DIR = 27 , TFM_MODAL_AUTOCONSTRAINT = 28 , TFM_MODAL_AUTOCONSTRAINTPLANE = 29 , TFM_MODAL_PRECISION = 30
}
 

Functions

Public Transform API
bool initTransform (struct bContext *C, struct TransInfo *t, struct wmOperator *op, const struct wmEvent *event, int mode)
 
void saveTransform (struct bContext *C, struct TransInfo *t, struct wmOperator *op)
 
int transformEvent (TransInfo *t, const struct wmEvent *event)
 
void transformApply (struct bContext *C, TransInfo *t)
 
int transformEnd (struct bContext *C, TransInfo *t)
 
void setTransformViewMatrices (TransInfo *t)
 
void setTransformViewAspect (TransInfo *t, float r_aspect[3])
 
void convertViewVec (TransInfo *t, float r_vec[3], double dx, double dy)
 
void projectIntViewEx (TransInfo *t, const float vec[3], int adr[2], eV3DProjTest flag)
 
void projectIntView (TransInfo *t, const float vec[3], int adr[2])
 
void projectFloatViewEx (TransInfo *t, const float vec[3], float adr[2], eV3DProjTest flag)
 
void projectFloatView (TransInfo *t, const float vec[3], float adr[2])
 
void applyAspectRatio (TransInfo *t, float vec[2])
 
void removeAspectRatio (TransInfo *t, float vec[2])
 
struct wmKeyMaptransform_modal_keymap (struct wmKeyConfig *keyconf)
 
bool transform_apply_matrix (TransInfo *t, float mat[4][4])
 
void transform_final_value_get (const TransInfo *t, float *value, int value_num)
 
TransData Creation and General Handling
bool transdata_check_local_islands (TransInfo *t, short around)
 

Enums and Flags

#define T_ALL_RESTRICTIONS   (T_NO_CONSTRAINT | T_NULL_ONE)
 
#define T_PROP_EDIT_ALL   (T_PROP_EDIT | T_PROP_CONNECTED | T_PROP_PROJECTED)
 
enum  eTContext {
  CTX_NONE = 0 , CTX_CAMERA = (1 << 0) , CTX_CURSOR = (1 << 1) , CTX_EDGE_DATA = (1 << 2) ,
  CTX_GPENCIL_STROKES = (1 << 3) , CTX_MASK = (1 << 4) , CTX_MOVIECLIP = (1 << 5) , CTX_OBJECT = (1 << 6) ,
  CTX_PAINT_CURVE = (1 << 7) , CTX_POSE_BONE = (1 << 8) , CTX_TEXTURE_SPACE = (1 << 9) , CTX_SEQUENCER_IMAGE = (1 << 10) ,
  CTX_NO_PET = (1 << 11) , CTX_AUTOCONFIRM = (1 << 12) , CTX_OBMODE_XFORM_OBDATA = (1 << 13) , CTX_OBMODE_XFORM_SKIP_CHILDREN = (1 << 14) ,
  CTX_VIEW2D_EDGE_PAN = (1 << 15)
}
 
enum  eTFlag {
  T_EDIT = 1 << 0 , T_POINTS = 1 << 1 , T_NO_CONSTRAINT = 1 << 2 , T_NULL_ONE = 1 << 3 ,
  T_PROP_EDIT = 1 << 4 , T_PROP_CONNECTED = 1 << 5 , T_PROP_PROJECTED = 1 << 6 , T_V3D_ALIGN = 1 << 7 ,
  T_2D_EDIT = 1 << 8 , T_CLIP_UV = 1 << 9 , T_AUTOIK = 1 << 10 , T_NO_MIRROR = 1 << 11 ,
  T_INPUT_IS_VALUES_FINAL = 1 << 12 , T_MODAL = 1 << 13 , T_NO_PROJECT = 1 << 14 , T_RELEASE_CONFIRM = 1 << 15 ,
  T_ALT_TRANSFORM = 1 << 16 , T_OVERRIDE_CENTER = 1 << 17 , T_MODAL_CURSOR_SET = 1 << 18 , T_CLNOR_REBUILD = 1 << 19 ,
  T_AUTOMERGE = 1 << 20 , T_AUTOSPLIT = 1 << 21 , T_EVENT_DRAG_START = 1 << 22 , T_NO_CURSOR_WRAP = 1 << 23
}
 
enum  eTModifier {
  MOD_CONSTRAINT_SELECT_AXIS = 1 << 0 , MOD_PRECISION = 1 << 1 , MOD_SNAP = 1 << 2 , MOD_SNAP_INVERT = 1 << 3 ,
  MOD_CONSTRAINT_SELECT_PLANE = 1 << 4
}
 
enum  eTSnap {
  SNAP_RESETTED = 0 , SNAP_FORCED = 1 << 0 , TARGET_INIT = 1 << 1 , TARGET_GRID_INIT = 1 << 2 ,
  POINT_INIT = 1 << 3 , MULTI_POINTS = 1 << 4
}
 
enum  eTConstraint {
  CON_APPLY = 1 << 0 , CON_AXIS0 = 1 << 1 , CON_AXIS1 = 1 << 2 , CON_AXIS2 = 1 << 3 ,
  CON_SELECT = 1 << 4 , CON_NOFLIP = 1 << 5 , CON_USER = 1 << 6
}
 
enum  eTState { TRANS_STARTING = 0 , TRANS_RUNNING = 1 , TRANS_CONFIRM = 2 , TRANS_CANCEL = 3 }
 
enum  eRedrawFlag { TREDRAW_NOTHING = 0 , TREDRAW_SOFT = (1 << 0) , TREDRAW_HARD = (1 << 1) | TREDRAW_SOFT }
 
enum  eTHelpline {
  HLP_NONE = 0 , HLP_SPRING = 1 , HLP_ANGLE = 2 , HLP_HARROW = 3 ,
  HLP_VARROW = 4 , HLP_CARROW = 5 , HLP_TRACKBALL = 6
}
 
typedef enum eTSnap eTSnap
 

Transform Types

#define TRANS_CUSTOM_DATA_ELEM_MAX   (sizeof(TransCustomDataContainer) / sizeof(TransCustomData))
 
typedef struct TransSnapPoint TransSnapPoint
 
typedef struct TransSnap TransSnap
 
typedef struct TransCon TransCon
 
typedef struct MouseInput MouseInput
 
typedef struct TransCustomData TransCustomData
 
typedef struct TransCenterData TransCenterData
 
typedef struct TransCustomDataContainer TransCustomDataContainer
 
typedef struct TransDataContainer TransDataContainer
 
typedef struct TransInfo TransInfo
 

Gizmo

#define GIZMO_AXIS_LINE_WIDTH   2.0f
 
bool gimbal_axis_pose (struct Object *ob, const struct bPoseChannel *pchan, float gmat[3][3])
 
bool gimbal_axis_object (struct Object *ob, float gmat[3][3])
 

Generics

#define DRAWLIGHT   1
 
#define TRANSFORM_SNAP_MAX_PX   100.0f
 
#define TRANSFORM_DIST_INVALID   -FLT_MAX
 
#define TRANS_DATA_CONTAINER_FIRST_OK(t)   (&(t)->data_container[0])
 
#define TRANS_DATA_CONTAINER_FIRST_SINGLE(t)    (BLI_assert((t)->data_container_len == 1), (&(t)->data_container[0]))
 
#define FOREACH_TRANS_DATA_CONTAINER(t, th)
 
#define FOREACH_TRANS_DATA_CONTAINER_INDEX(t, th, i)
 
void initTransInfo (struct bContext *C, TransInfo *t, struct wmOperator *op, const struct wmEvent *event)
 
void freeTransCustomDataForMode (TransInfo *t)
 
void postTrans (struct bContext *C, TransInfo *t)
 
void resetTransModal (TransInfo *t)
 
void resetTransRestrictions (TransInfo *t)
 
void drawLine (TransInfo *t, const float center[3], const float dir[3], char axis, short options)
 
void applyTransObjects (TransInfo *t)
 
void restoreTransObjects (TransInfo *t)
 
void calculateCenter2D (TransInfo *t)
 
void calculateCenterLocal (TransInfo *t, const float center_global[3])
 
void calculateCenter (TransInfo *t)
 
void tranformViewUpdate (TransInfo *t)
 
void calculateCenterBound (TransInfo *t, float r_center[3])
 
void calculateCenterMedian (TransInfo *t, float r_center[3])
 
void calculateCenterCursor (TransInfo *t, float r_center[3])
 
void calculateCenterCursor2D (TransInfo *t, float r_center[2])
 
void calculateCenterCursorGraph2D (TransInfo *t, float r_center[2])
 
bool calculateCenterActive (TransInfo *t, bool select_only, float r_center[3])
 
void calculatePropRatio (TransInfo *t)
 
void transform_data_ext_rotate (TransData *td, float mat[3][3], bool use_drot)
 
struct Objecttransform_object_deform_pose_armature_get (const TransInfo *t, struct Object *ob)
 
void freeCustomNormalArray (TransInfo *t, TransDataContainer *tc, TransCustomData *custom_data)
 
bool checkUseAxisMatrix (TransInfo *t)
 

Mouse Input

enum  MouseInputMode {
  INPUT_NONE , INPUT_VECTOR , INPUT_SPRING , INPUT_SPRING_FLIP ,
  INPUT_SPRING_DELTA , INPUT_ANGLE , INPUT_ANGLE_SPRING , INPUT_TRACKBALL ,
  INPUT_HORIZONTAL_RATIO , INPUT_HORIZONTAL_ABSOLUTE , INPUT_VERTICAL_RATIO , INPUT_VERTICAL_ABSOLUTE ,
  INPUT_CUSTOM_RATIO , INPUT_CUSTOM_RATIO_FLIP
}
 
void initMouseInput (TransInfo *t, MouseInput *mi, const float center[2], const int mval[2], bool precision)
 
void initMouseInputMode (TransInfo *t, MouseInput *mi, MouseInputMode mode)
 
void applyMouseInput (struct TransInfo *t, struct MouseInput *mi, const int mval[2], float output[3])
 
void transform_input_update (TransInfo *t, const float fac)
 
void setCustomPoints (TransInfo *t, MouseInput *mi, const int start[2], const int end[2])
 
void setCustomPointsFromDirection (TransInfo *t, MouseInput *mi, const float dir[2])
 
void setInputPostFct (MouseInput *mi, void(*post)(struct TransInfo *t, float values[3]))
 

Macro Definition Documentation

◆ DRAWLIGHT

#define DRAWLIGHT   1

◆ FOREACH_TRANS_DATA_CONTAINER

#define FOREACH_TRANS_DATA_CONTAINER (   t,
  th 
)
Value:
for (TransDataContainer *tc = (t)->data_container, \
*tc_end = (t)->data_container + (t)->data_container_len; \
th != tc_end; \
th++)
_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

Definition at line 848 of file source/blender/editors/transform/transform.h.

◆ FOREACH_TRANS_DATA_CONTAINER_INDEX

#define FOREACH_TRANS_DATA_CONTAINER_INDEX (   t,
  th,
 
)
Value:
for (TransDataContainer *tc = ((i = 0), (t)->data_container), \
*tc_end = (t)->data_container + (t)->data_container_len; \
th != tc_end; \
th++, i++)

Definition at line 854 of file source/blender/editors/transform/transform.h.

◆ GIZMO_AXIS_LINE_WIDTH

#define GIZMO_AXIS_LINE_WIDTH   2.0f

◆ T_ALL_RESTRICTIONS

#define T_ALL_RESTRICTIONS   (T_NO_CONSTRAINT | T_NULL_ONE)

◆ T_PROP_EDIT_ALL

#define T_PROP_EDIT_ALL   (T_PROP_EDIT | T_PROP_CONNECTED | T_PROP_PROJECTED)

◆ TRANS_CUSTOM_DATA_ELEM_MAX

#define TRANS_CUSTOM_DATA_ELEM_MAX   (sizeof(TransCustomDataContainer) / sizeof(TransCustomData))

◆ TRANS_DATA_CONTAINER_FIRST_OK

#define TRANS_DATA_CONTAINER_FIRST_OK (   t)    (&(t)->data_container[0])

◆ TRANS_DATA_CONTAINER_FIRST_SINGLE

#define TRANS_DATA_CONTAINER_FIRST_SINGLE (   t)     (BLI_assert((t)->data_container_len == 1), (&(t)->data_container[0]))

◆ TRANSFORM_DIST_INVALID

#define TRANSFORM_DIST_INVALID   -FLT_MAX

◆ TRANSFORM_SNAP_MAX_PX

#define TRANSFORM_SNAP_MAX_PX   100.0f

Typedef Documentation

◆ eTSnap

typedef enum eTSnap eTSnap

◆ MouseInput

typedef struct MouseInput MouseInput

◆ TransCenterData

◆ TransCon

typedef struct TransCon TransCon

◆ TransCustomData

◆ TransCustomDataContainer

Rule of thumb for choosing between mode/type:

  • If transform mode uses the data, assign to mode (typically in transform.c).
  • If conversion uses the data as an extension to the TransData, assign to type (typically in transform_conversion.c).

◆ TransDataContainer

Container for Transform Data

Used to implement multi-object modes, so each object can have its own data array as well as object matrix, local center etc.

Anything that can't be shared between all objects and doesn't make sense to store for every vertex (in the TransDataContainer.data).

Note
at some point this could be used to store non object containers although this only makes sense if each container has its own matrices, otherwise all elements may as well be stored in one array (TransDataContainer.data), as is already done for curve-objects, f-curves. etc.

◆ TransInfo

typedef struct TransInfo TransInfo

◆ TransSnap

typedef struct TransSnap TransSnap

◆ TransSnapPoint

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TFM_MODAL_CANCEL 
TFM_MODAL_CONFIRM 
TFM_MODAL_TRANSLATE 
TFM_MODAL_ROTATE 
TFM_MODAL_RESIZE 
TFM_MODAL_SNAP_INV_ON 
TFM_MODAL_SNAP_INV_OFF 
TFM_MODAL_SNAP_TOGGLE 
TFM_MODAL_AXIS_X 
TFM_MODAL_AXIS_Y 
TFM_MODAL_AXIS_Z 
TFM_MODAL_PLANE_X 
TFM_MODAL_PLANE_Y 
TFM_MODAL_PLANE_Z 
TFM_MODAL_CONS_OFF 
TFM_MODAL_ADD_SNAP 
TFM_MODAL_REMOVE_SNAP 
TFM_MODAL_PROPSIZE_UP 
TFM_MODAL_PROPSIZE_DOWN 
TFM_MODAL_AUTOIK_LEN_INC 
TFM_MODAL_AUTOIK_LEN_DEC 
TFM_MODAL_EDGESLIDE_UP 
TFM_MODAL_EDGESLIDE_DOWN 
TFM_MODAL_PROPSIZE 

For analog input, like track-pad.

TFM_MODAL_INSERTOFS_TOGGLE_DIR 

Node editor insert offset (also called auto-offset) direction toggle.

TFM_MODAL_AUTOCONSTRAINT 
TFM_MODAL_AUTOCONSTRAINTPLANE 
TFM_MODAL_PRECISION 

Definition at line 216 of file source/blender/editors/transform/transform.h.

◆ eRedrawFlag

TransInfo.redraw

Enumerator
TREDRAW_NOTHING 
TREDRAW_SOFT 
TREDRAW_HARD 

Definition at line 191 of file source/blender/editors/transform/transform.h.

◆ eTConstraint

TransCon.mode, #TransInfo.con.mode

Enumerator
CON_APPLY 

When set constraints are in use.

CON_AXIS0 

These are only used for modal execution.

CON_AXIS1 
CON_AXIS2 
CON_SELECT 
CON_NOFLIP 

Does not reorient vector to face viewport when on.

CON_USER 

Definition at line 169 of file source/blender/editors/transform/transform.h.

◆ eTContext

enum eTContext

TransInfo.options

Enumerator
CTX_NONE 
CTX_CAMERA 
CTX_CURSOR 
CTX_EDGE_DATA 
CTX_GPENCIL_STROKES 
CTX_MASK 
CTX_MOVIECLIP 
CTX_OBJECT 
CTX_PAINT_CURVE 
CTX_POSE_BONE 
CTX_TEXTURE_SPACE 
CTX_SEQUENCER_IMAGE 
CTX_NO_PET 
CTX_AUTOCONFIRM 
CTX_OBMODE_XFORM_OBDATA 

When transforming object's, adjust the object data so it stays in the same place.

CTX_OBMODE_XFORM_SKIP_CHILDREN 

Transform object parents without moving their children.

CTX_VIEW2D_EDGE_PAN 

Enable edge scrolling in 2D views

Definition at line 60 of file source/blender/editors/transform/transform.h.

◆ eTFlag

enum eTFlag

TransInfo.flag

Enumerator
T_EDIT 
Note
We could remove 'T_EDIT' and use 'obedit_type', for now ensure they're in sync.
T_POINTS 

Transform points, having no rotation/scale.

T_NO_CONSTRAINT 

restrictions flags

T_NULL_ONE 
T_PROP_EDIT 
T_PROP_CONNECTED 
T_PROP_PROJECTED 
T_V3D_ALIGN 
T_2D_EDIT 

For 2D views such as UV or f-curve.

T_CLIP_UV 
T_AUTOIK 

Auto-IK is on.

T_NO_MIRROR 

Don't use mirror even if the data-block option is set.

T_INPUT_IS_VALUES_FINAL 

To indicate that the value set in the value parameter is the final value of the transformation, modified only by the constrain.

T_MODAL 

To specify if we save back settings at the end.

T_NO_PROJECT 

No re-topology (projection).

T_RELEASE_CONFIRM 
T_ALT_TRANSFORM 

Alternative transformation. used to add offset to tracking markers.

T_OVERRIDE_CENTER 

#TransInfo.center has been set, don't change it.

T_MODAL_CURSOR_SET 
T_CLNOR_REBUILD 
T_AUTOMERGE 

Merges unselected into selected after transforming (runs after transforming).

T_AUTOSPLIT 

Runs auto-merge & splits.

T_EVENT_DRAG_START 

Use drag-start position of the event, otherwise use the cursor coordinates (unmodified).

T_NO_CURSOR_WRAP 

No cursor wrapping on region bounds

Definition at line 87 of file source/blender/editors/transform/transform.h.

◆ eTHelpline

enum eTHelpline

TransInfo.helpline

Enumerator
HLP_NONE 
HLP_SPRING 
HLP_ANGLE 
HLP_HARROW 
HLP_VARROW 
HLP_CARROW 
HLP_TRACKBALL 

Definition at line 198 of file source/blender/editors/transform/transform.h.

◆ eTModifier

enum eTModifier

TransInfo.modifiers

Enumerator
MOD_CONSTRAINT_SELECT_AXIS 
MOD_PRECISION 
MOD_SNAP 
MOD_SNAP_INVERT 
MOD_CONSTRAINT_SELECT_PLANE 

Definition at line 149 of file source/blender/editors/transform/transform.h.

◆ eTSnap

enum eTSnap

TransSnap.status

Enumerator
SNAP_RESETTED 
SNAP_FORCED 
TARGET_INIT 
TARGET_GRID_INIT 
POINT_INIT 
MULTI_POINTS 

Definition at line 158 of file source/blender/editors/transform/transform.h.

◆ eTState

enum eTState

TransInfo.state

Enumerator
TRANS_STARTING 
TRANS_RUNNING 
TRANS_CONFIRM 
TRANS_CANCEL 

Definition at line 183 of file source/blender/editors/transform/transform.h.

◆ MouseInputMode

Enumerator
INPUT_NONE 
INPUT_VECTOR 
INPUT_SPRING 
INPUT_SPRING_FLIP 
INPUT_SPRING_DELTA 
INPUT_ANGLE 
INPUT_ANGLE_SPRING 
INPUT_TRACKBALL 
INPUT_HORIZONTAL_RATIO 
INPUT_HORIZONTAL_ABSOLUTE 
INPUT_VERTICAL_RATIO 
INPUT_VERTICAL_ABSOLUTE 
INPUT_CUSTOM_RATIO 
INPUT_CUSTOM_RATIO_FLIP 

Definition at line 736 of file source/blender/editors/transform/transform.h.

Function Documentation

◆ applyAspectRatio()

void applyAspectRatio ( TransInfo t,
float  vec[2] 
)

◆ applyMouseInput()

void applyMouseInput ( struct TransInfo t,
struct MouseInput mi,
const int  mval[2],
float  output[3] 
)

◆ applyTransObjects()

void applyTransObjects ( TransInfo t)

◆ calculateCenter()

void calculateCenter ( TransInfo t)

◆ calculateCenter2D()

void calculateCenter2D ( TransInfo t)

◆ calculateCenterActive()

bool calculateCenterActive ( TransInfo t,
bool  select_only,
float  r_center[3] 
)

◆ calculateCenterBound()

void calculateCenterBound ( TransInfo t,
float  r_center[3] 
)

◆ calculateCenterCursor()

void calculateCenterCursor ( TransInfo t,
float  r_center[3] 
)

◆ calculateCenterCursor2D()

void calculateCenterCursor2D ( TransInfo t,
float  r_center[2] 
)

◆ calculateCenterCursorGraph2D()

void calculateCenterCursorGraph2D ( TransInfo t,
float  r_center[2] 
)

◆ calculateCenterLocal()

void calculateCenterLocal ( TransInfo t,
const float  center_global[3] 
)

◆ calculateCenterMedian()

void calculateCenterMedian ( TransInfo t,
float  r_center[3] 
)

◆ calculatePropRatio()

void calculatePropRatio ( TransInfo t)

◆ checkUseAxisMatrix()

bool checkUseAxisMatrix ( TransInfo t)

Definition at line 2062 of file transform.c.

References ELEM, OB_ARMATURE, OB_CURVES_LEGACY, OB_MBALL, OB_MESH, t, T_EDIT, and V3D_AROUND_LOCAL_ORIGINS.

Referenced by setUserConstraint().

◆ convertViewVec()

void convertViewVec ( TransInfo t,
float  r_vec[3],
double  dx,
double  dy 
)

◆ drawLine()

void drawLine ( TransInfo t,
const float  center[3],
const float  dir[3],
char  axis,
short  options 
)

◆ freeCustomNormalArray()

void freeCustomNormalArray ( TransInfo t,
TransDataContainer tc,
TransCustomData custom_data 
)

◆ freeTransCustomDataForMode()

void freeTransCustomDataForMode ( TransInfo t)

Needed for mode switching.

Definition at line 712 of file transform_generics.c.

References FOREACH_TRANS_DATA_CONTAINER, freeTransCustomData(), NULL, and t.

Referenced by resetTransModal().

◆ gimbal_axis_object()

bool gimbal_axis_object ( struct Object ob,
float  gmat[3][3] 
)

◆ gimbal_axis_pose()

bool gimbal_axis_pose ( struct Object ob,
const struct bPoseChannel pchan,
float  gmat[3][3] 
)

◆ initMouseInput()

void initMouseInput ( TransInfo t,
MouseInput mi,
const float  center[2],
const int  mval[2],
bool  precision 
)

◆ initMouseInputMode()

void initMouseInputMode ( TransInfo t,
MouseInput mi,
MouseInputMode  mode 
)

Definition at line 288 of file transform_input.c.

References MouseInput::apply, calcSpringFactor(), CTX_wm_window(), data, MouseInput::data, MouseInput::factor, HLP_ANGLE, HLP_CARROW, HLP_HARROW, HLP_NONE, HLP_SPRING, HLP_TRACKBALL, HLP_VARROW, MouseInput::imval, INPUT_ANGLE, INPUT_ANGLE_SPRING, INPUT_CUSTOM_RATIO, INPUT_CUSTOM_RATIO_FLIP, INPUT_HORIZONTAL_ABSOLUTE, INPUT_HORIZONTAL_RATIO, INPUT_NONE, INPUT_SPRING, INPUT_SPRING_DELTA, INPUT_SPRING_FLIP, INPUT_TRACKBALL, INPUT_VECTOR, INPUT_VERTICAL_ABSOLUTE, INPUT_VERTICAL_RATIO, InputAngle(), InputAngleSpring(), InputCustomRatio(), InputCustomRatioFlip(), InputHorizontalAbsolute(), InputHorizontalRatio(), InputSpring(), InputSpringDelta(), InputSpringFlip(), InputTrackBall(), InputVector(), InputVerticalAbsolute(), InputVerticalRatio(), MEM_callocN, MEM_freeN, NULL, MouseInput::precision_factor, t, T_MODAL, T_MODAL_CURSOR_SET, MouseInput::use_virtual_mval, WM_cursor_modal_set(), WM_CURSOR_NONE, and WM_CURSOR_NSEW_SCROLL.

Referenced by initAlign(), initBakeTime(), initBend(), initBevelWeight(), initBoneEnvelope(), initBoneRoll(), initBoneSize(), initCrease_ex(), initCurveShrinkFatten(), initEdgeSlide_ex(), initGPOpacity(), initGPShrinkFatten(), initMaskShrinkFatten(), initMirror(), initNormalRotation(), initPushPull(), initResize(), initRotation(), initSeqSlide(), initShear_mouseInputMode(), initShrinkFatten(), initSkinResize(), initTilt(), initTimeScale(), initTimeSlide(), initTimeTranslate(), initToSphere(), initTrackball(), and initVertSlide_ex().

◆ initTransform()

bool initTransform ( struct bContext C,
struct TransInfo t,
struct wmOperator op,
const struct wmEvent event,
int  mode 
)
Note
caller needs to free t on a 0 return
Warning
event might be NULL (when tweaking from redo panel)
See also
saveTransform which writes these values back.

◆ initTransInfo()

void initTransInfo ( struct bContext C,
TransInfo t,
struct wmOperator op,
const struct wmEvent event 
)

Setup internal data, mouse, vectors

Note
op and event can be NULL
See also
saveTransform does the reverse.

Referenced by calculateTransformCenter(), and initTransform().

◆ postTrans()

void postTrans ( struct bContext C,
TransInfo t 
)

◆ projectFloatView()

void projectFloatView ( TransInfo t,
const float  vec[3],
float  adr[2] 
)

◆ projectFloatViewEx()

void projectFloatViewEx ( TransInfo t,
const float  vec[3],
float  adr[2],
eV3DProjTest  flag 
)

◆ projectIntView()

void projectIntView ( TransInfo t,
const float  vec[3],
int  adr[2] 
)

Definition at line 333 of file transform.c.

References projectIntViewEx(), t, and V3D_PROJ_TEST_NOP.

Referenced by projectFloatViewEx(), and transform_input_update().

◆ projectIntViewEx()

void projectIntViewEx ( TransInfo t,
const float  vec[3],
int  adr[2],
eV3DProjTest  flag 
)

◆ removeAspectRatio()

void removeAspectRatio ( TransInfo t,
float  vec[2] 
)

◆ resetTransModal()

void resetTransModal ( TransInfo t)

Free data before switching to another mode.

Definition at line 112 of file transform_generics.c.

References freeTransCustomDataForMode(), and t.

Referenced by transformEvent().

◆ resetTransRestrictions()

void resetTransRestrictions ( TransInfo t)

Definition at line 117 of file transform_generics.c.

References t, and T_ALL_RESTRICTIONS.

Referenced by transformEvent().

◆ restoreTransObjects()

void restoreTransObjects ( TransInfo t)

◆ saveTransform()

void saveTransform ( struct bContext C,
struct TransInfo t,
struct wmOperator op 
)
See also
initTransform which reads values from the operator.

Definition at line 1498 of file transform.c.

References C, CON_APPLY, CON_AXIS0, CON_AXIS1, CON_AXIS2, constraintModeToIndex(), CTX_data_tool_settings(), CTX_MASK, CTX_NO_PET, ELEM, wmOperator::flag, MOD_SNAP, Object::mode, NULL, OB_MODE_OBJECT, OBACT, OP_IS_REPEAT, wmMsgParams_RNA::prop, PROP_EDIT_CONNECTED, PROP_EDIT_PROJECTED, PROP_EDIT_USE, ToolSettings::prop_mode, ToolSettings::proportional_action, ToolSettings::proportional_edit, ToolSettings::proportional_fcurve, ToolSettings::proportional_mask, ToolSettings::proportional_objects, ToolSettings::proportional_size, wmOperator::ptr, wmMsgParams_RNA::ptr, RNA_boolean_set(), RNA_enum_set(), RNA_float_set(), RNA_float_set_array(), RNA_pointer_create(), RNA_property_array_check(), RNA_property_boolean_set(), RNA_property_boolean_set_array(), RNA_property_enum_get(), RNA_property_enum_set(), RNA_property_float_get(), RNA_property_float_set(), RNA_property_float_set_array(), RNA_property_is_set(), RNA_property_unset(), RNA_struct_find_property(), SCE_SNAP, SCE_SNAP_TARGET_NOT_ACTIVE, SCE_SNAP_TARGET_NOT_EDITED, SCE_SNAP_TARGET_NOT_NONEDITED, SCE_SNAP_TARGET_ONLY_SELECTABLE, ToolSettings::snap_flag, ToolSettings::snap_flag_node, ToolSettings::snap_flag_seq, ToolSettings::snap_uv_flag, SPACE_ACTION, SPACE_GRAPH, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, t, T_ALT_TRANSFORM, T_MODAL, T_NO_MIRROR, T_PROP_CONNECTED, T_PROP_EDIT, T_PROP_EDIT_ALL, T_PROP_PROJECTED, TFM_SHRINKFATTEN, transformModeUseSnap(), UVCALC_TRANSFORM_CORRECT_SLIDE, V3D_ORIENT_CUSTOM_MATRIX, and WM_msg_publish_rna_params().

Referenced by transformops_exit().

◆ setCustomPoints()

void setCustomPoints ( TransInfo t,
MouseInput mi,
const int  start[2],
const int  end[2] 
)

◆ setCustomPointsFromDirection()

void setCustomPointsFromDirection ( TransInfo t,
MouseInput mi,
const float  dir[2] 
)

◆ setInputPostFct()

void setInputPostFct ( MouseInput mi,
void(*)(struct TransInfo *t, float values[3])  post 
)

Definition at line 405 of file transform_input.c.

References MouseInput::post.

◆ setTransformViewAspect()

void setTransformViewAspect ( TransInfo t,
float  r_aspect[3] 
)

◆ setTransformViewMatrices()

void setTransformViewMatrices ( TransInfo t)

◆ tranformViewUpdate()

void tranformViewUpdate ( TransInfo t)

◆ transdata_check_local_islands()

bool transdata_check_local_islands ( TransInfo t,
short  around 
)

Definition at line 64 of file transform.c.

References CTX_CURSOR, CTX_TEXTURE_SPACE, ELEM, OB_GPENCIL, OB_MESH, t, and V3D_AROUND_LOCAL_ORIGINS.

Referenced by initTransInfo(), and set_prop_dist().

◆ transform_apply_matrix()

bool transform_apply_matrix ( TransInfo t,
float  mat[4][4] 
)

Transform a single matrix using the current t->final_values.

Definition at line 2076 of file transform.c.

References NULL, and t.

Referenced by gizmo_modal().

◆ transform_data_ext_rotate()

void transform_data_ext_rotate ( TransData td,
float  mat[3][3],
bool  use_drot 
)

◆ transform_final_value_get()

void transform_final_value_get ( const TransInfo t,
float value,
int  value_num 
)

Definition at line 2085 of file transform.c.

References t.

Referenced by gizmo_modal().

◆ transform_input_update()

void transform_input_update ( TransInfo t,
const float  fac 
)

◆ transform_modal_keymap()

struct wmKeyMap* transform_modal_keymap ( struct wmKeyConfig keyconf)

◆ transform_object_deform_pose_armature_get()

struct Object* transform_object_deform_pose_armature_get ( const TransInfo t,
struct Object ob 
)

◆ transformApply()

void transformApply ( struct bContext C,
TransInfo t 
)

◆ transformEnd()

int transformEnd ( struct bContext C,
TransInfo t 
)

◆ transformEvent()

int transformEvent ( TransInfo t,
const struct wmEvent event 
)