Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform.h
| Show First 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | typedef struct SlideOrigData { | ||||
| struct BMesh *bm_origfaces; | struct BMesh *bm_origfaces; | ||||
| struct MemArena *arena; | struct MemArena *arena; | ||||
| /** Number of math BMLoop layers. */ | /** Number of math BMLoop layers. */ | ||||
| int layer_math_map_num; | int layer_math_map_num; | ||||
| /** Array size of 'layer_math_map_num' | /** Array size of 'layer_math_map_num' | ||||
| * maps TransDataVertSlideVert.cd_group index to absolute CustomData layer index */ | * maps TransDataVertSlideVert.cd_group index to absolute CustomData layer index */ | ||||
| int *layer_math_map; | int *layer_math_map; | ||||
| /** Array of slide vert data especially for mirror verts. */ | |||||
| TransDataGenericSlideVert *sv_mirror; | |||||
| int totsv_mirror; | |||||
| } SlideOrigData; | } SlideOrigData; | ||||
| typedef struct EdgeSlideData { | typedef struct EdgeSlideData { | ||||
| TransDataEdgeSlideVert *sv; | TransDataEdgeSlideVert *sv; | ||||
| int totsv; | int totsv; | ||||
| int mval_start[2], mval_end[2]; | int mval_start[2], mval_end[2]; | ||||
| struct BMEditMesh *em; | struct BMEditMesh *em; | ||||
| ▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | typedef struct TransData { | ||||
| */ | */ | ||||
| void *extra; | void *extra; | ||||
| /** Various flags. */ | /** Various flags. */ | ||||
| int flag; | int flag; | ||||
| /** If set, copy of Object or PoseChannel protection. */ | /** If set, copy of Object or PoseChannel protection. */ | ||||
| short protectflag; | short protectflag; | ||||
| } TransData; | } TransData; | ||||
| typedef struct TransDataMirror { | |||||
| /** location of mirrored reference data. */ | |||||
| float *loc_ref; | |||||
campbellbarton: Could be a `const` to prevent accidents. | |||||
| /** Location of the data to transform. */ | |||||
| float *loc; | |||||
Done Inline ActionsThink it would be more clear to call loc_src, loc_dst. campbellbarton: Think it would be more clear to call `loc_src`, `loc_dst`. | |||||
| short sign[3]; | |||||
Done Inline ActionsWould store this as a flag, since multiplying a float by a short isn't all that efficient. campbellbarton: Would store this as a flag, since multiplying a float by a short isn't all that efficient. | |||||
Done Inline ActionsUsed bit-fields mano-wii: Used bit-fields | |||||
| void *extra; | |||||
| } TransDataMirror; | |||||
| typedef struct MouseInput { | typedef struct MouseInput { | ||||
| void (*apply)(struct TransInfo *t, struct MouseInput *mi, const double mval[2], float output[3]); | void (*apply)(struct TransInfo *t, struct MouseInput *mi, const double mval[2], float output[3]); | ||||
| void (*post)(struct TransInfo *t, float values[3]); | void (*post)(struct TransInfo *t, float values[3]); | ||||
| /** Initial mouse position. */ | /** Initial mouse position. */ | ||||
| int imval[2]; | int imval[2]; | ||||
| bool precision; | bool precision; | ||||
| float precision_factor; | float precision_factor; | ||||
| ▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | typedef struct TransDataContainer { | ||||
| /** Center of transformation (in local-space), Calculated from #TransInfo.center_global. */ | /** Center of transformation (in local-space), Calculated from #TransInfo.center_global. */ | ||||
| float center_local[3]; | float center_local[3]; | ||||
| /** | /** | ||||
| * Mirror option | * Mirror option | ||||
| */ | */ | ||||
| struct { | struct { | ||||
| /* Currently for mesh X mirror only. */ | union { | ||||
| int axis_flag; | struct { | ||||
| /** Set to -1.0f or 1.0 when use_mirror is set. */ | /* For easy access. */ | ||||
| float sign; | uint axis_x : 1; | ||||
| uint axis_y : 1; | |||||
| uint axis_z : 1; | |||||
| }; | |||||
| short axis_flag; | |||||
Done Inline ActionsCan see how this reads nicely but think this could be a flag too. campbellbarton: Can see how this reads nicely but think this could be a flag too.
Since it fits better in a… | |||||
Done Inline Actionsaxis_flag is being used only as a bool. I could rename it to is_mirror_enabled if preferable. mano-wii: `axis_flag` is being used only as a bool. I could rename it to `is_mirror_enabled` if… | |||||
| }; | |||||
| /** Mirror data array. */ | |||||
| TransDataMirror *data; | |||||
| int data_len; | |||||
| } mirror; | } mirror; | ||||
| TransCustomDataContainer custom; | TransCustomDataContainer custom; | ||||
| } TransDataContainer; | } TransDataContainer; | ||||
| typedef struct TransInfo { | typedef struct TransInfo { | ||||
| TransDataContainer *data_container; | TransDataContainer *data_container; | ||||
| int data_container_len; | int data_container_len; | ||||
| ▲ Show 20 Lines • Show All 291 Lines • ▼ Show 20 Lines | enum { | ||||
| TD_BEZTRIPLE = 1 << 12, | TD_BEZTRIPLE = 1 << 12, | ||||
| /** when this is set, don't apply translation changes to this element */ | /** when this is set, don't apply translation changes to this element */ | ||||
| TD_NO_LOC = 1 << 13, | TD_NO_LOC = 1 << 13, | ||||
| /** For Graph Editor autosnap, indicates that point should not undergo autosnapping */ | /** For Graph Editor autosnap, indicates that point should not undergo autosnapping */ | ||||
| TD_NOTIMESNAP = 1 << 14, | TD_NOTIMESNAP = 1 << 14, | ||||
| /** For Graph Editor - curves that can only have int-values | /** For Graph Editor - curves that can only have int-values | ||||
| * need their keyframes tagged with this. */ | * need their keyframes tagged with this. */ | ||||
| TD_INTVALUES = 1 << 15, | TD_INTVALUES = 1 << 15, | ||||
| /** For editmode mirror, clamp to x = 0 */ | /** For editmode mirror, clamp axis to 0 */ | ||||
| TD_MIRROR_EDGE = 1 << 16, | TD_MIRROR_EDGE_X = 1 << 16, | ||||
| TD_MIRROR_EDGE_Y = 1 << 17, | |||||
| TD_MIRROR_EDGE_Z = 1 << 18, | |||||
| /** For fcurve handles, move them along with their keyframes */ | /** For fcurve handles, move them along with their keyframes */ | ||||
| TD_MOVEHANDLE1 = 1 << 17, | TD_MOVEHANDLE1 = 1 << 19, | ||||
| TD_MOVEHANDLE2 = 1 << 18, | TD_MOVEHANDLE2 = 1 << 20, | ||||
| /** Exceptional case with pose bone rotating when a parent bone has 'Local Location' | /** Exceptional case with pose bone rotating when a parent bone has 'Local Location' | ||||
| * option enabled and rotating also transforms it. */ | * option enabled and rotating also transforms it. */ | ||||
| TD_PBONE_LOCAL_MTX_P = 1 << 19, | TD_PBONE_LOCAL_MTX_P = 1 << 21, | ||||
| /** Same as above but for a child bone. */ | /** Same as above but for a child bone. */ | ||||
| TD_PBONE_LOCAL_MTX_C = 1 << 20, | TD_PBONE_LOCAL_MTX_C = 1 << 22, | ||||
| }; | }; | ||||
| /** #TransSnap.status */ | /** #TransSnap.status */ | ||||
| enum { | enum { | ||||
| SNAP_FORCED = 1 << 0, | SNAP_FORCED = 1 << 0, | ||||
| TARGET_INIT = 1 << 1, | TARGET_INIT = 1 << 1, | ||||
| POINT_INIT = 1 << 2, | POINT_INIT = 1 << 2, | ||||
| MULTI_POINTS = 1 << 3, | MULTI_POINTS = 1 << 3, | ||||
| ▲ Show 20 Lines • Show All 247 Lines • Show Last 20 Lines | |||||
Could be a const to prevent accidents.