Blender V5.0
wm_operators.cc File Reference
#include <algorithm>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <cstddef>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <fmt/format.h>
#include "MEM_guardedalloc.h"
#include "CLG_log.h"
#include "DNA_ID.h"
#include "DNA_armature_types.h"
#include "DNA_brush_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
#include "BLT_translation.hh"
#include "BLI_dial_2d.h"
#include "BLI_listbase.h"
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "BLI_math_vector_types.hh"
#include "BLI_path_utils.hh"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_time.h"
#include "BLI_utildefines.h"
#include "BKE_anim_data.hh"
#include "BKE_brush.hh"
#include "BKE_colortools.hh"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_idprop.hh"
#include "BKE_image.hh"
#include "BKE_image_format.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_library.hh"
#include "BKE_main.hh"
#include "BKE_material.hh"
#include "BKE_preview_image.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "BKE_screen.hh"
#include "BKE_idtype.hh"
#include "BLF_api.hh"
#include "GPU_immediate.hh"
#include "GPU_immediate_util.hh"
#include "GPU_matrix.hh"
#include "GPU_state.hh"
#include "IMB_imbuf_types.hh"
#include "ED_fileselect.hh"
#include "ED_gpencil_legacy.hh"
#include "ED_grease_pencil.hh"
#include "ED_numinput.hh"
#include "ED_screen.hh"
#include "ED_undo.hh"
#include "ED_view3d.hh"
#include "DEG_depsgraph_query.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "RNA_path.hh"
#include "RNA_prototypes.hh"
#include "UI_interface.hh"
#include "UI_interface_icons.hh"
#include "UI_interface_layout.hh"
#include "UI_resources.hh"
#include "WM_api.hh"
#include "WM_keymap.hh"
#include "WM_types.hh"
#include "wm.hh"
#include "wm_draw.hh"
#include "wm_event_system.hh"
#include "wm_event_types.hh"
#include "wm_files.hh"
#include "wm_window.hh"

Go to the source code of this file.

Classes

struct  EnumSearchMenu
struct  wmOpPopUp
struct  SearchPopupInit_Data
struct  RadialControl
struct  PreviewsIDEnsureData

Macros

#define UNDOCUMENTED_OPERATOR_TIP   N_("(undocumented operator)")
#define CTX_TEST_PTR_ID(C, member, idptr)
#define CTX_TEST_PTR_ID_CAST(C, member, member_full, cast, idptr)
#define TEST_PTR_DATA_TYPE(member, rna_type, rna_ptr, dataptr_cmp)
#define TEST_PTR_DATA_TYPE_FROM_CONTEXT(member, rna_type, rna_ptr)
#define ID_CAST_OBDATA(id_pt)
#define ID_CAST_OBMATACT(id_pt)
#define ID_CAST_SCENEWORLD(id_pt)

Functions

Operator Last Properties API
static bool operator_last_properties_init_impl (wmOperator *op, IDProperty *last_properties)
bool WM_operator_last_properties_init (wmOperator *op)
bool WM_operator_last_properties_store (wmOperator *op)
Default Operator Callbacks
wmOperatorStatus WM_generic_select_modal (bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_generic_select_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void WM_operator_view3d_unit_defaults (bContext *C, wmOperator *op)
int WM_operator_smooth_viewtx_get (const wmOperator *op)
wmOperatorStatus WM_menu_invoke_ex (bContext *C, wmOperator *op, blender::wm::OpCallContext opcontext)
wmOperatorStatus WM_menu_invoke (bContext *C, wmOperator *op, const wmEvent *)
static uiBlockwm_enum_search_menu (bContext *C, ARegion *region, void *arg)
wmOperatorStatus WM_enum_search_invoke (bContext *C, wmOperator *op, const wmEvent *)
wmOperatorStatus WM_operator_confirm_message_ex (bContext *C, wmOperator *op, const char *title, const int icon, const char *message, const blender::wm::OpCallContext)
wmOperatorStatus WM_operator_confirm_message (bContext *C, wmOperator *op, const char *message)
wmOperatorStatus WM_operator_confirm (bContext *C, wmOperator *op, const wmEvent *)
wmOperatorStatus WM_operator_confirm_or_exec (bContext *C, wmOperator *op, const wmEvent *)
wmOperatorStatus WM_operator_filesel (bContext *C, wmOperator *op, const wmEvent *)
bool WM_operator_filesel_ensure_ext_imtype (wmOperator *op, const ImageFormatData *im_format)
bool WM_operator_winactive (bContext *C)
bool WM_operator_check_ui_enabled (const bContext *C, const char *idname)
wmOperatorWM_operator_last_redo (const bContext *C)
IDPropertyWM_operator_last_properties_ensure_idprops (wmOperatorType *ot)
void WM_operator_last_properties_ensure (wmOperatorType *ot, PointerRNA *ptr)
IDWM_operator_drop_load_path (bContext *C, wmOperator *op, const short idcode)
static void wm_block_redo_cb (bContext *C, void *arg_op, int)
static void wm_block_redo_cancel_cb (bContext *C, void *arg_op)
static uiBlockwm_block_create_redo (bContext *C, ARegion *region, void *arg_op)
static void dialog_exec_cb (bContext *C, void *arg1, void *arg2)
static void wm_operator_ui_popup_cancel (bContext *C, void *user_data)
static void dialog_cancel_cb (bContext *C, void *arg1, void *arg2)
static uiBlockwm_block_dialog_create (bContext *C, ARegion *region, void *user_data)
static uiBlockwm_operator_ui_create (bContext *C, ARegion *region, void *user_data)
static void wm_operator_ui_popup_ok (bContext *C, void *arg, int retval)
wmOperatorStatus WM_operator_confirm_ex (bContext *C, wmOperator *op, const char *title, const char *message, const char *confirm_text, int icon, bool cancel_default)
wmOperatorStatus WM_operator_ui_popup (bContext *C, wmOperator *op, int width)
static wmOperatorStatus wm_operator_props_popup_ex (bContext *C, wmOperator *op, const bool do_call, const bool do_redo, std::optional< std::string > title=std::nullopt, std::optional< std::string > confirm_text=std::nullopt, const bool cancel_default=false, std::optional< std::string > message=std::nullopt)
wmOperatorStatus WM_operator_props_popup_confirm_ex (bContext *C, wmOperator *op, const wmEvent *, std::optional< std::string > title, std::optional< std::string > confirm_text, const bool cancel_default, std::optional< std::string > message)
wmOperatorStatus WM_operator_props_popup_confirm (bContext *C, wmOperator *op, const wmEvent *)
wmOperatorStatus WM_operator_props_popup_call (bContext *C, wmOperator *op, const wmEvent *)
wmOperatorStatus WM_operator_props_popup (bContext *C, wmOperator *op, const wmEvent *)
wmOperatorStatus WM_operator_props_dialog_popup (bContext *C, wmOperator *op, int width, std::optional< std::string > title, std::optional< std::string > confirm_text, const bool cancel_default, std::optional< std::string > message)
wmOperatorStatus WM_operator_redo_popup (bContext *C, wmOperator *op)
Debug Menu Operator

Set internal debug value, mainly for developers.

static wmOperatorStatus wm_debug_menu_exec (bContext *C, wmOperator *op)
static wmOperatorStatus wm_debug_menu_invoke (bContext *C, wmOperator *op, const wmEvent *)
static void WM_OT_debug_menu (wmOperatorType *ot)
Reset Defaults Operator
static wmOperatorStatus wm_operator_defaults_exec (bContext *C, wmOperator *op)
static void WM_OT_operator_defaults (wmOperatorType *ot)
Window/Screen Operators
static bool wm_operator_winactive_normal (bContext *C)
static bool wm_operator_winactive_not_full (bContext *C)
static void WM_OT_window_close (wmOperatorType *ot)
static void WM_OT_window_new (wmOperatorType *ot)
static void WM_OT_window_new_main (wmOperatorType *ot)
static void WM_OT_window_fullscreen_toggle (wmOperatorType *ot)
static wmOperatorStatus wm_exit_blender_exec (bContext *C, wmOperator *)
static wmOperatorStatus wm_exit_blender_invoke (bContext *C, wmOperator *, const wmEvent *)
static void WM_OT_quit_blender (wmOperatorType *ot)
default paint cursors, draw always around cursor
  • Returns handler to free.
  • poll(bContext): returns 1 if draw should happen.
  • draw(bContext): drawing callback for paint cursor.
wmPaintCursorWM_paint_cursor_activate (short space_type, short region_type, bool(*poll)(bContext *C), wmPaintCursorDraw draw, void *customdata)
bool WM_paint_cursor_end (wmPaintCursor *handle)
void WM_paint_cursor_remove_by_type (wmWindowManager *wm, void *draw_fn, void(*free)(void *))
Report Memory Statistics

Use for testing/debugging.

static wmOperatorStatus memory_statistics_exec (bContext *, wmOperator *)
static void WM_OT_memory_statistics (wmOperatorType *ot)
Data-Block Preview Generation Operator

Use for material/texture/light ... etc.

static void previews_id_ensure (bContext *C, Scene *scene, ID *id)
static int previews_id_ensure_callback (LibraryIDLinkCallbackData *cb_data)
static wmOperatorStatus previews_ensure_exec (bContext *C, wmOperator *)
static void WM_OT_previews_ensure (wmOperatorType *ot)
Doc from UI Operator
static wmOperatorStatus doc_view_manual_ui_context_exec (bContext *C, wmOperator *)
static void WM_OT_doc_view_manual_ui_context (wmOperatorType *ot)
Toggle Stereo 3D Operator

Turning it full-screen if needed.

static void WM_OT_stereo3d_set (wmOperatorType *ot)
Operator Registration & Keymaps
void wm_operatortypes_register ()
static void gesture_circle_modal_keymap (wmKeyConfig *keyconf)
static void gesture_straightline_modal_keymap (wmKeyConfig *keyconf)
static void gesture_box_modal_keymap (wmKeyConfig *keyconf)
static void gesture_lasso_modal_keymap (wmKeyConfig *keyconf)
static void gesture_polyline_modal_keymap (wmKeyConfig *keyconf)
static void gesture_zoom_border_modal_keymap (wmKeyConfig *keyconf)
void wm_window_keymap (wmKeyConfig *keyconf)
Enum Filter Functions

Filter functions that can be used with rna_id_itemf() below. Should return false if 'id' should be excluded.

static bool rna_id_enum_filter_single (const ID *id, void *user_data)
static bool rna_id_enum_filter_single_and_assets (const ID *id, void *user_data)
static const EnumPropertyItemrna_id_itemf (bool *r_free, ID *id, bool local, bool(*filter_ids)(const ID *id, void *user_data), void *user_data)
const EnumPropertyItemRNA_action_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
const EnumPropertyItemRNA_collection_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
const EnumPropertyItemRNA_collection_local_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
const EnumPropertyItemRNA_image_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
const EnumPropertyItemRNA_image_local_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
const EnumPropertyItemRNA_scene_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
const EnumPropertyItemRNA_scene_local_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
const EnumPropertyItemRNA_scene_without_sequencer_scene_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
const EnumPropertyItemRNA_movieclip_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
const EnumPropertyItemRNA_movieclip_local_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
const EnumPropertyItemRNA_mask_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
const EnumPropertyItemRNA_mask_local_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)

Operator API

#define OP_BL_SEP_STRING   "_OT_"
#define OP_BL_SEP_LEN   4
#define OP_PY_SEP_CHAR   '.'
#define OP_PY_SEP_LEN   1
#define OP_MAX_PY_IDNAME   (OP_MAX_TYPENAME - OP_BL_SEP_LEN + OP_PY_SEP_LEN - 1)
size_t WM_operator_py_idname (char *dst, const char *src)
size_t WM_operator_bl_idname (char *dst, const char *src)
bool WM_operator_bl_idname_is_valid (const char *idname)
bool WM_operator_py_idname_ok_or_report (ReportList *reports, const char *classname, const char *idname)
std::string WM_operator_pystring_ex (bContext *C, wmOperator *op, const bool all_args, const bool macro_args, wmOperatorType *ot, PointerRNA *opptr)
std::string WM_operator_pystring (bContext *C, wmOperator *op, const bool all_args, const bool macro_args)
std::string WM_operator_pystring_abbreviate (std::string str, int str_len_max)
static const char * wm_context_member_from_ptr (const bContext *C, const PointerRNA *ptr, bool *r_is_id)
std::optional< std::string > WM_context_path_resolve_property_full (const bContext *C, const PointerRNA *ptr, PropertyRNA *prop, int index)
std::optional< std::string > WM_context_path_resolve_full (bContext *C, const PointerRNA *ptr)
static std::optional< std::string > wm_prop_pystring_from_context (bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index)
std::optional< std::string > WM_prop_pystring_assign (bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index)
void WM_operator_properties_create_ptr (PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_create (PointerRNA *ptr, const char *opstring)
void WM_operator_properties_alloc (PointerRNA **ptr, IDProperty **properties, const char *opstring)
void WM_operator_properties_sanitize (PointerRNA *ptr, const bool no_context)
bool WM_operator_properties_default (PointerRNA *ptr, const bool do_update)
void WM_operator_properties_reset (wmOperator *op)
void WM_operator_properties_clear (PointerRNA *ptr)
void WM_operator_properties_free (PointerRNA *ptr)

Radial Control Operator

#define WM_RADIAL_CONTROL_DISPLAY_SIZE   (200 * UI_SCALE_FAC)
#define WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE   (35 * UI_SCALE_FAC)
#define WM_RADIAL_CONTROL_DISPLAY_WIDTH   (WM_RADIAL_CONTROL_DISPLAY_SIZE - WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE)
#define WM_RADIAL_MAX_STR   10
enum  RCPropFlags { RC_PROP_ALLOW_MISSING = 1 , RC_PROP_REQUIRE_FLOAT = 2 , RC_PROP_REQUIRE_BOOL = 4 }
static void radial_control_update_header (wmOperator *op, bContext *C)
static void radial_control_set_initial_mouse (RadialControl *rc, const wmEvent *event)
static void radial_control_set_tex (RadialControl *rc)
static void radial_control_paint_tex (RadialControl *rc, float radius, float alpha)
static void radial_control_paint_curve (uint pos, Brush *br, float radius, int line_segments)
static void radial_control_paint_cursor (bContext *, const blender::int2 &, const blender::float2 &, void *customdata)
static int radial_control_get_path (PointerRNA *ctx_ptr, wmOperator *op, const char *name, PointerRNA *r_ptr, PropertyRNA **r_prop, int req_length, RCPropFlags flags)
static int radial_control_get_properties (bContext *C, wmOperator *op)
static wmOperatorStatus radial_control_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void radial_control_set_value (RadialControl *rc, float val)
static void radial_control_cancel (bContext *C, wmOperator *op)
static wmOperatorStatus radial_control_modal (bContext *C, wmOperator *op, const wmEvent *event)
static void WM_OT_radial_control (wmOperatorType *ot)

Operator/Menu Search Operator

enum  SearchType { SEARCH_TYPE_OPERATOR = 0 , SEARCH_TYPE_MENU = 1 , SEARCH_TYPE_SINGLE_MENU = 2 }
static char g_search_text [256] = ""
static uiBlockwm_block_search_menu (bContext *C, ARegion *region, void *userdata)
static wmOperatorStatus wm_search_menu_exec (bContext *, wmOperator *)
static wmOperatorStatus wm_search_menu_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void WM_OT_search_menu (wmOperatorType *ot)
static void WM_OT_search_operator (wmOperatorType *ot)
static void WM_OT_search_single_menu (wmOperatorType *ot)
static wmOperatorStatus wm_call_menu_exec (bContext *C, wmOperator *op)
static std::string wm_call_menu_get_name (wmOperatorType *ot, PointerRNA *ptr)
static void WM_OT_call_menu (wmOperatorType *ot)
static wmOperatorStatus wm_call_pie_menu_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus wm_call_pie_menu_exec (bContext *C, wmOperator *op)
static void WM_OT_call_menu_pie (wmOperatorType *ot)
static wmOperatorStatus wm_call_panel_exec (bContext *C, wmOperator *op)
static std::string wm_call_panel_get_name (wmOperatorType *ot, PointerRNA *ptr)
static void WM_OT_call_panel (wmOperatorType *ot)
static wmOperatorStatus asset_shelf_popover_invoke (bContext *C, wmOperator *op, const wmEvent *)
static void WM_OT_call_asset_shelf_popover (wmOperatorType *ot)

Redraw Timer Operator

Use for simple benchmarks.

enum  {
  eRTDrawRegion = 0 , eRTDrawRegionSwap = 1 , eRTDrawWindow = 2 , eRTDrawWindowSwap = 3 ,
  eRTAnimationStep = 4 , eRTAnimationPlay = 5 , eRTUndo = 6
}
static const EnumPropertyItem redraw_timer_type_items []
static void redraw_timer_window_swap (bContext *C)
static void redraw_timer_step (bContext *C, Scene *scene, Depsgraph *depsgraph, wmWindow *win, ScrArea *area, ARegion *region, const int type, const int cfra, const int steps_done, const int steps_total)
static bool redraw_timer_poll (bContext *C)
static wmOperatorStatus redraw_timer_exec (bContext *C, wmOperator *op)
static void WM_OT_redraw_timer (wmOperatorType *ot)

Data-Block Preview Clear Operator

enum  PreviewFilterID {
  PREVIEW_FILTER_ALL , PREVIEW_FILTER_GEOMETRY , PREVIEW_FILTER_SHADING , PREVIEW_FILTER_SCENE ,
  PREVIEW_FILTER_COLLECTION , PREVIEW_FILTER_OBJECT , PREVIEW_FILTER_MATERIAL , PREVIEW_FILTER_LIGHT ,
  PREVIEW_FILTER_WORLD , PREVIEW_FILTER_TEXTURE , PREVIEW_FILTER_IMAGE
}
static const EnumPropertyItem preview_id_type_items []
static uint preview_filter_to_idfilter (enum PreviewFilterID filter)
static wmOperatorStatus previews_clear_exec (bContext *C, wmOperator *op)
static void WM_OT_previews_clear (wmOperatorType *ot)

Detailed Description

Functions for dealing with wmOperator, adding, removing, calling as well as some generic operators and shared operator properties.

Definition in file wm_operators.cc.

Macro Definition Documentation

◆ CTX_TEST_PTR_ID

#define CTX_TEST_PTR_ID ( C,
member,
idptr )
Value:
{ \
const char *ctx_member = member; \
PointerRNA ctx_item_ptr = CTX_data_pointer_get(C, ctx_member); \
if (ctx_item_ptr.owner_id == idptr) { \
member_id = ctx_member; \
is_id = true; \
break; \
} \
} \
(void)0
PointerRNA CTX_data_pointer_get(const bContext *C, const char *member)
#define C
Definition RandGen.cpp:29
ID * owner_id
Definition RNA_types.hh:51

Referenced by wm_context_member_from_ptr().

◆ CTX_TEST_PTR_ID_CAST

#define CTX_TEST_PTR_ID_CAST ( C,
member,
member_full,
cast,
idptr )
Value:
{ \
const char *ctx_member = member; \
const char *ctx_member_full = member_full; \
PointerRNA ctx_item_ptr = CTX_data_pointer_get(C, ctx_member); \
if (ctx_item_ptr.owner_id && (ID *)cast(ctx_item_ptr.owner_id) == idptr) { \
member_id = ctx_member_full; \
is_id = true; \
break; \
} \
} \
(void)0
#define cast
Definition DNA_ID.h:414

Referenced by wm_context_member_from_ptr().

◆ ID_CAST_OBDATA

#define ID_CAST_OBDATA ( id_pt)
Value:
(((Object *)(id_pt))->data)
BMesh const char void * data

Referenced by wm_context_member_from_ptr().

◆ ID_CAST_OBMATACT

#define ID_CAST_OBMATACT ( id_pt)
Value:
BKE_object_material_get(((Object *)id_pt), ((Object *)id_pt)->actcol)
Material * BKE_object_material_get(Object *ob, short act)

Referenced by wm_context_member_from_ptr().

◆ ID_CAST_SCENEWORLD

#define ID_CAST_SCENEWORLD ( id_pt)
Value:
(((Scene *)(id_pt))->world)

Referenced by wm_context_member_from_ptr().

◆ OP_BL_SEP_LEN

#define OP_BL_SEP_LEN   4

◆ OP_BL_SEP_STRING

#define OP_BL_SEP_STRING   "_OT_"

◆ OP_MAX_PY_IDNAME

#define OP_MAX_PY_IDNAME   (OP_MAX_TYPENAME - OP_BL_SEP_LEN + OP_PY_SEP_LEN - 1)

Definition at line 131 of file wm_operators.cc.

Referenced by WM_operator_bl_idname(), and WM_operator_py_idname_ok_or_report().

◆ OP_PY_SEP_CHAR

#define OP_PY_SEP_CHAR   '.'

Definition at line 126 of file wm_operators.cc.

Referenced by WM_operator_bl_idname(), and WM_operator_py_idname().

◆ OP_PY_SEP_LEN

#define OP_PY_SEP_LEN   1

Definition at line 127 of file wm_operators.cc.

Referenced by WM_operator_bl_idname(), and WM_operator_py_idname().

◆ TEST_PTR_DATA_TYPE

#define TEST_PTR_DATA_TYPE ( member,
rna_type,
rna_ptr,
dataptr_cmp )
Value:
{ \
const char *ctx_member = member; \
if (RNA_struct_is_a((rna_ptr)->type, &(rna_type)) && (rna_ptr)->data == (dataptr_cmp)) { \
member_id = ctx_member; \
break; \
} \
} \
(void)0
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)

Referenced by wm_context_member_from_ptr().

◆ TEST_PTR_DATA_TYPE_FROM_CONTEXT

#define TEST_PTR_DATA_TYPE_FROM_CONTEXT ( member,
rna_type,
rna_ptr )
Value:
{ \
const char *ctx_member = member; \
if (RNA_struct_is_a((rna_ptr)->type, &(rna_type)) && \
(rna_ptr)->data == (CTX_data_pointer_get_type(C, ctx_member, &(rna_type)).data)) \
{ \
member_id = ctx_member; \
break; \
} \
} \
(void)0
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)

Referenced by wm_context_member_from_ptr().

◆ UNDOCUMENTED_OPERATOR_TIP

#define UNDOCUMENTED_OPERATOR_TIP   N_("(undocumented operator)")

Definition at line 117 of file wm_operators.cc.

◆ WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE

#define WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE   (35 * UI_SCALE_FAC)

◆ WM_RADIAL_CONTROL_DISPLAY_SIZE

#define WM_RADIAL_CONTROL_DISPLAY_SIZE   (200 * UI_SCALE_FAC)

◆ WM_RADIAL_CONTROL_DISPLAY_WIDTH

◆ WM_RADIAL_MAX_STR

#define WM_RADIAL_MAX_STR   10

Definition at line 2559 of file wm_operators.cc.

Referenced by radial_control_paint_cursor().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
eRTDrawRegion 
eRTDrawRegionSwap 
eRTDrawWindow 
eRTDrawWindowSwap 
eRTAnimationStep 
eRTAnimationPlay 
eRTUndo 

Definition at line 3647 of file wm_operators.cc.

◆ PreviewFilterID

Enumerator
PREVIEW_FILTER_ALL 
PREVIEW_FILTER_GEOMETRY 
PREVIEW_FILTER_SHADING 
PREVIEW_FILTER_SCENE 
PREVIEW_FILTER_COLLECTION 
PREVIEW_FILTER_OBJECT 
PREVIEW_FILTER_MATERIAL 
PREVIEW_FILTER_LIGHT 
PREVIEW_FILTER_WORLD 
PREVIEW_FILTER_TEXTURE 
PREVIEW_FILTER_IMAGE 

Definition at line 3972 of file wm_operators.cc.

◆ RCPropFlags

Enumerator
RC_PROP_ALLOW_MISSING 
RC_PROP_REQUIRE_FLOAT 
RC_PROP_REQUIRE_BOOL 

Definition at line 2967 of file wm_operators.cc.

◆ SearchType

enum SearchType
Enumerator
SEARCH_TYPE_OPERATOR 
SEARCH_TYPE_MENU 
SEARCH_TYPE_SINGLE_MENU 

Definition at line 2016 of file wm_operators.cc.

Function Documentation

◆ asset_shelf_popover_invoke()

◆ dialog_cancel_cb()

void dialog_cancel_cb ( bContext * C,
void * arg1,
void * arg2 )
static

◆ dialog_exec_cb()

void dialog_exec_cb ( bContext * C,
void * arg1,
void * arg2 )
static

◆ doc_view_manual_ui_context_exec()

◆ gesture_box_modal_keymap()

◆ gesture_circle_modal_keymap()

◆ gesture_lasso_modal_keymap()

void gesture_lasso_modal_keymap ( wmKeyConfig * keyconf)
static

◆ gesture_polyline_modal_keymap()

◆ gesture_straightline_modal_keymap()

◆ gesture_zoom_border_modal_keymap()

◆ memory_statistics_exec()

wmOperatorStatus memory_statistics_exec ( bContext * ,
wmOperator *  )
static

Definition at line 3855 of file wm_operators.cc.

References MEM_printmemlist_stats, and OPERATOR_FINISHED.

Referenced by WM_OT_memory_statistics().

◆ operator_last_properties_init_impl()

◆ preview_filter_to_idfilter()

◆ previews_clear_exec()

◆ previews_ensure_exec()

◆ previews_id_ensure()

void previews_id_ensure ( bContext * C,
Scene * scene,
ID * id )
static

◆ previews_id_ensure_callback()

◆ radial_control_cancel()

◆ radial_control_get_path()

int radial_control_get_path ( PointerRNA * ctx_ptr,
wmOperator * op,
const char * name,
PointerRNA * r_ptr,
PropertyRNA ** r_prop,
int req_length,
RCPropFlags flags )
static

Attempt to retrieve the rna pointer/property from an rna path.

Returns
0 for failure, 1 for success, and also 1 if property is not set.

Definition at line 2978 of file wm_operators.cc.

References BKE_report(), BKE_reportf(), len, name, PROP_BOOLEAN, PROP_FLOAT, wmOperator::ptr, RC_PROP_ALLOW_MISSING, RC_PROP_REQUIRE_BOOL, RC_PROP_REQUIRE_FLOAT, wmOperator::reports, RNA_path_resolve(), RNA_property_array_length(), RNA_property_type(), RNA_string_get(), RPT_ERROR, and str.

Referenced by radial_control_get_properties().

◆ radial_control_get_properties()

◆ radial_control_invoke()

wmOperatorStatus radial_control_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

◆ radial_control_modal()

wmOperatorStatus radial_control_modal ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

Definition at line 3290 of file wm_operators.cc.

References applyNumInput(), atan2f, BLI_dial_angle(), BLI_dial_free(), BLI_dial_init(), C, ceil, CLAMP, clamp_f(), CTX_wm_manager(), CTX_wm_region(), RadialControl::current_value, wmOperator::customdata, DEG2RADF, RadialControl::dial, ED_region_tag_redraw(), ED_undo_is_legacy_compatible_for_property(), ED_undo_push(), EVT_ESCKEY, EVT_LEFTSHIFTKEY, EVT_PADENTER, EVT_RETKEY, EVT_RIGHTSHIFTKEY, float, FLT_MAX, fmod(), handleNumInput(), hasNumInput(), RadialControl::init_event, RadialControl::initial_radial_center, RadialControl::initial_value, KM_CTRL, KM_PRESS, KM_RELEASE, LEFTMOUSE, len_v2(), M_PI, RadialControl::max_value, RadialControl::min_value, MOUSEMOVE, wmOperatorType::name, RadialControl::num_input, wmWindowManager::op_undo_depth, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, PointerRNA::owner_id, RadialControl::prop, PROP_ANGLE, PROP_DISTANCE, PROP_DISTANCE_DIAMETER, PROP_FACTOR, PROP_NONE, PROP_PERCENTAGE, PROP_PIXEL, PROP_PIXEL_DIAMETER, RadialControl::ptr, wmOperator::ptr, RAD2DEGF, radial_control_cancel(), radial_control_set_value(), radial_control_update_header(), ret, RIGHTMOUSE, RNA_boolean_get(), RNA_property_float_get_array(), RNA_property_update(), RadialControl::slow_mode, RadialControl::slow_mouse, snap(), RadialControl::subtype, wmEvent::type, wmOperator::type, wmEvent::val, WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE, WM_RADIAL_CONTROL_DISPLAY_SIZE, WM_RADIAL_CONTROL_DISPLAY_WIDTH, wmEvent::xy, RadialControl::zoom_prop, and RadialControl::zoom_ptr.

Referenced by WM_OT_radial_control().

◆ radial_control_paint_cursor()

void radial_control_paint_cursor ( bContext * ,
const blender::int2 & ,
const blender::float2 & ,
void * customdata )
static

◆ radial_control_paint_curve()

void radial_control_paint_curve ( uint pos,
Brush * br,
float radius,
int line_segments )
static

◆ radial_control_paint_tex()

◆ radial_control_set_initial_mouse()

◆ radial_control_set_tex()

◆ radial_control_set_value()

void radial_control_set_value ( RadialControl * rc,
float val )
static

◆ radial_control_update_header()

◆ redraw_timer_exec()

◆ redraw_timer_poll()

bool redraw_timer_poll ( bContext * C)
static

Definition at line 3750 of file wm_operators.cc.

References C, G, and WM_operator_winactive().

Referenced by WM_OT_redraw_timer().

◆ redraw_timer_step()

◆ redraw_timer_window_swap()

◆ RNA_action_itemf()

const EnumPropertyItem * RNA_action_itemf ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
bool * r_free )

Generic functions, return an enum from library data, index is the position in the linked list can add more for different types as needed.

Definition at line 4565 of file wm_operators.cc.

References C, CTX_data_main(), and rna_id_itemf().

Referenced by NLA_OT_actionclip_add(), and blender::ed::outliner::OUTLINER_OT_action_set().

◆ RNA_collection_itemf()

const EnumPropertyItem * RNA_collection_itemf ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
bool * r_free )

◆ RNA_collection_local_itemf()

const EnumPropertyItem * RNA_collection_local_itemf ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
bool * r_free )

Definition at line 4592 of file wm_operators.cc.

References C, CTX_data_main(), and rna_id_itemf().

Referenced by blender::ed::object::OBJECT_OT_collection_link().

◆ rna_id_enum_filter_single()

bool rna_id_enum_filter_single ( const ID * id,
void * user_data )
static

Definition at line 4509 of file wm_operators.cc.

Referenced by rna_id_enum_filter_single_and_assets().

◆ rna_id_enum_filter_single_and_assets()

bool rna_id_enum_filter_single_and_assets ( const ID * id,
void * user_data )
static

◆ rna_id_itemf()

◆ RNA_image_itemf()

const EnumPropertyItem * RNA_image_itemf ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
bool * r_free )

Definition at line 4601 of file wm_operators.cc.

References C, CTX_data_main(), and rna_id_itemf().

Referenced by PAINT_OT_project_image().

◆ RNA_image_local_itemf()

const EnumPropertyItem * RNA_image_local_itemf ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
bool * r_free )

Definition at line 4609 of file wm_operators.cc.

References C, CTX_data_main(), and rna_id_itemf().

◆ RNA_mask_itemf()

const EnumPropertyItem * RNA_mask_itemf ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
bool * r_free )

Definition at line 4663 of file wm_operators.cc.

References C, CTX_data_main(), and rna_id_itemf().

Referenced by blender::ed::vse::SEQUENCER_OT_mask_strip_add().

◆ RNA_mask_local_itemf()

const EnumPropertyItem * RNA_mask_local_itemf ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
bool * r_free )

Definition at line 4671 of file wm_operators.cc.

References C, CTX_data_main(), and rna_id_itemf().

◆ RNA_movieclip_itemf()

const EnumPropertyItem * RNA_movieclip_itemf ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
bool * r_free )

Definition at line 4646 of file wm_operators.cc.

References C, CTX_data_main(), and rna_id_itemf().

Referenced by blender::ed::vse::SEQUENCER_OT_movieclip_strip_add().

◆ RNA_movieclip_local_itemf()

const EnumPropertyItem * RNA_movieclip_local_itemf ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
bool * r_free )

Definition at line 4654 of file wm_operators.cc.

References C, CTX_data_main(), and rna_id_itemf().

◆ RNA_scene_itemf()

const EnumPropertyItem * RNA_scene_itemf ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
bool * r_free )

Definition at line 4618 of file wm_operators.cc.

References C, CTX_data_main(), and rna_id_itemf().

Referenced by MARKER_OT_make_links_scene().

◆ RNA_scene_local_itemf()

const EnumPropertyItem * RNA_scene_local_itemf ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
bool * r_free )

Definition at line 4626 of file wm_operators.cc.

References C, CTX_data_main(), and rna_id_itemf().

Referenced by blender::ed::object::OBJECT_OT_make_links_scene().

◆ RNA_scene_without_sequencer_scene_itemf()

const EnumPropertyItem * RNA_scene_without_sequencer_scene_itemf ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
bool * r_free )

◆ wm_block_create_redo()

◆ wm_block_dialog_create()

uiBlock * wm_block_dialog_create ( bContext * C,
ARegion * region,
void * user_data )
static

Dialogs are popups that require user verification (click OK) before exec.

Definition at line 1533 of file wm_operators.cc.

References ALERT_ICON_MAX, ALERT_ICON_NONE, ALERT_ICON_QUESTION, blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLF_DRAW_STR_DUMMY_MAX, BLF_width(), uiLayout::block(), blender::ui::block_layout(), But, C, col, uiLayout::column(), uiStyle::columnspace, data, dialog_cancel_cb(), dialog_exec_cb(), blender::ui::Emboss, IFACE_, uiLayout::label(), Line, padding(), blender::ui::Panel, uiLayout::scale_y_set(), uiLayout::separator(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::StringRefBase::trim(), UI_block_begin(), UI_block_bounds_set_centered(), UI_block_bounds_set_popup(), UI_block_flag_disable(), UI_block_flag_enable(), UI_block_func_set(), UI_block_has_active_default_button(), UI_BLOCK_KEEP_OPEN, UI_BLOCK_LOOP, UI_BLOCK_MOVEMOUSE_QUIT, UI_BLOCK_NUMSELECT, UI_BLOCK_THEME_STYLE_POPUP, UI_block_theme_style_set(), UI_BUT_ACTIVE_DEFAULT, UI_but_flag_enable(), UI_but_func_set(), UI_BUT_LABEL_ALIGN_SPLIT_COLUMN, UI_fontstyle_set(), UI_popup_dummy_panel_set(), UI_SCALE_FAC, UI_style_get_dpi(), UI_UNIT_X, UI_UNIT_Y, uiDefBut(), uiFontStyle::uifont_id, uiItemL_ex(), uiItemsAlertBox(), uiTemplateOperatorPropertyButs(), blender::ui::Vertical, uiStyle::widget, uiLayout::width(), WM_POPUP_POSITION_CENTER, WM_POPUP_POSITION_MOUSE, and WM_POPUP_SIZE_SMALL.

Referenced by WM_operator_confirm_ex(), and WM_operator_props_dialog_popup().

◆ wm_block_redo_cancel_cb()

void wm_block_redo_cancel_cb ( bContext * C,
void * arg_op )
static

Definition at line 1420 of file wm_operators.cc.

References C, WM_operator_free(), and WM_operator_last_redo().

Referenced by wm_operator_props_popup_ex().

◆ wm_block_redo_cb()

void wm_block_redo_cb ( bContext * C,
void * arg_op,
int  )
static

◆ wm_block_search_menu()

◆ wm_call_menu_exec()

wmOperatorStatus wm_call_menu_exec ( bContext * C,
wmOperator * op )
static

◆ wm_call_menu_get_name()

std::string wm_call_menu_get_name ( wmOperatorType * ot,
PointerRNA * ptr )
static

◆ wm_call_panel_exec()

wmOperatorStatus wm_call_panel_exec ( bContext * C,
wmOperator * op )
static

◆ wm_call_panel_get_name()

std::string wm_call_panel_get_name ( wmOperatorType * ot,
PointerRNA * ptr )
static

◆ wm_call_pie_menu_exec()

wmOperatorStatus wm_call_pie_menu_exec ( bContext * C,
wmOperator * op )
static

◆ wm_call_pie_menu_invoke()

wmOperatorStatus wm_call_pie_menu_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

Definition at line 2231 of file wm_operators.cc.

References BKE_ST_MAXNAME, C, wmOperator::ptr, RNA_string_get(), and UI_pie_menu_invoke().

Referenced by WM_OT_call_menu_pie().

◆ wm_context_member_from_ptr()

const char * wm_context_member_from_ptr ( const bContext * C,
const PointerRNA * ptr,
bool * r_is_id )
static
Parameters
r_is_id:
  • When set to true, the returned member is an ID type. This is a signal that RNA_path_from_ID_to_struct needs to be used to calculate the remainder of the RNA path.
  • When set to false, the returned member is not an ID type. In this case the context path must resolve to ptr, since there is no convenient way to calculate partial RNA paths.
Note
While the path to the ID is typically sufficient to calculate the remainder of the path, in practice this would cause WM_context_path_resolve_property_full to create a path such as: object.data.bones["Bones"].use_deform such paths are not useful for key-shortcuts, so this function supports returning data-paths directly to context members that aren't ID types.

Definition at line 444 of file wm_operators.cc.

References bArmature::act_bone, bArmature::act_edbone, SpaceAction::ads, SpaceGraph::ads, SpaceNla::ads, C, CTX_TEST_PTR_ID, CTX_TEST_PTR_ID_CAST, CTX_wm_area(), CTX_wm_region(), CTX_wm_space_data(), ED_fileselect_get_active_params(), bArmature::edbo, GS, ID_AR, ID_CAST_OBDATA, ID_CAST_OBMATACT, ID_CAST_SCENEWORLD, ID_MA, ID_OB, ID_SCE, ID_SCR, id_type_can_have_animdata(), ID_WO, OB_DATA_SUPPORT_ID_CASE, params, ptr, View3D::shading, SPACE_ACTION, SPACE_CLIP, SPACE_FILE, SPACE_GRAPH, SPACE_IMAGE, SPACE_NLA, SPACE_NODE, SPACE_SEQ, SPACE_VIEW3D, SpaceLink::spacetype, TEST_PTR_DATA_TYPE, and TEST_PTR_DATA_TYPE_FROM_CONTEXT.

Referenced by WM_context_path_resolve_property_full().

◆ WM_context_path_resolve_full()

std::optional< std::string > WM_context_path_resolve_full ( bContext * C,
const PointerRNA * ptr )

◆ WM_context_path_resolve_property_full()

std::optional< std::string > WM_context_path_resolve_property_full ( const bContext * C,
const PointerRNA * ptr,
PropertyRNA * prop,
int index )

◆ wm_debug_menu_exec()

◆ wm_debug_menu_invoke()

wmOperatorStatus wm_debug_menu_invoke ( bContext * C,
wmOperator * op,
const wmEvent *  )
static

Definition at line 1957 of file wm_operators.cc.

References C, G, IFACE_, wmOperator::ptr, RNA_int_set(), and WM_operator_props_dialog_popup().

Referenced by WM_OT_debug_menu().

◆ WM_enum_search_invoke()

◆ wm_enum_search_menu()

◆ wm_exit_blender_exec()

wmOperatorStatus wm_exit_blender_exec ( bContext * C,
wmOperator *  )
static

Definition at line 2434 of file wm_operators.cc.

References C, OPERATOR_FINISHED, and wm_exit_schedule_delayed().

Referenced by WM_OT_quit_blender().

◆ wm_exit_blender_invoke()

wmOperatorStatus wm_exit_blender_invoke ( bContext * C,
wmOperator * ,
const wmEvent *  )
static

◆ WM_generic_select_invoke()

◆ WM_generic_select_modal()

◆ WM_menu_invoke()

wmOperatorStatus WM_menu_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )

Definition at line 1137 of file wm_operators.cc.

References C, blender::wm::InvokeRegionWin, and WM_menu_invoke_ex().

Referenced by ACTION_OT_easing_type(), ACTION_OT_extrapolation_type(), ACTION_OT_handle_type(), ACTION_OT_interpolation_type(), ACTION_OT_keyframe_insert(), ACTION_OT_keyframe_type(), ACTION_OT_mirror(), ACTION_OT_snap(), ANIM_OT_channels_setting_disable(), ANIM_OT_channels_setting_enable(), ANIM_OT_channels_setting_toggle(), ARMATURE_OT_autoside_names(), ARMATURE_OT_calculate_roll(), ARMATURE_OT_select_similar(), BOID_OT_rule_add(), blender::ed::object::COLLECTION_OT_objects_add_active(), blender::ed::object::COLLECTION_OT_objects_remove(), blender::ed::object::COLLECTION_OT_objects_remove_active(), CURVE_OT_delete(), CURVE_OT_handle_type_set(), CURVE_OT_select_similar(), CURVE_OT_spline_type_set(), blender::ed::curves::CURVES_OT_handle_type_set(), blender::ed::object::datalayout_transfer_invoke(), GRAPH_OT_easing_type(), GRAPH_OT_extrapolation_type(), GRAPH_OT_fmodifier_add(), GRAPH_OT_handle_type(), GRAPH_OT_interpolation_type(), GRAPH_OT_keyframe_insert(), GRAPH_OT_mirror(), graphkeys_selected_control_points_invoke(), blender::ed::greasepencil::GREASE_PENCIL_OT_caps_set(), blender::ed::greasepencil::GREASE_PENCIL_OT_convert_curve_type(), blender::ed::greasepencil::GREASE_PENCIL_OT_cyclical_set(), blender::ed::greasepencil::GREASE_PENCIL_OT_delete_frame(), blender::ed::greasepencil::GREASE_PENCIL_OT_dissolve(), blender::ed::greasepencil::GREASE_PENCIL_OT_reproject(), blender::ed::greasepencil::GREASE_PENCIL_OT_select_similar(), blender::ed::greasepencil::GREASE_PENCIL_OT_separate(), blender::ed::greasepencil::GREASE_PENCIL_OT_set_curve_type(), blender::ed::greasepencil::GREASE_PENCIL_OT_set_handle_type(), LATTICE_OT_flip(), MARKER_OT_make_links_scene(), MASK_OT_handle_type_set(), MBALL_OT_select_similar(), MESH_OT_delete(), MESH_OT_merge(), MESH_OT_select_similar(), MESH_OT_separate(), MESH_OT_sort_elements(), blender::ed::object::modifier_add_invoke(), new_sequencer_scene_invoke(), NLA_OT_fmodifier_add(), NLA_OT_snap(), blender::ed::space_node::NODE_OT_select_grouped(), blender::ed::object::OBJECT_OT_constraint_add(), blender::ed::object::OBJECT_OT_constraint_add_with_targets(), blender::ed::object::OBJECT_OT_convert(), blender::ed::object::OBJECT_OT_data_transfer(), blender::ed::object::OBJECT_OT_empty_add(), blender::ed::object::OBJECT_OT_hook_remove(), blender::ed::object::OBJECT_OT_light_add(), blender::ed::object::OBJECT_OT_make_local(), blender::ed::object::OBJECT_OT_metaball_add(), blender::ed::object::OBJECT_OT_origin_set(), blender::ed::object::OBJECT_OT_parent_clear(), blender::ed::object::OBJECT_OT_select_by_type(), blender::ed::object::OBJECT_OT_select_grouped(), blender::ed::object::OBJECT_OT_select_linked(), blender::ed::object::OBJECT_OT_shaderfx_add(), blender::ed::object::OBJECT_OT_track_clear(), blender::ed::object::OBJECT_OT_track_set(), blender::ed::object::OBJECT_OT_vertex_group_set_active(), blender::ed::outliner::OUTLINER_OT_animdata_operation(), blender::ed::outliner::OUTLINER_OT_constraint_operation(), blender::ed::outliner::OUTLINER_OT_data_operation(), blender::ed::outliner::OUTLINER_OT_id_operation(), blender::ed::outliner::OUTLINER_OT_lib_operation(), blender::ed::outliner::OUTLINER_OT_liboverride_operation(), blender::ed::outliner::OUTLINER_OT_liboverride_troubleshoot_operation(), blender::ed::outliner::OUTLINER_OT_modifier_operation(), blender::ed::outliner::OUTLINER_OT_object_operation(), blender::ed::outliner::OUTLINER_OT_scene_operation(), PAINT_OT_weight_from_bones(), PARTICLE_OT_delete(), POSE_OT_autoside_names(), blender::ed::object::POSE_OT_constraint_add(), blender::ed::object::POSE_OT_constraint_add_with_targets(), POSE_OT_rotation_mode_set(), POSE_OT_select_grouped(), RIGIDBODY_OT_mass_calculate(), RIGIDBODY_OT_shape_change(), SCENE_OT_new(), SCENE_OT_new_sequencer(), SCENE_OT_view_layer_add(), blender::ed::vse::SEQUENCER_OT_select_grouped(), blender::ed::vse::SEQUENCER_OT_strip_modifier_copy(), UV_OT_select_similar(), VIEW3D_OT_bone_select_menu(), VIEW3D_OT_select_menu(), WM_event_add(), WM_OT_previews_clear(), and WM_OT_redraw_timer().

◆ WM_menu_invoke_ex()

◆ WM_operator_bl_idname()

size_t WM_operator_bl_idname ( char * dst,
const char * src )

◆ WM_operator_bl_idname_is_valid()

bool WM_operator_bl_idname_is_valid ( const char * idname)

Return true when an operators name follows the SOME_OT_op naming convention.

Definition at line 174 of file wm_operators.cc.

References OP_BL_SEP_LEN, and OP_BL_SEP_STRING.

Referenced by PYOP_wrap_macro_define(), wm_operatortype_append__end(), WM_operatortype_append_macro(), and WM_operatortype_append_macro_ptr().

◆ WM_operator_check_ui_enabled()

bool WM_operator_check_ui_enabled ( const bContext * C,
const char * idname )

Return false, if the UI should be disabled.

Definition at line 1295 of file wm_operators.cc.

References C, CTX_data_scene(), CTX_wm_manager(), ED_undo_is_valid(), WM_JOB_TYPE_ANY, and WM_jobs_test().

Referenced by ed_undo_redo_poll(), hud_panel_operator_redo_draw(), wm_block_create_redo(), and WM_event_add().

◆ WM_operator_confirm()

wmOperatorStatus WM_operator_confirm ( bContext * C,
wmOperator * op,
const wmEvent * event )

Invoke callback, confirm menu + exec.

Definition at line 1245 of file wm_operators.cc.

References ALERT_ICON_NONE, C, IFACE_, wmOperatorType::name, wmOperator::type, and WM_operator_confirm_ex().

Referenced by WM_event_add(), WM_OT_read_history(), WM_OT_read_userpref(), and WM_OT_save_userpref().

◆ WM_operator_confirm_ex()

wmOperatorStatus WM_operator_confirm_ex ( bContext * C,
wmOperator * op,
const char * title = nullptr,
const char * message = nullptr,
const char * confirm_text = nullptr,
int icon = 0,
bool cancel_default = false )

Like WM_operator_confirm, but with more options and can't be used as an invoke directly.

Definition at line 1764 of file wm_operators.cc.

References C, data, IFACE_, OPERATOR_RUNNING_MODAL, wmOperator::ptr, wmOperator::type, UI_DEFAULT_TEXT_POINTS, UI_popup_block_ex(), UI_SCALE_FAC, UI_style_get(), wm_block_dialog_create(), wm_operator_ui_popup_cancel(), wm_operator_ui_popup_ok(), WM_operatortype_name(), WM_POPUP_POSITION_CENTER, WM_POPUP_POSITION_MOUSE, WM_POPUP_SIZE_LARGE, and WM_POPUP_SIZE_SMALL.

Referenced by actkeys_delete_invoke(), armature_delete_selected_invoke(), blender::ed::object::bake_simulation::bake_simulation_invoke(), blender::ed::sculpt_paint::brush_asset_delete_invoke(), clear_anim_v3d_invoke(), clear_anim_vse_invoke(), blender::ed::object::collection_exporter_remove_invoke(), delete_curve_invoke(), delete_invoke(), delete_key_v3d_invoke(), delete_key_vse_invoke(), delete_marker_invoke(), delete_metaelems_invoke(), delete_track_invoke(), ed_marker_delete_invoke(), file_delete_invoke(), file_directory_new_invoke(), graphkeys_delete_invoke(), blender::ed::object::modifier_apply_invoke(), nlaedit_make_single_user_invoke(), blender::ed::object::object_delete_invoke(), blender::ed::object::object_transform_apply_invoke(), pack_all_invoke(), blender::ed::animrig::pose_asset_delete_invoke(), preferences_extension_repo_remove_invoke(), blender::ed::sculpt_paint::dyntopo::sculpt_dynamic_topology_toggle_invoke(), text_reload_invoke(), text_unlink_invoke(), unpack_libraries_invoke(), WM_event_add(), wm_homefile_write_invoke(), WM_operator_confirm(), WM_operator_confirm_message(), WM_operator_confirm_message_ex(), WM_operator_confirm_or_exec(), wm_read_factory_settings_invoke(), wm_revert_mainfile_invoke(), and wm_userpref_read_invoke().

◆ WM_operator_confirm_message()

wmOperatorStatus WM_operator_confirm_message ( bContext * C,
wmOperator * op,
const char * message )

Definition at line 1239 of file wm_operators.cc.

References ALERT_ICON_NONE, C, IFACE_, and WM_operator_confirm_ex().

Referenced by WM_event_add().

◆ WM_operator_confirm_message_ex()

wmOperatorStatus WM_operator_confirm_message_ex ( bContext * C,
wmOperator * op,
const char * title,
int icon,
const char * message,
blender::wm::OpCallContext opcontext )

Can't be used as an invoke directly, needs message arg (can be NULL).

Definition at line 1211 of file wm_operators.cc.

References ALERT_ICON_ERROR, ALERT_ICON_INFO, ALERT_ICON_NONE, ALERT_ICON_QUESTION, ALERT_ICON_WARNING, C, IFACE_, and WM_operator_confirm_ex().

Referenced by WM_event_add().

◆ WM_operator_confirm_or_exec()

wmOperatorStatus WM_operator_confirm_or_exec ( bContext * C,
wmOperator * op,
const wmEvent * event )

◆ wm_operator_defaults_exec()

◆ WM_operator_drop_load_path()

◆ WM_operator_filesel()

◆ WM_operator_filesel_ensure_ext_imtype()

◆ WM_operator_last_properties_ensure()

void WM_operator_last_properties_ensure ( wmOperatorType * ot,
PointerRNA * ptr )

◆ WM_operator_last_properties_ensure_idprops()

IDProperty * WM_operator_last_properties_ensure_idprops ( wmOperatorType * ot)

Definition at line 1317 of file wm_operators.cc.

References blender::bke::idprop::create_group(), and ot.

Referenced by WM_event_add(), and WM_operator_last_properties_ensure().

◆ WM_operator_last_properties_init()

◆ WM_operator_last_properties_store()

◆ WM_operator_last_redo()

◆ WM_operator_properties_alloc()

void WM_operator_properties_alloc ( PointerRNA ** ptr,
IDProperty ** properties,
const char * opstring )

◆ WM_operator_properties_clear()

void WM_operator_properties_clear ( PointerRNA * ptr)

Definition at line 850 of file wm_operators.cc.

References IDP_ClearProperty(), and ptr.

Referenced by WM_event_add(), and wm_macro_modal().

◆ WM_operator_properties_create()

◆ WM_operator_properties_create_ptr()

void WM_operator_properties_create_ptr ( PointerRNA * ptr,
wmOperatorType * ot )

Definition at line 737 of file wm_operators.cc.

References G_MAIN, ot, ptr, and RNA_pointer_create_discrete().

Referenced by bone_mouse_select_menu(), constraint_reorder(), blender::ed::asset::shelf::create_asset_operator_params(), file_browse_invoke(), file_directory_enter_handle(), file_external_operation_exec(), ghost_event_proc(), blender::ed::outliner::id_remap_fn(), image_file_browse_invoke(), blender::ed::outliner::lib_relocate(), blender::ed::space_node::link_drag_search_exec_fn(), menu_item_enum_opname_menu_active(), blender::seq::modifier_reorder(), modifier_reorder(), blender::ed::vse::move_strips(), blender::ed::space_node::node_add_group_asset_invoke(), blender::ed::space_node::node_swap_group_asset_invoke(), object_mouse_select_menu(), uiLayout::op_enum(), uiLayout::op_menu_enum(), blender::ed::outliner::outliner_id_relocate_invoke(), blender::ed::outliner::outliner_item_drag_drop_invoke(), preferences_extension_url_drop_invoke(), pyop_call(), shaderfx_reorder(), blender::ed::transform::special_aftertrans_update__node(), toolsystem_ref_set_by_brush_type(), blender::ed::transform::transform_from_gizmo_invoke(), blender::ed::space_node::tree_path_handle_func(), ui_but_anim_decorate_cb(), ui_but_extra_operator_icon_add_ptr(), UI_but_operator_ptr_ensure(), ui_handle_menu_letter_press_search(), ui_pie_menu_level_invoke(), ui_tooltip_data_from_tool(), view3d_interactive_add_modal(), wm_drop_import_file_exec(), wm_dropbox_item_update_ot(), WM_event_add(), WM_gizmo_operator_set(), wm_keymap_item_properties_update_ot(), WM_menu_name_call(), WM_operator_properties_create(), WM_operator_pystring_ex(), WM_operator_type_set(), WM_operator_ui_poll(), WM_operatortype_props_advanced_end(), wm_recover_auto_save_exec(), wm_recover_last_session_impl(), wm_test_autorun_revert_action_exec(), WM_toolsystem_ref_set_by_id_ex(), and WM_xr_actionmap_item_properties_update_ot().

◆ WM_operator_properties_default()

bool WM_operator_properties_default ( PointerRNA * ptr,
bool do_update )

Set all props to their default.

Parameters
do_updateOnly update un-initialized props.
Note
There's nothing specific to operators here. This could be made a general function.

Definition at line 806 of file wm_operators.cc.

References PROP_POINTER, ptr, RNA_property_is_set(), RNA_property_pointer_get(), RNA_property_pointer_type(), RNA_property_reset(), RNA_property_type(), RNA_STRUCT_BEGIN, RNA_STRUCT_END, and WM_operator_properties_default().

Referenced by WM_event_add(), wm_keymap_item_find(), wm_keymap_item_find_in_keymap(), WM_operator_properties_default(), and WM_operator_type_set().

◆ WM_operator_properties_free()

void WM_operator_properties_free ( PointerRNA * ptr)

Definition at line 859 of file wm_operators.cc.

References IDP_FreeProperty(), and ptr.

Referenced by bone_mouse_select_menu(), constraint_reorder(), doc_view_manual_ui_context_exec(), file_browse_invoke(), file_directory_enter_handle(), file_external_operation_exec(), file_smoothscroll_invoke(), ghost_event_proc(), blender::ed::outliner::id_remap_fn(), image_file_browse_invoke(), blender::ed::outliner::lib_relocate(), blender::ed::space_node::link_drag_search_exec_fn(), blender::seq::modifier_reorder(), modifier_reorder(), blender::ed::vse::move_strips(), blender::ed::space_node::node_add_group_asset_invoke(), blender::ed::space_node::node_render_changed_exec(), blender::ed::space_node::node_swap_group_asset_invoke(), object_mouse_select_menu(), blender::ed::asset::shelf::AssetViewItem::on_activate(), blender::ed::asset::shelf::AssetDragController::on_drag_start(), blender::ed::outliner::outliner_id_relocate_invoke(), blender::ed::outliner::outliner_item_drag_drop_invoke(), preferences_extension_url_drop_invoke(), pyop_as_string(), pyop_call(), shaderfx_reorder(), blender::ed::transform::special_aftertrans_update__node(), toolsystem_ref_set_by_brush_type(), blender::ed::transform::transform_from_gizmo_invoke(), blender::ed::space_node::tree_path_handle_func(), ui_apply_but_funcs_after(), ui_but_anim_decorate_cb(), ui_but_extra_operator_icon_free(), ui_but_free(), ui_tooltip_data_from_tool(), view3d_interactive_add_modal(), wm_drop_import_file_exec(), wm_drop_item_free_data(), WM_event_add(), WM_gizmo_free(), WM_gizmo_operator_set(), wm_handler_operator_call(), wm_keymap_item_free_data(), WM_keymap_item_properties_reset(), WM_keymap_remove_item(), WM_menu_name_call(), WM_operator_pystring_ex(), WM_operator_type_set(), wm_operatortype_free_macro(), wm_test_autorun_revert_action_set(), WM_toolsystem_ref_set_by_id_ex(), wm_xr_actionmap_item_properties_free(), and MenuSearch_Item::OperatorData::~OperatorData().

◆ WM_operator_properties_reset()

◆ WM_operator_properties_sanitize()

◆ WM_operator_props_dialog_popup()

wmOperatorStatus WM_operator_props_dialog_popup ( bContext * C,
wmOperator * op,
int width,
std::optional< std::string > title,
std::optional< std::string > confirm_text,
const bool cancel_default,
std::optional< std::string > message )

◆ WM_operator_props_popup()

◆ WM_operator_props_popup_call()

wmOperatorStatus WM_operator_props_popup_call ( bContext * C,
wmOperator * op,
const wmEvent * event )

Same as WM_operator_props_popup but call the operator first, This way - the button values correspond to the result of the operator. Without this, first access to a button will make the result jump, see #32452.

Definition at line 1875 of file wm_operators.cc.

References C, and wm_operator_props_popup_ex().

Referenced by UV_OT_pack_islands(), and WM_event_add().

◆ WM_operator_props_popup_confirm()

wmOperatorStatus WM_operator_props_popup_confirm ( bContext * C,
wmOperator * op,
const wmEvent * event )

Invoke callback, exec + redo popup.

Same as WM_operator_props_popup but don't use operator redo. just wraps WM_operator_props_dialog_popup.

Definition at line 1868 of file wm_operators.cc.

References C, and wm_operator_props_popup_ex().

Referenced by WM_event_add().

◆ WM_operator_props_popup_confirm_ex()

◆ wm_operator_props_popup_ex()

wmOperatorStatus wm_operator_props_popup_ex ( bContext * C,
wmOperator * op,
const bool do_call,
const bool do_redo,
std::optional< std::string > title = std::nullopt,
std::optional< std::string > confirm_text = std::nullopt,
const bool cancel_default = false,
std::optional< std::string > message = std::nullopt )
static

◆ WM_operator_py_idname()

◆ WM_operator_py_idname_ok_or_report()

bool WM_operator_py_idname_ok_or_report ( ReportList * reports,
const char * classname,
const char * idname )

Sanity check to ensure WM_operator_bl_idname won't fail.

Returns
true when there are no problems with idname, otherwise report an error.

Definition at line 198 of file wm_operators.cc.

References BKE_reportf(), dot(), i, OP_MAX_PY_IDNAME, and RPT_ERROR.

◆ WM_operator_pystring()

std::string WM_operator_pystring ( bContext * C,
wmOperator * op,
const bool all_args,
const bool macro_args )

◆ WM_operator_pystring_abbreviate()

std::string WM_operator_pystring_abbreviate ( std::string str,
int str_len_max )

Definition at line 333 of file wm_operators.cc.

References str.

Referenced by ui_tooltip_text_python_from_op().

◆ WM_operator_pystring_ex()

std::string WM_operator_pystring_ex ( bContext * C,
wmOperator * op,
bool all_args,
bool macro_args,
wmOperatorType * ot,
PointerRNA * opptr )

Operator as a Python command.

Return a string representation of the operator, with the arguments that it runs so Python can run it again.

When calling from an existing wmOperator, better to use simple version: WM_operator_pystring(C, op);

Note
Both op and opptr may be NULL (op is only used for macro operators).

Definition at line 255 of file wm_operators.cc.

References C, ListBase::first, wmOperatorType::idname, wmOperator::macro, wmOperator::next, OP_MAX_TYPENAME, ot, wmOperator::ptr, RNA_pointer_as_string_id(), RNA_pointer_as_string_keywords(), wmOperator::type, WM_operator_properties_create_ptr(), WM_operator_properties_free(), and WM_operator_py_idname().

Referenced by copy_python_command_button_exec(), pyop_as_string(), ui_but_copy_operator(), ui_layout_introspect_button(), ui_tooltip_text_python_from_op(), and WM_operator_pystring().

◆ WM_operator_redo_popup()

◆ WM_operator_smooth_viewtx_get()

◆ wm_operator_ui_create()

◆ WM_operator_ui_popup()

wmOperatorStatus WM_operator_ui_popup ( bContext * C,
wmOperator * op,
int width )

◆ wm_operator_ui_popup_cancel()

void wm_operator_ui_popup_cancel ( bContext * C,
void * user_data )
static

◆ wm_operator_ui_popup_ok()

void wm_operator_ui_popup_ok ( bContext * C,
void * arg,
int retval )
static

Definition at line 1752 of file wm_operators.cc.

References C, data, and WM_operator_call_ex().

Referenced by WM_operator_confirm_ex(), and WM_operator_props_dialog_popup().

◆ WM_operator_view3d_unit_defaults()

◆ WM_operator_winactive()

◆ wm_operator_winactive_normal()

bool wm_operator_winactive_normal ( bContext * C)
static

This poll functions is needed in place of WM_operator_winactive while it crashes on full screen.

Definition at line 2357 of file wm_operators.cc.

References C, CTX_wm_window(), G, SCREENNORMAL, bScreen::state, and WM_window_get_active_screen().

Referenced by WM_OT_window_new_main().

◆ wm_operator_winactive_not_full()

bool wm_operator_winactive_not_full ( bContext * C)
static

Definition at line 2375 of file wm_operators.cc.

References C, CTX_wm_window(), G, SCREENFULL, bScreen::state, and WM_window_get_active_screen().

Referenced by WM_OT_window_new().

◆ wm_operatortypes_register()

◆ WM_OT_call_asset_shelf_popover()

void WM_OT_call_asset_shelf_popover ( wmOperatorType * ot)
static

◆ WM_OT_call_menu()

◆ WM_OT_call_menu_pie()

◆ WM_OT_call_panel()

◆ WM_OT_debug_menu()

void WM_OT_debug_menu ( wmOperatorType * ot)
static

◆ WM_OT_doc_view_manual_ui_context()

void WM_OT_doc_view_manual_ui_context ( wmOperatorType * ot)
static

◆ WM_OT_memory_statistics()

void WM_OT_memory_statistics ( wmOperatorType * ot)
static

Definition at line 3861 of file wm_operators.cc.

References memory_statistics_exec(), and ot.

Referenced by wm_operatortypes_register().

◆ WM_OT_operator_defaults()

void WM_OT_operator_defaults ( wmOperatorType * ot)
static

Definition at line 1999 of file wm_operators.cc.

References OPTYPE_INTERNAL, ot, and wm_operator_defaults_exec().

Referenced by wm_operatortypes_register().

◆ WM_OT_previews_clear()

void WM_OT_previews_clear ( wmOperatorType * ot)
static

◆ WM_OT_previews_ensure()

void WM_OT_previews_ensure ( wmOperatorType * ot)
static

Definition at line 3955 of file wm_operators.cc.

References ot, and previews_ensure_exec().

Referenced by wm_operatortypes_register().

◆ WM_OT_quit_blender()

void WM_OT_quit_blender ( wmOperatorType * ot)
static

Definition at line 2453 of file wm_operators.cc.

References ot, wm_exit_blender_exec(), and wm_exit_blender_invoke().

Referenced by wm_operatortypes_register().

◆ WM_OT_radial_control()

◆ WM_OT_redraw_timer()

◆ WM_OT_search_menu()

void WM_OT_search_menu ( wmOperatorType * ot)
static

◆ WM_OT_search_operator()

void WM_OT_search_operator ( wmOperatorType * ot)
static

◆ WM_OT_search_single_menu()

void WM_OT_search_single_menu ( wmOperatorType * ot)
static

◆ WM_OT_stereo3d_set()

◆ WM_OT_window_close()

void WM_OT_window_close ( wmOperatorType * ot)
static

Definition at line 2394 of file wm_operators.cc.

References ot, WM_operator_winactive(), and wm_window_close_exec().

Referenced by wm_operatortypes_register().

◆ WM_OT_window_fullscreen_toggle()

void WM_OT_window_fullscreen_toggle ( wmOperatorType * ot)
static

◆ WM_OT_window_new()

void WM_OT_window_new ( wmOperatorType * ot)
static

Definition at line 2404 of file wm_operators.cc.

References ot, wm_operator_winactive_not_full(), and wm_window_new_exec().

Referenced by wm_operatortypes_register().

◆ WM_OT_window_new_main()

void WM_OT_window_new_main ( wmOperatorType * ot)
static

◆ WM_paint_cursor_activate()

◆ WM_paint_cursor_end()

◆ WM_paint_cursor_remove_by_type()

void WM_paint_cursor_remove_by_type ( wmWindowManager * wm,
void * draw_fn,
void(* free )(void *) )

◆ WM_prop_pystring_assign()

std::optional< std::string > WM_prop_pystring_assign ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
int index )

◆ wm_prop_pystring_from_context()

std::optional< std::string > wm_prop_pystring_from_context ( bContext * C,
PointerRNA * ptr,
PropertyRNA * prop,
int index )
static

Definition at line 700 of file wm_operators.cc.

References C, ptr, and WM_context_path_resolve_property_full().

Referenced by WM_prop_pystring_assign().

◆ wm_search_menu_exec()

wmOperatorStatus wm_search_menu_exec ( bContext * ,
wmOperator *  )
static

◆ wm_search_menu_invoke()

◆ wm_window_keymap()

Variable Documentation

◆ g_search_text

char g_search_text[256] = ""
static

Definition at line 2028 of file wm_operators.cc.

Referenced by wm_block_search_menu(), and wm_search_menu_invoke().

◆ preview_id_type_items

const EnumPropertyItem preview_id_type_items[]
static
Initial value:
= {
{PREVIEW_FILTER_ALL, "ALL", 0, "All Types", ""},
"GEOMETRY",
0,
"All Geometry Types",
"Clear previews for scenes, collections and objects"},
"SHADING",
0,
"All Shading Types",
"Clear previews for materials, lights, worlds, textures and images"},
{PREVIEW_FILTER_SCENE, "SCENE", 0, "Scenes", ""},
{PREVIEW_FILTER_COLLECTION, "COLLECTION", 0, "Collections", ""},
{PREVIEW_FILTER_OBJECT, "OBJECT", 0, "Objects", ""},
{PREVIEW_FILTER_MATERIAL, "MATERIAL", 0, "Materials", ""},
{PREVIEW_FILTER_LIGHT, "LIGHT", 0, "Lights", ""},
{PREVIEW_FILTER_WORLD, "WORLD", 0, "Worlds", ""},
{PREVIEW_FILTER_TEXTURE, "TEXTURE", 0, "Textures", ""},
{PREVIEW_FILTER_IMAGE, "IMAGE", 0, "Images", ""},
{0, nullptr, 0, nullptr, nullptr},
}
@ PREVIEW_FILTER_WORLD
@ PREVIEW_FILTER_TEXTURE
@ PREVIEW_FILTER_GEOMETRY
@ PREVIEW_FILTER_LIGHT
@ PREVIEW_FILTER_MATERIAL
@ PREVIEW_FILTER_COLLECTION
@ PREVIEW_FILTER_ALL
@ PREVIEW_FILTER_IMAGE
@ PREVIEW_FILTER_OBJECT
@ PREVIEW_FILTER_SCENE
@ PREVIEW_FILTER_SHADING

Definition at line 3987 of file wm_operators.cc.

Referenced by WM_OT_previews_clear().

◆ redraw_timer_type_items

const EnumPropertyItem redraw_timer_type_items[]
static
Initial value:
= {
{eRTDrawRegion, "DRAW", 0, "Draw Region", "Draw region"},
{eRTDrawRegionSwap, "DRAW_SWAP", 0, "Draw Region & Swap", "Draw region and swap"},
{eRTDrawWindow, "DRAW_WIN", 0, "Draw Window", "Draw window"},
{eRTDrawWindowSwap, "DRAW_WIN_SWAP", 0, "Draw Window & Swap", "Draw window and swap"},
{eRTAnimationStep, "ANIM_STEP", 0, "Animation Step", "Animation steps"},
{eRTAnimationPlay, "ANIM_PLAY", 0, "Animation Play", "Animation playback"},
{eRTUndo, "UNDO", 0, "Undo/Redo", "Undo and redo"},
{0, nullptr, 0, nullptr, nullptr},
}
@ eRTDrawWindowSwap
@ eRTAnimationStep
@ eRTDrawRegionSwap
@ eRTDrawWindow
@ eRTUndo
@ eRTDrawRegion
@ eRTAnimationPlay

Definition at line 3657 of file wm_operators.cc.

Referenced by redraw_timer_exec(), and WM_OT_redraw_timer().