Blender  V2.93
move3d_gizmo.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
31 #include "MEM_guardedalloc.h"
32 
33 #include "BLI_math.h"
34 
35 #include "BKE_context.h"
36 
37 #include "GPU_immediate.h"
38 #include "GPU_immediate_util.h"
39 #include "GPU_matrix.h"
40 #include "GPU_select.h"
41 #include "GPU_state.h"
42 
43 #include "RNA_access.h"
44 #include "RNA_define.h"
45 
46 #include "WM_api.h"
47 #include "WM_types.h"
48 
49 #include "ED_gizmo_library.h"
50 #include "ED_screen.h"
52 #include "ED_view3d.h"
53 
54 /* own includes */
55 #include "../gizmo_geometry.h"
56 #include "../gizmo_library_intern.h"
57 
58 #define MVAL_MAX_PX_DIST 12.0f
59 
60 typedef struct MoveGizmo3D {
62  /* Added to 'matrix_basis' when calculating the matrix. */
63  float prop_co[3];
65 
66 static void gizmo_move_matrix_basis_get(const wmGizmo *gz, float r_matrix[4][4])
67 {
68  MoveGizmo3D *move = (MoveGizmo3D *)gz;
69 
70  copy_m4_m4(r_matrix, move->gizmo.matrix_basis);
71  add_v3_v3(r_matrix[3], move->prop_co);
72 }
73 
74 static int gizmo_move_modal(bContext *C,
75  wmGizmo *gz,
76  const wmEvent *event,
77  eWM_GizmoFlagTweak tweak_flag);
78 
79 typedef struct MoveInteraction {
80  struct {
81  float mval[2];
82  /* Only for when using properties. */
83  float prop_co[3];
84  float matrix_final[4][4];
85  } init;
86  struct {
88  } prev;
89 
90  /* We could have other snap contexts, for now only support 3D view. */
92 
94 
95 #define DIAL_RESOLUTION 32
96 
97 /* -------------------------------------------------------------------- */
98 
99 static void move_geom_draw(const wmGizmo *gz,
100  const float color[4],
101  const bool select,
102  const int draw_options)
103 {
104 #ifdef USE_GIZMO_CUSTOM_DIAL
105  UNUSED_VARS(move3d, col, axis_modal_mat);
106  wm_gizmo_geometryinfo_draw(&wm_gizmo_geom_data_move3d, select);
107 #else
108  const int draw_style = RNA_enum_get(gz->ptr, "draw_style");
109  const bool filled = (draw_style != ED_GIZMO_MOVE_STYLE_CROSS_2D) &&
110  ((draw_options & (select ? (ED_GIZMO_MOVE_DRAW_FLAG_FILL |
113 
116 
119 
120  float viewport[4];
121  GPU_viewport_size_get_f(viewport);
122  immUniform2fv("viewportSize", &viewport[2]);
123  immUniform1f("lineWidth", gz->line_width * U.pixelsize);
124 
125  immUniformColor4fv(color);
126 
127  /* Use the final scale as a radius if it's not already applied to the final matrix. */
128  const float radius = (gz->flag & WM_GIZMO_DRAW_NO_SCALE) ? gz->scale_final : 1.0f;
129 
130  if (draw_style == ED_GIZMO_MOVE_STYLE_RING_2D) {
131  if (filled) {
133  }
134  else {
136  }
137  }
138  else if (draw_style == ED_GIZMO_MOVE_STYLE_CROSS_2D) {
139  const float radius_diag = M_SQRT1_2 * radius;
141  immVertex2f(pos, radius_diag, radius_diag);
142  immVertex2f(pos, -radius_diag, -radius_diag);
143 
144  immVertex2f(pos, -radius_diag, radius_diag);
145  immVertex2f(pos, radius_diag, -radius_diag);
146  immEnd();
147  }
148  else {
149  BLI_assert(0);
150  }
151 
153 
155 #endif
156 }
157 
158 static void move3d_get_translate(const wmGizmo *gz,
159  const wmEvent *event,
160  const ARegion *region,
161  float co_delta[3])
162 {
163  MoveInteraction *inter = gz->interaction_data;
164  const float mval_delta[2] = {
165  event->mval[0] - inter->init.mval[0],
166  event->mval[1] - inter->init.mval[1],
167  };
168 
169  RegionView3D *rv3d = region->regiondata;
170  float co_ref[3];
171  mul_v3_mat3_m4v3(co_ref, gz->matrix_space, inter->init.prop_co);
172  const float zfac = ED_view3d_calc_zfac(rv3d, co_ref, NULL);
173 
174  ED_view3d_win_to_delta(region, mval_delta, co_delta, zfac);
175 
176  float matrix_space_inv[3][3];
177  copy_m3_m4(matrix_space_inv, gz->matrix_space);
178  invert_m3(matrix_space_inv);
179  mul_m3_v3(matrix_space_inv, co_delta);
180 }
181 
182 static void move3d_draw_intern(const bContext *C,
183  wmGizmo *gz,
184  const bool select,
185  const bool highlight)
186 {
187  MoveInteraction *inter = gz->interaction_data;
188  const int draw_options = RNA_enum_get(gz->ptr, "draw_options");
189  const bool align_view = (draw_options & ED_GIZMO_MOVE_DRAW_FLAG_ALIGN_VIEW) != 0;
190  float color[4];
191  float matrix_final[4][4];
192  float matrix_align[4][4];
193 
194  gizmo_color_get(gz, highlight, color);
195  WM_gizmo_calc_matrix_final(gz, matrix_final);
196 
197  GPU_matrix_push();
198  GPU_matrix_mul(matrix_final);
199 
200  if (align_view) {
201  float matrix_final_unit[4][4];
203  normalize_m4_m4(matrix_final_unit, matrix_final);
204  mul_m4_m4m4(matrix_align, rv3d->viewmat, matrix_final_unit);
205  zero_v3(matrix_align[3]);
206  transpose_m4(matrix_align);
207  GPU_matrix_mul(matrix_align);
208  }
209 
211  move_geom_draw(gz, color, select, draw_options);
213  GPU_matrix_pop();
214 
215  if (gz->interaction_data) {
216  GPU_matrix_push();
218 
219  if (align_view) {
220  GPU_matrix_mul(matrix_align);
221  }
222 
224  move_geom_draw(gz, (const float[4]){0.5f, 0.5f, 0.5f, 0.5f}, select, draw_options);
226  GPU_matrix_pop();
227  }
228 }
229 
230 static void gizmo_move_draw_select(const bContext *C, wmGizmo *gz, int select_id)
231 {
232  GPU_select_load_id(select_id);
233  move3d_draw_intern(C, gz, true, false);
234 }
235 
236 static void gizmo_move_draw(const bContext *C, wmGizmo *gz)
237 {
238  const bool is_modal = gz->state & WM_GIZMO_STATE_MODAL;
239  const bool is_highlight = (gz->state & WM_GIZMO_STATE_HIGHLIGHT) != 0;
240 
241  (void)is_modal;
242 
244  move3d_draw_intern(C, gz, false, is_highlight);
246 }
247 
249  wmGizmo *gz,
250  const wmEvent *event,
251  eWM_GizmoFlagTweak tweak_flag)
252 {
253  MoveInteraction *inter = gz->interaction_data;
254  if ((event->type != MOUSEMOVE) && (inter->prev.tweak_flag == tweak_flag)) {
255  return OPERATOR_RUNNING_MODAL;
256  }
257  MoveGizmo3D *move = (MoveGizmo3D *)gz;
259 
260  float prop_delta[3];
261  if (CTX_wm_area(C)->spacetype == SPACE_VIEW3D) {
262  move3d_get_translate(gz, event, region, prop_delta);
263  }
264  else {
265  float mval_proj_init[2], mval_proj_curr[2];
266  if ((gizmo_window_project_2d(C, gz, inter->init.mval, 2, false, mval_proj_init) == false) ||
268  C, gz, (const float[2]){UNPACK2(event->mval)}, 2, false, mval_proj_curr) == false)) {
269  return OPERATOR_RUNNING_MODAL;
270  }
271  sub_v2_v2v2(prop_delta, mval_proj_curr, mval_proj_init);
272  if ((gz->flag & WM_GIZMO_DRAW_NO_SCALE) == 0) {
273  mul_v2_fl(prop_delta, gz->scale_final);
274  }
275  prop_delta[2] = 0.0f;
276  }
277 
278  if (tweak_flag & WM_GIZMO_TWEAK_PRECISE) {
279  mul_v3_fl(prop_delta, 0.1f);
280  }
281 
282  add_v3_v3v3(move->prop_co, inter->init.prop_co, prop_delta);
283 
284  if (tweak_flag & WM_GIZMO_TWEAK_SNAP) {
285  if (inter->snap_context_v3d) {
286  float dist_px = MVAL_MAX_PX_DIST * U.pixelsize;
287  const float mval_fl[2] = {UNPACK2(event->mval)};
288  float co[3];
290  inter->snap_context_v3d,
293  &(const struct SnapObjectParams){
294  .snap_select = SNAP_ALL,
295  .use_object_edit_cage = true,
296  .use_occlusion_test = true,
297  },
298  mval_fl,
299  NULL,
300  &dist_px,
301  co,
302  NULL)) {
303  float matrix_space_inv[4][4];
304  invert_m4_m4(matrix_space_inv, gz->matrix_space);
305  mul_v3_m4v3(move->prop_co, matrix_space_inv, co);
306  }
307  }
308  }
309 
310  /* set the property for the operator and call its modal function */
311  wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset");
312  if (WM_gizmo_target_property_is_valid(gz_prop)) {
314  }
315  else {
316  zero_v3(move->prop_co);
317  }
318 
320 
321  inter->prev.tweak_flag = tweak_flag;
322 
323  return OPERATOR_RUNNING_MODAL;
324 }
325 
326 static void gizmo_move_exit(bContext *C, wmGizmo *gz, const bool cancel)
327 {
328  MoveInteraction *inter = gz->interaction_data;
329  bool use_reset_value = false;
330  const float *reset_value = NULL;
331  if (cancel) {
332  /* Set the property for the operator and call its modal function. */
333  wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset");
334  if (WM_gizmo_target_property_is_valid(gz_prop)) {
335  use_reset_value = true;
336  reset_value = inter->init.prop_co;
337  }
338  }
339 
340  if (use_reset_value) {
341  wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset");
342  if (WM_gizmo_target_property_is_valid(gz_prop)) {
343  WM_gizmo_target_property_float_set_array(C, gz, gz_prop, reset_value);
344  }
345  }
346 
347  if (inter->snap_context_v3d) {
349  inter->snap_context_v3d = NULL;
350  }
351 
352  if (!cancel) {
353  wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset");
354  if (WM_gizmo_target_property_is_valid(gz_prop)) {
356  }
357  }
358 }
359 
360 static int gizmo_move_invoke(bContext *C, wmGizmo *gz, const wmEvent *event)
361 {
362  const bool use_snap = RNA_boolean_get(gz->ptr, "use_snap");
363 
364  MoveInteraction *inter = MEM_callocN(sizeof(MoveInteraction), __func__);
365  inter->init.mval[0] = event->mval[0];
366  inter->init.mval[1] = event->mval[1];
367 
368 #if 0
369  copy_v3_v3(inter->init.prop_co, move->prop_co);
370 #else
371  wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset");
372  if (WM_gizmo_target_property_is_valid(gz_prop)) {
374  }
375 #endif
376 
378 
379  if (use_snap) {
381  if (area) {
382  switch (area->spacetype) {
383  case SPACE_VIEW3D: {
386  break;
387  }
388  default:
389  /* Not yet supported. */
390  BLI_assert(0);
391  }
392  }
393  }
394 
395  gz->interaction_data = inter;
396 
397  return OPERATOR_RUNNING_MODAL;
398 }
399 
400 static int gizmo_move_test_select(bContext *C, wmGizmo *gz, const int mval[2])
401 {
402  float point_local[2];
403 
404  if (gizmo_window_project_2d(C, gz, (const float[2]){UNPACK2(mval)}, 2, true, point_local) ==
405  false) {
406  return -1;
407  }
408 
409  /* The 'gz->scale_final' is already applied to the projection
410  * when #WM_GIZMO_DRAW_NO_SCALE isn't set. */
411  const float radius = (gz->flag & WM_GIZMO_DRAW_NO_SCALE) ? gz->scale_final : 1.0f;
412  if (len_squared_v2(point_local) < radius) {
413  return 0;
414  }
415 
416  return -1;
417 }
418 
420 {
421  MoveGizmo3D *move = (MoveGizmo3D *)gz;
422  if (WM_gizmo_target_property_is_valid(gz_prop)) {
424  }
425  else {
426  zero_v3(move->prop_co);
427  }
428 }
429 
431 {
432  return WM_CURSOR_NSEW_SCROLL;
433 }
434 
435 /* -------------------------------------------------------------------- */
439 static void GIZMO_GT_move_3d(wmGizmoType *gzt)
440 {
441  /* identifiers */
442  gzt->idname = "GIZMO_GT_move_3d";
443 
444  /* api callbacks */
445  gzt->draw = gizmo_move_draw;
449  gzt->invoke = gizmo_move_invoke;
451  gzt->modal = gizmo_move_modal;
452  gzt->exit = gizmo_move_exit;
454 
455  gzt->struct_size = sizeof(MoveGizmo3D);
456 
457  /* rna */
458  static EnumPropertyItem rna_enum_draw_style[] = {
459  {ED_GIZMO_MOVE_STYLE_RING_2D, "RING_2D", 0, "Ring", ""},
460  {ED_GIZMO_MOVE_STYLE_CROSS_2D, "CROSS_2D", 0, "Ring", ""},
461  {0, NULL, 0, NULL, NULL},
462  };
463  static EnumPropertyItem rna_enum_draw_options[] = {
464  {ED_GIZMO_MOVE_DRAW_FLAG_FILL, "FILL", 0, "Filled", ""},
465  {ED_GIZMO_MOVE_DRAW_FLAG_FILL_SELECT, "FILL_SELECT", 0, "Use fill for selection test", ""},
466  {ED_GIZMO_MOVE_DRAW_FLAG_ALIGN_VIEW, "ALIGN_VIEW", 0, "Align View", ""},
467  {0, NULL, 0, NULL, NULL},
468  };
469 
470  RNA_def_enum(
471  gzt->srna, "draw_style", rna_enum_draw_style, ED_GIZMO_MOVE_STYLE_RING_2D, "Draw Style", "");
472  RNA_def_enum_flag(gzt->srna, "draw_options", rna_enum_draw_options, 0, "Draw Options", "");
473  RNA_def_boolean(gzt->srna, "use_snap", false, "Use Snap", "");
474 
475  WM_gizmotype_target_property_def(gzt, "offset", PROP_FLOAT, 3);
476 }
477 
479 {
481 }
482  /* Move Gizmo API */
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:714
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Definition: context.c:1424
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:760
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:725
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
Definition: context.c:769
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define M_SQRT1_2
Definition: BLI_math_base.h:50
void mul_m3_v3(const float M[3][3], float r[3])
Definition: math_matrix.c:930
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
Definition: math_matrix.c:262
void copy_m3_m4(float m1[3][3], const float m2[4][4])
Definition: math_matrix.c:105
bool invert_m4_m4(float R[4][4], const float A[4][4])
Definition: math_matrix.c:1278
void normalize_m4_m4(float R[4][4], const float M[4][4]) ATTR_NONNULL()
Definition: math_matrix.c:1972
void copy_m4_m4(float m1[4][4], const float m2[4][4])
Definition: math_matrix.c:95
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
Definition: math_matrix.c:742
bool invert_m3(float R[3][3])
Definition: math_matrix.c:1152
void transpose_m4(float R[4][4])
Definition: math_matrix.c:1358
void mul_v3_mat3_m4v3(float r[3], const float M[4][4], const float v[3])
Definition: math_matrix.c:804
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:83
#define UNPACK2(a)
#define UNUSED_VARS(...)
#define UNUSED(x)
#define SCE_SNAP_MODE_FACE
#define SCE_SNAP_MODE_VERTEX
#define SCE_SNAP_MODE_EDGE
@ 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:706
SnapObjectContext * ED_transform_snap_object_context_create_view3d(struct Scene *scene, int flag, const struct ARegion *region, const struct View3D *v3d)
bool ED_transform_snap_object_project_view3d(struct SnapObjectContext *sctx, struct Depsgraph *depsgraph, const unsigned short snap_to, const struct SnapObjectParams *params, const float mval[2], const float prev_co[3], float *dist_px, float r_loc[3], float r_no[3])
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx)
void ED_view3d_win_to_delta(const struct ARegion *region, const float mval[2], float out[3], const float zfac)
float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3], bool *r_flip)
void immUniform2fv(const char *name, const float data[2])
void immUnbindProgram(void)
void immVertex2f(uint attr_id, float x, float y)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
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_fill_2d(uint shdr_pos, float x, float y, float radius, int nsegments)
void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float radius, int nsegments)
void GPU_matrix_pop(void)
Definition: gpu_matrix.cc:142
#define GPU_matrix_mul(x)
Definition: GPU_matrix.h:223
void GPU_matrix_push(void)
Definition: gpu_matrix.cc:135
@ GPU_PRIM_LINES
Definition: GPU_primitive.h:36
bool GPU_select_load_id(unsigned int id)
Definition: gpu_select.c:108
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
Definition: GPU_shader.h:223
@ GPU_SHADER_3D_UNIFORM_COLOR
Definition: GPU_shader.h:200
@ GPU_BLEND_NONE
Definition: GPU_state.h:55
@ GPU_BLEND_ALPHA
Definition: GPU_state.h:57
void GPU_blend(eGPUBlend blend)
Definition: gpu_state.cc:55
void GPU_viewport_size_get_f(float coords[4])
Definition: gpu_state.cc:279
@ 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.
@ PROP_FLOAT
Definition: RNA_types.h:75
#define C
Definition: RandGen.cpp:39
eWM_GizmoFlagTweak
Gizmo tweak flag. Bitflag 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
unsigned int U
Definition: btGjkEpa3.h:78
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, const bool highlight, float r_color[4])
uint pos
uint col
format
Definition: logImageCore.h:47
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
void ED_gizmotypes_move_3d(void)
Definition: move3d_gizmo.c:478
static int gizmo_move_test_select(bContext *C, wmGizmo *gz, const int mval[2])
Definition: move3d_gizmo.c:400
static void gizmo_move_exit(bContext *C, wmGizmo *gz, const bool cancel)
Definition: move3d_gizmo.c:326
static void gizmo_move_property_update(wmGizmo *gz, wmGizmoProperty *gz_prop)
Definition: move3d_gizmo.c:419
static void gizmo_move_draw_select(const bContext *C, wmGizmo *gz, int select_id)
Definition: move3d_gizmo.c:230
static int gizmo_move_modal(bContext *C, wmGizmo *gz, const wmEvent *event, eWM_GizmoFlagTweak tweak_flag)
Definition: move3d_gizmo.c:248
struct MoveGizmo3D MoveGizmo3D
#define DIAL_RESOLUTION
Definition: move3d_gizmo.c:95
static void GIZMO_GT_move_3d(wmGizmoType *gzt)
Definition: move3d_gizmo.c:439
static void move_geom_draw(const wmGizmo *gz, const float color[4], const bool select, const int draw_options)
Definition: move3d_gizmo.c:99
static void gizmo_move_draw(const bContext *C, wmGizmo *gz)
Definition: move3d_gizmo.c:236
static int gizmo_move_cursor_get(wmGizmo *UNUSED(gz))
Definition: move3d_gizmo.c:430
static void move3d_draw_intern(const bContext *C, wmGizmo *gz, const bool select, const bool highlight)
Definition: move3d_gizmo.c:182
static void gizmo_move_matrix_basis_get(const wmGizmo *gz, float r_matrix[4][4])
Definition: move3d_gizmo.c:66
static int gizmo_move_invoke(bContext *C, wmGizmo *gz, const wmEvent *event)
Definition: move3d_gizmo.c:360
static void move3d_get_translate(const wmGizmo *gz, const wmEvent *event, const ARegion *region, float co_delta[3])
Definition: move3d_gizmo.c:158
struct MoveInteraction MoveInteraction
#define MVAL_MAX_PX_DIST
Definition: move3d_gizmo.c:58
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:6261
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6402
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
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:3795
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:3771
void * regiondata
wmGizmo gizmo
Definition: move3d_gizmo.c:61
float prop_co[3]
Definition: move3d_gizmo.c:63
float prop_co[3]
Definition: move3d_gizmo.c:83
struct MoveInteraction::@323 init
eWM_GizmoFlagTweak tweak_flag
Definition: move3d_gizmo.c:87
float matrix_final[4][4]
Definition: move3d_gizmo.c:84
struct SnapObjectContext * snap_context_v3d
Definition: move3d_gizmo.c:91
struct MoveInteraction::@324 prev
float viewmat[4][4]
const struct ARegion * region
int mval[2]
Definition: WM_types.h:583
short type
Definition: WM_types.h:577
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
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
Definition: util_avxb.h:167
@ WM_CURSOR_NSEW_SCROLL
Definition: wm_cursors.h:67
@ MOUSEMOVE
void WM_gizmo_calc_matrix_final(const wmGizmo *gz, float r_mat[4][4])
Definition: wm_gizmo.c:601
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 *))