Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_gizmo_extrude_3d.c
| Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
| static const float extrude_button_scale = 0.15f; | static const float extrude_button_scale = 0.15f; | ||||
| static const float extrude_button_offset_scale = 1.5f; | static const float extrude_button_offset_scale = 1.5f; | ||||
| static const float extrude_arrow_scale = 1.0f; | static const float extrude_arrow_scale = 1.0f; | ||||
| static const float extrude_arrow_xyz_axis_scale = 1.0f; | static const float extrude_arrow_xyz_axis_scale = 1.0f; | ||||
| static const float extrude_arrow_normal_axis_scale = 1.0f; | static const float extrude_arrow_normal_axis_scale = 1.0f; | ||||
| static const float extrude_dial_scale = 0.2; | static const float extrude_dial_scale = 0.2; | ||||
| static const uchar shape_plus[] = { | static const uchar shape_plus[] = { | ||||
| 0x5f, 0xfb, 0x40, 0xee, 0x25, 0xda, 0x11, 0xbf, 0x4, 0xa0, 0x0, 0x80, 0x4, 0x5f, 0x11, 0x40, | 0x73, 0x73, 0x73, 0x36, 0x8c, 0x36, 0x8c, 0x73, 0xc9, 0x73, 0xc9, 0x8c, 0x8c, | ||||
| 0x25, 0x25, 0x40, 0x11, 0x5f, 0x4, 0x7f, 0x0, 0xa0, 0x4, 0xbf, 0x11, 0xda, 0x25, 0xee, 0x40, | 0x8c, 0x8c, 0xc9, 0x73, 0xc9, 0x73, 0x8c, 0x36, 0x8c, 0x36, 0x73, 0x36, 0x73, | ||||
| 0xfb, 0x5f, 0xff, 0x7f, 0xfb, 0xa0, 0xee, 0xbf, 0xda, 0xda, 0xbf, 0xee, 0xa0, 0xfb, 0x80, 0xff, | |||||
| 0x6e, 0xd7, 0x92, 0xd7, 0x92, 0x90, 0xd8, 0x90, 0xd8, 0x6d, 0x92, 0x6d, 0x92, 0x27, 0x6e, 0x27, | |||||
| 0x6e, 0x6d, 0x28, 0x6d, 0x28, 0x90, 0x6e, 0x90, 0x6e, 0xd7, 0x80, 0xff, 0x5f, 0xfb, 0x5f, 0xfb, | |||||
| }; | }; | ||||
| typedef struct GizmoExtrudeGroup { | typedef struct GizmoExtrudeGroup { | ||||
| /* XYZ & normal. */ | /* XYZ & normal. */ | ||||
| wmGizmo *invoke_xyz_no[4]; | wmGizmo *invoke_xyz_no[4]; | ||||
| /* Constrained & unconstrained (arrow & circle). */ | /* Constrained & unconstrained (arrow & circle). */ | ||||
| wmGizmo *adjust[2]; | wmGizmo *adjust[2]; | ||||
| ▲ Show 20 Lines • Show All 245 Lines • ▼ Show 20 Lines | if (has_redo) { | ||||
| WM_gizmo_set_flag(gz_adjust, WM_GIZMO_HIDDEN, false); | WM_gizmo_set_flag(gz_adjust, WM_GIZMO_HIDDEN, false); | ||||
| } | } | ||||
| /* Redo with current settings. */ | /* Redo with current settings. */ | ||||
| if (has_redo) { | if (has_redo) { | ||||
| for (int i = 0; i < 4; i++) { | for (int i = 0; i < 4; i++) { | ||||
| RNA_enum_set(ggd->invoke_xyz_no[i]->ptr, | RNA_enum_set(ggd->invoke_xyz_no[i]->ptr, | ||||
| "draw_options", | "draw_options", | ||||
| ((gz_adjust == ggd->adjust[0]) && | ED_GIZMO_BUTTON_SHOW_BACKDROP | | ||||
| (((gz_adjust == ggd->adjust[0]) && | |||||
| dot_v3v3(ggd->adjust[0]->matrix_basis[2], | dot_v3v3(ggd->adjust[0]->matrix_basis[2], | ||||
| ggd->invoke_xyz_no[i]->matrix_offset[3]) > 0.98f) ? | ggd->invoke_xyz_no[i]->matrix_offset[3]) > 0.98f) ? | ||||
| 0 : | 0 : | ||||
| ED_GIZMO_BUTTON_SHOW_HELPLINE); | ED_GIZMO_BUTTON_SHOW_HELPLINE)); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| for (int i = 0; i < 4; i++) { | for (int i = 0; i < 4; i++) { | ||||
| RNA_enum_set(ggd->invoke_xyz_no[i]->ptr, "draw_options", ED_GIZMO_BUTTON_SHOW_HELPLINE); | RNA_enum_set(ggd->invoke_xyz_no[i]->ptr, | ||||
| "draw_options", | |||||
| ED_GIZMO_BUTTON_SHOW_BACKDROP | ED_GIZMO_BUTTON_SHOW_HELPLINE); | |||||
| } | } | ||||
| } | } | ||||
| /* TODO: skip calculating axis which wont be used (above). */ | /* TODO: skip calculating axis which wont be used (above). */ | ||||
| switch (axis_type) { | switch (axis_type) { | ||||
| case EXTRUDE_AXIS_NORMAL: | case EXTRUDE_AXIS_NORMAL: | ||||
| for (int i = 0; i < 3; i++) { | for (int i = 0; i < 3; i++) { | ||||
| WM_gizmo_set_flag(ggd->invoke_xyz_no[i], WM_GIZMO_HIDDEN, true); | WM_gizmo_set_flag(ggd->invoke_xyz_no[i], WM_GIZMO_HIDDEN, true); | ||||
| ▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines | |||||