Blender V4.3
wm_operators.cc File Reference
#include <algorithm>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <cstddef>
#include <cstdio>
#include <cstring>
#include <iostream>
#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_blenlib.h"
#include "BLI_dial_2d.h"
#include "BLI_math_matrix.hh"
#include "BLI_math_rotation.h"
#include "BLI_math_vector_types.hh"
#include "BLI_string_utils.hh"
#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_main.hh"
#include "BKE_material.h"
#include "BKE_preview_image.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "BKE_screen.hh"
#include "BKE_unit.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_resources.hh"
#include "WM_api.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)   (((Object *)(id_pt))->data)
 
#define ID_CAST_OBMATACT(id_pt)    BKE_object_material_get(((Object *)id_pt), ((Object *)id_pt)->actcol)
 
#define ID_CAST_SCENEWORLD(id_pt)   (((Scene *)(id_pt))->world)
 

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
int WM_generic_select_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
int 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)
 
int WM_menu_invoke_ex (bContext *C, wmOperator *op, wmOperatorCallContext opcontext)
 
int WM_menu_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
static uiBlockwm_enum_search_menu (bContext *C, ARegion *region, void *arg)
 
int WM_enum_search_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
int WM_operator_confirm_message_ex (bContext *C, wmOperator *op, const char *title, const int icon, const char *message, const wmOperatorCallContext)
 
int WM_operator_confirm_message (bContext *C, wmOperator *op, const char *message)
 
int WM_operator_confirm (bContext *C, wmOperator *op, const wmEvent *)
 
int WM_operator_confirm_or_exec (bContext *C, wmOperator *op, const wmEvent *)
 
int 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)
 
int WM_operator_confirm_ex (bContext *C, wmOperator *op, const char *title, const char *message, const char *confirm_text, int icon, bool cancel_default)
 
int WM_operator_ui_popup (bContext *C, wmOperator *op, int width)
 
static int 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)
 
int 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)
 
int WM_operator_props_popup_confirm (bContext *C, wmOperator *op, const wmEvent *)
 
int WM_operator_props_popup_call (bContext *C, wmOperator *op, const wmEvent *)
 
int WM_operator_props_popup (bContext *C, wmOperator *op, const wmEvent *)
 
int 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)
 
int WM_operator_redo_popup (bContext *C, wmOperator *op)
 
Debug Menu Operator

Set internal debug value, mainly for developers.

static int wm_debug_menu_exec (bContext *C, wmOperator *op)
 
static int wm_debug_menu_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
static void WM_OT_debug_menu (wmOperatorType *ot)
 
Reset Defaults Operator
static int 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 int wm_exit_blender_exec (bContext *C, wmOperator *)
 
static int 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 int 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 int previews_ensure_exec (bContext *C, wmOperator *)
 
static void WM_OT_previews_ensure (wmOperatorType *ot)
 
Doc from UI Operator
static int 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 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_active_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 *, int x, int y, 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 int 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 int 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 int wm_search_menu_exec (bContext *, wmOperator *)
 
static int 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 int 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 int wm_call_pie_menu_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int wm_call_pie_menu_exec (bContext *C, wmOperator *op)
 
static void WM_OT_call_menu_pie (wmOperatorType *ot)
 
static int 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 int 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)
 
static bool redraw_timer_poll (bContext *C)
 
static int 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 int 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)
ID * owner_id
Definition RNA_types.hh:40

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
Definition DNA_ID.h:413

Referenced by wm_context_member_from_ptr().

◆ ID_CAST_OBDATA

#define ID_CAST_OBDATA ( id_pt)    (((Object *)(id_pt))->data)

◆ ID_CAST_OBMATACT

#define ID_CAST_OBMATACT ( id_pt)     BKE_object_material_get(((Object *)id_pt), ((Object *)id_pt)->actcol)

◆ ID_CAST_SCENEWORLD

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

◆ 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 128 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 123 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 124 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 114 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 2513 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 3565 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 3872 of file wm_operators.cc.

◆ RCPropFlags

Enumerator
RC_PROP_ALLOW_MISSING 
RC_PROP_REQUIRE_FLOAT 
RC_PROP_REQUIRE_BOOL 

Definition at line 2891 of file wm_operators.cc.

◆ SearchType

enum SearchType
Enumerator
SEARCH_TYPE_OPERATOR 
SEARCH_TYPE_MENU 
SEARCH_TYPE_SINGLE_MENU 

Definition at line 1967 of file wm_operators.cc.

Function Documentation

◆ asset_shelf_popover_invoke()

◆ dialog_cancel_cb()

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

◆ dialog_exec_cb()

static 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()

static void gesture_lasso_modal_keymap ( wmKeyConfig * keyconf)
static

◆ gesture_polyline_modal_keymap()

◆ gesture_straightline_modal_keymap()

◆ gesture_zoom_border_modal_keymap()

static void gesture_zoom_border_modal_keymap ( wmKeyConfig * keyconf)
static

◆ memory_statistics_exec()

static int memory_statistics_exec ( bContext * ,
wmOperator *  )
static

Definition at line 3755 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()

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

◆ previews_id_ensure_callback()

◆ radial_control_cancel()

◆ radial_control_get_path()

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

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 2902 of file wm_operators.cc.

References BKE_report(), BKE_reportf(), len, MEM_freeN(), 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_alloc(), RPT_ERROR, and str.

Referenced by radial_control_get_properties().

◆ radial_control_get_properties()

◆ radial_control_invoke()

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

◆ radial_control_modal()

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

Definition at line 3221 of file wm_operators.cc.

References applyNumInput(), atan2f, BLI_dial_angle(), BLI_dial_init(), 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_mouse, RadialControl::initial_value, int, KM_CTRL, KM_PRESS, KM_RELEASE, LEFTMOUSE, len_v2(), M_PI, RadialControl::max_value, MEM_SAFE_FREE, 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_FACTOR, PROP_NONE, PROP_PERCENTAGE, PROP_PIXEL, 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()

static void radial_control_paint_cursor ( bContext * ,
int x,
int y,
void * customdata )
static

◆ radial_control_paint_curve()

static 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()

static void radial_control_set_value ( RadialControl * rc,
float val )
static

◆ radial_control_update_header()

◆ redraw_timer_exec()

◆ redraw_timer_poll()

static bool redraw_timer_poll ( bContext * C)
static

Definition at line 3661 of file wm_operators.cc.

References G, and WM_operator_winactive().

Referenced by WM_OT_redraw_timer().

◆ redraw_timer_step()

◆ redraw_timer_window_swap()

static void redraw_timer_window_swap ( bContext * C)
static

◆ 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 4447 of file wm_operators.cc.

References 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 4474 of file wm_operators.cc.

References CTX_data_main(), and rna_id_itemf().

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

◆ rna_id_enum_filter_single()

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

Definition at line 4402 of file wm_operators.cc.

Referenced by RNA_scene_without_active_itemf().

◆ rna_id_itemf()

◆ RNA_image_itemf()

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

Definition at line 4483 of file wm_operators.cc.

References 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 4491 of file wm_operators.cc.

References 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 4545 of file wm_operators.cc.

References CTX_data_main(), and rna_id_itemf().

Referenced by 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 4553 of file wm_operators.cc.

References 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 4528 of file wm_operators.cc.

References CTX_data_main(), and rna_id_itemf().

Referenced by 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 4536 of file wm_operators.cc.

References 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 4500 of file wm_operators.cc.

References 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 4508 of file wm_operators.cc.

References CTX_data_main(), and rna_id_itemf().

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

◆ RNA_scene_without_active_itemf()

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

◆ wm_block_create_redo()

◆ wm_block_dialog_create()

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

◆ wm_block_redo_cancel_cb()

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

Definition at line 1410 of file wm_operators.cc.

References WM_operator_free(), and WM_operator_last_redo().

Referenced by wm_operator_props_popup_ex().

◆ wm_block_redo_cb()

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

◆ wm_block_search_menu()

◆ wm_call_menu_exec()

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

◆ wm_call_menu_get_name()

◆ wm_call_panel_exec()

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

◆ wm_call_panel_get_name()

◆ wm_call_pie_menu_exec()

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

◆ wm_call_pie_menu_invoke()

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

Definition at line 2187 of file wm_operators.cc.

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

Referenced by WM_OT_call_menu_pie().

◆ wm_context_member_from_ptr()

static 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 441 of file wm_operators.cc.

References bArmature::act_bone, bArmature::act_edbone, SpaceAction::ads, SpaceGraph::ads, SpaceNla::ads, 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, ID::name, OB_DATA_SUPPORT_ID_CASE, PointerRNA::owner_id, params, ptr, View3D::shading, SPACE_ACTION, 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()

static int wm_debug_menu_exec ( bContext * C,
wmOperator * op )
static

◆ wm_debug_menu_invoke()

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

Definition at line 1910 of file wm_operators.cc.

References 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()

static int wm_exit_blender_exec ( bContext * C,
wmOperator *  )
static

Definition at line 2389 of file wm_operators.cc.

References OPERATOR_FINISHED, and wm_exit_schedule_delayed().

Referenced by WM_OT_quit_blender().

◆ wm_exit_blender_invoke()

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

◆ WM_generic_select_invoke()

int WM_generic_select_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )

◆ WM_generic_select_modal()

◆ WM_menu_invoke()

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

Definition at line 1118 of file wm_operators.cc.

References WM_menu_invoke_ex(), and WM_OP_INVOKE_REGION_WIN.

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_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(), 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(), SEQUENCER_OT_select_grouped(), SEQUENCER_OT_strip_modifier_copy(), UV_OT_select_similar(), VIEW3D_OT_bone_select_menu(), VIEW3D_OT_select_menu(), 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 171 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 1285 of file wm_operators.cc.

References 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(), and wm_block_create_redo().

◆ WM_operator_confirm()

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

Invoke callback, confirm menu + exec.

Definition at line 1237 of file wm_operators.cc.

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

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

◆ WM_operator_confirm_ex()

int 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 1728 of file wm_operators.cc.

References IFACE_, int, 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(), blender::ed::object::collection_exporter_remove_invoke(), delete_curve_invoke(), delete_invoke(), delete_key_v3d_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(), preferences_extension_repo_remove_invoke(), text_reload_invoke(), text_unlink_invoke(), unpack_libraries_invoke(), 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()

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

Definition at line 1231 of file wm_operators.cc.

References ALERT_ICON_NONE, IFACE_, and WM_operator_confirm_ex().

◆ WM_operator_confirm_message_ex()

int WM_operator_confirm_message_ex ( bContext * C,
wmOperator * op,
const char * title,
int icon,
const char * message,
wmOperatorCallContext opcontext )

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

Definition at line 1203 of file wm_operators.cc.

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

◆ WM_operator_confirm_or_exec()

int 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()

bool WM_operator_filesel_ensure_ext_imtype ( wmOperator * op,
const ImageFormatData * im_format )

◆ 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)

◆ 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 842 of file wm_operators.cc.

References PointerRNA::data, IDP_ClearProperty(), and ptr.

Referenced by 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 729 of file wm_operators.cc.

References G_MAIN, ot, ptr, RNA_pointer_create(), and wmOperatorType::srna.

Referenced by bone_mouse_select_menu(), constraint_reorder(), blender::ed::asset::shelf::create_activate_operator_params(), file_browse_invoke(), file_directory_enter_handle(), file_external_operation_exec(), file_handler_import_operator_create_ptr(), 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(), modifier_reorder(), blender::ed::object::move_to_collection_menu_create(), blender::ed::space_node::node_add_group_asset_invoke(), object_mouse_select_menu(), 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(), transform_from_gizmo_invoke(), 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(), uiItemBooleanO(), uiItemEnumO_ptr(), uiItemEnumO_string(), uiItemEnumO_value(), uiItemFloatO(), uiItemIntO(), uiItemMenuEnumFullO_ptr(), uiItemsFullEnumO(), uiItemsFullEnumO_items(), uiItemStringO(), view3d_interactive_add_modal(), wm_dropbox_item_update_ot(), 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_exec(), 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 798 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_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 851 of file wm_operators.cc.

References PointerRNA::data, 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(), menu_search_arg_free_fn(), modifier_reorder(), blender::ed::space_node::node_add_group_asset_invoke(), blender::ed::space_node::node_render_changed_exec(), object_mouse_select_menu(), blender::ed::asset::shelf::AssetViewItem::on_activate(), 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(), transform_from_gizmo_invoke(), ui_apply_but_funcs_after(), ui_but_anim_decorate_cb(), ui_but_extra_operator_icon_free(), ui_but_free(), ui_tooltip_data_from_tool(), uilist_free_dyn_data(), view3d_interactive_add_modal(), wm_drop_import_file_exec(), wm_drop_item_free_data(), 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(), and wm_xr_actionmap_item_properties_free().

◆ WM_operator_properties_reset()

◆ WM_operator_properties_sanitize()

◆ WM_operator_props_dialog_popup()

◆ WM_operator_props_popup()

◆ WM_operator_props_popup_call()

int 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 1832 of file wm_operators.cc.

References wm_operator_props_popup_ex().

Referenced by UV_OT_pack_islands().

◆ WM_operator_props_popup_confirm()

int 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 1827 of file wm_operators.cc.

References wm_operator_props_popup_ex().

◆ WM_operator_props_popup_confirm_ex()

◆ wm_operator_props_popup_ex()

static int 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 )
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 195 of file wm_operators.cc.

References BKE_reportf(), 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 330 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 252 of file wm_operators.cc.

References ListBase::first, wmOperatorType::idname, wmOperator::macro, wmOperatorType::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()

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

◆ wm_operator_ui_popup_cancel()

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

◆ wm_operator_ui_popup_ok()

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

Definition at line 1716 of file wm_operators.cc.

References 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()

static 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 2312 of file wm_operators.cc.

References CTX_wm_window(), G, SCREENNORMAL, and WM_window_get_active_screen().

Referenced by WM_OT_window_new_main().

◆ wm_operator_winactive_not_full()

static bool wm_operator_winactive_not_full ( bContext * C)
static

Definition at line 2330 of file wm_operators.cc.

References CTX_wm_window(), G, SCREENFULL, and WM_window_get_active_screen().

Referenced by WM_OT_window_new().

◆ wm_operatortypes_register()

◆ WM_OT_call_asset_shelf_popover()

◆ WM_OT_call_menu()

◆ WM_OT_call_menu_pie()

◆ WM_OT_call_panel()

◆ WM_OT_debug_menu()

◆ WM_OT_doc_view_manual_ui_context()

◆ WM_OT_memory_statistics()

static void WM_OT_memory_statistics ( wmOperatorType * ot)
static

◆ WM_OT_operator_defaults()

◆ WM_OT_previews_clear()

◆ WM_OT_previews_ensure()

static void WM_OT_previews_ensure ( wmOperatorType * ot)
static

◆ WM_OT_quit_blender()

◆ WM_OT_radial_control()

◆ WM_OT_redraw_timer()

◆ WM_OT_search_menu()

◆ WM_OT_search_operator()

◆ WM_OT_search_single_menu()

◆ WM_OT_stereo3d_set()

◆ WM_OT_window_close()

◆ WM_OT_window_fullscreen_toggle()

◆ WM_OT_window_new()

◆ WM_OT_window_new_main()

◆ 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()

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

Definition at line 692 of file wm_operators.cc.

References ptr, and WM_context_path_resolve_property_full().

Referenced by WM_prop_pystring_assign().

◆ wm_search_menu_exec()

static int 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 1979 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 3887 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 3575 of file wm_operators.cc.

Referenced by redraw_timer_exec(), and WM_OT_redraw_timer().