Blender  V3.3
ED_transform.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 /* ******************* Registration Function ********************** */
15 
16 struct Object;
17 struct bContext;
18 struct wmKeyConfig;
19 struct wmOperatorType;
20 
21 void ED_keymap_transform(struct wmKeyConfig *keyconf);
22 void transform_operatortypes(void);
23 
24 /* ******************** Macros & Prototypes *********************** */
25 
26 /* MODE AND NUMINPUT FLAGS */
27 typedef enum {
28  TFM_INIT = -1,
56  TFM_DEPRECATED, /* was BEVEL */
65 } eTfmMode;
66 
67 /* Standalone call to get the transformation center corresponding to the current situation
68  * returns 1 if successful, 0 otherwise (usually means there's no selection)
69  * (if false is returns, `cent3d` is unmodified). */
71  int centerMode,
72  float cent3d[3],
73  float cent2d[2]);
74 
75 struct Object;
76 struct Scene;
77 struct wmGizmoGroupType;
78 
79 /* UNUSED */
80 // int BIF_snappingSupported(struct Object *obedit);
81 
82 struct ReportList;
84 struct bContext;
85 
88 void BIF_removeTransformOrientationIndex(struct bContext *C, int index);
90  struct ReportList *reports,
91  const char *name,
92  bool use_view,
93  bool activate,
94  bool overwrite);
96 
98  const struct View3D *v3d,
99  struct Object *ob,
100  struct Object *obedit,
101  short around,
102  float r_orientation_mat[3][3]);
103 
105 
106 /* to be able to add operator properties to other operators */
107 
108 #define P_MIRROR (1 << 0)
109 #define P_MIRROR_DUMMY (P_MIRROR | (1 << 9))
110 #define P_PROPORTIONAL (1 << 1)
111 #define P_ORIENT_AXIS (1 << 2)
112 #define P_ORIENT_AXIS_ORTHO (1 << 16)
113 #define P_ORIENT_MATRIX (1 << 17)
114 #define P_SNAP (1 << 3)
115 #define P_GEO_SNAP (P_SNAP | (1 << 4))
116 #define P_ALIGN_SNAP (P_GEO_SNAP | (1 << 5))
117 #define P_CONSTRAINT (1 << 6)
118 #define P_OPTIONS (1 << 7)
119 #define P_CORRECT_UV (1 << 8)
120 #define P_NO_DEFAULTS (1 << 10)
121 #define P_NO_TEXSPACE (1 << 11)
122 #define P_CENTER (1 << 12)
123 #define P_GPENCIL_EDIT (1 << 13)
124 #define P_CURSOR_EDIT (1 << 14)
125 #define P_CLNOR_INVALIDATE (1 << 15)
126 #define P_VIEW2D_EDGE_PAN (1 << 16)
127 /* For properties performed when confirming the transformation. */
128 #define P_POST_TRANSFORM (1 << 19)
129 
130 void Transform_Properties(struct wmOperatorType *ot, int flags);
131 
132 /* *** transform_orientations.c *** */
133 void ED_transform_calc_orientation_from_type(const struct bContext *C, float r_mat[3][3]);
144  struct ViewLayer *view_layer,
145  const struct View3D *v3d,
146  const struct RegionView3D *rv3d,
147  struct Object *ob,
148  struct Object *obedit,
149  short orientation_index,
150  int pivot_point,
151  float r_mat[3][3]);
152 
153 /* transform gizmos */
154 
155 void VIEW3D_GGT_xform_gizmo(struct wmGizmoGroupType *gzgt);
160 void VIEW3D_GGT_xform_cage(struct wmGizmoGroupType *gzgt);
161 void VIEW3D_GGT_xform_shear(struct wmGizmoGroupType *gzgt);
162 
163 /* *** transform_gizmo_extrude_3d.c *** */
164 void VIEW3D_GGT_xform_extrude(struct wmGizmoGroupType *gzgt);
165 
166 /* Generic 2D transform gizmo callback assignment. */
171 
172 #define SNAP_INCREMENTAL_ANGLE DEG2RAD(5.0)
173 
175  float center[3]; /* Center for transform widget. */
176  float min[3], max[3]; /* Bounding-box of selection for transform widget. */
177 
178  /* Normalized axis */
179  float axis[3][3];
180  float axis_min[3], axis_max[3];
181 
187  float matrix_space[4][4];
188 };
189 
193  /* Use 'Scene.orientation_type' when zero, otherwise subtract one and use. */
195 };
202  const struct TransformCalcParams *params,
203  struct TransformBounds *tbounds);
204 
212  struct ARegion *region,
213  int frame_1,
214  int frame_2,
215  int *r_snap_distance,
216  float *r_snap_frame);
217 
218 void ED_draw_sequencer_snap_point(struct bContext *C, float snap_point);
219 
220 #ifdef __cplusplus
221 }
222 #endif
unsigned int uint
Definition: BLI_sys_types.h:67
unsigned short ushort
Definition: BLI_sys_types.h:68
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 ED_draw_sequencer_snap_point(struct bContext *C, float snap_point)
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:27
@ TFM_RESIZE
Definition: ED_transform.h:32
@ TFM_EDGE_SLIDE
Definition: ED_transform.h:59
@ TFM_BONESIZE
Definition: ED_transform.h:44
@ TFM_SKIN_RESIZE
Definition: ED_transform.h:33
@ TFM_SHEAR
Definition: ED_transform.h:35
@ TFM_SHRINKFATTEN
Definition: ED_transform.h:37
@ TFM_TIME_TRANSLATE
Definition: ED_transform.h:50
@ TFM_TIME_SLIDE
Definition: ED_transform.h:51
@ TFM_BAKE_TIME
Definition: ED_transform.h:55
@ TFM_VERT_CREASE
Definition: ED_transform.h:42
@ TFM_VERT_SLIDE
Definition: ED_transform.h:60
@ TFM_BEND
Definition: ED_transform.h:36
@ TFM_ROTATION
Definition: ED_transform.h:31
@ TFM_BONE_ENVELOPE
Definition: ED_transform.h:45
@ TFM_BWEIGHT
Definition: ED_transform.h:57
@ TFM_ALIGN
Definition: ED_transform.h:58
@ TFM_TIME_SCALE
Definition: ED_transform.h:52
@ TFM_DEPRECATED
Definition: ED_transform.h:56
@ TFM_TIME_DUPLICATE
Definition: ED_transform.h:54
@ TFM_BONE_ROLL
Definition: ED_transform.h:49
@ TFM_TIME_EXTEND
Definition: ED_transform.h:53
@ TFM_GPENCIL_SHRINKFATTEN
Definition: ED_transform.h:48
@ TFM_CURVE_SHRINKFATTEN
Definition: ED_transform.h:46
@ TFM_TILT
Definition: ED_transform.h:38
@ TFM_INIT
Definition: ED_transform.h:28
@ TFM_SEQ_SLIDE
Definition: ED_transform.h:61
@ TFM_TOSPHERE
Definition: ED_transform.h:34
@ TFM_EDGE_CREASE
Definition: ED_transform.h:41
@ TFM_GPENCIL_OPACITY
Definition: ED_transform.h:64
@ TFM_MIRROR
Definition: ED_transform.h:43
@ TFM_TRANSLATION
Definition: ED_transform.h:30
@ TFM_MASK_SHRINKFATTEN
Definition: ED_transform.h:47
@ TFM_BONE_ENVELOPE_DIST
Definition: ED_transform.h:62
@ TFM_NORMAL_ROTATION
Definition: ED_transform.h:63
@ TFM_DUMMY
Definition: ED_transform.h:29
@ TFM_PUSHPULL
Definition: ED_transform.h:40
@ TFM_TRACKBALL
Definition: ED_transform.h:39
bool BIF_createTransformOrientation(struct bContext *C, struct ReportList *reports, const char *name, bool use_view, bool activate, bool overwrite)
void BIF_removeTransformOrientation(struct bContext *C, struct TransformOrientation *target)
void BIF_removeTransformOrientationIndex(struct bContext *C, int index)
bool ED_transform_snap_sequencer_to_closest_strip_calc(struct Scene *scene, struct ARegion *region, int frame_1, int frame_2, int *r_snap_distance, float *r_snap_frame)
bool calculateTransformCenter(struct bContext *C, int centerMode, float cent3d[3], float cent2d[2])
Definition: transform.c:1341
void VIEW3D_GGT_xform_extrude(struct wmGizmoGroupType *gzgt)
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)
short ED_transform_calc_orientation_from_type_ex(const struct Scene *scene, struct ViewLayer *view_layer, const struct View3D *v3d, const struct RegionView3D *rv3d, struct Object *ob, struct Object *obedit, short orientation_index, int pivot_point, float r_mat[3][3])
void ED_getTransformOrientationMatrix(struct ViewLayer *view_layer, const struct View3D *v3d, struct Object *ob, struct Object *obedit, short around, float r_orientation_mat[3][3])
#define C
Definition: RandGen.cpp:25
void activate(bool forceActivation=false) const
Scene scene
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
float axis_min[3]
Definition: ED_transform.h:180
float axis[3][3]
Definition: ED_transform.h:179
float axis_max[3]
Definition: ED_transform.h:180
float matrix_space[4][4]
Definition: ED_transform.h:187
wmOperatorType * ot
Definition: wm_files.c:3479