Blender  V2.93
Functions
wm_operator_props.c File Reference
#include "DNA_space_types.h"
#include "BLI_math_base.h"
#include "BLI_rect.h"
#include "UI_resources.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "ED_select_utils.h"
#include "WM_api.h"
#include "WM_types.h"

Go to the source code of this file.

Functions

void WM_operator_properties_confirm_or_exec (wmOperatorType *ot)
 
static const EnumPropertyItemwm_operator_properties_filesel_sort_items_itemf (struct bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 
void WM_operator_properties_filesel (wmOperatorType *ot, int filter, short type, short action, short flag, short display, short sort)
 
static void wm_operator_properties_select_action_ex (wmOperatorType *ot, int default_action, const EnumPropertyItem *select_actions, bool hide_gui)
 
void WM_operator_properties_select_action (wmOperatorType *ot, int default_action, bool hide_gui)
 
void WM_operator_properties_select_action_simple (wmOperatorType *ot, int default_action, bool hide_gui)
 
void WM_operator_properties_select_random (wmOperatorType *ot)
 
int WM_operator_properties_select_random_seed_increment_get (wmOperator *op)
 
void WM_operator_properties_select_all (wmOperatorType *ot)
 
void WM_operator_properties_border (wmOperatorType *ot)
 
void WM_operator_properties_border_to_rcti (struct wmOperator *op, rcti *rect)
 
void WM_operator_properties_border_to_rctf (struct wmOperator *op, rctf *rect)
 
void WM_operator_properties_gesture_box_ex (wmOperatorType *ot, bool deselect, bool extend)
 
void WM_operator_properties_use_cursor_init (wmOperatorType *ot)
 
void WM_operator_properties_gesture_box_select (wmOperatorType *ot)
 
void WM_operator_properties_gesture_box (wmOperatorType *ot)
 
void WM_operator_properties_select_operation (wmOperatorType *ot)
 
void WM_operator_properties_select_operation_simple (wmOperatorType *ot)
 
void WM_operator_properties_select_walk_direction (wmOperatorType *ot)
 
void WM_operator_properties_generic_select (wmOperatorType *ot)
 
void WM_operator_properties_gesture_box_zoom (wmOperatorType *ot)
 
void WM_operator_properties_gesture_lasso (wmOperatorType *ot)
 
void WM_operator_properties_gesture_straightline (wmOperatorType *ot, int cursor)
 
void WM_operator_properties_gesture_circle (wmOperatorType *ot)
 
void WM_operator_properties_mouse_select (wmOperatorType *ot)
 
void WM_operator_properties_checker_interval (wmOperatorType *ot, bool nth_can_disable)
 
void WM_operator_properties_checker_interval_from_op (struct wmOperator *op, struct CheckerIntervalParams *op_params)
 
bool WM_operator_properties_checker_interval_test (const struct CheckerIntervalParams *op_params, int depth)
 

Detailed Description

Generic re-usable property definitions and accessors for operators to share. (WM_operator_properties_* functions).

Definition in file wm_operator_props.c.

Function Documentation

◆ WM_operator_properties_border()

void WM_operator_properties_border ( wmOperatorType ot)

◆ WM_operator_properties_border_to_rctf()

void WM_operator_properties_border_to_rctf ( struct wmOperator op,
rctf rect 
)

◆ WM_operator_properties_border_to_rcti()

void WM_operator_properties_border_to_rcti ( struct wmOperator op,
rcti rect 
)

◆ WM_operator_properties_checker_interval()

void WM_operator_properties_checker_interval ( wmOperatorType ot,
bool  nth_can_disable 
)
Parameters
nth_can_disableEnable if we want to be able to select no interval at all.

Definition at line 588 of file wm_operator_props.c.

References min_ii(), ot, RNA_def_int(), and wmOperatorType::srna.

Referenced by CURVE_OT_select_nth(), MESH_OT_select_nth(), and path_select_properties().

◆ WM_operator_properties_checker_interval_from_op()

void WM_operator_properties_checker_interval_from_op ( struct wmOperator op,
struct CheckerIntervalParams op_params 
)

◆ WM_operator_properties_checker_interval_test()

bool WM_operator_properties_checker_interval_test ( const struct CheckerIntervalParams op_params,
int  depth 
)

◆ WM_operator_properties_confirm_or_exec()

void WM_operator_properties_confirm_or_exec ( wmOperatorType ot)

◆ WM_operator_properties_filesel()

void WM_operator_properties_filesel ( wmOperatorType ot,
int  filter,
short  type,
short  action,
short  flag,
short  display,
short  sort 
)

Definition at line 76 of file wm_operator_props.c.

References DummyRNA_NULL_items, FILE_DEFAULTDISPLAY, FILE_HORIZONTALDISPLAY, FILE_IMGDISPLAY, FILE_LOADLIB, FILE_MAX, FILE_SAVE, FILE_SPECIAL, FILE_TYPE_ALEMBIC, FILE_TYPE_ARCHIVE, FILE_TYPE_BLENDER, FILE_TYPE_BLENDER_BACKUP, FILE_TYPE_BLENDERLIB, FILE_TYPE_BTX, FILE_TYPE_COLLADA, FILE_TYPE_FOLDER, FILE_TYPE_FTFONT, FILE_TYPE_IMAGE, FILE_TYPE_MOVIE, FILE_TYPE_PYSCRIPT, FILE_TYPE_SOUND, FILE_TYPE_TEXT, FILE_TYPE_USD, FILE_TYPE_VOLUME, FILE_VERTICALDISPLAY, filter(), NULL, ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_collection_runtime(), RNA_def_enum(), RNA_def_enum_funcs(), RNA_def_int(), RNA_def_property_flag(), RNA_def_string_dir_path(), RNA_def_string_file_name(), RNA_def_string_file_path(), RNA_OperatorFileListElement, sort(), wmOperatorType::srna, type, WM_FILESEL_DIRECTORY, WM_FILESEL_FILENAME, WM_FILESEL_FILEPATH, WM_FILESEL_FILES, WM_FILESEL_RELPATH, WM_FILESEL_SHOW_PROPS, and wm_operator_properties_filesel_sort_items_itemf().

Referenced by BUTTONS_OT_directory_browse(), BUTTONS_OT_file_browse(), CACHEFILE_OT_open(), CLIP_OT_open(), ED_OT_lib_id_load_custom_preview(), FILE_OT_find_missing_files(), FONT_OT_open(), FONT_OT_text_paste_from_file(), GRAPH_OT_sound_bake(), IMAGE_OT_open(), IMAGE_OT_replace(), IMAGE_OT_save_as(), NODE_OT_add_file(), OBJECT_OT_multires_external_save(), OBJECT_OT_volume_import(), RIGIDBODY_OT_world_export(), SCREEN_OT_screenshot(), SEQUENCER_OT_change_path(), SEQUENCER_OT_export_subtitles(), SEQUENCER_OT_image_strip_add(), SEQUENCER_OT_movie_strip_add(), SEQUENCER_OT_sound_strip_add(), SOUND_OT_mixdown(), SOUND_OT_open(), SOUND_OT_open_mono(), TEXT_OT_open(), TEXT_OT_save_as(), VIEW3D_OT_background_image_add(), WM_OT_append(), WM_OT_gpencil_import_svg(), WM_OT_lib_reload(), WM_OT_lib_relocate(), WM_OT_link(), WM_OT_open_mainfile(), WM_OT_recover_auto_save(), WM_OT_save_as_mainfile(), and WM_OT_save_mainfile().

◆ wm_operator_properties_filesel_sort_items_itemf()

static const EnumPropertyItem* wm_operator_properties_filesel_sort_items_itemf ( struct bContext UNUSEDC,
PointerRNA UNUSEDptr,
PropertyRNA UNUSEDprop,
bool *  r_free 
)
static

Extends rna_enum_fileselect_params_sort_items with a default item for operators to use.

Definition at line 54 of file wm_operator_props.c.

References FILE_SORT_DEFAULT, rna_enum_fileselect_params_sort_items, RNA_enum_item_add(), RNA_enum_item_end(), and RNA_enum_items_add().

Referenced by WM_operator_properties_filesel().

◆ WM_operator_properties_generic_select()

void WM_operator_properties_generic_select ( wmOperatorType ot)

Selecting and tweaking items are overlapping operations. Getting both to work without conflicts requires special care. See https://wiki.blender.org/wiki/Human_Interface_Guidelines/Selection#Select-tweaking for the desired behavior.

For default click selection (with no modifier keys held), the select operators can do the following:

  • On a mouse press on an unselected item, change selection and finish immediately after. This sends an undo push and allows transform to take over should a tweak event be caught now.
  • On a mouse press on a selected item, don't change selection state, but start modal execution of the operator. Idea is that we wait with deselecting other items until we know that the intention wasn't to tweak (mouse press+drag) all selected items.
  • If a tweak is recognized before the release event happens, cancel the operator, so that transform can take over and no undo-push is sent.
  • If the release event occurs rather than a tweak one, deselect all items but the one under the cursor, and finish the modal operator.

This utility, together with WM_generic_select_invoke() and WM_generic_select_modal() should help getting the wanted behavior to work. Most generic logic should be handled in these, so that the select operators only have to care for the case dependent handling.

Every select operator has slightly different requirements, e.g. sequencer strip selection also needs to account for handle selection. This should be the baseline behavior though.

Definition at line 478 of file wm_operator_props.c.

References ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_int(), RNA_def_property_flag(), and wmOperatorType::srna.

Referenced by ACTION_OT_clickselect(), GRAPH_OT_clickselect(), MARKER_OT_select(), NLA_OT_click_select(), NODE_OT_select(), and SEQUENCER_OT_select().

◆ WM_operator_properties_gesture_box()

void WM_operator_properties_gesture_box ( wmOperatorType ot)

◆ WM_operator_properties_gesture_box_ex()

void WM_operator_properties_gesture_box_ex ( wmOperatorType ot,
bool  deselect,
bool  extend 
)

◆ WM_operator_properties_gesture_box_select()

void WM_operator_properties_gesture_box_select ( wmOperatorType ot)

◆ WM_operator_properties_gesture_box_zoom()

void WM_operator_properties_gesture_box_zoom ( wmOperatorType ot)

◆ WM_operator_properties_gesture_circle()

void WM_operator_properties_gesture_circle ( wmOperatorType ot)

◆ WM_operator_properties_gesture_lasso()

void WM_operator_properties_gesture_lasso ( wmOperatorType ot)

◆ WM_operator_properties_gesture_straightline()

void WM_operator_properties_gesture_straightline ( wmOperatorType ot,
int  cursor 
)

◆ WM_operator_properties_mouse_select()

void WM_operator_properties_mouse_select ( wmOperatorType ot)

◆ WM_operator_properties_select_action()

void WM_operator_properties_select_action ( wmOperatorType ot,
int  default_action,
bool  hide_gui 
)

◆ wm_operator_properties_select_action_ex()

static void wm_operator_properties_select_action_ex ( wmOperatorType ot,
int  default_action,
const EnumPropertyItem select_actions,
bool  hide_gui 
)
static

◆ WM_operator_properties_select_action_simple()

void WM_operator_properties_select_action_simple ( wmOperatorType ot,
int  default_action,
bool  hide_gui 
)

only SELECT/DESELECT

Definition at line 268 of file wm_operator_props.c.

References NULL, ot, SEL_DESELECT, SEL_SELECT, and wm_operator_properties_select_action_ex().

Referenced by WM_operator_properties_select_random().

◆ WM_operator_properties_select_all()

void WM_operator_properties_select_all ( wmOperatorType ot)

◆ WM_operator_properties_select_operation()

void WM_operator_properties_select_operation ( wmOperatorType ot)

◆ WM_operator_properties_select_operation_simple()

void WM_operator_properties_select_operation_simple ( wmOperatorType ot)

◆ WM_operator_properties_select_random()

void WM_operator_properties_select_random ( wmOperatorType ot)

◆ WM_operator_properties_select_random_seed_increment_get()

int WM_operator_properties_select_random_seed_increment_get ( wmOperator op)

◆ WM_operator_properties_select_walk_direction()

void WM_operator_properties_select_walk_direction ( wmOperatorType ot)

◆ WM_operator_properties_use_cursor_init()

void WM_operator_properties_use_cursor_init ( wmOperatorType ot)

Disable using cursor position, use when view operators are initialized from buttons.

Definition at line 388 of file wm_operator_props.c.

References ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_property_flag(), and wmOperatorType::srna.

Referenced by CLIP_OT_view_zoom(), IMAGE_OT_view_zoom(), VIEW2D_OT_zoom(), and view3d_operator_properties_common().