Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform.h
| Show First 20 Lines • Show All 415 Lines • ▼ Show 20 Lines | typedef struct TransInfo { | ||||
| short around; | short around; | ||||
| char spacetype; /* spacetype where transforming is */ | char spacetype; /* spacetype where transforming is */ | ||||
| char helpline; /* helpline modes (not to be confused with hotline) */ | char helpline; /* helpline modes (not to be confused with hotline) */ | ||||
| float vec[3]; /* translation, to show for widget */ | float vec[3]; /* translation, to show for widget */ | ||||
| float mat[3][3]; /* rot/rescale, to show for widget */ | float mat[3][3]; /* rot/rescale, to show for widget */ | ||||
| float spacemtx[3][3]; /* orientation matrix of the current space */ | float spacemtx[3][3]; /* orientation matrix of the current space */ | ||||
| float trans_spacemtx[3][3]; /* orientation matrix of the current translation space */ | |||||
| float rots_spacemtx[3][3]; /* orientation matrix of the current translation space */ | |||||
| float scale_spacemtx[3][3]; /* orientation matrix of the current translation space */ | |||||
| char spacename[64]; /* name of the current space, MAX_NAME */ | char spacename[64]; /* name of the current space, MAX_NAME */ | ||||
| struct Object *poseobj; /* if t->flag & T_POSE, this denotes pose object */ | struct Object *poseobj; /* if t->flag & T_POSE, this denotes pose object */ | ||||
| /** | /** | ||||
| * Rule of thumb for choosing between mode/type: | * Rule of thumb for choosing between mode/type: | ||||
| * - If transform mode uses the data, assign to `mode` | * - If transform mode uses the data, assign to `mode` | ||||
| * (typically in transform.c). | * (typically in transform.c). | ||||
| Show All 39 Lines | #define TRANS_CUSTOM_DATA_ELEM_MAX (sizeof(((TransInfo *)NULL)->custom) / sizeof(TransCustomData)) | ||||
| int mval[2]; /* current mouse position */ | int mval[2]; /* current mouse position */ | ||||
| float zfac; /* use for 3d view */ | float zfac; /* use for 3d view */ | ||||
| struct Object *obedit; | struct Object *obedit; | ||||
| float obedit_mat[3][3]; /* normalized editmode matrix (T_EDIT only) */ | float obedit_mat[3][3]; /* normalized editmode matrix (T_EDIT only) */ | ||||
| void *draw_handle_apply; | void *draw_handle_apply; | ||||
| void *draw_handle_view; | void *draw_handle_view; | ||||
| void *draw_handle_pixel; | void *draw_handle_pixel; | ||||
| void *draw_handle_cursor; | void *draw_handle_cursor; | ||||
| // These three member variables for setting up the multi transformations | |||||
| short current_translation, current_rotation, current_scale; | |||||
| short pad; | |||||
| } TransInfo; | } TransInfo; | ||||
| /* ******************** Macros & Prototypes *********************** */ | /* ******************** Macros & Prototypes *********************** */ | ||||
| /* transinfo->state */ | /* transinfo->state */ | ||||
| #define TRANS_STARTING 0 | #define TRANS_STARTING 0 | ||||
| #define TRANS_RUNNING 1 | #define TRANS_RUNNING 1 | ||||
| ▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | |||||
| void drawConstraint(TransInfo *t); | void drawConstraint(TransInfo *t); | ||||
| void getConstraintMatrix(TransInfo *t); | void getConstraintMatrix(TransInfo *t); | ||||
| void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]); | void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]); | ||||
| void setAxisMatrixConstraint(TransInfo *t, int mode, const char text[]); | void setAxisMatrixConstraint(TransInfo *t, int mode, const char text[]); | ||||
| void setLocalConstraint(TransInfo *t, int mode, const char text[]); | void setLocalConstraint(TransInfo *t, int mode, const char text[]); | ||||
| void setUserConstraint(TransInfo *t, short orientation, int mode, const char text[]); | void setUserConstraint(TransInfo *t, short orientation, int mode, const char text[]); | ||||
| void setUserConstraintCustom(TransInfo *t, short orientation, int mode, float omx[3][3], const char ftext[]); | |||||
| void constraintNumInput(TransInfo *t, float vec[3]); | void constraintNumInput(TransInfo *t, float vec[3]); | ||||
| bool isLockConstraint(TransInfo *t); | bool isLockConstraint(TransInfo *t); | ||||
| int getConstraintSpaceDimension(TransInfo *t); | int getConstraintSpaceDimension(TransInfo *t); | ||||
| char constraintModeToChar(TransInfo *t); | char constraintModeToChar(TransInfo *t); | ||||
| void startConstraint(TransInfo *t); | void startConstraint(TransInfo *t); | ||||
| ▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
| void getViewVector(TransInfo *t, float coord[3], float vec[3]); | void getViewVector(TransInfo *t, float coord[3], float vec[3]); | ||||
| void transform_data_ext_rotate(TransData *td, float mat[3][3], bool use_drot); | void transform_data_ext_rotate(TransData *td, float mat[3][3], bool use_drot); | ||||
| /*********************** Transform Orientations ******************************/ | /*********************** Transform Orientations ******************************/ | ||||
| void initTransformOrientation(struct bContext *C, TransInfo *t); | void initTransformOrientation(struct bContext *C, TransInfo *t); | ||||
| void initTransformOrientationCustom(struct bContext *C, TransInfo *t, short manipulator_orientation, float omtx[3][3]); | |||||
| /* Those two fill in mat and return non-zero on success */ | /* Those two fill in mat and return non-zero on success */ | ||||
| bool createSpaceNormal(float mat[3][3], const float normal[3]); | bool createSpaceNormal(float mat[3][3], const float normal[3]); | ||||
| bool createSpaceNormalTangent(float mat[3][3], const float normal[3], const float tangent[3]); | bool createSpaceNormalTangent(float mat[3][3], const float normal[3], const float tangent[3]); | ||||
| struct TransformOrientation *addMatrixSpace(struct bContext *C, float mat[3][3], | struct TransformOrientation *addMatrixSpace(struct bContext *C, float mat[3][3], | ||||
| const char *name, const bool overwrite); | const char *name, const bool overwrite); | ||||
| bool applyTransformOrientation(const struct bContext *C, float mat[3][3], char r_name[64], int index); | bool applyTransformOrientation(const struct bContext *C, float mat[3][3], char r_name[64], int index); | ||||
| Show All 27 Lines | |||||