|
Blender V4.5
|
#include <cstring>#include "CLG_log.h"#include "MEM_guardedalloc.h"#include "BLI_listbase.h"#include "BLI_string.h"#include "BLI_utildefines.h"#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.
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.
Definition in file wm_toolsystem.cc.
|
static |
Definition at line 210 of file wm_toolsystem.cc.
References BKE_paint_get_tool_enum_from_paintmode(), brush_type_identifier_get(), EnumPropertyItem::identifier, and RNA_enum_from_value().
Referenced by brush_type_identifier_get(), toolsystem_brush_activate_from_toolref_for_object_paint(), toolsystem_brush_type_binding_update(), and WM_toolsystem_activate_brush_and_tool().
|
static |
Definition at line 220 of file wm_toolsystem.cc.
References BKE_paintmode_get_active_from_context(), BKE_paintmode_get_from_tool(), BLI_assert, bToolRef_Runtime::brush_type, brush_type_matches_active_tool(), C, bToolRef_Runtime::flag, G, bToolRef::runtime, TOOLREF_FLAG_USE_BRUSHES, and toolsystem_active_tool_from_context_or_view3d().
Referenced by brush_type_matches_active_tool(), and WM_toolsystem_activate_brush_and_tool().
|
static |
Definition at line 1267 of file wm_toolsystem.cc.
References blender::bke::idprop::create_group(), IDP_GetPropertyFromGroup(), IDP_GROUP, IDP_ReplaceInGroup_ex(), idprops_ensure_named_group(), IDProperty::name, STRNCPY(), and IDProperty::type.
Referenced by idprops_ensure_named_group(), WM_toolsystem_ref_properties_ensure_ex(), and WM_toolsystem_ref_properties_ensure_idprops().
Get the active tool for the current context (space and mode) if the current space supports tools or, fallback to the active tool of the 3D View in the current mode.
Use this instead of WM_toolsystem_ref_from_context() when usage from properties editors should be possible, which shows tool settings of the 3D View.
Definition at line 163 of file wm_toolsystem.cc.
References C, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area(), CTX_wm_workspace(), bToolKey::mode, bToolKey::space_type, SPACE_VIEW3D, ScrArea::spacetype, toolsystem_active_tool_from_context_or_view3d(), WM_toolsystem_mode_from_spacetype(), WM_toolsystem_ref_find(), WM_toolsystem_ref_from_context(), and WM_TOOLSYSTEM_SPACE_MASK.
Referenced by brush_type_matches_active_tool(), toolsystem_active_tool_from_context_or_view3d(), and WM_toolsystem_activate_brush_and_tool().
|
static |
Activate a brush compatible with tref, call when the active tool changes.
Definition at line 430 of file wm_toolsystem.cc.
References BLI_assert, CTX_MODE_PARTICLE, bToolRef_Runtime::flag, bToolRef::mode, bToolRef::runtime, SI_MODE_PAINT, SPACE_IMAGE, bToolRef::space_type, SPACE_VIEW3D, TOOLREF_FLAG_USE_BRUSHES, toolsystem_brush_activate_from_toolref(), toolsystem_brush_activate_from_toolref_for_object_paint(), and toolsystem_brush_activate_from_toolref_for_object_particle().
Referenced by toolsystem_brush_activate_from_toolref(), and toolsystem_ref_link().
|
static |
Definition at line 363 of file wm_toolsystem.cc.
References BKE_paint_brush_set(), BKE_paint_brush_type_default_reference(), BKE_paint_ensure_from_paintmode(), BKE_paint_get_active_from_paintmode(), BKE_paintmode_get_from_tool(), BLI_assert, NamedBrushAssetReference::brush_asset_reference, bToolRef_Runtime::brush_type, brush_type_identifier_get(), ListBase::first, Invalid, LISTBASE_FOREACH, ToolSystemBrushBindings::main_brush_asset_reference, Paint_Runtime::ob_mode, bToolRef::runtime, Paint::runtime, Paint::tool_brush_bindings, toolsystem_brush_activate_from_toolref_for_object_paint(), toolsystem_brush_type_binding_lookup(), toolsystem_main_brush_binding_update_from_active(), wmWindowManager::windows, Main::wm, WM_window_get_active_scene(), and WM_window_get_active_workspace().
Referenced by toolsystem_brush_activate_from_toolref(), and toolsystem_brush_activate_from_toolref_for_object_paint().
|
static |
Definition at line 337 of file wm_toolsystem.cc.
References ParticleEditSettings::brushtype, bToolRef_Runtime::data_block, ListBase::first, i, LISTBASE_FOREACH, ToolSettings::particle, RNA_enum_from_identifier(), rna_enum_particle_edit_hair_brush_items, bToolRef::runtime, Scene::toolsettings, toolsystem_brush_activate_from_toolref_for_object_particle(), EnumPropertyItem::value, wmWindowManager::windows, Main::wm, WM_window_get_active_scene(), and WM_window_get_active_workspace().
Referenced by toolsystem_brush_activate_from_toolref(), and toolsystem_brush_activate_from_toolref_for_object_particle().
|
static |
Definition at line 483 of file wm_toolsystem.cc.
References BKE_paint_get_active_from_paintmode(), BKE_paint_previous_asset_reference_clear(), BKE_paintmode_get_from_tool(), ListBase::first, LISTBASE_FOREACH, toolsystem_brush_clear_paint_reference(), wmWindowManager::windows, Main::wm, WM_window_get_active_scene(), and WM_window_get_active_workspace().
Referenced by toolsystem_brush_clear_paint_reference(), and toolsystem_ref_link().
|
static |
Special case, the active brush data-block for the image & 3D viewport are shared. This means changing the active brush tool in one space must change the tool for the other space as well, see: #131062.
Definition at line 456 of file wm_toolsystem.cc.
References CTX_MODE_PAINT_TEXTURE, bToolRef::idname, bToolKey::mode, bToolRef::mode, SI_MODE_PAINT, SPACE_IMAGE, bToolKey::space_type, bToolRef::space_type, SPACE_VIEW3D, toolsystem_brush_sync_for_texture_paint(), toolsystem_ref_set_by_id_pending(), and WM_toolsystem_ref_find().
Referenced by toolsystem_brush_sync_for_texture_paint(), and toolsystem_ref_link().
|
static |
Definition at line 238 of file wm_toolsystem.cc.
References ToolSystemBrushBindings::active_brush_per_brush_type, BLI_findstring_ptr(), offsetof, Paint::tool_brush_bindings, and toolsystem_brush_type_binding_lookup().
Referenced by toolsystem_brush_activate_from_toolref_for_object_paint(), toolsystem_brush_type_binding_lookup(), and toolsystem_brush_type_binding_update().
|
static |
Definition at line 265 of file wm_toolsystem.cc.
References ToolSystemBrushBindings::active_brush_per_brush_type, BLI_addhead(), BLI_strdup(), Paint::brush, NamedBrushAssetReference::brush_asset_reference, Paint::brush_asset_reference, brush_type_identifier_get(), MEM_callocN(), NamedBrushAssetReference::name, Paint::tool_brush_bindings, toolsystem_brush_type_binding_lookup(), and toolsystem_brush_type_binding_update().
Referenced by toolsystem_brush_type_binding_update(), and WM_toolsystem_activate_brush_and_tool().
|
static |
Definition at line 1110 of file wm_toolsystem.cc.
References CTX_MODE_EDIT_TEXT, CTX_MODE_PAINT_GPENCIL_LEGACY, CTX_MODE_PAINT_GREASE_PENCIL, CTX_MODE_PAINT_TEXTURE, CTX_MODE_PAINT_VERTEX, CTX_MODE_PAINT_WEIGHT, CTX_MODE_PARTICLE, CTX_MODE_SCULPT, CTX_MODE_SCULPT_CURVES, CTX_MODE_SCULPT_GPENCIL_LEGACY, CTX_MODE_SCULPT_GREASE_PENCIL, CTX_MODE_VERTEX_GPENCIL_LEGACY, CTX_MODE_VERTEX_GREASE_PENCIL, CTX_MODE_WEIGHT_GPENCIL_LEGACY, CTX_MODE_WEIGHT_GREASE_PENCIL, bToolKey::mode, SI_MODE_PAINT, SI_MODE_VIEW, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, bToolKey::space_type, SPACE_VIEW3D, and toolsystem_default_tool().
Referenced by toolsystem_default_tool(), and toolsystem_reinit_ensure_toolref().
|
static |
Definition at line 723 of file wm_toolsystem.cc.
References ELEM, bToolKey::mode, SI_MODE_PAINT, SI_MODE_UV, SI_MODE_VIEW, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, bToolKey::space_type, SPACE_VIEW3D, and toolsystem_key_ensure_check().
Referenced by toolsystem_key_ensure_check(), and WM_toolsystem_update_from_context().
|
static |
Similar to toolsystem_active_tool_from_context_or_view3d(), but returns the tool key only.
Definition at line 138 of file wm_toolsystem.cc.
References bToolKey::mode, bToolKey::space_type, SPACE_VIEW3D, ScrArea::spacetype, toolsystem_key_from_context_or_view3d(), WM_toolsystem_mode_from_spacetype(), and WM_TOOLSYSTEM_SPACE_MASK.
Referenced by toolsystem_key_from_context_or_view3d(), and toolsystem_ref_set_by_brush_type().
|
static |
Update the bindings so the main brush reference matches the currently active brush.
Definition at line 250 of file wm_toolsystem.cc.
References blender::bke::asset_edit_weak_reference_from_id(), Paint::brush, Brush::id, ToolSystemBrushBindings::main_brush_asset_reference, Paint::tool_brush_bindings, and toolsystem_main_brush_binding_update_from_active().
Referenced by toolsystem_brush_activate_from_toolref_for_object_paint(), toolsystem_main_brush_binding_update_from_active(), and WM_toolsystem_activate_brush_and_tool().
Definition at line 503 of file wm_toolsystem.cc.
References CLOG_WARN, bToolRef_Runtime::flag, wmGizmoGroupType::flag, bToolRef_Runtime::gizmo_group, wmGizmoGroupType::gzmap_params, bToolRef::runtime, TOOLREF_FLAG_USE_BRUSHES, toolsystem_brush_activate_from_toolref(), toolsystem_brush_clear_paint_reference(), toolsystem_brush_sync_for_texture_paint(), toolsystem_ref_link(), WM_gizmo_group_type_ensure_ptr(), WM_gizmoconfig_update_tag_group_type_init(), WM_gizmogrouptype_find(), WM_GIZMOGROUPTYPE_TOOL_INIT, WM_gizmomaptype_ensure(), and WM_LOG_TOOLS.
Referenced by toolsystem_ref_link(), toolsystem_refresh_ref(), and WM_toolsystem_ref_set_from_runtime().
|
static |
Definition at line 1005 of file wm_toolsystem.cc.
References BLI_assert, C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area(), CTX_wm_workspace(), RNA_enum_set(), RNA_string_set(), bToolKey::space_type, ScrArea::spacetype, toolsystem_key_from_context_or_view3d(), toolsystem_ref_set_by_brush_type(), toolsystem_refresh_screen_from_active_tool(), WM_OP_EXEC_DEFAULT, WM_operator_name_call_ptr(), WM_operator_properties_create_ptr(), WM_operator_properties_free(), WM_operatortype_find(), WM_toolsystem_ref_find(), WM_TOOLSYSTEM_SPACE_MASK, and WM_TOOLSYSTEM_SPACE_MASK_MODE_FROM_SPACE.
Referenced by toolsystem_ref_set_by_brush_type(), and WM_toolsystem_activate_brush_and_tool().
|
static |
Request a tool ID be activated in a context where it's not known if the tool exists, when the areas using this tool are not visible. In this case, set the idname as pending and flag tools area for updating.
If the tool doesn't exist then the current tool is to be left as-is.
Definition at line 1055 of file wm_toolsystem.cc.
References AREA_FLAG_ACTIVE_TOOL_UPDATE, BLI_assert, bToolRef::idname, bToolRef::idname_pending, LISTBASE_FOREACH, Main::screens, STREQ, STRNCPY(), and toolsystem_ref_set_by_id_pending().
Referenced by toolsystem_brush_sync_for_texture_paint(), and toolsystem_ref_set_by_id_pending().
Definition at line 533 of file wm_toolsystem.cc.
References C, CTX_data_main(), bToolRef::runtime, toolsystem_ref_link(), and toolsystem_refresh_ref().
Referenced by toolsystem_refresh_ref(), WM_toolsystem_refresh(), WM_toolsystem_refresh_active(), and WM_toolsystem_refresh_all().
|
static |
Definition at line 924 of file wm_toolsystem.cc.
References bScreen::areabase, ListBase::first, LISTBASE_FOREACH, bToolRef::mode, bToolRef::runtime, bToolRef::space_type, toolsystem_refresh_screen_from_active_tool(), Main::wm, WM_toolsystem_mode_from_spacetype(), WM_window_get_active_scene(), WM_window_get_active_screen(), WM_window_get_active_view_layer(), and WM_window_get_active_workspace().
Referenced by toolsystem_ref_set_by_brush_type(), toolsystem_refresh_screen_from_active_tool(), WM_toolsystem_ref_set_by_id_ex(), and WM_toolsystem_ref_set_from_runtime().
|
static |
Run after changing modes.
Definition at line 1157 of file wm_toolsystem.cc.
References C, bToolRef::idname, STRNCPY(), toolsystem_default_tool(), toolsystem_reinit_ensure_toolref(), toolsystem_reinit_with_toolref(), and WM_toolsystem_ref_ensure().
Referenced by toolsystem_reinit_ensure_toolref(), WM_toolsystem_refresh_active(), WM_toolsystem_update_from_context(), and wm_toolsystem_update_from_context_view3d_impl().
Definition at line 549 of file wm_toolsystem.cc.
References C, toolsystem_reinit_ref(), and toolsystem_reinit_with_toolref().
Referenced by toolsystem_reinit_ref(), WM_toolsystem_reinit(), and WM_toolsystem_reinit_all().
Definition at line 1096 of file wm_toolsystem.cc.
References C, bToolRef::idname, bToolRef::idname_pending, bToolKey::mode, bToolRef::mode, bToolKey::space_type, bToolRef::space_type, toolsystem_reinit_with_toolref(), and WM_toolsystem_ref_set_by_id_ex().
Referenced by toolsystem_reinit_ensure_toolref(), toolsystem_reinit_ref(), and toolsystem_reinit_with_toolref().
Definition at line 186 of file wm_toolsystem.cc.
References C, CTX_data_main(), bToolRef_Runtime::gizmo_group, bToolRef::runtime, toolsystem_unlink_ref(), WM_gizmo_group_remove_by_tool(), and WM_gizmogrouptype_find().
Referenced by toolsystem_unlink_ref(), WM_toolsystem_ref_set_from_runtime(), WM_toolsystem_unlink(), and WM_toolsystem_unlink_all().
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.
Definition at line 296 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(), C, 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(), WM_toolsystem_activate_brush_and_tool(), and WM_toolsystem_ref_set_by_id().
Referenced by blender::ed::sculpt_paint::brush_asset_activate_exec(), blender::ed::sculpt_paint::brush_asset_save_as_exec(), and WM_toolsystem_activate_brush_and_tool().
| bool WM_toolsystem_active_tool_has_custom_cursor | ( | const bContext * | C | ) |
Definition at line 1234 of file wm_toolsystem.cc.
References C, bToolRef_Runtime::cursor, WM_CURSOR_DEFAULT, WM_toolsystem_active_tool_has_custom_cursor(), and WM_toolsystem_runtime_from_context().
Referenced by blender::ed::greasepencil::brush_cursor_poll(), and WM_toolsystem_active_tool_has_custom_cursor().
| bool WM_toolsystem_active_tool_is_brush | ( | const bContext * | C | ) |
For paint modes to support non-brush tools.
Definition at line 1228 of file wm_toolsystem.cc.
References C, bToolRef_Runtime::flag, TOOLREF_FLAG_USE_BRUSHES, WM_toolsystem_active_tool_is_brush(), and WM_toolsystem_runtime_from_context().
Referenced by blender::ed::greasepencil::brush_cursor_poll(), brush_drawcursor(), brush_edit_poll(), blender::ed::sculpt_paint::grease_pencil_brush_stroke_poll(), blender::ed::greasepencil::grease_pencil_poll_vertex_cursor(), blender::ed::greasepencil::grease_pencil_poll_weight_cursor(), blender::ed::sculpt_paint::grease_pencil_sculpt_paint_poll(), blender::ed::sculpt_paint::grease_pencil_vertex_brush_stroke_poll(), blender::ed::sculpt_paint::grease_pencil_weight_brush_stroke_poll(), image_paint_poll_ex(), blender::ed::greasepencil::keymap_grease_pencil_brush_stroke_poll(), blender::ed::greasepencil::keymap_grease_pencil_fill_tool_poll(), blender::ed::sculpt_paint::paint_draw_tex_overlay(), vertex_paint_poll_ex(), weight_paint_poll_ex(), and WM_toolsystem_active_tool_is_brush().
| void WM_toolsystem_do_msg_notify_tag_refresh | ( | bContext * | C, |
| wmMsgSubscribeKey * | msg_key, | ||
| wmMsgSubscribeValue * | msg_val ) |
Follow wmMsgNotifyFn spec.
Definition at line 1240 of file wm_toolsystem.cc.
References bScreen::areabase, BLI_findindex(), C, CTX_data_main(), ListBase::first, bToolKey::mode, wmWindow::next, bToolKey::space_type, ScrArea::spacetype, wmMsgSubscribeValue::user_data, Main::wm, WM_toolsystem_do_msg_notify_tag_refresh(), WM_toolsystem_mode_from_spacetype(), WM_toolsystem_refresh(), WM_toolsystem_refresh_screen_area(), WM_window_get_active_scene(), WM_window_get_active_screen(), WM_window_get_active_view_layer(), and WM_window_get_active_workspace().
Referenced by view3d_main_region_message_subscribe(), and WM_toolsystem_do_msg_notify_tag_refresh().
| void WM_toolsystem_init | ( | const bContext * | C | ) |
Definition at line 708 of file wm_toolsystem.cc.
References BLI_assert, C, CTX_data_main(), CTX_wm_window(), LISTBASE_FOREACH, MEM_SAFE_FREE, WM_toolsystem_init(), and Main::workspaces.
Referenced by wm_file_read_post(), and WM_toolsystem_init().
| bool WM_toolsystem_key_from_context | ( | const Scene * | scene, |
| ViewLayer * | view_layer, | ||
| ScrArea * | area, | ||
| bToolKey * | tkey ) |
Definition at line 779 of file wm_toolsystem.cc.
References bToolKey::mode, SPACE_EMPTY, bToolKey::space_type, ScrArea::spacetype, WM_toolsystem_key_from_context(), and WM_toolsystem_mode_from_spacetype().
Referenced by WM_toolsystem_key_from_context(), and WM_toolsystem_ref_set_by_id().
| int WM_toolsystem_mode_from_spacetype | ( | const Scene * | scene, |
| ViewLayer * | view_layer, | ||
| ScrArea * | area, | ||
| int | space_type ) |
Definition at line 741 of file wm_toolsystem.cc.
References BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), CTX_data_mode_enum_ex(), CTX_MODE_OBJECT, ListBase::first, Object::mode, SpaceImage::mode, OBEDIT_FROM_OBACT, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, SPACE_VIEW3D, ScrArea::spacedata, SpaceSeq::view, and WM_toolsystem_mode_from_spacetype().
Referenced by toolsystem_active_tool_from_context_or_view3d(), toolsystem_key_from_context_or_view3d(), toolsystem_refresh_screen_from_active_tool(), WM_toolsystem_do_msg_notify_tag_refresh(), WM_toolsystem_key_from_context(), WM_toolsystem_mode_from_spacetype(), WM_toolsystem_ref_from_context(), WM_toolsystem_refresh_active(), WM_toolsystem_refresh_screen_area(), WM_toolsystem_reinit_all(), WM_toolsystem_update_from_context(), wm_toolsystem_update_from_context_view3d_impl(), and WM_window_cursor_keymap_status_refresh().
Definition at line 120 of file wm_toolsystem.cc.
References BLI_addhead(), MEM_callocN(), bToolKey::mode, bToolRef::mode, bToolKey::space_type, bToolRef::space_type, WorkSpace::tools, WM_toolsystem_ref_ensure(), and WM_toolsystem_ref_find().
Referenced by toolsystem_reinit_ensure_toolref(), and WM_toolsystem_ref_ensure().
Definition at line 103 of file wm_toolsystem.cc.
References BLI_assert, LISTBASE_FOREACH, bToolKey::mode, bToolKey::space_type, WorkSpace::tools, WM_toolsystem_ref_find(), and WM_TOOLSYSTEM_SPACE_MASK.
Referenced by toolsystem_active_tool_from_context_or_view3d(), toolsystem_brush_sync_for_texture_paint(), toolsystem_ref_set_by_brush_type(), WM_toolsystem_ref_ensure(), WM_toolsystem_ref_find(), WM_toolsystem_ref_from_context(), WM_toolsystem_ref_set_by_id_ex(), WM_toolsystem_refresh(), WM_toolsystem_refresh_active(), WM_toolsystem_reinit(), WM_toolsystem_reinit_all(), WM_toolsystem_runtime_find(), WM_toolsystem_unlink(), and WM_window_cursor_keymap_status_refresh().
Definition at line 74 of file wm_toolsystem.cc.
References BLI_assert, C, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area(), CTX_wm_workspace(), ScrArea_Runtime::is_tool_set, bToolKey::mode, ScrArea::runtime, bToolKey::space_type, ScrArea::spacetype, ScrArea_Runtime::tool, WM_toolsystem_mode_from_spacetype(), WM_toolsystem_ref_find(), WM_toolsystem_ref_from_context(), and WM_TOOLSYSTEM_SPACE_MASK.
Referenced by ED_image_paint_brush_type_update_sticky_shading_color(), ED_image_paint_brush_type_use_canvas(), blender::ed::transform::gizmo_mesh_extrude_refresh(), gizmo_mesh_spin_init_draw_prepare(), gizmo_mesh_spin_init_refresh(), image_paint_brush_type_shading_color_follows_last_used_tool(), blender::ed::greasepencil::keymap_grease_pencil_brush_stroke_poll(), tool_generic_create_gizmo(), toolsystem_active_tool_from_context_or_view3d(), blender::ed::transform::transform_from_gizmo_invoke(), WM_gizmo_operator_invoke(), wm_handler_operator_call(), WM_toolsystem_ref_from_context(), and WM_toolsystem_runtime_from_context().
| void WM_toolsystem_ref_properties_ensure_ex | ( | bToolRef * | tref, |
| const char * | idname, | ||
| StructRNA * | type, | ||
| PointerRNA * | r_ptr ) |
Definition at line 1306 of file wm_toolsystem.cc.
References idprops_ensure_named_group(), RNA_pointer_create_discrete(), WM_toolsystem_ref_properties_ensure_ex(), and WM_toolsystem_ref_properties_ensure_idprops().
Referenced by WM_toolsystem_ref_properties_ensure_ex().
| IDProperty * WM_toolsystem_ref_properties_ensure_idprops | ( | bToolRef * | tref | ) |
Definition at line 1287 of file wm_toolsystem.cc.
References blender::bke::idprop::create_group(), bToolRef::idname, idprops_ensure_named_group(), bToolRef::properties, and WM_toolsystem_ref_properties_ensure_idprops().
Referenced by WM_toolsystem_ref_properties_ensure_ex(), and WM_toolsystem_ref_properties_ensure_idprops().
| bool WM_toolsystem_ref_properties_get_ex | ( | bToolRef * | tref, |
| const char * | idname, | ||
| StructRNA * | type, | ||
| PointerRNA * | r_ptr ) |
Definition at line 1295 of file wm_toolsystem.cc.
References IDP_GetPropertyFromGroup(), RNA_pointer_create_discrete(), WM_toolsystem_ref_properties_get_ex(), and WM_toolsystem_ref_properties_get_idprops().
Referenced by WM_toolsystem_ref_properties_get_ex().
| IDProperty * WM_toolsystem_ref_properties_get_idprops | ( | bToolRef * | tref | ) |
Definition at line 1278 of file wm_toolsystem.cc.
References bToolRef::idname, IDP_GetPropertyFromGroup(), bToolRef::properties, and WM_toolsystem_ref_properties_get_idprops().
Referenced by WM_toolsystem_ref_properties_get_ex(), WM_toolsystem_ref_properties_get_idprops(), and WM_toolsystem_ref_properties_init_for_keymap().
| void WM_toolsystem_ref_properties_init_for_keymap | ( | bToolRef * | tref, |
| PointerRNA * | dst_ptr, | ||
| PointerRNA * | src_ptr, | ||
| wmOperatorType * | ot ) |
Definition at line 1316 of file wm_toolsystem.cc.
References blender::bke::idprop::create_group(), PointerRNA::data, wmOperatorType::idname, IDP_CopyProperty(), IDP_GetPropertyFromGroup(), IDP_MergeGroup(), WM_toolsystem_ref_properties_get_idprops(), and WM_toolsystem_ref_properties_init_for_keymap().
Referenced by view3d_interactive_add_modal(), wm_handler_operator_call(), and WM_toolsystem_ref_properties_init_for_keymap().
Definition at line 992 of file wm_toolsystem.cc.
References C, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area(), CTX_wm_workspace(), WM_toolsystem_key_from_context(), WM_toolsystem_ref_set_by_id(), and WM_toolsystem_ref_set_by_id_ex().
Referenced by WM_toolsystem_activate_brush_and_tool(), and WM_toolsystem_ref_set_by_id().
| bToolRef * WM_toolsystem_ref_set_by_id_ex | ( | bContext * | C, |
| WorkSpace * | workspace, | ||
| const bToolKey * | tkey, | ||
| const char * | name, | ||
| bool | cycle ) |
Definition at line 951 of file wm_toolsystem.cc.
References BLI_assert, C, CTX_data_main(), CTX_wm_area(), bToolRef::idname, RNA_boolean_set(), RNA_enum_set(), RNA_string_set(), bToolKey::space_type, ScrArea::spacetype, STREQ, toolsystem_refresh_screen_from_active_tool(), WM_OP_EXEC_DEFAULT, WM_operator_name_call_ptr(), WM_operator_properties_create_ptr(), WM_operator_properties_free(), WM_operatortype_find(), WM_toolsystem_ref_find(), WM_toolsystem_ref_set_by_id_ex(), WM_TOOLSYSTEM_SPACE_MASK, and WM_TOOLSYSTEM_SPACE_MASK_MODE_FROM_SPACE.
Referenced by toolsystem_reinit_with_toolref(), WM_toolsystem_ref_set_by_id(), and WM_toolsystem_ref_set_by_id_ex().
| void WM_toolsystem_ref_set_from_runtime | ( | bContext * | C, |
| WorkSpace * | workspace, | ||
| bToolRef * | tref, | ||
| const bToolRef_Runtime * | tref_rt, | ||
| const char * | idname ) |
Definition at line 608 of file wm_toolsystem.cc.
References wmWindow::addmousemove, C, CTX_data_main(), CTX_wm_message_bus(), CTX_wm_window(), bToolRef_Runtime::flag, wmGizmoGroupType::flag, bToolRef_Runtime::gizmo_group, WorkSpace::id, bToolRef::idname, bToolRef::idname_fallback, bToolRef::idname_pending, bToolRef_Runtime::keymap_fallback, MEM_callocN(), bToolRef::runtime, STRNCPY(), wmWindow::tag_cursor_refresh, TOOLREF_FLAG_FALLBACK_KEYMAP, toolsystem_ref_link(), toolsystem_refresh_screen_from_active_tool(), toolsystem_unlink_ref(), WM_gizmogrouptype_find(), WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP, WM_msg_publish_rna_prop, and WM_toolsystem_ref_set_from_runtime().
Referenced by WM_toolsystem_ref_set_from_runtime().
Sync the internal active state of a tool back into the tool system, this is needed for active brushes where the real active state is not stored in the tool system.
Definition at line 674 of file wm_toolsystem.cc.
References BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), ParticleEditSettings::brushtype, CTX_MODE_PARTICLE, bToolRef_Runtime::data_block, ListBase::first, i, EnumPropertyItem::identifier, bToolRef::idname, LISTBASE_FOREACH, bToolRef::mode, Object::mode, EnumPropertyItem::name, OB_MODE_PARTICLE_EDIT, ToolSettings::particle, RNA_enum_from_value(), rna_enum_particle_edit_hair_brush_items, bToolRef::runtime, SNPRINTF, bToolRef::space_type, SPACE_VIEW3D, STREQ, STRNCPY(), Scene::toolsettings, wmWindowManager::windows, Main::wm, WM_toolsystem_ref_sync_from_context(), WM_window_get_active_scene(), WM_window_get_active_view_layer(), and WM_window_get_active_workspace().
Referenced by WM_toolsystem_ref_sync_from_context().
Definition at line 541 of file wm_toolsystem.cc.
References C, toolsystem_refresh_ref(), WM_toolsystem_ref_find(), and WM_toolsystem_refresh().
Referenced by WM_toolsystem_do_msg_notify_tag_refresh(), and WM_toolsystem_refresh().
| void WM_toolsystem_refresh_active | ( | bContext * | C | ) |
Use to update the active tool (shown in the top bar) in the least disruptive way.
This is a little involved since there may be multiple valid active tools depending on the mode and space type.
Used when undoing since the active mode may have changed.
Definition at line 800 of file wm_toolsystem.cc.
References bScreen::areabase, BKE_workspace_id_tag_all_visible(), C, CTX_data_main(), CTX_wm_area(), CTX_wm_area_set(), CTX_wm_region(), CTX_wm_region_set(), CTX_wm_window(), CTX_wm_window_set(), ListBase::first, ID_TAG_DOIT, LISTBASE_FOREACH, bToolKey::mode, bToolRef::runtime, bToolKey::space_type, toolsystem_refresh_ref(), toolsystem_reinit_ensure_toolref(), Main::wm, WM_toolsystem_mode_from_spacetype(), WM_toolsystem_ref_find(), WM_toolsystem_refresh_active(), WM_TOOLSYSTEM_SPACE_MASK, WM_window_get_active_scene(), WM_window_get_active_screen(), WM_window_get_active_view_layer(), WM_window_get_active_workspace(), and Main::workspaces.
Referenced by ed_undo_step_post(), and WM_toolsystem_refresh_active().
Definition at line 577 of file wm_toolsystem.cc.
References BLI_assert, C, LISTBASE_FOREACH, WorkSpace::tools, toolsystem_refresh_ref(), and WM_toolsystem_refresh_all().
Referenced by WM_toolsystem_refresh_all().
| void WM_toolsystem_refresh_screen_all | ( | Main * | bmain | ) |
Definition at line 912 of file wm_toolsystem.cc.
References ListBase::first, LISTBASE_FOREACH, Main::wm, WM_toolsystem_refresh_screen_all(), and WM_toolsystem_refresh_screen_window().
Referenced by ed_undo_step_post(), and WM_toolsystem_refresh_screen_all().
| bool WM_toolsystem_refresh_screen_area | ( | WorkSpace * | workspace, |
| const Scene * | scene, | ||
| ViewLayer * | view_layer, | ||
| ScrArea * | area ) |
Definition at line 871 of file wm_toolsystem.cc.
References ScrArea_Runtime::is_tool_set, LISTBASE_FOREACH, ScrArea::runtime, ScrArea::spacetype, ScrArea_Runtime::tool, WorkSpace::tools, WM_toolsystem_mode_from_spacetype(), and WM_toolsystem_refresh_screen_area().
Referenced by ED_area_init(), WM_toolsystem_do_msg_notify_tag_refresh(), WM_toolsystem_refresh_screen_area(), and WM_toolsystem_refresh_screen_window().
| void WM_toolsystem_refresh_screen_window | ( | wmWindow * | win | ) |
Definition at line 893 of file wm_toolsystem.cc.
References bScreen::areabase, LISTBASE_FOREACH, SPACE_TYPE_NUM, WorkSpace::tools, WM_toolsystem_refresh_screen_area(), WM_toolsystem_refresh_screen_window(), WM_window_get_active_scene(), WM_window_get_active_screen(), WM_window_get_active_view_layer(), and WM_window_get_active_workspace().
Referenced by ED_screen_scene_change(), WM_toolsystem_refresh_screen_all(), and WM_toolsystem_refresh_screen_window().
Definition at line 553 of file wm_toolsystem.cc.
References C, toolsystem_reinit_ref(), WM_toolsystem_ref_find(), and WM_toolsystem_reinit().
Referenced by WM_toolsystem_reinit().
Definition at line 584 of file wm_toolsystem.cc.
References bScreen::areabase, C, LISTBASE_FOREACH, bToolKey::mode, bToolKey::space_type, bToolRef::tag, toolsystem_reinit_ref(), WM_toolsystem_mode_from_spacetype(), WM_toolsystem_ref_find(), WM_toolsystem_reinit_all(), WM_TOOLSYSTEM_SPACE_MASK, WM_window_get_active_scene(), WM_window_get_active_screen(), WM_window_get_active_view_layer(), and WM_window_get_active_workspace().
Referenced by WM_toolsystem_reinit_all().
| bToolRef_Runtime * WM_toolsystem_runtime_find | ( | WorkSpace * | workspace, |
| const bToolKey * | tkey ) |
Definition at line 114 of file wm_toolsystem.cc.
References bToolRef::runtime, WM_toolsystem_ref_find(), and WM_toolsystem_runtime_find().
Referenced by WM_toolsystem_runtime_find().
| bToolRef_Runtime * WM_toolsystem_runtime_from_context | ( | const bContext * | C | ) |
Definition at line 97 of file wm_toolsystem.cc.
References C, bToolRef::runtime, WM_toolsystem_ref_from_context(), and WM_toolsystem_runtime_from_context().
Referenced by ED_gizmo_poll_or_unlink_delayed_from_tool_ex(), view3d_ruler_poll(), WM_toolsystem_active_tool_has_custom_cursor(), WM_toolsystem_active_tool_is_brush(), and WM_toolsystem_runtime_from_context().
Definition at line 198 of file wm_toolsystem.cc.
References C, bToolRef::runtime, toolsystem_unlink_ref(), WM_toolsystem_ref_find(), and WM_toolsystem_unlink().
Referenced by WM_toolsystem_unlink().
Operate on all active tools.
Definition at line 561 of file wm_toolsystem.cc.
References C, LISTBASE_FOREACH, WorkSpace::tools, toolsystem_unlink_ref(), and WM_toolsystem_unlink_all().
Referenced by WM_toolsystem_unlink_all().
| void WM_toolsystem_update_from_context | ( | bContext * | C, |
| WorkSpace * | workspace, | ||
| const Scene * | scene, | ||
| ViewLayer * | view_layer, | ||
| ScrArea * | area ) |
Definition at line 1217 of file wm_toolsystem.cc.
References C, bToolKey::mode, bToolKey::space_type, ScrArea::spacetype, toolsystem_key_ensure_check(), toolsystem_reinit_ensure_toolref(), WM_toolsystem_mode_from_spacetype(), and WM_toolsystem_update_from_context().
Referenced by wm_draw_area_offscreen(), and WM_toolsystem_update_from_context().
| void WM_toolsystem_update_from_context_view3d | ( | bContext * | C | ) |
Definition at line 1184 of file wm_toolsystem.cc.
References BLI_listbase_is_single(), C, CTX_data_main(), CTX_wm_area(), CTX_wm_area_set(), CTX_wm_region(), CTX_wm_region_set(), CTX_wm_window(), CTX_wm_window_set(), CTX_wm_workspace(), ListBase::first, LISTBASE_FOREACH, wmWindowManager::windows, Main::wm, WM_toolsystem_update_from_context_view3d(), wm_toolsystem_update_from_context_view3d_impl(), and WM_window_get_active_workspace().
Referenced by blender::ed::sculpt_paint::curves_sculptmode_toggle_exec(), ed_object_select_pick(), blender::ed::object::editmode_toggle_exec(), blender::ed::object::object_transfer_mode_invoke(), blender::ed::greasepencil::paintmode_toggle_exec(), particle_edit_toggle_exec(), blender::ed::object::posemode_exec(), blender::ed::sculpt_paint::sculpt_mode_toggle_exec(), blender::ed::greasepencil::sculptmode_toggle_exec(), texture_paint_toggle_exec(), blender::ed::greasepencil::vertexmode_toggle_exec(), vpaint_mode_toggle_exec(), blender::ed::greasepencil::weightmode_toggle_exec(), WM_toolsystem_update_from_context_view3d(), and wpaint_mode_toggle_exec().
Definition at line 1173 of file wm_toolsystem.cc.
References C, CTX_data_scene(), CTX_data_view_layer(), bToolKey::mode, bToolKey::space_type, SPACE_VIEW3D, toolsystem_reinit_ensure_toolref(), WM_toolsystem_mode_from_spacetype(), and wm_toolsystem_update_from_context_view3d_impl().
Referenced by WM_toolsystem_update_from_context_view3d(), and wm_toolsystem_update_from_context_view3d_impl().