diff options
author | Siddhartha Jejurkar <f20180617@goa.bits-pilani.ac.in> | 2021-12-17 16:01:32 +0300 |
---|---|---|
committer | Siddhartha Jejurkar <f20180617@goa.bits-pilani.ac.in> | 2021-12-17 16:01:32 +0300 |
commit | dbc41b30f88b96f7d8c6e995b17f5930eb55cc77 (patch) | |
tree | c6c495328443ea3621e5df2ef483b0e0dd504496 /source/blender/editors/transform/transform.h | |
parent | 99a2af76d10e05a18987be5d554ada197b1ca086 (diff) | |
parent | 7c9e4099854a4fc8eab4db97173c1aacd25f9e08 (diff) |
Merge branch 'master' into soc-2021-uv-edge-select-supportsoc-2021-uv-edge-select-support
Diffstat (limited to 'source/blender/editors/transform/transform.h')
-rw-r--r-- | source/blender/editors/transform/transform.h | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index d78cd13f8b8..3035d11d0e3 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -298,6 +298,10 @@ enum { /** \} */ +/* -------------------------------------------------------------------- */ +/** \name Transform Types + * \{ */ + typedef struct TransSnapPoint { struct TransSnapPoint *next, *prev; float co[3]; @@ -608,7 +612,7 @@ typedef struct TransInfo { * mouse button then.) */ bool is_launch_event_tweak; - bool is_orient_set; + bool is_orient_default_overwrite; struct { short type; @@ -687,11 +691,19 @@ typedef struct TransInfo { /** \name Public Transform API * \{ */ +/** + * \note caller needs to free `t` on a 0 return + * \warning \a event might be NULL (when tweaking from redo panel) + * \see #saveTransform which writes these values back. + */ bool initTransform(struct bContext *C, struct TransInfo *t, struct wmOperator *op, const struct wmEvent *event, int mode); +/** + * \see #initTransform which reads values from the operator. + */ 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); @@ -708,6 +720,9 @@ 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]); +/** + * Called in transform_ops.c, on each regeneration of key-maps. + */ struct wmKeyMap *transform_modal_keymap(struct wmKeyConfig *keyconf); /** \} */ @@ -772,12 +787,28 @@ void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *t, float val /** \name Generics * \{ */ +/** + * Setup internal data, mouse, vectors + * + * \note \a op and \a event can be NULL + * + * \see #saveTransform does the reverse. + */ void initTransInfo(struct bContext *C, TransInfo *t, struct wmOperator *op, const struct wmEvent *event); +/** + * Needed for mode switching. + */ void freeTransCustomDataForMode(TransInfo *t); +/** + * Here I would suggest only #TransInfo related issues, like free data & reset vars. Not redraws. + */ void postTrans(struct bContext *C, TransInfo *t); +/** + * Free data before switching to another mode. + */ void resetTransModal(TransInfo *t); void resetTransRestrictions(TransInfo *t); @@ -800,17 +831,25 @@ 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]); +/** + * \param select_only: only get active center from data being transformed. + */ bool calculateCenterActive(TransInfo *t, bool select_only, float r_center[3]); void calculatePropRatio(TransInfo *t); +/** + * Rotate an element, low level code, ignore protected channels. + * (use for objects or pose-bones) + * Similar to #ElementRotation. + */ void transform_data_ext_rotate(TransData *td, float mat[3][3], bool use_drot); struct Object *transform_object_deform_pose_armature_get(const TransInfo *t, struct Object *ob); void freeCustomNormalArray(TransInfo *t, TransDataContainer *tc, TransCustomData *custom_data); -/* TODO: `transform_query.c`. */ +/* TODO: move to: `transform_query.c`. */ bool checkUseAxisMatrix(TransInfo *t); #define TRANSFORM_SNAP_MAX_PX 100.0f |