Blender  V3.3
Classes
WM_gizmo_types.h File Reference
#include "BLI_compiler_attrs.h"
#include "BLI_utildefines.h"
#include "DNA_listBase.h"
#include "wm_gizmo_fn.h"

Go to the source code of this file.

Classes

struct  wmGizmoOpElem
 
struct  wmGizmo
 
struct  wmGizmoProperty
 
struct  wmGizmoPropertyType
 
struct  wmGizmoWrapper
 
struct  wmGizmoMapType_Params
 
struct  wmGizmoType
 
struct  wmGizmoGroupTypeRef
 
struct  wmGizmoGroupType
 
struct  wmGizmoGroup
 

Gizmo Types

Gizmo defines for external use.

Only included in WM_types.h and lower level files.

#define WM_GIZMOMAP_DRAWSTEP_MAX   2
 
enum  eWM_GizmoFlagState { WM_GIZMO_STATE_HIGHLIGHT = (1 << 0) , WM_GIZMO_STATE_MODAL = (1 << 1) , WM_GIZMO_STATE_SELECT = (1 << 2) }
 
enum  eWM_GizmoFlag {
  WM_GIZMO_DRAW_HOVER = (1 << 0) , WM_GIZMO_DRAW_MODAL = (1 << 1) , WM_GIZMO_DRAW_VALUE = (1 << 2) , WM_GIZMO_HIDDEN = (1 << 3) ,
  WM_GIZMO_HIDDEN_SELECT = (1 << 4) , WM_GIZMO_HIDDEN_KEYMAP = (1 << 5) , WM_GIZMO_DRAW_OFFSET_SCALE = (1 << 6) , WM_GIZMO_DRAW_NO_SCALE = (1 << 7) ,
  WM_GIZMO_MOVE_CURSOR = (1 << 8) , WM_GIZMO_SELECT_BACKGROUND = (1 << 9) , WM_GIZMO_OPERATOR_TOOL_INIT = (1 << 10) , WM_GIZMO_EVENT_HANDLE_ALL = (1 << 11) ,
  WM_GIZMO_NO_TOOLTIP = (1 << 12)
}
 
enum  eWM_GizmoFlagGroupTypeFlag {
  WM_GIZMOGROUPTYPE_3D = (1 << 0) , WM_GIZMOGROUPTYPE_SCALE = (1 << 1) , WM_GIZMOGROUPTYPE_DEPTH_3D = (1 << 2) , WM_GIZMOGROUPTYPE_SELECT = (1 << 3) ,
  WM_GIZMOGROUPTYPE_PERSISTENT = (1 << 4) , WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL = (1 << 5) , WM_GIZMOGROUPTYPE_DRAW_MODAL_EXCLUDE = (1 << 6) , WM_GIZMOGROUPTYPE_TOOL_INIT = (1 << 7) ,
  WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP = (1 << 8) , WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK = (1 << 9) , WM_GIZMOGROUPTYPE_VR_REDRAWS = (1 << 10)
}
 
enum  eWM_GizmoFlagGroupInitFlag { WM_GIZMOGROUP_INIT_SETUP = (1 << 0) , WM_GIZMOGROUP_INIT_REFRESH = (1 << 1) }
 
enum  eWM_GizmoFlagMapTypeUpdateFlag { WM_GIZMOMAPTYPE_UPDATE_INIT = (1 << 0) , WM_GIZMOMAPTYPE_UPDATE_REMOVE = (1 << 1) , WM_GIZMOMAPTYPE_KEYMAP_INIT = (1 << 2) }
 
enum  eWM_GizmoFlagTweak { WM_GIZMO_TWEAK_PRECISE = (1 << 0) , WM_GIZMO_TWEAK_SNAP = (1 << 1) }
 Gizmo tweak flag. Bit-flag passed to gizmo while tweaking. More...
 
enum  eWM_GizmoFlagMapDrawStep { WM_GIZMOMAP_DRAWSTEP_2D = 0 , WM_GIZMOMAP_DRAWSTEP_3D }
 
typedef enum eWM_GizmoFlagState eWM_GizmoFlagState
 
typedef enum eWM_GizmoFlag eWM_GizmoFlag
 
typedef enum eWM_GizmoFlagGroupTypeFlag eWM_GizmoFlagGroupTypeFlag
 
typedef enum eWM_GizmoFlagGroupInitFlag eWM_GizmoFlagGroupInitFlag
 
typedef enum eWM_GizmoFlagMapTypeUpdateFlag eWM_GizmoFlagMapTypeUpdateFlag
 
typedef struct wmGizmoOpElem wmGizmoOpElem
 
typedef struct wmGizmoProperty wmGizmoProperty
 
typedef struct wmGizmoPropertyType wmGizmoPropertyType
 
typedef struct wmGizmoWrapper wmGizmoWrapper
 
typedef struct wmGizmoType wmGizmoType
 
typedef struct wmGizmoGroupTypeRef wmGizmoGroupTypeRef
 
typedef struct wmGizmoGroupType wmGizmoGroupType
 
typedef struct wmGizmoGroup wmGizmoGroup
 
typedef enum eWM_GizmoFlagMapDrawStep eWM_GizmoFlagMapDrawStep
 
 ENUM_OPERATORS (eWM_GizmoFlag, WM_GIZMO_NO_TOOLTIP)
 
 ENUM_OPERATORS (eWM_GizmoFlagGroupTypeFlag, WM_GIZMOGROUPTYPE_VR_REDRAWS)
 

Macro Definition Documentation

◆ WM_GIZMOMAP_DRAWSTEP_MAX

#define WM_GIZMOMAP_DRAWSTEP_MAX   2

Definition at line 512 of file WM_gizmo_types.h.

Typedef Documentation

◆ eWM_GizmoFlag

wmGizmo.flag Flags for individual gizmos.

◆ eWM_GizmoFlagGroupInitFlag

◆ eWM_GizmoFlagGroupTypeFlag

wmGizmoGroupType.flag Flags that influence the behavior of all gizmos in the group.

◆ eWM_GizmoFlagMapDrawStep

Pass a value of this enum to WM_gizmomap_draw to tell it what to draw.

◆ eWM_GizmoFlagMapTypeUpdateFlag

wmGizmoMapType.type_update_flag Gizmo-map type update flag

◆ eWM_GizmoFlagState

◆ wmGizmoGroup

typedef struct wmGizmoGroup wmGizmoGroup

◆ wmGizmoGroupType

◆ wmGizmoGroupTypeRef

Factory class for a gizmo-group type, gets called every time a new area is spawned.

◆ wmGizmoOpElem

typedef struct wmGizmoOpElem wmGizmoOpElem

◆ wmGizmoProperty

Similar to PropertyElemRNA, but has an identifier.

◆ wmGizmoPropertyType

◆ wmGizmoType

typedef struct wmGizmoType wmGizmoType

◆ wmGizmoWrapper

Simple utility wrapper for storing a single gizmo as wmGizmoGroup.customdata (which gets freed).

Enumeration Type Documentation

◆ eWM_GizmoFlag

wmGizmo.flag Flags for individual gizmos.

Enumerator
WM_GIZMO_DRAW_HOVER 

Draw only while hovering.

WM_GIZMO_DRAW_MODAL 

Draw while dragging.

WM_GIZMO_DRAW_VALUE 

Draw an indicator for the current value while dragging.

WM_GIZMO_HIDDEN 
WM_GIZMO_HIDDEN_SELECT 
WM_GIZMO_HIDDEN_KEYMAP 

Ignore the key-map for this gizmo.

WM_GIZMO_DRAW_OFFSET_SCALE 

When set 'scale_final' value also scales the offset. Use when offset is to avoid screen-space overlap instead of absolute positioning.

WM_GIZMO_DRAW_NO_SCALE 

User should still use 'scale_final' for any handles and UI elements. This simply skips scale when calculating the final matrix. Needed when the gizmo needs to align with the interface underneath it.

WM_GIZMO_MOVE_CURSOR 

Hide the cursor and lock its position while interacting with this gizmo.

WM_GIZMO_SELECT_BACKGROUND 

Don't write into the depth buffer when selecting.

WM_GIZMO_OPERATOR_TOOL_INIT 

Use the active tools operator properties when running as an operator.

WM_GIZMO_EVENT_HANDLE_ALL 

Don't pass through events to other handlers (allows click/drag not to have its events stolen by press events in other keymaps).

WM_GIZMO_NO_TOOLTIP 

Don't use tool-tips for this gizmo (can be distracting).

Definition at line 49 of file WM_gizmo_types.h.

◆ eWM_GizmoFlagGroupInitFlag

wmGizmoGroup.init_flag

Enumerator
WM_GIZMOGROUP_INIT_SETUP 

Gizmo-group has been initialized.

WM_GIZMOGROUP_INIT_REFRESH 

Definition at line 158 of file WM_gizmo_types.h.

◆ eWM_GizmoFlagGroupTypeFlag

wmGizmoGroupType.flag Flags that influence the behavior of all gizmos in the group.

Enumerator
WM_GIZMOGROUPTYPE_3D 

Mark gizmo-group as being 3D

WM_GIZMOGROUPTYPE_SCALE 

Scale gizmos as 3D object that respects zoom (otherwise zoom independent draw size). NOTE: currently only for 3D views, 2D support needs adding.

WM_GIZMOGROUPTYPE_DEPTH_3D 

Gizmos can be depth culled with scene objects (covered by other geometry - TODO)

WM_GIZMOGROUPTYPE_SELECT 

Gizmos can be selected.

WM_GIZMOGROUPTYPE_PERSISTENT 

The gizmo group is to be kept (not removed on loading a new file for eg).

WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL 

Show all other gizmos when interacting. Also show this group when another group is being interacted with.

WM_GIZMOGROUPTYPE_DRAW_MODAL_EXCLUDE 

Don't draw this gizmo group when it is modal.

WM_GIZMOGROUPTYPE_TOOL_INIT 

When used with tool, only run when activating the tool, instead of linking the gizmo while the tool is active.

Warning
this option has some limitations, we might even re-implement this differently. Currently it's quite minimal so we can see how it works out. The main issue is controlling how a gizmo is activated with a tool when a tool can activate multiple operators based on the key-map. We could even move the options into the key-map item. ~ campbell.
WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP 

This gizmo type supports using the fallback tools keymap. #wmGizmoGroup.use_tool_fallback will need to be set too.

Often useful in combination with WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK

WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK 

Use this from a gizmos refresh callback so we can postpone the refresh operation until the tweak operation is finished. Only do this when the group doesn't have a highlighted gizmo.

The result for the user is tweak events delay the gizmo from flashing under the users cursor, for selection operations. This means gizmos that use this check don't interfere with click-drag events by popping up under the cursor and catching the drag-drag event.

WM_GIZMOGROUPTYPE_VR_REDRAWS 

Cause continuous redraws, i.e. set the region redraw flag on every main loop iteration. This should really be avoided by using proper region redraw tagging, notifiers and the message-bus, however for VR it's sometimes needed.

Definition at line 93 of file WM_gizmo_types.h.

◆ eWM_GizmoFlagMapDrawStep

Pass a value of this enum to WM_gizmomap_draw to tell it what to draw.

Enumerator
WM_GIZMOMAP_DRAWSTEP_2D 

Draw 2D gizmo-groups (WM_GIZMOGROUPTYPE_3D not set).

WM_GIZMOMAP_DRAWSTEP_3D 

Draw 3D gizmo-groups (WM_GIZMOGROUPTYPE_3D set).

Definition at line 506 of file WM_gizmo_types.h.

◆ eWM_GizmoFlagMapTypeUpdateFlag

wmGizmoMapType.type_update_flag Gizmo-map type update flag

Enumerator
WM_GIZMOMAPTYPE_UPDATE_INIT 

A new type has been added, needs to be initialized for all views.

WM_GIZMOMAPTYPE_UPDATE_REMOVE 
WM_GIZMOMAPTYPE_KEYMAP_INIT 

Needed because keymap may be registered before and after window initialization. So we need to keep track of keymap initialization separately.

Definition at line 168 of file WM_gizmo_types.h.

◆ eWM_GizmoFlagState

wmGizmo.state

Enumerator
WM_GIZMO_STATE_HIGHLIGHT 

While hovered.

WM_GIZMO_STATE_MODAL 

While dragging.

WM_GIZMO_STATE_SELECT 

Definition at line 37 of file WM_gizmo_types.h.

◆ eWM_GizmoFlagTweak

Gizmo tweak flag. Bit-flag passed to gizmo while tweaking.

Note
Gizmos are responsible for handling this #wmGizmo.modal callback.
Enumerator
WM_GIZMO_TWEAK_PRECISE 
WM_GIZMO_TWEAK_SNAP 

Definition at line 187 of file WM_gizmo_types.h.

Function Documentation

◆ ENUM_OPERATORS() [1/2]

ENUM_OPERATORS ( eWM_GizmoFlag  ,
WM_GIZMO_NO_TOOLTIP   
)

◆ ENUM_OPERATORS() [2/2]