Blender V5.0
wmOperatorType Struct Reference

#include <WM_types.hh>

Public Attributes

const char * name
const char * idname
const char * translation_context
const char * description
const char * undo_group
wmOperatorStatus(* exec )(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(* check )(bContext *C, wmOperator *op)
wmOperatorStatus(* invoke )(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
void(* cancel )(bContext *C, wmOperator *op)
wmOperatorStatus(* modal )(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
bool(* poll )(bContext *C) ATTR_WARN_UNUSED_RESULT
bool(* poll_property )(const bContext *C, wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT
void(* ui )(bContext *C, wmOperator *op)
bool(* ui_poll )(wmOperatorType *ot, PointerRNA *ptr)
std::string(* get_name )(wmOperatorType *ot, PointerRNA *ptr)
std::string(* get_description )(bContext *C, wmOperatorType *ot, PointerRNA *ptr)
bool(* depends_on_cursor )(bContext &C, wmOperatorType &ot, PointerRNA *ptr)
StructRNAsrna
IDPropertylast_properties
PropertyRNAprop
ListBase macro
wmKeyMapmodalkeymap
bool(* pyop_poll )(bContext *C, wmOperatorType *ot) ATTR_WARN_UNUSED_RESULT
ExtensionRNA rna_ext
int cursor_pending
short flag

Detailed Description

Definition at line 1031 of file WM_types.hh.

Member Data Documentation

◆ cancel

void(* wmOperatorType::cancel) (bContext *C, wmOperator *op)

Called when a modal operator is canceled (not used often). Internal cleanup can be done here if needed.

Definition at line 1073 of file WM_types.hh.

Referenced by blender::ed::sculpt_paint::paint_stroke_modal(), WM_event_remove_handlers(), wm_handler_fileselect_do(), wm_macro_cancel(), and wm_operator_ui_popup_cancel().

◆ check

bool(* wmOperatorType::check) (bContext *C, wmOperator *op)

This callback executes on a running operator whenever as property is changed. It can correct its own properties or report errors for invalid settings in exceptional cases. Boolean return value, True denotes a change has been made and to redraw.

Definition at line 1057 of file WM_types.hh.

Referenced by ED_undo_operator_repeat(), file_draw_check_ex(), popup_check(), and WM_event_add_fileselect().

◆ cursor_pending

int wmOperatorType::cursor_pending

Cursor to use when waiting for cursor input, see: OPTYPE_DEPENDS_ON_CURSOR.

Definition at line 1154 of file WM_types.hh.

◆ depends_on_cursor

bool(* wmOperatorType::depends_on_cursor) (bContext &C, wmOperatorType &ot, PointerRNA *ptr)

A dynamic version of OPTYPE_DEPENDS_ON_CURSOR which can depend on operator properties.

Definition at line 1124 of file WM_types.hh.

◆ description

const char* wmOperatorType::description

Use for tooltips and Python docs.

Definition at line 1039 of file WM_types.hh.

Referenced by file_execute_get_description(), and blender::ed::space_node::NODE_OT_new_compositor_sequencer_node_group().

◆ exec

◆ flag

◆ get_description

std::string(* wmOperatorType::get_description) (bContext *C, wmOperatorType *ot, PointerRNA *ptr)

Return a different description to use in the user interface, based on property values. The returned string is expected to be translated if needed.

Definition at line 1121 of file WM_types.hh.

Referenced by ui_but_tip_from_enum_item().

◆ get_name

std::string(* wmOperatorType::get_name) (wmOperatorType *ot, PointerRNA *ptr)

Return a different name to use in the user interface, based on property values. The returned string is expected to be translated if needed.

WARNING: This callback does not currently work as expected in most common usage cases (e.g. any definition of an operator button through the layout API will fail to execute it). See #112253 for details.

Definition at line 1115 of file WM_types.hh.

◆ idname

◆ invoke

wmOperatorStatus(* wmOperatorType::invoke) (bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT

For modal temporary operators, initially invoke is called, then any further events are handled in modal. If the operation is canceled due to some external reason, cancel is called See defines below for return values.

Definition at line 1065 of file WM_types.hh.

Referenced by wm_macro_invoke_internal(), wm_operator_invoke(), and wm_save_as_mainfile_exec().

◆ last_properties

IDProperty* wmOperatorType::last_properties

Previous settings - for initializing on re-use.

Definition at line 1130 of file WM_types.hh.

Referenced by WM_operator_last_properties_init(), and WM_operator_last_properties_store().

◆ macro

ListBase wmOperatorType::macro

wmOperatorTypeMacro.

Definition at line 1142 of file WM_types.hh.

Referenced by WM_operator_repeat_check().

◆ modal

◆ modalkeymap

◆ name

const char* wmOperatorType::name

Text for UI, undo (should not exceed OP_MAX_TYPENAME).

Definition at line 1033 of file WM_types.hh.

Referenced by button_matches_search_filter(), clear_render_border_exec(), ED_imapaint_bucket_fill(), ED_undo_grouped_push_op(), ED_undo_operator_repeat(), ED_undo_pop_op(), ED_undo_push_op(), ed_undo_redo_poll(), fluid_free_exec(), fluid_initjob(), fly_modal(), blender::ed::sculpt_paint::undo::geometry_begin(), hud_panel_operator_redo_draw(), image_flip_exec(), image_invert_exec(), image_rotate_orthogonal_exec(), image_scale_exec(), keyingset_active_menu_invoke(), move_to_collection_regular_invoke(), blender::ed::object::multires_base_apply_exec(), blender::ed::space_node::NODE_OT_new_compositor_sequencer_node_group(), blender::ed::object::object_hide_collection_invoke(), pack_islands_exec(), paintcurve_delete_point_exec(), paintcurve_point_add(), paintcurve_point_select(), paintcurve_slide_modal(), blender::ed::sculpt_paint::undo::push_begin(), blender::ed::sculpt_paint::undo::push_enter_sculpt_mode(), radial_control_modal(), render_border_exec(), stroke_undo_begin(), text_autocomplete_invoke(), text_autocomplete_modal(), texture_paint_camera_project_exec(), blender::ed::sculpt_paint::image::ops::paint::texture_paint_init(), blender::ed::transform::transformops_data(), view3d_all_exec(), view3d_navigate_modal_fn(), view3d_zoom_border_exec(), viewcenter_cursor_exec(), viewcenter_pick_invoke(), viewdolly_modal(), vieworbit_exec(), viewroll_exec(), viewselected_exec(), viewzoom_exec(), walk_modal(), wm_block_create_redo(), WM_operator_confirm(), WM_operator_confirm_or_exec(), and workspace_add_invoke().

◆ poll

bool(* wmOperatorType::poll) (bContext *C) ATTR_WARN_UNUSED_RESULT

Verify if the operator can be executed in the current context. Note that the operator may still fail to execute even if this returns true.

Definition at line 1089 of file WM_types.hh.

Referenced by blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), radial_control_invoke(), and WM_operator_redo_popup().

◆ poll_property

bool(* wmOperatorType::poll_property) (const bContext *C, wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT

Used to check if properties should be displayed in auto-generated UI. Use 'check' callback to enforce refreshing.

Definition at line 1095 of file WM_types.hh.

Referenced by template_operator_property_buts_draw_single(), and ui_layout_operator_properties_only_booleans().

◆ prop

PropertyRNA* wmOperatorType::prop

Default rna property to use for generic invoke functions. menus, enum search... etc. Example: Enum 'type' for a Delete menu.

When assigned a string/number property, immediately edit the value when used in a popup. see: UI_BUT_ACTIVATE_ON_INIT.

Definition at line 1139 of file WM_types.hh.

Referenced by delete_key_exec(), keyframe_insert_with_keyingset_exec(), blender::ed::object::make_override_library_exec(), blender::ed::object::make_override_library_invoke(), op_generic_value_invoke(), op_generic_value_modal(), blender::ed::object::parent_set_invoke(), template_operator_property_buts_draw_single(), and WM_menu_invoke_ex().

◆ pyop_poll

bool(* wmOperatorType::pyop_poll) (bContext *C, wmOperatorType *ot) ATTR_WARN_UNUSED_RESULT

Python needs the operator type as well.

Definition at line 1148 of file WM_types.hh.

◆ rna_ext

ExtensionRNA wmOperatorType::rna_ext

RNA integration.

Definition at line 1151 of file WM_types.hh.

◆ srna

◆ translation_context

const char* wmOperatorType::translation_context

Translation context (must not exceed BKE_ST_MAXNAME).

Definition at line 1037 of file WM_types.hh.

Referenced by move_to_collection_regular_invoke(), and blender::ed::object::object_hide_collection_invoke().

◆ ui

void(* wmOperatorType::ui) (bContext *C, wmOperator *op)

Optional panel for redo and repeat, auto-generated if not set.

Definition at line 1100 of file WM_types.hh.

Referenced by template_operator_property_buts_draw_single().

◆ ui_poll

bool(* wmOperatorType::ui_poll) (wmOperatorType *ot, PointerRNA *ptr)

Optional check for whether the ui callback should be called (usually to create the redo panel interface).

Definition at line 1105 of file WM_types.hh.

◆ undo_group

const char* wmOperatorType::undo_group

Identifier to group operators together.

Definition at line 1041 of file WM_types.hh.

Referenced by ED_undo_grouped_push_op().


The documentation for this struct was generated from the following file: