34 #define GIZMO_SIZE U.gizmo_size_navigate_v3d
37 #define GIZMO_OFFSET 10.0f
40 #define GIZMO_MINI_SIZE 28.0f
43 #define GIZMO_MINI_OFFSET 2.0f
67 .
opname =
"VIEW3D_OT_move",
68 .gizmo =
"GIZMO_GT_button_2d",
69 .icon = ICON_VIEW_PAN,
72 .opname =
"VIEW3D_OT_rotate",
73 .gizmo =
"VIEW3D_GT_navigate_rotate",
77 .opname =
"VIEW3D_OT_zoom",
78 .gizmo =
"GIZMO_GT_button_2d",
79 .icon = ICON_VIEW_ZOOM,
82 .opname =
"VIEW3D_OT_view_persportho",
83 .gizmo =
"GIZMO_GT_button_2d",
84 .icon = ICON_VIEW_PERSPECTIVE,
87 .opname =
"VIEW3D_OT_view_persportho",
88 .gizmo =
"GIZMO_GT_button_2d",
89 .icon = ICON_VIEW_ORTHO,
92 .opname =
"VIEW3D_OT_view_camera",
93 .gizmo =
"GIZMO_GT_button_2d",
94 .icon = ICON_VIEW_CAMERA,
147 int color_tint, color_tint_hi;
148 if (icon_color[0] > 128) {
166 if (info->
icon != ICON_NONE) {
185 for (
int i = 0; i <
ARRAY_SIZE(gz_ids); i++) {
194 for (
int i = 0; i <
ARRAY_SIZE(gz_ids); i++) {
204 const char mapping[6] = {
213 for (
int part_index = 0; part_index < 6; part_index += 1) {
233 for (
int i = 0; i < 3; i++) {
259 const float co_rotate[2] = {
264 float icon_offset_from_axis = 0.0f;
267 icon_offset_from_axis = icon_offset * 2.1f;
270 icon_offset_from_axis = (
UI_UNIT_X * 2.5) + ((
U.rvisize *
U.pixelsize * 2.0f));
273 icon_offset_from_axis = icon_offset_mini * 0.75f;
277 const float co[2] = {
289 if (show_rotate_gizmo) {
297 int icon_mini_slot = 0;
301 gz->
matrix_basis[3][1] = roundf(co[1] - (icon_offset_mini * icon_mini_slot++));
308 gz->
matrix_basis[3][1] = roundf(co[1] - (icon_offset_mini * icon_mini_slot++));
315 gz->
matrix_basis[3][1] = roundf(co[1] - (icon_offset_mini * icon_mini_slot++));
318 if (navgroup->
state.
rv3d.is_camera ==
false) {
321 gz->
matrix_basis[3][1] = roundf(co[1] - (icon_offset_mini * icon_mini_slot++));
330 gzgt->
name =
"View3D Navigate";
331 gzgt->
idname =
"VIEW3D_GGT_navigate";
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
#define CHECK_TYPE_PAIR(var_a, var_b)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_fl(float r[3], float f)
Object is a sort of wrapper for general info.
@ USER_SHOW_GIZMO_NAVIGATE
@ USER_MINI_AXIS_TYPE_GIZMO
@ USER_MINI_AXIS_TYPE_MINIMAL
@ USER_MINI_AXIS_TYPE_NONE
#define RV3D_LOCK_FLAGS(rv3d)
@ RV3D_LOCK_ZOOM_AND_DOLLY
@ V3D_GIZMO_HIDE_NAVIGATE
@ ED_GIZMO_BUTTON_SHOW_BACKDROP
@ ED_GIZMO_BUTTON_SHOW_OUTLINE
const rcti * ED_region_visible_rect(ARegion *region)
Read Guarded memory(de)allocation.
void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3])
void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
@ WM_GIZMOGROUPTYPE_SCALE
@ WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL
@ WM_GIZMOGROUPTYPE_PERSISTENT
void *(* MEM_callocN)(size_t len, const char *str)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
eWM_GizmoFlagGroupTypeFlag flag
wmGizmoGroupFnDrawPrepare draw_prepare
float matrix_offset[4][4]
static void WIDGETGROUP_navigate_setup(const bContext *C, wmGizmoGroup *gzgroup)
#define GIZMO_MINI_OFFSET
static bool WIDGETGROUP_navigate_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
void VIEW3D_GGT_navigate(wmGizmoGroupType *gzgt)
static void WIDGETGROUP_navigate_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
static struct NavigateGizmoInfo g_navigate_params[GZ_INDEX_TOTAL]
PointerRNA * WM_gizmo_operator_set(wmGizmo *gz, int part_index, wmOperatorType *ot, IDProperty *properties)
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
struct wmGizmoOpElem * WM_gizmo_operator_get(wmGizmo *gz, int part_index)
wmGizmo * WM_gizmo_new(const char *idname, wmGizmoGroup *gzgroup, PointerRNA *properties)
struct wmKeyMap * WM_gizmo_keymap_generic_click_drag(wmWindowManager *wm)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)