Blender V4.3
WM_toolsystem.hh File Reference

Go to the source code of this file.

Classes

struct  bToolKey
 

Macros

#define WM_TOOLSYSTEM_SPACE_MASK    ((1 << SPACE_IMAGE) | (1 << SPACE_NODE) | (1 << SPACE_VIEW3D) | (1 << SPACE_SEQ))
 
#define WM_TOOLSYSTEM_SPACE_MASK_MODE_FROM_SPACE   ((1 << SPACE_IMAGE) | (1 << SPACE_SEQ))
 
#define WM_toolsystem_ref_properties_ensure_from_operator(tref, ot, r_ptr)    WM_toolsystem_ref_properties_ensure_ex(tref, (ot)->idname, (ot)->srna, r_ptr)
 
#define WM_toolsystem_ref_properties_ensure_from_gizmo_group(tref, gzgroup, r_ptr)    WM_toolsystem_ref_properties_ensure_ex(tref, (gzgroup)->idname, (gzgroup)->srna, r_ptr)
 
#define WM_toolsystem_ref_properties_get_from_operator(tref, ot, r_ptr)    WM_toolsystem_ref_properties_get_ex(tref, (ot)->idname, (ot)->srna, r_ptr)
 
#define WM_toolsystem_ref_properties_get_from_gizmo_group(tref, gzgroup, r_ptr)    WM_toolsystem_ref_properties_get_ex(tref, (gzgroup)->idname, (gzgroup)->srna, r_ptr)
 

Functions

bToolRefWM_toolsystem_ref_from_context (const bContext *C)
 
bToolRefWM_toolsystem_ref_find (WorkSpace *workspace, const bToolKey *tkey)
 
bool WM_toolsystem_ref_ensure (WorkSpace *workspace, const bToolKey *tkey, bToolRef **r_tref)
 
bToolRefWM_toolsystem_ref_set_by_id_ex (bContext *C, WorkSpace *workspace, const bToolKey *tkey, const char *name, bool cycle)
 
bToolRefWM_toolsystem_ref_set_by_id (bContext *C, const char *name)
 
bToolRef_RuntimeWM_toolsystem_runtime_from_context (const bContext *C)
 
bToolRef_RuntimeWM_toolsystem_runtime_find (WorkSpace *workspace, const bToolKey *tkey)
 
bool WM_toolsystem_activate_brush_and_tool (bContext *C, Paint *paint, Brush *brush)
 
void WM_toolsystem_unlink (bContext *C, WorkSpace *workspace, const bToolKey *tkey)
 
void WM_toolsystem_refresh (const bContext *C, WorkSpace *workspace, const bToolKey *tkey)
 
void WM_toolsystem_reinit (bContext *C, WorkSpace *workspace, const bToolKey *tkey)
 
void WM_toolsystem_unlink_all (bContext *C, WorkSpace *workspace)
 
void WM_toolsystem_refresh_all (const bContext *C, WorkSpace *workspace)
 
void WM_toolsystem_reinit_all (bContext *C, wmWindow *win)
 
void WM_toolsystem_ref_set_from_runtime (bContext *C, WorkSpace *workspace, bToolRef *tref, const bToolRef_Runtime *tref_rt, const char *idname)
 
void WM_toolsystem_ref_sync_from_context (Main *bmain, WorkSpace *workspace, bToolRef *tref)
 
void WM_toolsystem_init (const bContext *C)
 
int WM_toolsystem_mode_from_spacetype (const Scene *scene, ViewLayer *view_layer, ScrArea *area, int space_type)
 
bool WM_toolsystem_key_from_context (const Scene *scene, ViewLayer *view_layer, ScrArea *area, bToolKey *tkey)
 
void WM_toolsystem_update_from_context_view3d (bContext *C)
 
void WM_toolsystem_update_from_context (bContext *C, WorkSpace *workspace, const Scene *scene, ViewLayer *view_layer, ScrArea *area)
 
bool WM_toolsystem_active_tool_is_brush (const bContext *C)
 
bool WM_toolsystem_active_tool_has_custom_cursor (const bContext *C)
 
void WM_toolsystem_do_msg_notify_tag_refresh (bContext *C, wmMsgSubscribeKey *msg_key, wmMsgSubscribeValue *msg_val)
 
IDPropertyWM_toolsystem_ref_properties_get_idprops (bToolRef *tref)
 
IDPropertyWM_toolsystem_ref_properties_ensure_idprops (bToolRef *tref)
 
void WM_toolsystem_ref_properties_ensure_ex (bToolRef *tref, const char *idname, StructRNA *type, PointerRNA *r_ptr)
 
bool WM_toolsystem_ref_properties_get_ex (bToolRef *tref, const char *idname, StructRNA *type, PointerRNA *r_ptr)
 
void WM_toolsystem_ref_properties_init_for_keymap (bToolRef *tref, PointerRNA *dst_ptr, PointerRNA *src_ptr, wmOperatorType *ot)
 
void WM_toolsystem_refresh_active (bContext *C)
 
bool WM_toolsystem_refresh_screen_area (WorkSpace *workspace, const Scene *scene, ViewLayer *view_layer, ScrArea *area)
 
void WM_toolsystem_refresh_screen_window (wmWindow *win)
 
void WM_toolsystem_refresh_screen_all (Main *bmain)
 

Macro Definition Documentation

◆ WM_toolsystem_ref_properties_ensure_from_gizmo_group

#define WM_toolsystem_ref_properties_ensure_from_gizmo_group ( tref,
gzgroup,
r_ptr )    WM_toolsystem_ref_properties_ensure_ex(tref, (gzgroup)->idname, (gzgroup)->srna, r_ptr)

◆ WM_toolsystem_ref_properties_ensure_from_operator

#define WM_toolsystem_ref_properties_ensure_from_operator ( tref,
ot,
r_ptr )    WM_toolsystem_ref_properties_ensure_ex(tref, (ot)->idname, (ot)->srna, r_ptr)

Definition at line 121 of file WM_toolsystem.hh.

◆ WM_toolsystem_ref_properties_get_from_gizmo_group

#define WM_toolsystem_ref_properties_get_from_gizmo_group ( tref,
gzgroup,
r_ptr )    WM_toolsystem_ref_properties_get_ex(tref, (gzgroup)->idname, (gzgroup)->srna, r_ptr)

Definition at line 132 of file WM_toolsystem.hh.

Referenced by tool_generic_create_gizmo().

◆ WM_toolsystem_ref_properties_get_from_operator

#define WM_toolsystem_ref_properties_get_from_operator ( tref,
ot,
r_ptr )    WM_toolsystem_ref_properties_get_ex(tref, (ot)->idname, (ot)->srna, r_ptr)

Definition at line 130 of file WM_toolsystem.hh.

Referenced by WM_gizmo_operator_invoke().

◆ WM_TOOLSYSTEM_SPACE_MASK

◆ WM_TOOLSYSTEM_SPACE_MASK_MODE_FROM_SPACE

#define WM_TOOLSYSTEM_SPACE_MASK_MODE_FROM_SPACE   ((1 << SPACE_IMAGE) | (1 << SPACE_SEQ))

Space-types that define their own "mode" (as returned by WM_toolsystem_mode_from_spacetype).

Definition at line 35 of file WM_toolsystem.hh.

Referenced by toolsystem_ref_set_by_brush_type(), and WM_toolsystem_ref_set_by_id_ex().

Function Documentation

◆ WM_toolsystem_activate_brush_and_tool()

bool WM_toolsystem_activate_brush_and_tool ( bContext * C,
Paint * paint,
Brush * brush )

Activate the brush through the tool system. This will call BKE_paint_brush_set() with brush, but it will also switch to the tool appropriate for this brush type (if necessary) and update the current tool-brush references to remember the last used brush for that tool.

Returns
True if the brush was successfully activated.

Definition at line 277 of file wm_toolsystem.cc.

References BKE_paint_brush_poll(), BKE_paint_brush_set(), BKE_paint_get_brush_type_from_paintmode(), BKE_paintmode_get_active_from_context(), BLI_assert_unreachable, bToolRef_Runtime::brush_type, brush_type_identifier_get(), brush_type_matches_active_tool(), bToolRef::runtime, toolsystem_active_tool_from_context_or_view3d(), toolsystem_brush_type_binding_update(), toolsystem_main_brush_binding_update_from_active(), toolsystem_ref_set_by_brush_type(), and WM_toolsystem_ref_set_by_id().

Referenced by blender::ed::sculpt_paint::brush_asset_activate_exec(), and blender::ed::sculpt_paint::brush_asset_save_as_exec().

◆ WM_toolsystem_active_tool_has_custom_cursor()

bool WM_toolsystem_active_tool_has_custom_cursor ( const bContext * C)

◆ WM_toolsystem_active_tool_is_brush()

◆ WM_toolsystem_do_msg_notify_tag_refresh()

◆ WM_toolsystem_init()

void WM_toolsystem_init ( const bContext * C)

◆ WM_toolsystem_key_from_context()

bool WM_toolsystem_key_from_context ( const Scene * scene,
ViewLayer * view_layer,
ScrArea * area,
bToolKey * tkey )

◆ WM_toolsystem_mode_from_spacetype()

◆ WM_toolsystem_ref_ensure()

bool WM_toolsystem_ref_ensure ( WorkSpace * workspace,
const bToolKey * tkey,
bToolRef ** r_tref )

◆ WM_toolsystem_ref_find()

◆ WM_toolsystem_ref_from_context()

◆ WM_toolsystem_ref_properties_ensure_ex()

void WM_toolsystem_ref_properties_ensure_ex ( bToolRef * tref,
const char * idname,
StructRNA * type,
PointerRNA * r_ptr )

◆ WM_toolsystem_ref_properties_ensure_idprops()

IDProperty * WM_toolsystem_ref_properties_ensure_idprops ( bToolRef * tref)

◆ WM_toolsystem_ref_properties_get_ex()

bool WM_toolsystem_ref_properties_get_ex ( bToolRef * tref,
const char * idname,
StructRNA * type,
PointerRNA * r_ptr )

◆ WM_toolsystem_ref_properties_get_idprops()

IDProperty * WM_toolsystem_ref_properties_get_idprops ( bToolRef * tref)

◆ WM_toolsystem_ref_properties_init_for_keymap()

◆ WM_toolsystem_ref_set_by_id()

◆ WM_toolsystem_ref_set_by_id_ex()

◆ WM_toolsystem_ref_set_from_runtime()

◆ WM_toolsystem_ref_sync_from_context()

◆ WM_toolsystem_refresh()

void WM_toolsystem_refresh ( const bContext * C,
WorkSpace * workspace,
const bToolKey * tkey )

◆ WM_toolsystem_refresh_active()

void WM_toolsystem_refresh_active ( bContext * C)

◆ WM_toolsystem_refresh_all()

void WM_toolsystem_refresh_all ( const bContext * C,
WorkSpace * workspace )

◆ WM_toolsystem_refresh_screen_all()

void WM_toolsystem_refresh_screen_all ( Main * bmain)

◆ WM_toolsystem_refresh_screen_area()

bool WM_toolsystem_refresh_screen_area ( WorkSpace * workspace,
const Scene * scene,
ViewLayer * view_layer,
ScrArea * area )

◆ WM_toolsystem_refresh_screen_window()

◆ WM_toolsystem_reinit()

void WM_toolsystem_reinit ( bContext * C,
WorkSpace * workspace,
const bToolKey * tkey )

Definition at line 477 of file wm_toolsystem.cc.

References toolsystem_reinit_ref(), and WM_toolsystem_ref_find().

◆ WM_toolsystem_reinit_all()

◆ WM_toolsystem_runtime_find()

bToolRef_Runtime * WM_toolsystem_runtime_find ( WorkSpace * workspace,
const bToolKey * tkey )

Definition at line 101 of file wm_toolsystem.cc.

References bToolRef::runtime, and WM_toolsystem_ref_find().

◆ WM_toolsystem_runtime_from_context()

◆ WM_toolsystem_unlink()

void WM_toolsystem_unlink ( bContext * C,
WorkSpace * workspace,
const bToolKey * tkey )

◆ WM_toolsystem_unlink_all()

void WM_toolsystem_unlink_all ( bContext * C,
WorkSpace * workspace )

Operate on all active tools.

Definition at line 485 of file wm_toolsystem.cc.

References LISTBASE_FOREACH, WorkSpace::tools, and toolsystem_unlink_ref().

◆ WM_toolsystem_update_from_context()

void WM_toolsystem_update_from_context ( bContext * C,
WorkSpace * workspace,
const Scene * scene,
ViewLayer * view_layer,
ScrArea * area )

◆ WM_toolsystem_update_from_context_view3d()