Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform.h
| Show First 20 Lines • Show All 525 Lines • ▼ Show 20 Lines | typedef struct TransInfo { | ||||
| /*************** NEW STUFF *********************/ | /*************** NEW STUFF *********************/ | ||||
| /** event type used to launch transform. */ | /** event type used to launch transform. */ | ||||
| short launch_event; | short launch_event; | ||||
| /** Is the actual launch event a tweak event? (launch_event above is set to the corresponding | /** Is the actual launch event a tweak event? (launch_event above is set to the corresponding | ||||
| * mouse button then.) */ | * mouse button then.) */ | ||||
| bool is_launch_event_tweak; | bool is_launch_event_tweak; | ||||
| struct { | struct { | ||||
| /** Orientation type when when we're not constrained. | |||||
| * nearly always global except for rotate which defaults to screen-space orientation. */ | |||||
| short unset; | |||||
| /** Orientation to use when a key is pressed. */ | |||||
| short user; | |||||
| /* Used when user is global. */ | |||||
| short user_alt; | |||||
| short index; | short index; | ||||
| short *types[2]; | short types[3]; | ||||
| /* this gets used when custom_orientation is V3D_ORIENT_CUSTOM */ | /* this gets used when orientation.type[x] is V3D_ORIENT_CUSTOM */ | ||||
| struct TransformOrientation *custom; | struct TransformOrientation *custom; | ||||
| /* this gets used when orientation.type[0] is V3D_ORIENT_CUSTOM_MATRIX */ | |||||
| float custom_matrix[3][3]; | |||||
| } orientation; | } orientation; | ||||
| /** backup from view3d, to restore on end. */ | /** backup from view3d, to restore on end. */ | ||||
| short gizmo_flag; | short gizmo_flag; | ||||
| short prop_mode; | short prop_mode; | ||||
| /** Value taken as input, either through mouse coordinates or entered as a parameter. */ | /** Value taken as input, either through mouse coordinates or entered as a parameter. */ | ||||
| float values[4]; | float values[4]; | ||||
| /** Offset applied ontop of modal input. */ | /** Offset applied ontop of modal input. */ | ||||
| float values_modal_offset[4]; | float values_modal_offset[4]; | ||||
| /** Final value of the transformation (displayed in the redo panel). | /** Final value of the transformation (displayed in the redo panel). | ||||
| * If the operator is executed directly (not modal), this value is usually the | * If the operator is executed directly (not modal), this value is usually the | ||||
| * value of the input parameter, except when a constrain is entered. */ | * value of the input parameter, except when a constrain is entered. */ | ||||
| float values_final[4]; | float values_final[4]; | ||||
| /* Axis members for modes that use an axis separate from the orientation (rotate & shear). */ | /* Axis members for modes that use an axis separate from the orientation (rotate & shear). */ | ||||
| /** Primary axis, rotate only uses this. */ | /** Primary axis, rotate only uses this. */ | ||||
| int orient_axis; | int orient_axis; | ||||
| /** Secondary axis, shear uses this. */ | /** Secondary axis, shear uses this. */ | ||||
| int orient_axis_ortho; | int orient_axis_ortho; | ||||
| /** Often this matrix has similar usage to #TransInfo.spacemtx however this | |||||
| * is used to define extra axes to operate on, not necessarily a space. | |||||
| * | |||||
| * For example, by default rotation operates on the view (`orient_matrix[2]`), | |||||
| * even when the current space isn't set to the view. */ | |||||
| float orient_matrix[3][3]; | |||||
| /** Don't overwrite when set by operator redo defines the orientation axis. */ | |||||
| bool orient_matrix_is_set; | |||||
| /** remove elements if operator is canceled. */ | /** remove elements if operator is canceled. */ | ||||
| bool remove_on_cancel; | bool remove_on_cancel; | ||||
| void *view; | void *view; | ||||
| /** Only valid (non null) during an operator called function. */ | /** Only valid (non null) during an operator called function. */ | ||||
| struct bContext *context; | struct bContext *context; | ||||
| struct ScrArea *area; | struct ScrArea *area; | ||||
| struct ARegion *region; | struct ARegion *region; | ||||
| ▲ Show 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | |||||
| void calculatePropRatio(TransInfo *t); | void calculatePropRatio(TransInfo *t); | ||||
| void getViewVector(const TransInfo *t, const float coord[3], float vec[3]); | void getViewVector(const TransInfo *t, const 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, short orientation); | ||||
| /* 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, | struct TransformOrientation *addMatrixSpace(struct bContext *C, | ||||
| float mat[3][3], | float mat[3][3], | ||||
| const char *name, | const char *name, | ||||
| ▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines | |||||