Blender  V3.3
move3d_gizmo.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
17 #include "MEM_guardedalloc.h"
18 
19 #include "BLI_math.h"
20 
21 #include "BKE_context.h"
22 
23 #include "GPU_immediate.h"
24 #include "GPU_immediate_util.h"
25 #include "GPU_matrix.h"
26 #include "GPU_select.h"
27 #include "GPU_state.h"
28 
29 #include "RNA_access.h"
30 #include "RNA_define.h"
31 
32 #include "WM_api.h"
33 #include "WM_types.h"
34 
35 #include "ED_gizmo_library.h"
36 #include "ED_screen.h"
38 #include "ED_view3d.h"
39 
40 /* own includes */
41 #include "../gizmo_geometry.h"
42 #include "../gizmo_library_intern.h"
43 
44 #define MVAL_MAX_PX_DIST 12.0f
45 
46 typedef struct MoveGizmo3D {
48  /* Added to 'matrix_basis' when calculating the matrix. */
49  float prop_co[3];
51 
52 static void gizmo_move_matrix_basis_get(const wmGizmo *gz, float r_matrix[4][4])
53 {
54  MoveGizmo3D *move = (MoveGizmo3D *)gz;
55 
56  copy_m4_m4(r_matrix, move->gizmo.matrix_basis);
57  add_v3_v3(r_matrix[3], move->prop_co);
58 }
59 
60 static int gizmo_move_modal(bContext *C,
61  wmGizmo *gz,
62  const wmEvent *event,
63  eWM_GizmoFlagTweak tweak_flag);
64 
65 typedef struct MoveInteraction {
66  struct {
67  float mval[2];
68  /* Only for when using properties. */
69  float prop_co[3];
70  float matrix_final[4][4];
71  } init;
72  struct {
74  } prev;
75 
76  /* We could have other snap contexts, for now only support 3D view. */
78 
80 
81 #define DIAL_RESOLUTION 32
82 
83 /* -------------------------------------------------------------------- */
84 
85 static void move_geom_draw(const wmGizmo *gz,
86  const float color[4],
87  const bool select,
88  const int draw_options)
89 {
90 #ifdef USE_GIZMO_CUSTOM_DIAL
91  UNUSED_VARS(move3d, col, axis_modal_mat);
92  wm_gizmo_geometryinfo_draw(&wm_gizmo_geom_data_move3d, select);
93 #else
94  const int draw_style = RNA_enum_get(gz->ptr, "draw_style");
95  const bool filled = (draw_style != ED_GIZMO_MOVE_STYLE_CROSS_2D) &&
96  ((draw_options & (select ? (ED_GIZMO_MOVE_DRAW_FLAG_FILL |
99 
101  /* NOTE(Metal): Prefer using 3D coordinates with 3D shader, even if rendering 2D gizmo's. */
103 
106 
107  float viewport[4];
108  GPU_viewport_size_get_f(viewport);
109  immUniform2fv("viewportSize", &viewport[2]);
110  immUniform1f("lineWidth", gz->line_width * U.pixelsize);
111 
113 
114  /* Use the final scale as a radius if it's not already applied to the final matrix. */
115  const float radius = (gz->flag & WM_GIZMO_DRAW_NO_SCALE) ? gz->scale_final : 1.0f;
116 
117  if (draw_style == ED_GIZMO_MOVE_STYLE_RING_2D) {
118  if (filled) {
119  imm_draw_circle_fill_3d(pos, 0.0f, 0.0f, radius, DIAL_RESOLUTION);
120  }
121  else {
122  imm_draw_circle_wire_3d(pos, 0.0f, 0.0f, radius, DIAL_RESOLUTION);
123  }
124  }
125  else if (draw_style == ED_GIZMO_MOVE_STYLE_CROSS_2D) {
126  const float radius_diag = M_SQRT1_2 * radius;
128  immVertex3f(pos, radius_diag, radius_diag, 0.0f);
129  immVertex3f(pos, -radius_diag, -radius_diag, 0.0f);
130 
131  immVertex3f(pos, -radius_diag, radius_diag, 0.0f);
132  immVertex3f(pos, radius_diag, -radius_diag, 0.0f);
133  immEnd();
134  }
135  else {
136  BLI_assert(0);
137  }
138 
140 
142 #endif
143 }
144 
145 static void move3d_get_translate(const wmGizmo *gz,
146  const wmEvent *event,
147  const ARegion *region,
148  float co_delta[3])
149 {
150  MoveInteraction *inter = gz->interaction_data;
151  const float xy_delta[2] = {
152  event->mval[0] - inter->init.mval[0],
153  event->mval[1] - inter->init.mval[1],
154  };
155 
156  RegionView3D *rv3d = region->regiondata;
157  float co_ref[3];
158  mul_v3_mat3_m4v3(co_ref, gz->matrix_space, inter->init.prop_co);
159  const float zfac = ED_view3d_calc_zfac(rv3d, co_ref);
160 
161  ED_view3d_win_to_delta(region, xy_delta, zfac, co_delta);
162 
163  float matrix_space_inv[3][3];
164  copy_m3_m4(matrix_space_inv, gz->matrix_space);
165  invert_m3(matrix_space_inv);
166  mul_m3_v3(matrix_space_inv, co_delta);
167 }
168 
169 static void move3d_draw_intern(const bContext *C,
170  wmGizmo *gz,
171  const bool select,
172  const bool highlight)
173 {
174  MoveInteraction *inter = gz->interaction_data;
175  const int draw_options = RNA_enum_get(gz->ptr, "draw_options");
176  const bool align_view = (draw_options & ED_GIZMO_MOVE_DRAW_FLAG_ALIGN_VIEW) != 0;
177  float color[4];
178  float matrix_final[4][4];
179  float matrix_align[4][4];
180 
181  gizmo_color_get(gz, highlight, color);
182  WM_gizmo_calc_matrix_final(gz, matrix_final);
183 
184  GPU_matrix_push();
185  GPU_matrix_mul(matrix_final);
186 
187  if (align_view) {
188  float matrix_final_unit[4][4];
190  normalize_m4_m4(matrix_final_unit, matrix_final);
191  mul_m4_m4m4(matrix_align, rv3d->viewmat, matrix_final_unit);
192  zero_v3(matrix_align[3]);
193  transpose_m4(matrix_align);
194  GPU_matrix_mul(matrix_align);
195  }
196 
198  move_geom_draw(gz, color, select, draw_options);
200  GPU_matrix_pop();
201 
202  if (gz->interaction_data) {
203  GPU_matrix_push();
205 
206  if (align_view) {
207  GPU_matrix_mul(matrix_align);
208  }
209 
211  move_geom_draw(gz, (const float[4]){0.5f, 0.5f, 0.5f, 0.5f}, select, draw_options);
213  GPU_matrix_pop();
214  }
215 }
216 
217 static void gizmo_move_draw_select(const bContext *C, wmGizmo *gz, int select_id)
218 {
219  GPU_select_load_id(select_id);
220  move3d_draw_intern(C, gz, true, false);
221 }
222 
223 static void gizmo_move_draw(const bContext *C, wmGizmo *gz)
224 {
225  const bool is_modal = gz->state & WM_GIZMO_STATE_MODAL;
226  const bool is_highlight = (gz->state & WM_GIZMO_STATE_HIGHLIGHT) != 0;
227 
228  (void)is_modal;
229 
231  move3d_draw_intern(C, gz, false, is_highlight);
233 }
234 
236  wmGizmo *gz,
237  const wmEvent *event,
238  eWM_GizmoFlagTweak tweak_flag)
239 {
240  MoveInteraction *inter = gz->interaction_data;
241  if ((event->type != MOUSEMOVE) && (inter->prev.tweak_flag == tweak_flag)) {
242  return OPERATOR_RUNNING_MODAL;
243  }
244  MoveGizmo3D *move = (MoveGizmo3D *)gz;
246 
247  float prop_delta[3];
248  if (CTX_wm_area(C)->spacetype == SPACE_VIEW3D) {
249  move3d_get_translate(gz, event, region, prop_delta);
250  }
251  else {
252  float mval_proj_init[2], mval_proj_curr[2];
253  if ((gizmo_window_project_2d(C, gz, inter->init.mval, 2, false, mval_proj_init) == false) ||
255  C, gz, (const float[2]){UNPACK2(event->mval)}, 2, false, mval_proj_curr) == false)) {
256  return OPERATOR_RUNNING_MODAL;
257  }
258  sub_v2_v2v2(prop_delta, mval_proj_curr, mval_proj_init);
259  if ((gz->flag & WM_GIZMO_DRAW_NO_SCALE) == 0) {
260  mul_v2_fl(prop_delta, gz->scale_final);
261  }
262  prop_delta[2] = 0.0f;
263  }
264 
265  if (tweak_flag & WM_GIZMO_TWEAK_PRECISE) {
266  mul_v3_fl(prop_delta, 0.1f);
267  }
268 
269  add_v3_v3v3(move->prop_co, inter->init.prop_co, prop_delta);
270 
271  if (tweak_flag & WM_GIZMO_TWEAK_SNAP) {
272  if (inter->snap_context_v3d) {
273  float dist_px = MVAL_MAX_PX_DIST * U.pixelsize;
274  const float mval_fl[2] = {UNPACK2(event->mval)};
275  float co[3];
277  inter->snap_context_v3d,
279  region,
280  CTX_wm_view3d(C),
282  &(const struct SnapObjectParams){
283  .snap_target_select = SCE_SNAP_TARGET_ALL,
284  .edit_mode_type = SNAP_GEOM_EDIT,
285  .use_occlusion_test = true,
286  },
287  NULL,
288  mval_fl,
289  NULL,
290  &dist_px,
291  co,
292  NULL)) {
293  float matrix_space_inv[4][4];
294  invert_m4_m4(matrix_space_inv, gz->matrix_space);
295  mul_v3_m4v3(move->prop_co, matrix_space_inv, co);
296  }
297  }
298  }
299 
300  /* set the property for the operator and call its modal function */
301  wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset");
302  if (WM_gizmo_target_property_is_valid(gz_prop)) {
304  }
305  else {
306  zero_v3(move->prop_co);
307  }
308 
310 
311  inter->prev.tweak_flag = tweak_flag;
312 
313  return OPERATOR_RUNNING_MODAL;
314 }
315 
316 static void gizmo_move_exit(bContext *C, wmGizmo *gz, const bool cancel)
317 {
318  MoveInteraction *inter = gz->interaction_data;
319  bool use_reset_value = false;
320  const float *reset_value = NULL;
321  if (cancel) {
322  /* Set the property for the operator and call its modal function. */
323  wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset");
324  if (WM_gizmo_target_property_is_valid(gz_prop)) {
325  use_reset_value = true;
326  reset_value = inter->init.prop_co;
327  }
328  }
329 
330  if (use_reset_value) {
331  wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset");
332  if (WM_gizmo_target_property_is_valid(gz_prop)) {
333  WM_gizmo_target_property_float_set_array(C, gz, gz_prop, reset_value);
334  }
335  }
336 
337  if (inter->snap_context_v3d) {
339  inter->snap_context_v3d = NULL;
340  }
341 
342  if (!cancel) {
343  wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset");
344  if (WM_gizmo_target_property_is_valid(gz_prop)) {
346  }
347  }
348 }
349 
350 static int gizmo_move_invoke(bContext *C, wmGizmo *gz, const wmEvent *event)
351 {
352  const bool use_snap = RNA_boolean_get(gz->ptr, "use_snap");
353 
354  MoveInteraction *inter = MEM_callocN(sizeof(MoveInteraction), __func__);
355  inter->init.mval[0] = event->mval[0];
356  inter->init.mval[1] = event->mval[1];
357 
358 #if 0
359  copy_v3_v3(inter->init.prop_co, move->prop_co);
360 #else
361  wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset");
362  if (WM_gizmo_target_property_is_valid(gz_prop)) {
364  }
365 #endif
366 
368 
369  if (use_snap) {
371  if (area) {
372  switch (area->spacetype) {
373  case SPACE_VIEW3D: {
375  break;
376  }
377  default:
378  /* Not yet supported. */
379  BLI_assert(0);
380  }
381  }
382  }
383 
384  gz->interaction_data = inter;
385 
386  return OPERATOR_RUNNING_MODAL;
387 }
388 
389 static int gizmo_move_test_select(bContext *C, wmGizmo *gz, const int mval[2])
390 {
391  float point_local[2];
392 
393  if (gizmo_window_project_2d(C, gz, (const float[2]){UNPACK2(mval)}, 2, true, point_local) ==
394  false) {
395  return -1;
396  }
397 
398  /* The 'gz->scale_final' is already applied to the projection
399  * when #WM_GIZMO_DRAW_NO_SCALE isn't set. */
400  const float radius = (gz->flag & WM_GIZMO_DRAW_NO_SCALE) ? gz->scale_final : 1.0f;
401  if (len_squared_v2(point_local) < radius) {
402  return 0;
403  }
404 
405  return -1;
406 }
407 
409 {
410  MoveGizmo3D *move = (MoveGizmo3D *)gz;
411  if (WM_gizmo_target_property_is_valid(gz_prop)) {
413  }
414  else {
415  zero_v3(move->prop_co);
416  }
417 }
418 
420 {
421  return WM_CURSOR_NSEW_SCROLL;
422 }
423 
424 /* -------------------------------------------------------------------- */
428 static void GIZMO_GT_move_3d(wmGizmoType *gzt)
429 {
430  /* identifiers */
431  gzt->idname = "GIZMO_GT_move_3d";
432 
433  /* api callbacks */
434  gzt->draw = gizmo_move_draw;
438  gzt->invoke = gizmo_move_invoke;
440  gzt->modal = gizmo_move_modal;
441  gzt->exit = gizmo_move_exit;
443 
444  gzt->struct_size = sizeof(MoveGizmo3D);
445 
446  /* rna */
447  static EnumPropertyItem rna_enum_draw_style[] = {
448  {ED_GIZMO_MOVE_STYLE_RING_2D, "RING_2D", 0, "Ring", ""},
449  {ED_GIZMO_MOVE_STYLE_CROSS_2D, "CROSS_2D", 0, "Ring", ""},
450  {0, NULL, 0, NULL, NULL},
451  };
452  static EnumPropertyItem rna_enum_draw_options[] = {
453  {ED_GIZMO_MOVE_DRAW_FLAG_FILL, "FILL", 0, "Filled", ""},
454  {ED_GIZMO_MOVE_DRAW_FLAG_FILL_SELECT, "FILL_SELECT", 0, "Use fill for selection test", ""},
455  {ED_GIZMO_MOVE_DRAW_FLAG_ALIGN_VIEW, "ALIGN_VIEW", 0, "Align View", ""},
456  {0, NULL, 0, NULL, NULL},
457  };
458 
459  RNA_def_enum(
460  gzt->srna, "draw_style", rna_enum_draw_style, ED_GIZMO_MOVE_STYLE_RING_2D, "Draw Style", "");
461  RNA_def_enum_flag(gzt->srna, "draw_options", rna_enum_draw_options, 0, "Draw Options", "");
462  RNA_def_boolean(gzt->srna, "use_snap", false, "Use Snap", "");
463 
464  WM_gizmotype_target_property_def(gzt, "offset", PROP_FLOAT, 3);
465 }
466 
468 {
470 }
471  /* Move Gizmo API */
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:738
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Definition: context.c:1528
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:784
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
Definition: context.c:793
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define M_SQRT1_2
Definition: BLI_math_base.h:32
void mul_m3_v3(const float M[3][3], float r[3])
Definition: math_matrix.c:926
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
Definition: math_matrix.c:259
void copy_m3_m4(float m1[3][3], const float m2[4][4])
Definition: math_matrix.c:87
bool invert_m4_m4(float R[4][4], const float A[4][4])
Definition: math_matrix.c:1287
void normalize_m4_m4(float R[4][4], const float M[4][4]) ATTR_NONNULL()
Definition: math_matrix.c:1965
void copy_m4_m4(float m1[4][4], const float m2[4][4])
Definition: math_matrix.c:77
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
Definition: math_matrix.c:739
bool invert_m3(float R[3][3])
Definition: math_matrix.c:1171
void transpose_m4(float R[4][4])
Definition: math_matrix.c:1377
void mul_v3_mat3_m4v3(float r[3], const float M[4][4], const float v[3])
Definition: math_matrix.c:800
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
unsigned int uint
Definition: BLI_sys_types.h:67
#define UNPACK2(a)
#define UNUSED_VARS(...)
#define UNUSED(x)
@ SCE_SNAP_TARGET_ALL
@ SCE_SNAP_MODE_VERTEX
@ SCE_SNAP_MODE_EDGE
@ SCE_SNAP_MODE_FACE_RAYCAST
@ SPACE_VIEW3D
@ OPERATOR_RUNNING_MODAL
@ ED_GIZMO_MOVE_STYLE_CROSS_2D
@ ED_GIZMO_MOVE_STYLE_RING_2D
@ ED_GIZMO_MOVE_DRAW_FLAG_FILL_SELECT
@ ED_GIZMO_MOVE_DRAW_FLAG_FILL
@ ED_GIZMO_MOVE_DRAW_FLAG_ALIGN_VIEW
void ED_region_tag_redraw_editor_overlays(struct ARegion *region)
Definition: area.c:690
eSnapMode ED_transform_snap_object_project_view3d(struct SnapObjectContext *sctx, struct Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const eSnapMode snap_to, const struct SnapObjectParams *params, const float init_co[3], const float mval[2], const float prev_co[3], float *dist_px, float r_loc[3], float r_no[3])
SnapObjectContext * ED_transform_snap_object_context_create(struct Scene *scene, int flag)
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx)
void ED_view3d_win_to_delta(const struct ARegion *region, const float xy_delta[2], float zfac, float r_out[3])
float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3])
void immUniform2fv(const char *name, const float data[2])
void immUnbindProgram(void)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
void immVertex3f(uint attr_id, float x, float y, float z)
void immUniform1f(const char *name, float x)
void immUniformColor4fv(const float rgba[4])
GPUVertFormat * immVertexFormat(void)
void immBegin(GPUPrimType, uint vertex_len)
void immEnd(void)
void imm_draw_circle_wire_3d(uint pos, float x, float y, float radius, int nsegments)
void imm_draw_circle_fill_3d(uint pos, float x, float y, float radius, int nsegments)
void GPU_matrix_pop(void)
Definition: gpu_matrix.cc:126
#define GPU_matrix_mul(x)
Definition: GPU_matrix.h:224
void GPU_matrix_push(void)
Definition: gpu_matrix.cc:119
@ GPU_PRIM_LINES
Definition: GPU_primitive.h:20
bool GPU_select_load_id(unsigned int id)
Definition: gpu_select.c:117
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
Definition: GPU_shader.h:253
@ GPU_SHADER_3D_UNIFORM_COLOR
Definition: GPU_shader.h:230
@ GPU_BLEND_NONE
Definition: GPU_state.h:60
@ GPU_BLEND_ALPHA
Definition: GPU_state.h:62
void GPU_blend(eGPUBlend blend)
Definition: gpu_state.cc:39
void GPU_viewport_size_get_f(float coords[4])
Definition: gpu_state.cc:259
@ GPU_FETCH_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
@ PROP_FLOAT
Definition: RNA_types.h:61
#define C
Definition: RandGen.cpp:25
eWM_GizmoFlagTweak
Gizmo tweak flag. Bit-flag passed to gizmo while tweaking.
@ WM_GIZMO_TWEAK_PRECISE
@ WM_GIZMO_TWEAK_SNAP
@ WM_GIZMO_DRAW_NO_SCALE
@ WM_GIZMO_STATE_HIGHLIGHT
@ WM_GIZMO_STATE_MODAL
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
Definition: avxb.h:154
unsigned int U
Definition: btGjkEpa3.h:78
SyclQueue void void size_t num_bytes void
void wm_gizmo_geometryinfo_draw(const GizmoGeomInfo *info, const bool UNUSED(select), const float color[4])
bool gizmo_window_project_2d(bContext *C, const struct wmGizmo *gz, const float mval[2], int axis, bool use_offset, float r_co[2])
void gizmo_color_get(const struct wmGizmo *gz, bool highlight, float r_color[4])
uint pos
uint col
format
Definition: logImageCore.h:38
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
void ED_gizmotypes_move_3d(void)
Definition: move3d_gizmo.c:467
static int gizmo_move_test_select(bContext *C, wmGizmo *gz, const int mval[2])
Definition: move3d_gizmo.c:389
static void gizmo_move_exit(bContext *C, wmGizmo *gz, const bool cancel)
Definition: move3d_gizmo.c:316
static void gizmo_move_property_update(wmGizmo *gz, wmGizmoProperty *gz_prop)
Definition: move3d_gizmo.c:408
static void gizmo_move_draw_select(const bContext *C, wmGizmo *gz, int select_id)
Definition: move3d_gizmo.c:217
static int gizmo_move_modal(bContext *C, wmGizmo *gz, const wmEvent *event, eWM_GizmoFlagTweak tweak_flag)
Definition: move3d_gizmo.c:235
struct MoveGizmo3D MoveGizmo3D
#define DIAL_RESOLUTION
Definition: move3d_gizmo.c:81
static void GIZMO_GT_move_3d(wmGizmoType *gzt)
Definition: move3d_gizmo.c:428
static void move_geom_draw(const wmGizmo *gz, const float color[4], const bool select, const int draw_options)
Definition: move3d_gizmo.c:85
static void gizmo_move_draw(const bContext *C, wmGizmo *gz)
Definition: move3d_gizmo.c:223
static int gizmo_move_cursor_get(wmGizmo *UNUSED(gz))
Definition: move3d_gizmo.c:419
static void move3d_draw_intern(const bContext *C, wmGizmo *gz, const bool select, const bool highlight)
Definition: move3d_gizmo.c:169
static void gizmo_move_matrix_basis_get(const wmGizmo *gz, float r_matrix[4][4])
Definition: move3d_gizmo.c:52
static int gizmo_move_invoke(bContext *C, wmGizmo *gz, const wmEvent *event)
Definition: move3d_gizmo.c:350
static void move3d_get_translate(const wmGizmo *gz, const wmEvent *event, const ARegion *region, float co_delta[3])
Definition: move3d_gizmo.c:145
struct MoveInteraction MoveInteraction
#define MVAL_MAX_PX_DIST
Definition: move3d_gizmo.c:44
static void area(int d1, int d2, int e1, int e2, float weights[2])
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4863
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:5004
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3806
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3783
void * regiondata
wmGizmo gizmo
Definition: move3d_gizmo.c:47
float prop_co[3]
Definition: move3d_gizmo.c:49
float prop_co[3]
Definition: move3d_gizmo.c:69
struct MoveInteraction::@348 prev
struct MoveInteraction::@347 init
eWM_GizmoFlagTweak tweak_flag
Definition: move3d_gizmo.c:73
float matrix_final[4][4]
Definition: move3d_gizmo.c:70
struct SnapObjectContext * snap_context_v3d
Definition: move3d_gizmo.c:77
float viewmat[4][4]
int mval[2]
Definition: WM_types.h:684
short type
Definition: WM_types.h:678
wmGizmoFnDraw draw
wmGizmoFnModal modal
wmGizmoFnMatrixBasisGet matrix_basis_get
const char * idname
wmGizmoFnTestSelect test_select
wmGizmoFnExit exit
wmGizmoFnCursorGet cursor_get
struct StructRNA * srna
wmGizmoFnInvoke invoke
wmGizmoFnDrawSelect draw_select
wmGizmoFnPropertyUpdate property_update
void * interaction_data
eWM_GizmoFlagState state
float matrix_basis[4][4]
float scale_final
struct PointerRNA * ptr
float matrix_space[4][4]
float line_width
eWM_GizmoFlag flag
@ WM_CURSOR_NSEW_SCROLL
Definition: wm_cursors.h:51
@ MOUSEMOVE
void WM_gizmo_calc_matrix_final(const wmGizmo *gz, float r_mat[4][4])
Definition: wm_gizmo.c:554
wmGizmoProperty * WM_gizmo_target_property_find(wmGizmo *gz, const char *idname)
bool WM_gizmo_target_property_is_valid(const wmGizmoProperty *gz_prop)
void WM_gizmo_target_property_float_get_array(const wmGizmo *gz, wmGizmoProperty *gz_prop, float *value)
void WM_gizmotype_target_property_def(wmGizmoType *gzt, const char *idname, int data_type, int array_length)
void WM_gizmo_target_property_float_set_array(bContext *C, const wmGizmo *gz, wmGizmoProperty *gz_prop, const float *value)
void WM_gizmo_target_property_anim_autokey(bContext *C, const wmGizmo *UNUSED(gz), wmGizmoProperty *gz_prop)
void WM_gizmotype_append(void(*gtfunc)(struct wmGizmoType *))
Definition: wm_gizmo_type.c:93