Blender V5.3
ED_transform.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
12#include "BLI_sys_types.hh"
13
14namespace blender {
15
16/* ******************* Registration Function ********************** */
17
18struct ARegion;
19struct bContext;
20struct Main;
21struct Scene;
22struct ReportList;
24struct Object;
25struct RegionView3D;
26struct View3D;
27struct ViewLayer;
28struct wmGizmoGroupType;
29struct wmKeyConfig;
30struct wmOperatorType;
31
32namespace ed::transform {
33
34void keymap_transform(wmKeyConfig *keyconf);
36
37/* ******************** Macros & Prototypes *********************** */
38
39/* MODE AND NUMINPUT FLAGS */
78
84bool calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], float cent2d[2]);
85
86/* UNUSED */
87// int BIF_snappingSupported(Object *obedit);
88
93 ReportList *reports,
94 const char *name,
95 bool use_view,
96 bool activate,
97 bool overwrite);
99
100void ED_getTransformOrientationMatrix(const Main &bmain,
101 const Scene *scene,
102 ViewLayer *view_layer,
103 const View3D *v3d,
104 Object *ob,
105 Object *obedit,
106 short around,
107 float r_orientation_mat[3][3]);
108
110
111/* to be able to add operator properties to other operators */
112
113#define P_MIRROR (1 << 0)
114#define P_MIRROR_DUMMY (P_MIRROR | (1 << 1))
115#define P_PROPORTIONAL (1 << 2)
116#define P_ORIENT_AXIS (1 << 3)
117#define P_ORIENT_AXIS_ORTHO (1 << 4)
118#define P_ORIENT_MATRIX (1 << 5)
119#define P_SNAP (1 << 6)
120#define P_GEO_SNAP (P_SNAP | (1 << 7))
121#define P_ALIGN_SNAP (P_GEO_SNAP | (1 << 8))
122#define P_CONSTRAINT (1 << 9)
123#define P_OPTIONS (1 << 10)
124#define P_CORRECT_UV (1 << 11)
125#define P_NO_DEFAULTS (1 << 12)
126#define P_NO_TEXSPACE (1 << 13)
127#define P_CENTER (1 << 14)
128#define P_GPENCIL_EDIT (1 << 15)
129#define P_CURSOR_EDIT (1 << 16)
130#define P_VIEW2D_EDGE_PAN (1 << 17)
131/* For properties performed when confirming the transformation. */
132#define P_POST_TRANSFORM (1 << 18)
133#define P_TRANSLATE_ORIGIN (1 << 19)
134
135void properties_register(wmOperatorType *ot, int flags);
136
137/* `transform_orientations.cc` */
138void calc_orientation_from_type(const bContext *C, float r_mat[3][3]);
148short calc_orientation_from_type_ex(const Main &bmain,
149 const Scene *scene,
150 ViewLayer *view_layer,
151 const View3D *v3d,
152 const RegionView3D *rv3d,
153 Object *ob,
154 Object *obedit,
155 short orientation_index,
156 int pivot_point,
157 float r_mat[3][3]);
158
159bool calc_pivot_pos(const bContext *C, const short pivot_type, float r_pivot_pos[3]);
160
161/* transform gizmos */
162
163void VIEW3D_GGT_xform_gizmo(wmGizmoGroupType *gzgt);
167void VIEW3D_GGT_xform_gizmo_context(wmGizmoGroupType *gzgt);
168void VIEW3D_GGT_xform_cage(wmGizmoGroupType *gzgt);
169void VIEW3D_GGT_xform_shear(wmGizmoGroupType *gzgt);
170
171/* `transform_gizmo_extrude_3d.cc` */
172void VIEW3D_GGT_xform_extrude(wmGizmoGroupType *gzgt);
173
174/* Generic 2D transform gizmo callback assignment. */
175void ED_widgetgroup_gizmo2d_xform_callbacks_set(wmGizmoGroupType *gzgt);
176void ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set(wmGizmoGroupType *gzgt);
177void ED_widgetgroup_gizmo2d_resize_callbacks_set(wmGizmoGroupType *gzgt);
178void ED_widgetgroup_gizmo2d_rotate_callbacks_set(wmGizmoGroupType *gzgt);
179
180#define SNAP_INCREMENTAL_ANGLE DEG2RAD(5.0)
181#define SNAP_INCREMENTAL_SNAP_STEP 1.0f
182
185 float center[3];
187 float min[3], max[3];
188
190 float axis[3][3];
191 float axis_min[3], axis_max[3];
192
198 float matrix_space[4][4];
199};
200
207
212int calc_gizmo_stats(const bContext *C,
213 const TransformCalcParams *params,
214 TransformBounds *tbounds,
215 RegionView3D *rv3d);
216
225 ARegion *region,
226 const int left_frame,
227 const int right_frame,
228 const int channel,
229 int *r_snap_distance,
230 float2 *r_snap_point);
231
232void snap_sequencer_draw_drag_drop(Scene *scene, ARegion *region, const float2 snap_point);
233
234} // namespace ed::transform
235} // namespace blender
#define C
Definition RandGen.cpp:29
void activate(bool forceActivation=false) const
Definition scene.h:133
void ED_widgetgroup_gizmo2d_resize_callbacks_set(wmGizmoGroupType *gzgt)
void properties_register(wmOperatorType *ot, int flags)
void ED_widgetgroup_gizmo2d_xform_callbacks_set(wmGizmoGroupType *gzgt)
void VIEW3D_GGT_xform_gizmo_context(wmGizmoGroupType *gzgt)
bool calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], float cent2d[2])
bool BIF_createTransformOrientation(bContext *C, ReportList *reports, const char *name, bool use_view, bool activate, bool overwrite)
void VIEW3D_GGT_xform_gizmo(wmGizmoGroupType *gzgt)
void BIF_clearTransformOrientation(bContext *C)
void BIF_removeTransformOrientationIndex(bContext *C, int index)
void VIEW3D_GGT_xform_cage(wmGizmoGroupType *gzgt)
void VIEW3D_GGT_xform_shear(wmGizmoGroupType *gzgt)
bool snap_sequencer_calc_drag_drop(Scene *scene, ARegion *region, const int left_frame, const int right_frame, const int channel, int *r_snap_distance, float2 *r_snap_point)
void VIEW3D_GGT_xform_extrude(wmGizmoGroupType *gzgt)
void snap_sequencer_draw_drag_drop(Scene *scene, ARegion *region, const float2 snap_point)
short calc_orientation_from_type_ex(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d, const RegionView3D *rv3d, Object *ob, Object *obedit, short orientation_index, int pivot_point, float r_mat[3][3])
bool calc_pivot_pos(const bContext *C, const short pivot_type, float r_pivot_pos[3])
void keymap_transform(wmKeyConfig *keyconf)
void calc_orientation_from_type(const bContext *C, float r_mat[3][3])
int BIF_countTransformOrientation(const bContext *C)
void ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set(wmGizmoGroupType *gzgt)
void BIF_removeTransformOrientation(bContext *C, TransformOrientation *target)
void ED_getTransformOrientationMatrix(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d, Object *ob, Object *obedit, short around, float r_orientation_mat[3][3])
int calc_gizmo_stats(const bContext *C, const TransformCalcParams *params, TransformBounds *tbounds, RegionView3D *rv3d)
void BIF_selectTransformOrientation(bContext *C, TransformOrientation *target)
void ED_widgetgroup_gizmo2d_rotate_callbacks_set(wmGizmoGroupType *gzgt)
BMesh Iterators.
unsigned int uint
Definition BKE_text.h:55
unsigned short ushort
Definition BKE_text.h:56
VecBase< float, 2 > float2