Blender  V2.93
ED_transform.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 /* ******************* Registration Function ********************** */
31 
32 struct Object;
33 struct bContext;
34 struct wmKeyConfig;
35 struct wmOperatorType;
36 
37 void ED_keymap_transform(struct wmKeyConfig *keyconf);
38 void transform_operatortypes(void);
39 
40 /* ******************** Macros & Prototypes *********************** */
41 
42 /* MODE AND NUMINPUT FLAGS */
43 typedef enum {
44  TFM_INIT = -1,
71  TFM_DEPRECATED, /* was BEVEL */
80 } eTfmMode;
81 
82 /* Standalone call to get the transformation center corresponding to the current situation
83  * returns 1 if successful, 0 otherwise (usually means there's no selection)
84  * (if false is returns, `cent3d` is unmodified). */
86  int centerMode,
87  float cent3d[3],
88  float cent2d[2]);
89 
90 struct Object;
91 struct Scene;
92 struct wmGizmoGroupType;
93 
94 /* UNUSED */
95 // int BIF_snappingSupported(struct Object *obedit);
96 
97 struct ReportList;
99 struct bContext;
100 
102 void BIF_removeTransformOrientation(struct bContext *C, struct TransformOrientation *target);
103 void BIF_removeTransformOrientationIndex(struct bContext *C, int index);
105  struct ReportList *reports,
106  const char *name,
107  const bool use_view,
108  const bool activate,
109  const bool overwrite);
110 void BIF_selectTransformOrientation(struct bContext *C, struct TransformOrientation *target);
111 
113  struct Object *ob,
114  struct Object *obedit,
115  const short around,
116  float r_orientation_mat[3][3]);
117 
119 
120 /* to be able to add operator properties to other operators */
121 
122 #define P_MIRROR (1 << 0)
123 #define P_MIRROR_DUMMY (P_MIRROR | (1 << 9))
124 #define P_PROPORTIONAL (1 << 1)
125 #define P_ORIENT_AXIS (1 << 2)
126 #define P_ORIENT_AXIS_ORTHO (1 << 16)
127 #define P_ORIENT_MATRIX (1 << 17)
128 #define P_SNAP (1 << 3)
129 #define P_GEO_SNAP (P_SNAP | (1 << 4))
130 #define P_ALIGN_SNAP (P_GEO_SNAP | (1 << 5))
131 #define P_CONSTRAINT (1 << 6)
132 #define P_OPTIONS (1 << 7)
133 #define P_CORRECT_UV (1 << 8)
134 #define P_NO_DEFAULTS (1 << 10)
135 #define P_NO_TEXSPACE (1 << 11)
136 #define P_CENTER (1 << 12)
137 #define P_GPENCIL_EDIT (1 << 13)
138 #define P_CURSOR_EDIT (1 << 14)
139 #define P_CLNOR_INVALIDATE (1 << 15)
140 /* For properties performed when confirming the transformation. */
141 #define P_POST_TRANSFORM (1 << 19)
142 
143 void Transform_Properties(struct wmOperatorType *ot, int flags);
144 
145 /* *** transform_orientations.c *** */
146 void ED_transform_calc_orientation_from_type(const struct bContext *C, float r_mat[3][3]);
148  float r_mat[3][3],
149  /* extra args */
150  struct Scene *scene,
151  struct RegionView3D *rv3d,
152  struct Object *ob,
153  struct Object *obedit,
154  const short orientation_index,
155  const int pivot_point);
156 
157 /* transform gizmos */
158 
159 void VIEW3D_GGT_xform_gizmo(struct wmGizmoGroupType *gzgt);
161 void VIEW3D_GGT_xform_cage(struct wmGizmoGroupType *gzgt);
162 void VIEW3D_GGT_xform_shear(struct wmGizmoGroupType *gzgt);
163 
164 /* *** transform_gizmo_extrude_3d.c *** */
165 void VIEW3D_GGT_xform_extrude(struct wmGizmoGroupType *gzgt);
166 
167 /* Generic 2D transform gizmo callback assignment. */
172 
173 #define SNAP_INCREMENTAL_ANGLE DEG2RAD(5.0)
174 
176  float center[3]; /* Center for transform widget. */
177  float min[3], max[3]; /* Boundbox of selection for transform widget. */
178 
179  /* Normalized axis */
180  float axis[3][3];
181  float axis_min[3], axis_max[3];
182 };
183 
187  /* Use 'Scene.orientation_type' when zero, otherwise subtract one and use. */
189 };
191  const struct TransformCalcParams *params,
192  struct TransformBounds *tbounds);
193 
194 #ifdef __cplusplus
195 }
196 #endif
unsigned int uint
Definition: BLI_sys_types.h:83
unsigned short ushort
Definition: BLI_sys_types.h:84
void BIF_selectTransformOrientation(struct bContext *C, struct TransformOrientation *target)
void VIEW3D_GGT_xform_gizmo_context(struct wmGizmoGroupType *gzgt)
void BIF_clearTransformOrientation(struct bContext *C)
void Transform_Properties(struct wmOperatorType *ot, int flags)
void VIEW3D_GGT_xform_gizmo(struct wmGizmoGroupType *gzgt)
void ED_transform_calc_orientation_from_type(const struct bContext *C, float r_mat[3][3])
int ED_transform_calc_gizmo_stats(const struct bContext *C, const struct TransformCalcParams *params, struct TransformBounds *tbounds)
void transform_operatortypes(void)
void VIEW3D_GGT_xform_shear(struct wmGizmoGroupType *gzgt)
eTfmMode
Definition: ED_transform.h:43
@ TFM_RESIZE
Definition: ED_transform.h:48
@ TFM_EDGE_SLIDE
Definition: ED_transform.h:74
@ TFM_BONESIZE
Definition: ED_transform.h:59
@ TFM_SKIN_RESIZE
Definition: ED_transform.h:49
@ TFM_SHEAR
Definition: ED_transform.h:51
@ TFM_SHRINKFATTEN
Definition: ED_transform.h:53
@ TFM_TIME_TRANSLATE
Definition: ED_transform.h:65
@ TFM_TIME_SLIDE
Definition: ED_transform.h:66
@ TFM_BAKE_TIME
Definition: ED_transform.h:70
@ TFM_VERT_SLIDE
Definition: ED_transform.h:75
@ TFM_CREASE
Definition: ED_transform.h:57
@ TFM_BEND
Definition: ED_transform.h:52
@ TFM_ROTATION
Definition: ED_transform.h:47
@ TFM_BONE_ENVELOPE
Definition: ED_transform.h:60
@ TFM_BWEIGHT
Definition: ED_transform.h:72
@ TFM_ALIGN
Definition: ED_transform.h:73
@ TFM_TIME_SCALE
Definition: ED_transform.h:67
@ TFM_DEPRECATED
Definition: ED_transform.h:71
@ TFM_TIME_DUPLICATE
Definition: ED_transform.h:69
@ TFM_BONE_ROLL
Definition: ED_transform.h:64
@ TFM_TIME_EXTEND
Definition: ED_transform.h:68
@ TFM_GPENCIL_SHRINKFATTEN
Definition: ED_transform.h:63
@ TFM_CURVE_SHRINKFATTEN
Definition: ED_transform.h:61
@ TFM_TILT
Definition: ED_transform.h:54
@ TFM_INIT
Definition: ED_transform.h:44
@ TFM_SEQ_SLIDE
Definition: ED_transform.h:76
@ TFM_TOSPHERE
Definition: ED_transform.h:50
@ TFM_GPENCIL_OPACITY
Definition: ED_transform.h:79
@ TFM_MIRROR
Definition: ED_transform.h:58
@ TFM_TRANSLATION
Definition: ED_transform.h:46
@ TFM_MASK_SHRINKFATTEN
Definition: ED_transform.h:62
@ TFM_BONE_ENVELOPE_DIST
Definition: ED_transform.h:77
@ TFM_NORMAL_ROTATION
Definition: ED_transform.h:78
@ TFM_DUMMY
Definition: ED_transform.h:45
@ TFM_PUSHPULL
Definition: ED_transform.h:56
@ TFM_TRACKBALL
Definition: ED_transform.h:55
short ED_transform_calc_orientation_from_type_ex(const struct bContext *C, float r_mat[3][3], struct Scene *scene, struct RegionView3D *rv3d, struct Object *ob, struct Object *obedit, const short orientation_index, const int pivot_point)
void BIF_removeTransformOrientation(struct bContext *C, struct TransformOrientation *target)
void BIF_removeTransformOrientationIndex(struct bContext *C, int index)
bool calculateTransformCenter(struct bContext *C, int centerMode, float cent3d[3], float cent2d[2])
Definition: transform.c:1259
void VIEW3D_GGT_xform_extrude(struct wmGizmoGroupType *gzgt)
void ED_getTransformOrientationMatrix(const struct bContext *C, struct Object *ob, struct Object *obedit, const short around, float r_orientation_mat[3][3])
void ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set(struct wmGizmoGroupType *gzgt)
int BIF_countTransformOrientation(const struct bContext *C)
void ED_keymap_transform(struct wmKeyConfig *keyconf)
void VIEW3D_GGT_xform_cage(struct wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_xform_callbacks_set(struct wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_rotate_callbacks_set(struct wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_resize_callbacks_set(struct wmGizmoGroupType *gzgt)
bool BIF_createTransformOrientation(struct bContext *C, struct ReportList *reports, const char *name, const bool use_view, const bool activate, const bool overwrite)
#define C
Definition: RandGen.cpp:39
void activate(bool forceActivation=false) const
Scene scene
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
float axis_min[3]
Definition: ED_transform.h:181
float axis[3][3]
Definition: ED_transform.h:180
float axis_max[3]
Definition: ED_transform.h:181
wmOperatorType * ot
Definition: wm_files.c:3156