Blender  V2.93
transform_gizmo_extrude_3d.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 
21 #include "BLI_array_utils.h"
22 #include "BLI_listbase.h"
23 #include "BLI_math.h"
24 #include "BLI_utildefines.h"
25 
26 #include "BKE_context.h"
27 #include "BKE_global.h"
28 #include "BKE_scene.h"
29 
30 #include "RNA_access.h"
31 #include "RNA_define.h"
32 
33 #include "WM_api.h"
34 #include "WM_message.h"
35 #include "WM_toolsystem.h"
36 #include "WM_types.h"
37 
38 #include "ED_gizmo_library.h"
39 #include "ED_gizmo_utils.h"
40 #include "ED_screen.h"
41 #include "ED_transform.h"
42 
43 #include "UI_resources.h"
44 
45 #include "MEM_guardedalloc.h"
46 
47 /* -------------------------------------------------------------------- */
51 enum {
54 };
55 
56 static const float extrude_button_scale = 0.15f;
57 static const float extrude_button_offset_scale = 1.5f;
58 static const float extrude_outer_scale = 1.2f;
59 static const float extrude_arrow_scale = 0.7f;
60 static const float extrude_arrow_xyz_axis_scale = 0.6666f;
61 static const float extrude_arrow_normal_axis_scale = 0.6666f;
62 static const float extrude_dial_scale = 0.2;
63 
64 static const uchar shape_plus[] = {
65  0x73, 0x73, 0x73, 0x36, 0x8c, 0x36, 0x8c, 0x73, 0xc9, 0x73, 0xc9, 0x8c, 0x8c,
66  0x8c, 0x8c, 0xc9, 0x73, 0xc9, 0x73, 0x8c, 0x36, 0x8c, 0x36, 0x73, 0x36, 0x73,
67 };
68 
69 typedef struct GizmoExtrudeGroup {
70 
71  /* XYZ & normal. */
73  /* Only visible when 'drag' tool option is disabled. */
75  /* Constrained & unconstrained (arrow & circle). */
78 
79  /* Copied from the transform operator,
80  * use to redo with the same settings. */
81  struct {
82  float orient_matrix[3][3];
83  bool constraint_axis[3];
84  float value[4];
86 
87  /* Depends on object type. */
89 
90  struct {
91  float normal_mat3[3][3]; /* use Z axis for normal. */
93  } data;
94 
98 
100  const float mat[3][3])
101 {
102  for (int i = 0; i < 3; i++) {
104  mat[i],
107  }
108 }
109 
111  const float mat[3][3])
112 {
113  /* Set orientation without location. */
114  for (int j = 0; j < 3; j++) {
115  copy_v3_v3(ggd->adjust[0]->matrix_basis[j], mat[j]);
116  }
117  /* nop when (i == 2). */
118  swap_v3_v3(ggd->adjust[0]->matrix_basis[ggd->adjust_axis], ggd->adjust[0]->matrix_basis[2]);
119 }
120 
121 static void gizmo_mesh_extrude_setup(const bContext *C, wmGizmoGroup *gzgroup)
122 {
123  struct GizmoExtrudeGroup *ggd = MEM_callocN(sizeof(GizmoExtrudeGroup), __func__);
124  gzgroup->customdata = ggd;
125 
126  const wmGizmoType *gzt_arrow = WM_gizmotype_find("GIZMO_GT_arrow_3d", true);
127  const wmGizmoType *gzt_move = WM_gizmotype_find("GIZMO_GT_button_2d", true);
128  const wmGizmoType *gzt_dial = WM_gizmotype_find("GIZMO_GT_dial_3d", true);
129 
130  ggd->adjust[0] = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL);
131  ggd->adjust[1] = WM_gizmo_new_ptr(gzt_dial, gzgroup, NULL);
132  RNA_enum_set(ggd->adjust[1]->ptr, "draw_options", ED_GIZMO_DIAL_DRAW_FLAG_FILL_SELECT);
133 
134  for (int i = 0; i < 4; i++) {
135  ggd->invoke_xyz_no[i] = WM_gizmo_new_ptr(gzt_move, gzgroup, NULL);
137  }
138 
139  {
140  ggd->invoke_view = WM_gizmo_new_ptr(gzt_dial, gzgroup, NULL);
141  ggd->invoke_view->select_bias = -2.0f;
143  }
144 
145  {
146  PropertyRNA *prop = RNA_struct_find_property(ggd->invoke_xyz_no[3]->ptr, "shape");
147  for (int i = 0; i < 4; i++) {
149  ggd->invoke_xyz_no[i]->ptr, prop, (const char *)shape_plus, ARRAY_SIZE(shape_plus));
150  }
151  }
152 
153  {
154  const char *op_idname = NULL;
155  /* Grease pencil does not use `obedit`. */
156  /* GPXX: Remove if OB_MODE_EDIT_GPENCIL is merged with OB_MODE_EDIT */
157  const Object *obact = CTX_data_active_object(C);
158  if (obact->type == OB_GPENCIL) {
159  op_idname = "GPENCIL_OT_extrude_move";
160  }
161  else if (obact->type == OB_MESH) {
162  op_idname = "MESH_OT_extrude_context_move";
163  ggd->normal_axis = 2;
164  }
165  else if (obact->type == OB_ARMATURE) {
166  op_idname = "ARMATURE_OT_extrude_move";
167  ggd->normal_axis = 1;
168  }
169  else if (obact->type == OB_CURVE) {
170  op_idname = "CURVE_OT_extrude_move";
171  ggd->normal_axis = 2;
172  }
173  else {
174  BLI_assert(0);
175  }
176  ggd->ot_extrude = WM_operatortype_find(op_idname, true);
177  ggd->gzgt_axis_type_prop = RNA_struct_type_find_property(gzgroup->type->srna, "axis_type");
178  }
179 
180  for (int i = 0; i < 3; i++) {
182  }
184  ggd->invoke_view->color[3] = 0.5f;
185 
186  for (int i = 0; i < 2; i++) {
188  }
189 
190  for (int i = 0; i < 4; i++) {
192  }
194  ggd->invoke_view->line_width = 2.0f;
195 
198  ggd->adjust[1]->line_width = 2.0f;
199 
200  /* XYZ & normal axis extrude. */
201  for (int i = 0; i < 4; i++) {
203  {
204  bool constraint[3] = {0, 0, 0};
205  constraint[(i < 3) ? i : ggd->normal_axis] = true;
206  PointerRNA macroptr = RNA_pointer_get(ptr, "TRANSFORM_OT_translate");
207  RNA_boolean_set(&macroptr, "release_confirm", true);
208  RNA_boolean_set_array(&macroptr, "constraint_axis", constraint);
209  }
210  }
211 
212  {
214  PointerRNA macroptr = RNA_pointer_get(ptr, "TRANSFORM_OT_translate");
215  RNA_boolean_set(&macroptr, "release_confirm", true);
216 
217  const bool constraint[3] = {0, 0, 0};
218  RNA_boolean_set_array(&macroptr, "constraint_axis", constraint);
219  }
220 
221  /* Adjust extrude. */
222  for (int i = 0; i < 2; i++) {
223  wmGizmo *gz = ggd->adjust[i];
225  PointerRNA macroptr = RNA_pointer_get(ptr, "TRANSFORM_OT_translate");
226  RNA_boolean_set(&macroptr, "release_confirm", true);
227  wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, 0);
228  gzop->is_redo = true;
229  }
230 }
231 
232 static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *gzgroup)
233 {
234  GizmoExtrudeGroup *ggd = gzgroup->customdata;
235 
236  for (int i = 0; i < 4; i++) {
238  }
240  for (int i = 0; i < 2; i++) {
241  WM_gizmo_set_flag(ggd->adjust[i], WM_GIZMO_HIDDEN, true);
242  }
243 
244  if (G.moving) {
245  return;
246  }
247 
249 
250  int axis_type;
251  {
252  PointerRNA ptr;
255  axis_type = RNA_property_enum_get(&ptr, ggd->gzgt_axis_type_prop);
256  }
257 
259  const bool use_normal = ((ggd->data.orientation_index != V3D_ORIENT_NORMAL) ||
260  (axis_type == EXTRUDE_AXIS_NORMAL));
261  const int axis_len_used = use_normal ? 4 : 3;
262 
263  struct TransformBounds tbounds;
264 
265  if (use_normal) {
266  struct TransformBounds tbounds_normal;
268  &(struct TransformCalcParams){
269  .orientation_index = V3D_ORIENT_NORMAL + 1,
270  },
271  &tbounds_normal)) {
272  unit_m3(tbounds_normal.axis);
273  }
274  copy_m3_m3(ggd->data.normal_mat3, tbounds_normal.axis);
275  }
276 
277  /* TODO(campbell): run second since this modifies the 3D view, it should not. */
279  &(struct TransformCalcParams){
280  .orientation_index = ggd->data.orientation_index + 1,
281  },
282  &tbounds)) {
283  return;
284  }
285 
286  /* Main axis is normal. */
287  if (!use_normal) {
288  copy_m3_m3(ggd->data.normal_mat3, tbounds.axis);
289  }
290 
291  /* Offset the add icon. */
293  ggd->data.normal_mat3[ggd->normal_axis],
296 
297  /* Adjust current operator. */
298  /* Don't use 'WM_operator_last_redo' because selection actions will be ignored. */
300  bool has_redo = (op && op->type == ggd->ot_extrude);
301  wmOperator *op_xform = has_redo ? op->macro.last : NULL;
302 
303  bool adjust_is_flip = false;
304  wmGizmo *gz_adjust = NULL;
305 
306  if (has_redo) {
307  gz_adjust = ggd->adjust[1];
308  /* We can't access this from 'ot->last_properties'
309  * because some properties use skip-save. */
310  RNA_float_get_array(op_xform->ptr, "orient_matrix", &ggd->redo_xform.orient_matrix[0][0]);
311  RNA_boolean_get_array(op_xform->ptr, "constraint_axis", ggd->redo_xform.constraint_axis);
312  RNA_float_get_array(op_xform->ptr, "value", ggd->redo_xform.value);
313 
314  /* Set properties for redo. */
315  for (int i = 0; i < 3; i++) {
316  if (ggd->redo_xform.constraint_axis[i]) {
317  adjust_is_flip = ggd->redo_xform.value[i] < 0.0f;
318  ggd->adjust_axis = i;
319  gz_adjust = ggd->adjust[0];
320  break;
321  }
322  }
323  }
324 
325  /* Needed for normal orientation. */
327 
328  /* Location. */
329  for (int i = 0; i < axis_len_used; i++) {
331  }
333  /* Un-hide. */
334  for (int i = 0; i < axis_len_used; i++) {
336  }
337 
338  if (has_redo) {
339  if (gz_adjust == ggd->adjust[0]) {
341  if (adjust_is_flip) {
342  negate_v3(ggd->adjust[0]->matrix_basis[2]);
343  }
344  }
345  WM_gizmo_set_matrix_location(gz_adjust, tbounds.center);
346  WM_gizmo_set_flag(gz_adjust, WM_GIZMO_HIDDEN, false);
347  }
348 
349  /* Redo with current settings. */
350  if (has_redo) {
351  for (int i = 0; i < 4; i++) {
352  RNA_enum_set(ggd->invoke_xyz_no[i]->ptr,
353  "draw_options",
355  (((gz_adjust == ggd->adjust[0]) &&
356  dot_v3v3(ggd->adjust[0]->matrix_basis[2],
357  ggd->invoke_xyz_no[i]->matrix_offset[3]) > 0.98f) ?
358  0 :
360  }
361  }
362  else {
363  for (int i = 0; i < 4; i++) {
364  RNA_enum_set(ggd->invoke_xyz_no[i]->ptr,
365  "draw_options",
367  }
368  }
369 
370  /* TODO: skip calculating axis which wont be used (above). */
371  switch (axis_type) {
372  case EXTRUDE_AXIS_NORMAL:
373  for (int i = 0; i < 3; i++) {
375  }
376  break;
377  case EXTRUDE_AXIS_XYZ:
379  break;
380  }
381 
384  gzgroup->use_fallback_keymap = true;
385  }
386  else {
388  gzgroup->use_fallback_keymap = false;
389  }
390 }
391 
393 {
394  GizmoExtrudeGroup *ggd = gzgroup->customdata;
395  switch (ggd->data.orientation_index) {
396  case V3D_ORIENT_VIEW: {
398  float mat[3][3];
399  copy_m3_m4(mat, rv3d->viewinv);
400  normalize_m3(mat);
402  break;
403  }
404  }
405 
406  /* Basic ordering for drawing only. */
407  {
409  LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) {
410  gz->temp.f = dot_v3v3(rv3d->viewinv[2], gz->matrix_offset[3]);
411  }
413 
414  if ((ggd->adjust[1]->flag & WM_GIZMO_HIDDEN) == 0) {
415  copy_v3_v3(ggd->adjust[1]->matrix_basis[0], rv3d->viewinv[0]);
416  copy_v3_v3(ggd->adjust[1]->matrix_basis[1], rv3d->viewinv[1]);
417  copy_v3_v3(ggd->adjust[1]->matrix_basis[2], rv3d->viewinv[2]);
418  }
419  if ((ggd->invoke_view->flag & WM_GIZMO_HIDDEN) == 0) {
420  copy_v3_v3(ggd->invoke_view->matrix_basis[0], rv3d->viewinv[0]);
421  copy_v3_v3(ggd->invoke_view->matrix_basis[1], rv3d->viewinv[1]);
422  copy_v3_v3(ggd->invoke_view->matrix_basis[2], rv3d->viewinv[2]);
423  }
424  }
425 }
426 
428  wmGizmoGroup *gzgroup,
429  wmGizmo *gz,
430  const wmEvent *UNUSED(event))
431 {
432  GizmoExtrudeGroup *ggd = gzgroup->customdata;
433  if (ELEM(gz, ggd->adjust[0], ggd->adjust[1])) {
434  /* Set properties for redo. */
435  wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, 0);
436  PointerRNA macroptr = RNA_pointer_get(&gzop->ptr, "TRANSFORM_OT_translate");
437  if (gz == ggd->adjust[0]) {
438  RNA_boolean_set_array(&macroptr, "constraint_axis", ggd->redo_xform.constraint_axis);
439  RNA_float_set_array(&macroptr, "orient_matrix", &ggd->redo_xform.orient_matrix[0][0]);
440  RNA_enum_set(&macroptr, "orient_type", V3D_ORIENT_NORMAL);
441  }
442  RNA_float_set_array(&macroptr, "value", ggd->redo_xform.value);
443  }
444  else if (gz == ggd->invoke_view) {
445  /* pass */
446  }
447  else {
448  /* Workaround for extrude action modifying normals. */
449  const int i = BLI_array_findindex(ggd->invoke_xyz_no, ARRAY_SIZE(ggd->invoke_xyz_no), &gz);
450  BLI_assert(i != -1);
451  bool use_normal_matrix = false;
452  if (i == 3) {
453  use_normal_matrix = true;
454  }
455  else if (ggd->data.orientation_index == V3D_ORIENT_NORMAL) {
456  use_normal_matrix = true;
457  }
458  if (use_normal_matrix) {
459  wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, 0);
460  PointerRNA macroptr = RNA_pointer_get(&gzop->ptr, "TRANSFORM_OT_translate");
461  RNA_float_set_array(&macroptr, "orient_matrix", &ggd->data.normal_mat3[0][0]);
462  RNA_enum_set(&macroptr, "orient_type", V3D_ORIENT_NORMAL);
463  }
464  }
465 }
466 
468  wmGizmoGroup *gzgroup,
469  struct wmMsgBus *mbus)
470 {
471  GizmoExtrudeGroup *ggd = gzgroup->customdata;
472  ARegion *region = CTX_wm_region(C);
473 
474  /* Subscribe to view properties */
475  wmMsgSubscribeValue msg_sub_value_gz_tag_refresh = {
476  .owner = region,
477  .user_data = gzgroup->parent_gzmap,
479  };
480 
481  {
483  mbus, TransformOrientationSlot, type, &msg_sub_value_gz_tag_refresh);
484  }
485 
487  &(const wmMsgParams_RNA){
488  .ptr =
489  (PointerRNA){
490  .type = gzgroup->type->srna,
491  },
492  .prop = ggd->gzgt_axis_type_prop,
493  },
494  &msg_sub_value_gz_tag_refresh,
495  __func__);
496 
497  {
499  PointerRNA toolsettings_ptr;
500  RNA_pointer_create(&scene->id, &RNA_ToolSettings, scene->toolsettings, &toolsettings_ptr);
501  extern PropertyRNA rna_ToolSettings_workspace_tool_type;
502  const PropertyRNA *props[] = {
503  &rna_ToolSettings_workspace_tool_type,
504  };
505  for (int i = 0; i < ARRAY_SIZE(props); i++) {
507  mbus, &toolsettings_ptr, props[i], &msg_sub_value_gz_tag_refresh, __func__);
508  }
509  }
510 }
511 
513 {
514  gzgt->name = "3D View Extrude";
515  gzgt->idname = "VIEW3D_GGT_xform_extrude";
516 
519 
522 
530 
531  static const EnumPropertyItem axis_type_items[] = {
532  {EXTRUDE_AXIS_NORMAL, "NORMAL", 0, "Normal", "Only show normal axis"},
533  {EXTRUDE_AXIS_XYZ, "XYZ", 0, "XYZ", "Follow scene orientation"},
534  {0, NULL, 0, NULL, NULL},
535  };
536  RNA_def_enum(gzgt->srna, "axis_type", axis_type_items, 0, "Axis Type", "");
537 }
538 
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:689
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1279
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
int BKE_scene_orientation_get_index(struct Scene *scene, int slot_index)
Definition: scene.c:2531
Generic array manipulation API.
#define BLI_array_findindex(arr, arr_len, p)
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
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:89
void unit_m3(float m[3][3])
Definition: math_matrix.c:58
void copy_m3_m4(float m1[3][3], const float m2[4][4])
Definition: math_matrix.c:105
void normalize_m3(float R[3][3]) ATTR_NONNULL()
Definition: math_matrix.c:1919
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:86
#define ARRAY_SIZE(arr)
#define UNUSED(x)
#define ELEM(...)
@ OB_ARMATURE
@ OB_MESH
@ OB_CURVE
@ OB_GPENCIL
@ SCE_WORKSPACE_TOOL_FALLBACK
@ SCE_ORIENT_DEFAULT
@ RGN_TYPE_WINDOW
@ SPACE_VIEW3D
@ V3D_ORIENT_NORMAL
@ V3D_ORIENT_VIEW
@ ED_GIZMO_DIAL_DRAW_FLAG_FILL_SELECT
@ ED_GIZMO_BUTTON_SHOW_BACKDROP
@ ED_GIZMO_BUTTON_SHOW_HELPLINE
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.
StructRNA RNA_ToolSettings
struct PointerRNA PointerRNA
#define C
Definition: RandGen.cpp:39
void UI_GetThemeColor3fv(int colorid, float col[3])
Definition: resources.c:1191
@ TH_AXIS_X
Definition: UI_resources.h:316
@ TH_GIZMO_PRIMARY
Definition: UI_resources.h:321
@ 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:45
void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const bool *values)
Definition: rna_access.c:6296
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:146
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6562
void RNA_boolean_get_array(PointerRNA *ptr, const char *name, bool *values)
Definition: rna_access.c:6284
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
Definition: rna_access.c:6272
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:866
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
Definition: rna_access.c:6378
PropertyRNA * RNA_struct_type_find_property(StructRNA *srna, const char *identifier)
Definition: rna_access.c:953
void RNA_property_string_set_bytes(PointerRNA *ptr, PropertyRNA *prop, const char *value, int len)
Definition: rna_access.c:3430
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:3543
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:6413
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
Definition: rna_access.c:6390
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
struct GizmoExtrudeGroup::@586 redo_xform
struct GizmoExtrudeGroup::@587 data
void * last
Definition: DNA_listBase.h:47
float viewinv[4][4]
struct ToolSettings * toolsettings
float axis[3][3]
Definition: ED_transform.h:180
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
bool use_fallback_keymap
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
#define G(x, y, z)
PointerRNA * ptr
Definition: wm_files.c:3157
PointerRNA * WM_gizmo_operator_set(wmGizmo *gz, int part_index, wmOperatorType *ot, IDProperty *properties)
Definition: wm_gizmo.c:232
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition: wm_gizmo.c:96
void WM_gizmo_set_scale(wmGizmo *gz, const float scale)
Definition: wm_gizmo.c:349
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
Definition: wm_gizmo.c:316
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
Definition: wm_gizmo.c:339
struct wmGizmoOpElem * WM_gizmo_operator_get(wmGizmo *gz, int part_index)
Definition: wm_gizmo.c:224
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:58
#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:71