Blender V4.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
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
28void ED_keymap_transform(wmKeyConfig *keyconf);
30
31/* ******************** Macros & Prototypes *********************** */
32
33/* MODE AND NUMINPUT FLAGS */
73
79bool calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], float cent2d[2]);
80
81/* UNUSED */
82// int BIF_snappingSupported(Object *obedit);
83
88 ReportList *reports,
89 const char *name,
90 bool use_view,
91 bool activate,
92 bool overwrite);
94
96 ViewLayer *view_layer,
97 const View3D *v3d,
98 Object *ob,
99 Object *obedit,
100 short around,
101 float r_orientation_mat[3][3]);
102
104
105/* to be able to add operator properties to other operators */
106
107#define P_MIRROR (1 << 0)
108#define P_MIRROR_DUMMY (P_MIRROR | (1 << 1))
109#define P_PROPORTIONAL (1 << 2)
110#define P_ORIENT_AXIS (1 << 3)
111#define P_ORIENT_AXIS_ORTHO (1 << 4)
112#define P_ORIENT_MATRIX (1 << 5)
113#define P_SNAP (1 << 6)
114#define P_GEO_SNAP (P_SNAP | (1 << 7))
115#define P_ALIGN_SNAP (P_GEO_SNAP | (1 << 8))
116#define P_CONSTRAINT (1 << 9)
117#define P_OPTIONS (1 << 10)
118#define P_CORRECT_UV (1 << 11)
119#define P_NO_DEFAULTS (1 << 12)
120#define P_NO_TEXSPACE (1 << 13)
121#define P_CENTER (1 << 14)
122#define P_GPENCIL_EDIT (1 << 15)
123#define P_CURSOR_EDIT (1 << 16)
124#define P_VIEW2D_EDGE_PAN (1 << 17)
125/* For properties performed when confirming the transformation. */
126#define P_POST_TRANSFORM (1 << 18)
127
128void Transform_Properties(wmOperatorType *ot, int flags);
129
130/* `transform_orientations.cc` */
131void ED_transform_calc_orientation_from_type(const bContext *C, float r_mat[3][3]);
142 ViewLayer *view_layer,
143 const View3D *v3d,
144 const RegionView3D *rv3d,
145 Object *ob,
146 Object *obedit,
147 short orientation_index,
148 int pivot_point,
149 float r_mat[3][3]);
150
151bool ED_transform_calc_pivot_pos(const bContext *C, const short pivot_type, float r_pivot_pos[3]);
152
153/* transform gizmos */
154
162
163/* `transform_gizmo_extrude_3d.cc` */
165
166/* Generic 2D transform gizmo callback assignment. */
171
172#define SNAP_INCREMENTAL_ANGLE DEG2RAD(5.0)
173
176 float center[3];
178 float min[3], max[3];
179
181 float axis[3][3];
182 float axis_min[3], axis_max[3];
183
189 float matrix_space[4][4];
190};
191
205 TransformBounds *tbounds,
206 RegionView3D *rv3d);
207
215 ARegion *region,
216 int frame_1,
217 int frame_2,
218 int *r_snap_distance,
219 float *r_snap_frame);
220
221void ED_draw_sequencer_snap_point(ARegion *region, float snap_point);
unsigned short ushort
unsigned int uint
void ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set(wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_rotate_callbacks_set(wmGizmoGroupType *gzgt)
bool ED_transform_calc_pivot_pos(const bContext *C, const short pivot_type, float r_pivot_pos[3])
void VIEW3D_GGT_xform_gizmo_context(wmGizmoGroupType *gzgt)
void VIEW3D_GGT_xform_shear(wmGizmoGroupType *gzgt)
void VIEW3D_GGT_xform_gizmo(wmGizmoGroupType *gzgt)
void BIF_clearTransformOrientation(bContext *C)
short ED_transform_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])
void BIF_removeTransformOrientationIndex(bContext *C, int index)
void Transform_Properties(wmOperatorType *ot, int flags)
eTfmMode
@ TFM_RESIZE
@ TFM_EDGE_SLIDE
@ TFM_BONESIZE
@ TFM_SKIN_RESIZE
@ TFM_SHEAR
@ TFM_SHRINKFATTEN
@ TFM_TIME_TRANSLATE
@ TFM_TIME_SLIDE
@ TFM_BAKE_TIME
@ TFM_VERT_CREASE
@ TFM_VERT_SLIDE
@ TFM_BEND
@ TFM_ROTATION
@ TFM_BONE_ENVELOPE
@ TFM_BWEIGHT
@ TFM_ALIGN
@ TFM_TIME_SCALE
@ TFM_DEPRECATED
@ TFM_BONE_ROLL
@ TFM_TIME_EXTEND
@ TFM_GPENCIL_SHRINKFATTEN
@ TFM_CURVE_SHRINKFATTEN
@ TFM_TILT
@ TFM_INIT
@ TFM_SEQ_SLIDE
@ TFM_TOSPHERE
@ TFM_EDGE_CREASE
@ TFM_GPENCIL_OPACITY
@ TFM_MIRROR
@ TFM_TRANSLATION
@ TFM_MASK_SHRINKFATTEN
@ TFM_BONE_ENVELOPE_DIST
@ TFM_NORMAL_ROTATION
@ TFM_DUMMY
@ TFM_PUSHPULL
@ TFM_TRACKBALL
bool ED_transform_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 ED_widgetgroup_gizmo2d_resize_callbacks_set(wmGizmoGroupType *gzgt)
bool BIF_createTransformOrientation(bContext *C, ReportList *reports, const char *name, bool use_view, bool activate, bool overwrite)
void ED_transform_calc_orientation_from_type(const bContext *C, float r_mat[3][3])
int ED_transform_calc_gizmo_stats(const bContext *C, const TransformCalcParams *params, TransformBounds *tbounds, RegionView3D *rv3d)
void ED_draw_sequencer_snap_point(ARegion *region, float snap_point)
void BIF_removeTransformOrientation(bContext *C, TransformOrientation *target)
void ED_widgetgroup_gizmo2d_xform_callbacks_set(wmGizmoGroupType *gzgt)
void ED_getTransformOrientationMatrix(const Scene *scene, ViewLayer *view_layer, const View3D *v3d, Object *ob, Object *obedit, short around, float r_orientation_mat[3][3])
int BIF_countTransformOrientation(const bContext *C)
void BIF_selectTransformOrientation(bContext *C, TransformOrientation *target)
void ED_keymap_transform(wmKeyConfig *keyconf)
void VIEW3D_GGT_xform_extrude(wmGizmoGroupType *gzgt)
void transform_operatortypes()
bool calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], float cent2d[2])
void VIEW3D_GGT_xform_cage(wmGizmoGroupType *gzgt)
void activate(bool forceActivation=false) const
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
float matrix_space[4][4]
wmOperatorType * ot
Definition wm_files.cc:4125