Blender V5.0
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
11#include "BLI_sys_types.h"
12
13/* ******************* Registration Function ********************** */
14
15struct ARegion;
16struct bContext;
17struct Scene;
18struct ReportList;
20struct Object;
21struct RegionView3D;
22struct View3D;
23struct ViewLayer;
24struct wmGizmoGroupType;
25struct wmKeyConfig;
26struct wmOperatorType;
27
28namespace blender::ed::transform {
29
30void keymap_transform(wmKeyConfig *keyconf);
32
33/* ******************** Macros & Prototypes *********************** */
34
35/* MODE AND NUMINPUT FLAGS */
74
80bool calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], float cent2d[2]);
81
82/* UNUSED */
83// int BIF_snappingSupported(Object *obedit);
84
89 ReportList *reports,
90 const char *name,
91 bool use_view,
92 bool activate,
93 bool overwrite);
95
97 ViewLayer *view_layer,
98 const View3D *v3d,
99 Object *ob,
100 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 << 1))
110#define P_PROPORTIONAL (1 << 2)
111#define P_ORIENT_AXIS (1 << 3)
112#define P_ORIENT_AXIS_ORTHO (1 << 4)
113#define P_ORIENT_MATRIX (1 << 5)
114#define P_SNAP (1 << 6)
115#define P_GEO_SNAP (P_SNAP | (1 << 7))
116#define P_ALIGN_SNAP (P_GEO_SNAP | (1 << 8))
117#define P_CONSTRAINT (1 << 9)
118#define P_OPTIONS (1 << 10)
119#define P_CORRECT_UV (1 << 11)
120#define P_NO_DEFAULTS (1 << 12)
121#define P_NO_TEXSPACE (1 << 13)
122#define P_CENTER (1 << 14)
123#define P_GPENCIL_EDIT (1 << 15)
124#define P_CURSOR_EDIT (1 << 16)
125#define P_VIEW2D_EDGE_PAN (1 << 17)
126/* For properties performed when confirming the transformation. */
127#define P_POST_TRANSFORM (1 << 18)
128#define P_TRANSLATE_ORIGIN (1 << 19)
129
130void properties_register(wmOperatorType *ot, int flags);
131
132/* `transform_orientations.cc` */
133void calc_orientation_from_type(const bContext *C, float r_mat[3][3]);
143short calc_orientation_from_type_ex(const Scene *scene,
144 ViewLayer *view_layer,
145 const View3D *v3d,
146 const RegionView3D *rv3d,
147 Object *ob,
148 Object *obedit,
149 short orientation_index,
150 int pivot_point,
151 float r_mat[3][3]);
152
153bool calc_pivot_pos(const bContext *C, const short pivot_type, float r_pivot_pos[3]);
154
155/* transform gizmos */
156
164
165/* `transform_gizmo_extrude_3d.cc` */
167
168/* Generic 2D transform gizmo callback assignment. */
173
174#define SNAP_INCREMENTAL_ANGLE DEG2RAD(5.0)
175
178 float center[3];
180 float min[3], max[3];
181
183 float axis[3][3];
184 float axis_min[3], axis_max[3];
185
191 float matrix_space[4][4];
192};
193
200
205int calc_gizmo_stats(const bContext *C,
207 TransformBounds *tbounds,
208 RegionView3D *rv3d);
209
217 ARegion *region,
218 int frame_1,
219 int frame_2,
220 int *r_snap_distance,
221 float *r_snap_frame);
222
223void sequencer_snap_point(ARegion *region, float snap_point);
224
225} // namespace blender::ed::transform
unsigned int uint
unsigned short ushort
struct wmKeyConfig wmKeyConfig
#define C
Definition RandGen.cpp:29
void activate(bool forceActivation=false) const
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void ED_widgetgroup_gizmo2d_resize_callbacks_set(wmGizmoGroupType *gzgt)
void properties_register(wmOperatorType *ot, int flags)
void sequencer_snap_point(ARegion *region, float snap_point)
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)
void VIEW3D_GGT_xform_extrude(wmGizmoGroupType *gzgt)
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)
bool snap_sequencer_to_closest_strip_calc(Scene *scene, ARegion *region, int frame_1, int frame_2, int *r_snap_distance, float *r_snap_frame)
void BIF_removeTransformOrientation(bContext *C, TransformOrientation *target)
short calc_orientation_from_type_ex(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])
int calc_gizmo_stats(const bContext *C, const TransformCalcParams *params, TransformBounds *tbounds, RegionView3D *rv3d)
void ED_getTransformOrientationMatrix(const Scene *scene, ViewLayer *view_layer, const View3D *v3d, Object *ob, Object *obedit, short around, float r_orientation_mat[3][3])
void BIF_selectTransformOrientation(bContext *C, TransformOrientation *target)
void ED_widgetgroup_gizmo2d_rotate_callbacks_set(wmGizmoGroupType *gzgt)
const char * name
wmOperatorType * ot
Definition wm_files.cc:4237