Blender  V3.3
transform_gizmo_extrude_3d.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "BLI_array_utils.h"
8 #include "BLI_listbase.h"
9 #include "BLI_math.h"
10 #include "BLI_utildefines.h"
11 
12 #include "BKE_context.h"
13 #include "BKE_global.h"
14 #include "BKE_scene.h"
15 
16 #include "RNA_access.h"
17 #include "RNA_define.h"
18 
19 #include "WM_api.h"
20 #include "WM_message.h"
21 #include "WM_toolsystem.h"
22 #include "WM_types.h"
23 
24 #include "ED_gizmo_library.h"
25 #include "ED_gizmo_utils.h"
26 #include "ED_screen.h"
27 #include "ED_transform.h"
28 
29 #include "UI_resources.h"
30 
31 #include "MEM_guardedalloc.h"
32 
33 /* -------------------------------------------------------------------- */
37 enum {
40 };
41 
42 static const float extrude_button_scale = 0.15f;
43 static const float extrude_button_offset_scale = 1.5f;
44 static const float extrude_outer_scale = 1.2f;
45 static const float extrude_arrow_scale = 0.7f;
46 static const float extrude_arrow_xyz_axis_scale = 0.6666f;
47 static const float extrude_arrow_normal_axis_scale = 0.6666f;
48 static const float extrude_dial_scale = 0.2;
49 
50 static const uchar shape_plus[] = {
51  0x73, 0x73, 0x73, 0x36, 0x8c, 0x36, 0x8c, 0x73, 0xc9, 0x73, 0xc9, 0x8c, 0x8c,
52  0x8c, 0x8c, 0xc9, 0x73, 0xc9, 0x73, 0x8c, 0x36, 0x8c, 0x36, 0x73, 0x36, 0x73,
53 };
54 
55 typedef struct GizmoExtrudeGroup {
56 
57  /* XYZ & normal. */
59  /* Only visible when 'drag' tool option is disabled. */
61  /* Constrained & unconstrained (arrow & circle). */
64 
65  /* Copied from the transform operator,
66  * use to redo with the same settings. */
67  struct {
68  float orient_matrix[3][3];
69  bool constraint_axis[3];
70  float value[4];
73 
74  /* Depends on object type. */
76 
77  struct {
78  float normal_mat3[3][3]; /* use Z axis for normal. */
80  } data;
81 
85 
87  const float mat[3][3])
88 {
89  for (int i = 0; i < 3; i++) {
91  mat[i],
94  }
95 }
96 
98  const float mat[3][3])
99 {
100  /* Set orientation without location. */
101  for (int j = 0; j < 3; j++) {
102  copy_v3_v3(ggd->adjust[0]->matrix_basis[j], mat[j]);
103  }
104  /* nop when (i == 2). */
105  swap_v3_v3(ggd->adjust[0]->matrix_basis[ggd->adjust_axis], ggd->adjust[0]->matrix_basis[2]);
106 }
107 
108 static void gizmo_mesh_extrude_setup(const bContext *C, wmGizmoGroup *gzgroup)
109 {
110  struct GizmoExtrudeGroup *ggd = MEM_callocN(sizeof(GizmoExtrudeGroup), __func__);
111  gzgroup->customdata = ggd;
112 
113  const wmGizmoType *gzt_arrow = WM_gizmotype_find("GIZMO_GT_arrow_3d", true);
114  const wmGizmoType *gzt_move = WM_gizmotype_find("GIZMO_GT_button_2d", true);
115  const wmGizmoType *gzt_dial = WM_gizmotype_find("GIZMO_GT_dial_3d", true);
116 
117  ggd->adjust[0] = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL);
118  ggd->adjust[1] = WM_gizmo_new_ptr(gzt_dial, gzgroup, NULL);
119  RNA_enum_set(ggd->adjust[1]->ptr, "draw_options", ED_GIZMO_DIAL_DRAW_FLAG_FILL_SELECT);
120 
121  for (int i = 0; i < 4; i++) {
122  ggd->invoke_xyz_no[i] = WM_gizmo_new_ptr(gzt_move, gzgroup, NULL);
124  }
125 
126  {
127  ggd->invoke_view = WM_gizmo_new_ptr(gzt_dial, gzgroup, NULL);
128  ggd->invoke_view->select_bias = -2.0f;
130  }
131 
132  {
133  PropertyRNA *prop = RNA_struct_find_property(ggd->invoke_xyz_no[3]->ptr, "shape");
134  for (int i = 0; i < 4; i++) {
136  ggd->invoke_xyz_no[i]->ptr, prop, (const char *)shape_plus, ARRAY_SIZE(shape_plus));
137  }
138  }
139 
140  {
141  const char *op_idname = NULL;
142  /* Grease pencil does not use `obedit`. */
143  /* GPXX: Remove if OB_MODE_EDIT_GPENCIL is merged with OB_MODE_EDIT */
144  const Object *obact = CTX_data_active_object(C);
145  if (obact->type == OB_GPENCIL) {
146  op_idname = "GPENCIL_OT_extrude_move";
147  }
148  else if (obact->type == OB_MESH) {
149  op_idname = "MESH_OT_extrude_context_move";
150  ggd->normal_axis = 2;
151  }
152  else if (obact->type == OB_ARMATURE) {
153  op_idname = "ARMATURE_OT_extrude_move";
154  ggd->normal_axis = 1;
155  }
156  else if (obact->type == OB_CURVES_LEGACY) {
157  op_idname = "CURVE_OT_extrude_move";
158  ggd->normal_axis = 2;
159  }
160  else {
161  BLI_assert(0);
162  }
163  ggd->ot_extrude = WM_operatortype_find(op_idname, true);
164  ggd->gzgt_axis_type_prop = RNA_struct_type_find_property(gzgroup->type->srna, "axis_type");
165  }
166 
167  for (int i = 0; i < 3; i++) {
169  }
171  ggd->invoke_view->color[3] = 0.5f;
172 
173  for (int i = 0; i < 2; i++) {
175  }
176 
177  for (int i = 0; i < 4; i++) {
179  }
181  ggd->invoke_view->line_width = 2.0f;
182 
185  ggd->adjust[1]->line_width = 2.0f;
186 
187  /* XYZ & normal axis extrude. */
188  for (int i = 0; i < 4; i++) {
190  {
191  bool constraint[3] = {0, 0, 0};
192  constraint[(i < 3) ? i : ggd->normal_axis] = true;
193  PointerRNA macroptr = RNA_pointer_get(ptr, "TRANSFORM_OT_translate");
194  RNA_boolean_set(&macroptr, "release_confirm", true);
195  RNA_boolean_set_array(&macroptr, "constraint_axis", constraint);
196  }
197  }
198 
199  {
201  PointerRNA macroptr = RNA_pointer_get(ptr, "TRANSFORM_OT_translate");
202  RNA_boolean_set(&macroptr, "release_confirm", true);
203 
204  const bool constraint[3] = {0, 0, 0};
205  RNA_boolean_set_array(&macroptr, "constraint_axis", constraint);
206  }
207 
208  /* Adjust extrude. */
209  for (int i = 0; i < 2; i++) {
210  wmGizmo *gz = ggd->adjust[i];
212  PointerRNA macroptr = RNA_pointer_get(ptr, "TRANSFORM_OT_translate");
213  RNA_boolean_set(&macroptr, "release_confirm", true);
214  wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, 0);
215  gzop->is_redo = true;
216  }
217 }
218 
219 static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *gzgroup)
220 {
221  GizmoExtrudeGroup *ggd = gzgroup->customdata;
222 
223  for (int i = 0; i < 4; i++) {
225  }
227  for (int i = 0; i < 2; i++) {
228  WM_gizmo_set_flag(ggd->adjust[i], WM_GIZMO_HIDDEN, true);
229  }
230 
231  if (G.moving) {
232  return;
233  }
234 
236 
237  int axis_type;
238  {
239  PointerRNA ptr;
242  axis_type = RNA_property_enum_get(&ptr, ggd->gzgt_axis_type_prop);
243  }
244 
246  const bool use_normal = ((ggd->data.orientation_index != V3D_ORIENT_NORMAL) ||
247  (axis_type == EXTRUDE_AXIS_NORMAL));
248  const int axis_len_used = use_normal ? 4 : 3;
249 
250  struct TransformBounds tbounds;
251 
252  if (use_normal) {
253  struct TransformBounds tbounds_normal;
255  &(struct TransformCalcParams){
256  .orientation_index = V3D_ORIENT_NORMAL + 1,
257  },
258  &tbounds_normal)) {
259  unit_m3(tbounds_normal.axis);
260  }
261  copy_m3_m3(ggd->data.normal_mat3, tbounds_normal.axis);
262  }
263 
264  /* TODO(campbell): run second since this modifies the 3D view, it should not. */
266  &(struct TransformCalcParams){
267  .orientation_index = ggd->data.orientation_index + 1,
268  },
269  &tbounds)) {
270  return;
271  }
272 
273  /* Main axis is normal. */
274  if (!use_normal) {
275  copy_m3_m3(ggd->data.normal_mat3, tbounds.axis);
276  }
277 
278  /* Offset the add icon. */
280  ggd->data.normal_mat3[ggd->normal_axis],
283 
284  /* Adjust current operator. */
285  /* Don't use 'WM_operator_last_redo' because selection actions will be ignored. */
287  bool has_redo = (op && op->type == ggd->ot_extrude);
288  wmOperator *op_xform = has_redo ? op->macro.last : NULL;
289 
290  bool adjust_is_flip = false;
291  wmGizmo *gz_adjust = NULL;
292 
293  if (has_redo) {
294  gz_adjust = ggd->adjust[1];
295  /* We can't access this from 'ot->last_properties'
296  * because some properties use skip-save. */
297  RNA_float_get_array(op_xform->ptr, "orient_matrix", &ggd->redo_xform.orient_matrix[0][0]);
298  RNA_boolean_get_array(op_xform->ptr, "constraint_axis", ggd->redo_xform.constraint_axis);
299  RNA_float_get_array(op_xform->ptr, "value", ggd->redo_xform.value);
300  ggd->redo_xform.orient_type = RNA_enum_get(op_xform->ptr, "orient_type");
301 
302  /* Set properties for redo. */
303  for (int i = 0; i < 3; i++) {
304  if (ggd->redo_xform.constraint_axis[i]) {
305  adjust_is_flip = ggd->redo_xform.value[i] < 0.0f;
306  ggd->adjust_axis = i;
307  gz_adjust = ggd->adjust[0];
308  break;
309  }
310  }
311  }
312 
313  /* Needed for normal orientation. */
315 
316  /* Location. */
317  for (int i = 0; i < axis_len_used; i++) {
319  }
321  /* Un-hide. */
322  for (int i = 0; i < axis_len_used; i++) {
324  }
325 
326  if (has_redo) {
327  if (gz_adjust == ggd->adjust[0]) {
329  if (adjust_is_flip) {
330  negate_v3(ggd->adjust[0]->matrix_basis[2]);
331  }
332  }
333  WM_gizmo_set_matrix_location(gz_adjust, tbounds.center);
334  WM_gizmo_set_flag(gz_adjust, WM_GIZMO_HIDDEN, false);
335  }
336 
337  /* Redo with current settings. */
338  if (has_redo) {
339  for (int i = 0; i < 4; i++) {
340  RNA_enum_set(ggd->invoke_xyz_no[i]->ptr,
341  "draw_options",
343  (((gz_adjust == ggd->adjust[0]) &&
344  dot_v3v3(ggd->adjust[0]->matrix_basis[2],
345  ggd->invoke_xyz_no[i]->matrix_offset[3]) > 0.98f) ?
346  0 :
348  }
349  }
350  else {
351  for (int i = 0; i < 4; i++) {
352  RNA_enum_set(ggd->invoke_xyz_no[i]->ptr,
353  "draw_options",
355  }
356  }
357 
358  /* TODO: skip calculating axis which won't be used (above). */
359  switch (axis_type) {
360  case EXTRUDE_AXIS_NORMAL:
361  for (int i = 0; i < 3; i++) {
363  }
364  break;
365  case EXTRUDE_AXIS_XYZ:
367  break;
368  }
369 
372  }
373  else {
375  }
376 }
377 
379 {
380  GizmoExtrudeGroup *ggd = gzgroup->customdata;
381  switch (ggd->data.orientation_index) {
382  case V3D_ORIENT_VIEW: {
384  float mat[3][3];
385  copy_m3_m4(mat, rv3d->viewinv);
386  normalize_m3(mat);
388  break;
389  }
390  }
391 
392  /* Basic ordering for drawing only. */
393  {
395  LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) {
396  gz->temp.f = dot_v3v3(rv3d->viewinv[2], gz->matrix_offset[3]);
397  }
399 
400  if ((ggd->adjust[1]->flag & WM_GIZMO_HIDDEN) == 0) {
401  copy_v3_v3(ggd->adjust[1]->matrix_basis[0], rv3d->viewinv[0]);
402  copy_v3_v3(ggd->adjust[1]->matrix_basis[1], rv3d->viewinv[1]);
403  copy_v3_v3(ggd->adjust[1]->matrix_basis[2], rv3d->viewinv[2]);
404  }
405  if ((ggd->invoke_view->flag & WM_GIZMO_HIDDEN) == 0) {
406  copy_v3_v3(ggd->invoke_view->matrix_basis[0], rv3d->viewinv[0]);
407  copy_v3_v3(ggd->invoke_view->matrix_basis[1], rv3d->viewinv[1]);
408  copy_v3_v3(ggd->invoke_view->matrix_basis[2], rv3d->viewinv[2]);
409  }
410  }
411 }
412 
414  wmGizmoGroup *gzgroup,
415  wmGizmo *gz,
416  const wmEvent *UNUSED(event))
417 {
418  GizmoExtrudeGroup *ggd = gzgroup->customdata;
419  if (ELEM(gz, ggd->adjust[0], ggd->adjust[1])) {
420  /* Set properties for redo. */
421  wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, 0);
422  PointerRNA macroptr = RNA_pointer_get(&gzop->ptr, "TRANSFORM_OT_translate");
423  if (gz == ggd->adjust[0]) {
424  RNA_boolean_set_array(&macroptr, "constraint_axis", ggd->redo_xform.constraint_axis);
425  RNA_float_set_array(&macroptr, "orient_matrix", &ggd->redo_xform.orient_matrix[0][0]);
426  RNA_enum_set(&macroptr, "orient_matrix_type", ggd->redo_xform.orient_type);
427  RNA_enum_set(&macroptr, "orient_type", ggd->redo_xform.orient_type);
428  }
429  RNA_float_set_array(&macroptr, "value", ggd->redo_xform.value);
430  }
431  else if (gz == ggd->invoke_view) {
432  /* pass */
433  }
434  else {
435  /* Workaround for extrude action modifying normals. */
436  const int i = BLI_array_findindex(ggd->invoke_xyz_no, ARRAY_SIZE(ggd->invoke_xyz_no), &gz);
437  BLI_assert(i != -1);
438  bool use_normal_matrix = false;
439  if (i == 3) {
440  use_normal_matrix = true;
441  }
442  else if (ggd->data.orientation_index == V3D_ORIENT_NORMAL) {
443  use_normal_matrix = true;
444  }
445  if (use_normal_matrix) {
446  wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, 0);
447  PointerRNA macroptr = RNA_pointer_get(&gzop->ptr, "TRANSFORM_OT_translate");
448  RNA_float_set_array(&macroptr, "orient_matrix", &ggd->data.normal_mat3[0][0]);
449  RNA_enum_set(&macroptr, "orient_type", V3D_ORIENT_NORMAL);
450  }
451  }
452 }
453 
455  wmGizmoGroup *gzgroup,
456  struct wmMsgBus *mbus)
457 {
458  GizmoExtrudeGroup *ggd = gzgroup->customdata;
459  ARegion *region = CTX_wm_region(C);
460 
461  /* Subscribe to view properties */
462  wmMsgSubscribeValue msg_sub_value_gz_tag_refresh = {
463  .owner = region,
464  .user_data = gzgroup->parent_gzmap,
466  };
467 
468  {
470  mbus, TransformOrientationSlot, type, &msg_sub_value_gz_tag_refresh);
471  }
472 
474  &(const wmMsgParams_RNA){
475  .ptr =
476  (PointerRNA){
477  .type = gzgroup->type->srna,
478  },
479  .prop = ggd->gzgt_axis_type_prop,
480  },
481  &msg_sub_value_gz_tag_refresh,
482  __func__);
483 
484  {
486  PointerRNA toolsettings_ptr;
487  RNA_pointer_create(&scene->id, &RNA_ToolSettings, scene->toolsettings, &toolsettings_ptr);
488  const PropertyRNA *props[] = {
489  &rna_ToolSettings_workspace_tool_type,
490  };
491  for (int i = 0; i < ARRAY_SIZE(props); i++) {
493  mbus, &toolsettings_ptr, props[i], &msg_sub_value_gz_tag_refresh, __func__);
494  }
495  }
496 }
497 
499 {
500  gzgt->name = "3D View Extrude";
501  gzgt->idname = "VIEW3D_GGT_xform_extrude";
502 
505 
508 
516 
517  static const EnumPropertyItem axis_type_items[] = {
518  {EXTRUDE_AXIS_NORMAL, "NORMAL", 0, "Normal", "Only show normal axis"},
519  {EXTRUDE_AXIS_XYZ, "XYZ", 0, "XYZ", "Follow scene orientation"},
520  {0, NULL, 0, NULL, NULL},
521  };
522  RNA_def_enum(gzgt->srna, "axis_type", axis_type_items, 0, "Axis Type", "");
523 }
524 
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:713
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1353
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
int BKE_scene_orientation_get_index(struct Scene *scene, int slot_index)
Definition: scene.cc:2470
Generic array manipulation API.
#define BLI_array_findindex(arr, arr_len, p)
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void void BLI_listbase_sort(struct ListBase *listbase, int(*cmp)(const void *, const void *)) ATTR_NONNULL(1
void copy_m3_m3(float m1[3][3], const float m2[3][3])
Definition: math_matrix.c:71
void unit_m3(float m[3][3])
Definition: math_matrix.c:40
void copy_m3_m4(float m1[3][3], const float m2[4][4])
Definition: math_matrix.c:87
void normalize_m3(float R[3][3]) ATTR_NONNULL()
Definition: math_matrix.c:1912
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v3(float r[3])
MINLINE void swap_v3_v3(float a[3], float b[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
unsigned char uchar
Definition: BLI_sys_types.h:70
#define ARRAY_SIZE(arr)
#define UNUSED(x)
#define ELEM(...)
@ OB_ARMATURE
@ OB_MESH
@ OB_CURVES_LEGACY
@ OB_GPENCIL
@ SCE_WORKSPACE_TOOL_FALLBACK
@ SCE_ORIENT_DEFAULT
@ RGN_TYPE_WINDOW
@ SPACE_VIEW3D
@ V3D_ORIENT_NORMAL
@ V3D_ORIENT_VIEW
@ ED_GIZMO_BUTTON_SHOW_BACKDROP
@ ED_GIZMO_BUTTON_SHOW_HELPLINE
@ ED_GIZMO_DIAL_DRAW_FLAG_FILL_SELECT
bool ED_gizmo_poll_or_unlink_delayed_from_tool(const struct bContext *C, struct wmGizmoGroupType *gzgt)
int ED_transform_calc_gizmo_stats(const struct bContext *C, const struct TransformCalcParams *params, struct TransformBounds *tbounds)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
struct PointerRNA PointerRNA
#define C
Definition: RandGen.cpp:25
void UI_GetThemeColor3fv(int colorid, float col[3])
Definition: resources.c:1165
@ TH_AXIS_X
Definition: UI_resources.h:300
@ TH_GIZMO_PRIMARY
Definition: UI_resources.h:305
@ WM_GIZMO_HIDDEN
@ WM_GIZMO_DRAW_OFFSET_SCALE
@ WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP
@ WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK
@ WM_GIZMOGROUPTYPE_3D
#define WM_toolsystem_ref_properties_ensure_from_gizmo_group(tref, gzgroup, r_ptr)
Scene scene
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
#define G(x, y, z)
void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const bool *values)
Definition: rna_access.c:4898
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:136
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:5167
void RNA_boolean_get_array(PointerRNA *ptr, const char *name, bool *values)
Definition: rna_access.c:4886
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
Definition: rna_access.c:4874
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:717
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
Definition: rna_access.c:4980
PropertyRNA * RNA_struct_type_find_property(StructRNA *srna, const char *identifier)
Definition: rna_access.c:806
void RNA_property_string_set_bytes(PointerRNA *ptr, PropertyRNA *prop, const char *value, int len)
Definition: rna_access.c:3268
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:3402
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:5015
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
Definition: rna_access.c:4992
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:5004
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
struct GizmoExtrudeGroup::@616 redo_xform
struct GizmoExtrudeGroup::@617 data
void * last
Definition: DNA_listBase.h:31
float viewinv[4][4]
struct ToolSettings * toolsettings
float axis[3][3]
Definition: ED_transform.h:179
wmGizmoGroupFnSetupKeymap setup_keymap
wmGizmoGroupFnMsgBusSubscribe message_subscribe
wmGizmoGroupFnRefresh refresh
wmGizmoGroupFnInit setup
const char * idname
wmGizmoGroupFnInvokePrepare invoke_prepare
eWM_GizmoFlagGroupTypeFlag flag
wmGizmoGroupFnPoll poll
struct StructRNA * srna
struct wmGizmoMapType_Params gzmap_params
const char * name
wmGizmoGroupFnDrawPrepare draw_prepare
ListBase gizmos
struct wmGizmoGroupType * type
struct wmGizmoMap * parent_gzmap
PointerRNA ptr
float matrix_basis[4][4]
float select_bias
float matrix_offset[4][4]
float color[4]
struct PointerRNA * ptr
float line_width
eWM_GizmoFlag flag
struct wmOperatorType * type
struct PointerRNA * ptr
static void gizmo_mesh_extrude_setup(const bContext *C, wmGizmoGroup *gzgroup)
static const float extrude_button_scale
static const float extrude_dial_scale
static void gizmo_mesh_extrude_orientation_matrix_set_for_adjust(struct GizmoExtrudeGroup *ggd, const float mat[3][3])
static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *gzgroup)
static void gizmo_mesh_extrude_orientation_matrix_set(struct GizmoExtrudeGroup *ggd, const float mat[3][3])
static const float extrude_outer_scale
static const float extrude_arrow_xyz_axis_scale
void VIEW3D_GGT_xform_extrude(struct wmGizmoGroupType *gzgt)
static const uchar shape_plus[]
struct GizmoExtrudeGroup GizmoExtrudeGroup
static void gizmo_mesh_extrude_message_subscribe(const bContext *C, wmGizmoGroup *gzgroup, struct wmMsgBus *mbus)
static const float extrude_button_offset_scale
static void gizmo_mesh_extrude_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
static const float extrude_arrow_scale
static void gizmo_mesh_extrude_invoke_prepare(const bContext *UNUSED(C), wmGizmoGroup *gzgroup, wmGizmo *gz, const wmEvent *UNUSED(event))
static const float extrude_arrow_normal_axis_scale
PointerRNA * ptr
Definition: wm_files.c:3480
PointerRNA * WM_gizmo_operator_set(wmGizmo *gz, int part_index, wmOperatorType *ot, IDProperty *properties)
Definition: wm_gizmo.c:203
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition: wm_gizmo.c:81
void WM_gizmo_set_scale(wmGizmo *gz, const float scale)
Definition: wm_gizmo.c:314
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
Definition: wm_gizmo.c:284
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
Definition: wm_gizmo.c:304
struct wmGizmoOpElem * WM_gizmo_operator_get(wmGizmo *gz, int part_index)
Definition: wm_gizmo.c:195
int WM_gizmo_cmp_temp_fl_reverse(const void *gz_a_ptr, const void *gz_b_ptr)
wmKeyMap * WM_gizmogroup_setup_keymap_generic_maybe_drag(const wmGizmoGroupType *UNUSED(gzgt), wmKeyConfig *kc)
void WM_gizmo_do_msg_notify_tag_refresh(bContext *UNUSED(C), wmMsgSubscribeKey *UNUSED(msg_key), wmMsgSubscribeValue *msg_val)
const wmGizmoType * WM_gizmotype_find(const char *idname, bool quiet)
Definition: wm_gizmo_type.c:45
#define WM_msg_subscribe_rna_anon_prop(mbus, type_, prop_, value)
void WM_msg_subscribe_rna_params(struct wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
void WM_msg_subscribe_rna(struct wmMsgBus *mbus, PointerRNA *ptr, const PropertyRNA *prop, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
struct bToolRef * WM_toolsystem_ref_from_context(struct bContext *C)
Definition: wm_toolsystem.c:57