|
Blender
V2.93
|
#include "BLI_compiler_attrs.h"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_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) |
Typedefs | |
| typedef struct bToolKey | bToolKey |
| #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) |
Definition at line 115 of file WM_toolsystem.h.
| #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 113 of file WM_toolsystem.h.
| #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 124 of file WM_toolsystem.h.
| #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 122 of file WM_toolsystem.h.
| #define WM_TOOLSYSTEM_SPACE_MASK ((1 << SPACE_IMAGE) | (1 << SPACE_NODE) | (1 << SPACE_VIEW3D) | (1 << SPACE_SEQ)) |
Definition at line 43 of file WM_toolsystem.h.
| bool WM_toolsystem_active_tool_is_brush | ( | const struct bContext * | C | ) |
| void WM_toolsystem_do_msg_notify_tag_refresh | ( | struct bContext * | C, |
| struct wmMsgSubscribeKey * | msg_key, | ||
| struct wmMsgSubscribeValue * | msg_val | ||
| ) |
| void WM_toolsystem_init | ( | struct bContext * | C | ) |
Definition at line 420 of file wm_toolsystem.c.
References BLI_assert, C, CTX_data_main(), CTX_wm_window(), LISTBASE_FOREACH, MEM_SAFE_FREE, NULL, and Main::workspaces.
Referenced by wm_file_read_post().
| bool WM_toolsystem_key_from_context | ( | struct ViewLayer * | view_layer, |
| struct ScrArea * | area, | ||
| bToolKey * | tkey | ||
| ) |
Definition at line 487 of file wm_toolsystem.c.
References blender::compositor::area(), bToolKey::mode, NULL, SPACE_EMPTY, bToolKey::space_type, and WM_toolsystem_mode_from_spacetype().
Referenced by WM_toolsystem_ref_set_by_id().
| int WM_toolsystem_mode_from_spacetype | ( | struct ViewLayer * | view_layer, |
| struct ScrArea * | area, | ||
| int | space_type | ||
| ) |
Definition at line 453 of file wm_toolsystem.c.
References blender::compositor::area(), CTX_data_mode_enum_ex(), CTX_MODE_OBJECT, Object::mode, SpaceImage::mode, NULL, OBACT, OBEDIT_FROM_OBACT, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, SPACE_VIEW3D, and SpaceSeq::view.
Referenced by toolsystem_refresh_screen_from_active_tool(), WM_toolsystem_do_msg_notify_tag_refresh(), WM_toolsystem_key_from_context(), 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().
| bool WM_toolsystem_ref_ensure | ( | struct WorkSpace * | workspace, |
| const bToolKey * | tkey, | ||
| struct bToolRef ** | r_tref | ||
| ) |
Definition at line 114 of file wm_toolsystem.c.
References BLI_addhead(), MEM_callocN, bToolRef::mode, bToolKey::mode, bToolRef::space_type, bToolKey::space_type, WorkSpace::tools, and WM_toolsystem_ref_find().
Referenced by toolsystem_reinit_ensure_toolref().
Definition at line 97 of file wm_toolsystem.c.
References BLI_assert, LISTBASE_FOREACH, bToolKey::mode, NULL, bToolKey::space_type, WorkSpace::tools, and WM_TOOLSYSTEM_SPACE_MASK.
Referenced by WM_toolsystem_ref_ensure(), 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 71 of file wm_toolsystem.c.
References blender::compositor::area(), BLI_assert, C, CTX_data_view_layer(), CTX_wm_area(), CTX_wm_workspace(), NULL, bToolKey::space_type, WM_toolsystem_mode_from_spacetype(), WM_toolsystem_ref_find(), and WM_TOOLSYSTEM_SPACE_MASK.
Referenced by gizmo_mesh_extrude_refresh(), gizmo_mesh_spin_init_draw_prepare(), gizmo_mesh_spin_init_refresh(), tool_generic_create_gizmo(), transform_from_gizmo_invoke(), WM_gizmo_operator_invoke(), wm_handler_operator_call(), and WM_toolsystem_runtime_from_context().
| void WM_toolsystem_ref_properties_ensure_ex | ( | struct bToolRef * | tref, |
| const char * | idname, | ||
| struct StructRNA * | type, | ||
| struct PointerRNA * | r_ptr | ||
| ) |
Definition at line 853 of file wm_toolsystem.c.
References BLI_assert, IDP_GetPropertyFromGroup(), IDP_GROUP, IDP_New(), IDP_ReplaceInGroup_ex(), IDProperty::name, NULL, RNA_pointer_create(), STRNCPY, type, IDProperty::type, and WM_toolsystem_ref_properties_ensure_idprops().
| struct IDProperty* WM_toolsystem_ref_properties_ensure_idprops | ( | struct bToolRef * | tref | ) |
Definition at line 833 of file wm_toolsystem.c.
References IDP_GROUP, IDP_New(), NULL, and bToolRef::properties.
Referenced by WM_toolsystem_ref_properties_ensure_ex().
| bool WM_toolsystem_ref_properties_get_ex | ( | struct bToolRef * | tref, |
| const char * | idname, | ||
| struct StructRNA * | type, | ||
| struct PointerRNA * | r_ptr | ||
| ) |
Definition at line 842 of file wm_toolsystem.c.
References IDP_GetPropertyFromGroup(), NULL, bToolRef::properties, RNA_pointer_create(), and type.
| void WM_toolsystem_ref_properties_init_for_keymap | ( | struct bToolRef * | tref, |
| struct PointerRNA * | dst_ptr, | ||
| struct PointerRNA * | src_ptr, | ||
| struct wmOperatorType * | ot | ||
| ) |
Definition at line 873 of file wm_toolsystem.c.
References PointerRNA::data, wmOperatorType::idname, IDP_CopyProperty(), IDP_GetPropertyFromGroup(), IDP_GROUP, IDP_MergeGroup(), IDP_New(), NULL, ot, and bToolRef::properties.
Referenced by view3d_interactive_add_modal(), and wm_handler_operator_call().
Definition at line 649 of file wm_toolsystem.c.
References blender::compositor::area(), C, CTX_data_view_layer(), CTX_wm_area(), CTX_wm_workspace(), NULL, WM_toolsystem_key_from_context(), and WM_toolsystem_ref_set_by_id_ex().
Referenced by brush_generic_tool_set().
| struct bToolRef* WM_toolsystem_ref_set_by_id_ex | ( | struct bContext * | C, |
| struct WorkSpace * | workspace, | ||
| const bToolKey * | tkey, | ||
| const char * | name, | ||
| bool | cycle | ||
| ) |
Definition at line 619 of file wm_toolsystem.c.
References BLI_assert, C, CTX_data_main(), bToolRef::idname, NULL, ot, RNA_boolean_set(), RNA_enum_set(), RNA_string_set(), bToolKey::space_type, 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(), and WM_TOOLSYSTEM_SPACE_MASK.
Referenced by toolsystem_reinit_with_toolref(), and WM_toolsystem_ref_set_by_id().
| void WM_toolsystem_ref_set_from_runtime | ( | struct bContext * | C, |
| struct WorkSpace * | workspace, | ||
| struct bToolRef * | tref, | ||
| const struct bToolRef_Runtime * | tref_rt, | ||
| const char * | idname | ||
| ) |
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 368 of file wm_toolsystem.c.
References BKE_brush_tool_get, BKE_paint_get_active_from_paintmode(), BKE_paint_get_tool_enum_from_paintmode(), BKE_paintmode_get_from_tool(), Paint::brush, ParticleEditSettings::brushtype, CTX_MODE_PARTICLE, bToolRef_Runtime::data_block, ListBase::first, EnumPropertyItem::identifier, bToolRef::idname, LISTBASE_FOREACH, Object::mode, bToolRef::mode, EnumPropertyItem::name, NULL, OB_MODE_PARTICLE_EDIT, OBACT, ToolSettings::particle, RNA_enum_from_value(), rna_enum_particle_edit_hair_brush_items, bToolRef::runtime, scene, SNPRINTF, bToolRef::space_type, SPACE_VIEW3D, STREQ, STRNCPY, Scene::toolsettings, wmWindowManager::windows, Main::wm, WM_window_get_active_scene(), WM_window_get_active_view_layer(), and WM_window_get_active_workspace().
| void WM_toolsystem_refresh | ( | struct bContext * | C, |
| struct WorkSpace * | workspace, | ||
| const bToolKey * | tkey | ||
| ) |
Definition at line 234 of file wm_toolsystem.c.
References C, toolsystem_refresh_ref(), and WM_toolsystem_ref_find().
Referenced by WM_toolsystem_do_msg_notify_tag_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 513 of file wm_toolsystem.c.
References blender::compositor::area(), bScreen::areabase, BKE_workspace_id_tag_all_visible(), C, CTX_data_main(), ListBase::first, LIB_TAG_DOIT, LISTBASE_FOREACH, NULL, bToolKey::space_type, toolsystem_refresh_ref(), toolsystem_reinit_ensure_toolref(), Main::wm, WM_toolsystem_mode_from_spacetype(), WM_toolsystem_ref_find(), WM_TOOLSYSTEM_SPACE_MASK, 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().
Definition at line 271 of file wm_toolsystem.c.
References BLI_assert, C, LISTBASE_FOREACH, WorkSpace::tools, and toolsystem_refresh_ref().
| void WM_toolsystem_refresh_screen_all | ( | struct Main * | bmain | ) |
Definition at line 572 of file wm_toolsystem.c.
References blender::compositor::area(), bScreen::areabase, ListBase::first, LISTBASE_FOREACH, NULL, SPACE_TYPE_LAST, WorkSpace::tools, Main::wm, WM_toolsystem_refresh_screen_area(), WM_window_get_active_screen(), WM_window_get_active_view_layer(), and WM_window_get_active_workspace().
Referenced by ed_undo_step_post().
| void WM_toolsystem_refresh_screen_area | ( | struct WorkSpace * | workspace, |
| struct ViewLayer * | view_layer, | ||
| struct ScrArea * | area | ||
| ) |
Definition at line 557 of file wm_toolsystem.c.
References blender::compositor::area(), LISTBASE_FOREACH, NULL, WorkSpace::tools, and WM_toolsystem_mode_from_spacetype().
Referenced by ED_area_init(), WM_toolsystem_do_msg_notify_tag_refresh(), and WM_toolsystem_refresh_screen_all().
| void WM_toolsystem_reinit | ( | struct bContext * | C, |
| struct WorkSpace * | workspace, | ||
| const bToolKey * | tkey | ||
| ) |
Definition at line 246 of file wm_toolsystem.c.
References C, toolsystem_reinit_ref(), and WM_toolsystem_ref_find().
Definition at line 278 of file wm_toolsystem.c.
References blender::compositor::area(), bScreen::areabase, C, LISTBASE_FOREACH, bToolKey::space_type, bToolRef::tag, toolsystem_reinit_ref(), WM_toolsystem_mode_from_spacetype(), WM_toolsystem_ref_find(), WM_TOOLSYSTEM_SPACE_MASK, WM_window_get_active_screen(), WM_window_get_active_view_layer(), and WM_window_get_active_workspace().
| struct bToolRef_Runtime* WM_toolsystem_runtime_find | ( | struct WorkSpace * | workspace, |
| const bToolKey * | tkey | ||
| ) |
Definition at line 108 of file wm_toolsystem.c.
References NULL, bToolRef::runtime, and WM_toolsystem_ref_find().
| struct bToolRef_Runtime* WM_toolsystem_runtime_from_context | ( | struct bContext * | C | ) |
Definition at line 91 of file wm_toolsystem.c.
References C, NULL, bToolRef::runtime, and WM_toolsystem_ref_from_context().
Referenced by ED_gizmo_poll_or_unlink_delayed_from_tool_ex(), view3d_ruler_poll(), and WM_toolsystem_active_tool_is_brush().
| void WM_toolsystem_unlink | ( | struct bContext * | C, |
| struct WorkSpace * | workspace, | ||
| const bToolKey * | tkey | ||
| ) |
Definition at line 143 of file wm_toolsystem.c.
References C, bToolRef::runtime, toolsystem_unlink_ref(), and WM_toolsystem_ref_find().
Definition at line 255 of file wm_toolsystem.c.
References C, LISTBASE_FOREACH, WorkSpace::tools, and toolsystem_unlink_ref().
| void WM_toolsystem_update_from_context | ( | struct bContext * | C, |
| struct WorkSpace * | workspace, | ||
| struct ViewLayer * | view_layer, | ||
| struct ScrArea * | area | ||
| ) |
Definition at line 782 of file wm_toolsystem.c.
References blender::compositor::area(), C, NULL, bToolKey::space_type, toolsystem_key_ensure_check(), toolsystem_reinit_ensure_toolref(), and WM_toolsystem_mode_from_spacetype().
Referenced by wm_draw_window_offscreen().
| void WM_toolsystem_update_from_context_view3d | ( | struct bContext * | C | ) |
Definition at line 751 of file wm_toolsystem.c.
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_impl(), and WM_window_get_active_workspace().
Referenced by ed_object_select_pick(), editmode_toggle_exec(), gpencil_editmode_toggle_exec(), gpencil_paintmode_toggle_exec(), gpencil_sculptmode_toggle_exec(), gpencil_vertexmode_toggle_exec(), gpencil_weightmode_toggle_exec(), object_transfer_mode_to_base(), particle_edit_toggle_exec(), posemode_exec(), sculpt_mode_toggle_exec(), texture_paint_toggle_exec(), vpaint_mode_toggle_exec(), and wpaint_mode_toggle_exec().