Blender V5.3
wm_toolsystem.cc File Reference
#include <cstring>
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "BLI_listbase.hh"
#include "BLI_string.hh"
#include "BLI_string_utf8.hh"
#include "BLI_utildefines.hh"
#include "DNA_ID.h"
#include "DNA_brush_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_workspace_types.h"
#include "BKE_asset_edit.hh"
#include "BKE_brush.hh"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_idprop.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_paint.hh"
#include "BKE_workspace.hh"
#include "RNA_access.hh"
#include "RNA_enum_types.hh"
#include "WM_api.hh"
#include "WM_message.hh"
#include "WM_toolsystem.hh"
#include "WM_types.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Functions

static void blender::toolsystem_reinit_with_toolref (bContext *C, WorkSpace *, bToolRef *tref)
static bToolRef * blender::toolsystem_reinit_ensure_toolref (bContext *C, WorkSpace *workspace, const bToolKey *tkey, const char *default_tool)
static void blender::toolsystem_refresh_screen_from_active_tool (Main *bmain, WorkSpace *workspace, bToolRef *tref)
static void blender::toolsystem_ref_set_by_brush_type (bContext *C, const char *brush_type)
static void blender::toolsystem_ref_set_by_id_pending (Main *bmain, bToolRef *tref, const char *idname_pending)
static void blender::toolsystem_unlink_ref (bContext *C, WorkSpace *, bToolRef *tref)
void blender::WM_toolsystem_unlink (bContext *C, WorkSpace *workspace, const bToolKey *tkey)
static void blender::toolsystem_ref_link (Main *bmain, WorkSpace *workspace, bToolRef *tref)
static void blender::toolsystem_refresh_ref (const bContext *C, WorkSpace *workspace, bToolRef *tref)
void blender::WM_toolsystem_refresh (const bContext *C, WorkSpace *workspace, const bToolKey *tkey)
static void blender::toolsystem_reinit_ref (bContext *C, WorkSpace *workspace, bToolRef *tref)
void blender::WM_toolsystem_reinit (bContext *C, WorkSpace *workspace, const bToolKey *tkey)
void blender::WM_toolsystem_unlink_all (bContext *C, WorkSpace *workspace)
void blender::WM_toolsystem_refresh_all (const bContext *C, WorkSpace *workspace)
void blender::WM_toolsystem_reinit_all (bContext *C, wmWindow *win)
void blender::WM_toolsystem_ref_set_from_runtime (bContext *C, WorkSpace *workspace, bToolRef *tref, const bToolRef_Runtime *tref_rt, const char *idname)
void blender::WM_toolsystem_ref_sync_from_context (Main *bmain, WorkSpace *workspace, bToolRef *tref)
void blender::WM_toolsystem_init (const bContext *C)
static bool blender::toolsystem_key_ensure_check (const bToolKey *tkey)
int blender::WM_toolsystem_mode_from_spacetype (const Main &bmain, const Scene *scene, ViewLayer *view_layer, ScrArea *area, int space_type)
bool blender::WM_toolsystem_key_from_context (const Main &bmain, const Scene *scene, ViewLayer *view_layer, ScrArea *area, bToolKey *tkey)
void blender::WM_toolsystem_refresh_active (bContext *C)
bool blender::WM_toolsystem_refresh_screen_area (const Main &bmain, WorkSpace *workspace, const Scene *scene, ViewLayer *view_layer, ScrArea *area)
void blender::WM_toolsystem_refresh_screen_window (const Main &bmain, wmWindow *win)
void blender::WM_toolsystem_refresh_screen_all (Main *bmain)
bToolRef * blender::WM_toolsystem_ref_set_by_id_ex (bContext *C, WorkSpace *workspace, const bToolKey *tkey, const char *name, bool cycle)
bToolRef * blender::WM_toolsystem_ref_set_by_id (bContext *C, const char *name)
static const char * blender::toolsystem_default_tool (const bToolKey *tkey)
static void blender::wm_toolsystem_update_from_context_view3d_impl (bContext *C, WorkSpace *workspace)
void blender::WM_toolsystem_update_from_context_view3d (bContext *C)
void blender::WM_toolsystem_update_from_context (bContext *C, WorkSpace *workspace, const Scene *scene, ViewLayer *view_layer, ScrArea *area)
bool blender::WM_toolsystem_active_tool_is_brush (const bContext *C)
bool blender::WM_toolsystem_active_tool_has_custom_cursor (const bContext *C)
void blender::WM_toolsystem_do_msg_notify_tag_refresh (bContext *C, wmMsgSubscribeKey *, wmMsgSubscribeValue *msg_val)
static IDProperty * blender::idprops_ensure_named_group (IDProperty *group, const char *idname)
IDProperty * blender::WM_toolsystem_ref_properties_get_idprops (bToolRef *tref)
IDProperty * blender::WM_toolsystem_ref_properties_ensure_idprops (bToolRef *tref)
bool blender::WM_toolsystem_ref_properties_get_ex (bToolRef *tref, const char *idname, StructRNA *type, PointerRNA *r_ptr)
void blender::WM_toolsystem_ref_properties_ensure_ex (bToolRef *tref, const char *idname, StructRNA *type, PointerRNA *r_ptr)
void blender::WM_toolsystem_ref_properties_init_for_keymap (bToolRef *tref, PointerRNA *dst_ptr, PointerRNA *src_ptr, wmOperatorType *ot)
Tool Reference API
bToolRef * blender::WM_toolsystem_ref_from_context (const bContext *C)
bToolRef_Runtime * blender::WM_toolsystem_runtime_from_context (const bContext *C)
bToolRef * blender::WM_toolsystem_ref_find (WorkSpace *workspace, const bToolKey *tkey)
bToolRef_Runtime * blender::WM_toolsystem_runtime_find (WorkSpace *workspace, const bToolKey *tkey)
bool blender::WM_toolsystem_ref_ensure (WorkSpace *workspace, const bToolKey *tkey, bToolRef **r_tref)
static bToolKey blender::toolsystem_key_from_context_or_view3d (const Main &bmain, const Scene *scene, ViewLayer *view_layer, ScrArea *area)
static const bToolRef * blender::toolsystem_active_tool_from_context_or_view3d (const bContext *C)
Brush Tools
static const char * blender::brush_type_identifier_get (const int brush_type, const PaintMode paint_mode)
static bool blender::brush_type_matches_active_tool (bContext *C, const int brush_type)
static NamedBrushAssetReference * blender::toolsystem_brush_type_binding_lookup (const Paint *paint, const char *brush_type_name)
static void blender::toolsystem_main_brush_binding_update_from_active (Paint *paint)
static void blender::toolsystem_brush_type_binding_update (Paint *paint, const PaintMode paint_mode, const int brush_type)
bool blender::WM_toolsystem_activate_brush_and_tool (bContext *C, Paint *paint, Brush *brush)
static void blender::toolsystem_brush_activate_from_toolref_for_object_particle (const Main *bmain, const WorkSpace *workspace, const bToolRef *tref)
std::optional< AssetWeakReference > blender::WM_toolsystem_last_brush_asset_from_brush_type (Scene *scene, const int brush_type, const PaintMode paint_mode)
static void blender::toolsystem_brush_activate_from_toolref_for_object_paint (Main *bmain, const WorkSpace *workspace, const bToolRef *tref)
static void blender::toolsystem_brush_activate_from_toolref (Main *bmain, const WorkSpace *workspace, const bToolRef *tref)
static void blender::toolsystem_brush_sync_for_texture_paint (Main *bmain, WorkSpace *workspace, bToolRef *tref)
static void blender::toolsystem_brush_clear_paint_reference (Main *bmain, WorkSpace *workspace, bToolRef *tref)

Detailed Description

Tool-system used to define tools in Blender's toolbar. See: ./scripts/startup/bl_ui/space_toolsystem_common.py, ToolDef for a detailed description of tool definitions.

Note
Tools are stored per workspace. Notice many functions take #Main & #WorkSpace and not window/screen/scene data. This is intentional as changing tools must account for all scenes using that workspace. Functions that refreshes on tool change are responsible for updating all windows using this workspace.

Definition in file wm_toolsystem.cc.