Blender V5.0
bToolRef Struct Reference

#include <DNA_workspace_types.h>

Public Attributes

struct bToolRefnext
struct bToolRefprev
char idname [64]
char idname_fallback [64]
char idname_pending [64]
short tag
short space_type
int mode
IDPropertyproperties
bToolRef_Runtimeruntime

Detailed Description

Note
Stored per mode.

Definition at line 69 of file DNA_workspace_types.h.

Member Data Documentation

◆ idname

◆ idname_fallback

char bToolRef::idname_fallback[64]

Optionally use these when not interacting directly with the primary tools gizmo.

Definition at line 74 of file DNA_workspace_types.h.

Referenced by WM_toolsystem_ref_set_from_runtime().

◆ idname_pending

char bToolRef::idname_pending[64]

A pending request to switch to a different tool, this will be performed as part of the areas tool initialization. (see toolsystem_ref_set_by_id_pending).

Notes:

  • This can be used to synchronize tools between areas (if necessary).
  • If the tool doesn't exist, the exiting tool will left as is.
  • There is no need for a "fallback" version of this variable since activating the tool will also set its fallback, if it's defined.
  • This is not stored in the run-time because it's possible (for example) for a request to sync to another area isn't handled if the area isn't visible. So store this in the file, so the pending change can be performed when the area is shown.

Definition at line 90 of file DNA_workspace_types.h.

Referenced by toolsystem_ref_set_by_id_pending(), toolsystem_reinit_with_toolref(), and WM_toolsystem_ref_set_from_runtime().

◆ mode

int bToolRef::mode

Value depends on the 'space_type', object mode for 3D view, image editor has its own mode too. RNA needs to handle using item function.

See: #eSpaceImageMode for SPACE_IMAGE, eContextObjectMode for SPACE_VIEW3D, etc

Definition at line 103 of file DNA_workspace_types.h.

Referenced by BKE_paintmode_get_from_tool(), toolsystem_brush_activate_from_toolref(), toolsystem_brush_sync_for_texture_paint(), toolsystem_refresh_screen_from_active_tool(), toolsystem_reinit_with_toolref(), WM_toolsystem_ref_ensure(), and WM_toolsystem_ref_sync_from_context().

◆ next

struct bToolRef* bToolRef::next

Definition at line 70 of file DNA_workspace_types.h.

◆ prev

struct bToolRef * bToolRef::prev

Definition at line 70 of file DNA_workspace_types.h.

◆ properties

IDProperty* bToolRef::properties

Use for tool options, each group's name must match a tool name:

{"Tool Name": {"SOME_OT_operator": {...}, ..}, ..}

This is done since different tools may call the same operators with their own options.

Definition at line 112 of file DNA_workspace_types.h.

Referenced by BKE_workspace_tool_remove(), WM_toolsystem_ref_properties_ensure_idprops(), and WM_toolsystem_ref_properties_get_idprops().

◆ runtime

◆ space_type

◆ tag

short bToolRef::tag

Use to avoid initializing the same tool multiple times.

Definition at line 93 of file DNA_workspace_types.h.

Referenced by WM_toolsystem_reinit_all().


The documentation for this struct was generated from the following file: