Blender V5.3
interface_ops.cc File Reference
#include <cstring>
#include <fmt/format.h>
#include "MEM_guardedalloc.h"
#include "DNA_armature_types.h"
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_modifier_types.h"
#include "DNA_node_tree_interface_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "ANIM_keyframing.hh"
#include "BLI_listbase.hh"
#include "BLI_math_color_c.hh"
#include "BLI_rect.hh"
#include "BLI_string.hh"
#include "BLI_string_utf8.hh"
#include "BLF_api.hh"
#include "BLT_lang.hh"
#include "BLT_translation.hh"
#include "BKE_anim_data.hh"
#include "BKE_armature.hh"
#include "BKE_context.hh"
#include "BKE_fcurve.hh"
#include "BKE_idtype.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_override.hh"
#include "BKE_lib_remap.hh"
#include "BKE_library.hh"
#include "BKE_material.hh"
#include "BKE_node.hh"
#include "BKE_report.hh"
#include "BKE_screen.hh"
#include "IMB_colormanagement.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_build.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_path.hh"
#include "RNA_prototypes.hh"
#include "UI_abstract_view.hh"
#include "UI_interface.hh"
#include "UI_interface_layout.hh"
#include "UI_tree_view.hh"
#include "interface_intern.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_object.hh"
#include "ED_outliner.hh"
#include "ED_paint.hh"
#include "ED_undo.hh"
#include "ED_keyframing.hh"
#include "ED_screen.hh"
#include "NOD_socket.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::ui
namespace  blender::ui::internal

Functions

Vector< FCurve * > blender::ui::internal::get_property_drivers (PointerRNA *ptr, PropertyRNA *prop, bool get_all, int index, bool *r_is_array_prop)
int blender::ui::internal::paste_property_drivers (Span< FCurve * > src_drivers, bool is_array_prop, PointerRNA *dst_ptr, PropertyRNA *dst_prop)
Access Current Frame File Name & Line Number
void blender::PyC_FileAndNum_Safe (const char **r_filename, int *r_lineno)
Immediate redraw helper

Generally handlers shouldn't do any redrawing, that includes the layout/button definitions. That violates the Model-View-Controller pattern.

But there are some operators which really need to re-run the layout definitions for various reasons. For example, "Edit Source" does it to find out which exact Python code added a button. Other operators may need to access buttons that aren't currently visible. In Blender's UI code design that typically means just not adding the button in the first place, for a particular redraw. So the operator needs to change context and re-create the layout, so the button becomes available to act on.

static void blender::ui::region_redraw_immediately (bContext *C, ARegion *region)
Copy Data Path Operator
static bool blender::ui::copy_data_path_button_poll (bContext *C)
static wmOperatorStatus blender::ui::copy_data_path_button_exec (bContext *C, wmOperator *op)
static void blender::ui::UI_OT_copy_data_path_button (wmOperatorType *ot)
Copy As Driver Operator
static bool blender::ui::copy_as_driver_button_poll (bContext *C)
static wmOperatorStatus blender::ui::copy_as_driver_button_exec (bContext *C, wmOperator *op)
static void blender::ui::UI_OT_copy_as_driver_button (wmOperatorType *ot)
Copy Python Command Operator
static bool blender::ui::copy_python_command_button_poll (bContext *C)
static wmOperatorStatus blender::ui::copy_python_command_button_exec (bContext *C, wmOperator *)
static void blender::ui::UI_OT_copy_python_command_button (wmOperatorType *ot)
Reset to Default Values Button Operator
static wmOperatorStatus blender::ui::operator_button_property_finish (bContext *C, PointerRNA *ptr, PropertyRNA *prop)
static wmOperatorStatus blender::ui::operator_button_property_finish_with_undo (bContext *C, PointerRNA *ptr, PropertyRNA *prop)
static bool blender::ui::reset_default_button_poll (bContext *C)
static wmOperatorStatus blender::ui::reset_default_button_exec (bContext *C, wmOperator *op)
static void blender::ui::UI_OT_reset_default_button (wmOperatorType *ot)
Assign Value as Default Button Operator
static bool blender::ui::assign_default_button_poll (bContext *C)
static wmOperatorStatus blender::ui::assign_default_button_exec (bContext *C, wmOperator *)
static void blender::ui::UI_OT_assign_default_button (wmOperatorType *ot)
Unset Property Button Operator
static wmOperatorStatus blender::ui::unset_property_button_exec (bContext *C, wmOperator *)
static void blender::ui::UI_OT_unset_property_button (wmOperatorType *ot)
Add Override Operator
static bool blender::ui::override_add_button_poll (bContext *C)
static wmOperatorStatus blender::ui::override_add_button_exec (bContext *C, wmOperator *op)
static void blender::ui::UI_OT_override_add_button (wmOperatorType *ot)
static bool blender::ui::override_remove_button_poll (bContext *C)
static wmOperatorStatus blender::ui::override_remove_button_exec (bContext *C, wmOperator *op)
static void blender::ui::UI_OT_override_remove_button (wmOperatorType *ot)
static void blender::ui::override_idtemplate_ids_get (bContext *C, ID **r_owner_id, ID **r_id, PointerRNA *r_owner_ptr, PropertyRNA **r_prop)
static bool blender::ui::override_idtemplate_poll (bContext *C, const bool is_create_op)
static bool blender::ui::override_idtemplate_make_poll (bContext *C)
static wmOperatorStatus blender::ui::override_idtemplate_make_exec (bContext *C, wmOperator *)
static void blender::ui::UI_OT_override_idtemplate_make (wmOperatorType *ot)
static bool blender::ui::override_idtemplate_reset_poll (bContext *C)
static wmOperatorStatus blender::ui::override_idtemplate_reset_exec (bContext *C, wmOperator *)
static void blender::ui::UI_OT_override_idtemplate_reset (wmOperatorType *ot)
static bool blender::ui::override_idtemplate_clear_poll (bContext *C)
static wmOperatorStatus blender::ui::override_idtemplate_clear_exec (bContext *C, wmOperator *)
static void blender::ui::UI_OT_override_idtemplate_clear (wmOperatorType *ot)
static bool blender::ui::override_idtemplate_menu_poll (const bContext *C_const, MenuType *)
static void blender::ui::override_idtemplate_menu_draw (const bContext *, Menu *menu)
static void blender::ui::override_idtemplate_menu ()
Copy To Selected Operator
static PointerRNA blender::ui::rnapointer_pchan_to_bone (const PointerRNA &pchan_ptr)
static void blender::ui::context_selected_bones_via_pose (bContext *C, Vector< PointerRNA > *r_lb)
static void blender::ui::context_fcurve_modifiers_via_fcurve (bContext *C, Vector< PointerRNA > *r_lb, FModifier *source)
static void blender::ui::context_selected_key_blocks (ID *owner_id_key, Vector< PointerRNA > *r_lb)
static bool blender::ui::tree_interface_item_can_set_prop (const bNodeTreeInterfaceItem &item, const bNodeTreeInterfaceItem &active_item, PropertyRNA *prop)
static void blender::ui::ui_context_matched_tree_interface_items (PointerRNA *ptr, PropertyRNA *prop, Vector< PointerRNA > *r_lb)
bool blender::ui::context_copy_to_selected_list (bContext *C, PointerRNA *ptr, PropertyRNA *prop, Vector< PointerRNA > *r_lb, bool *r_use_path_from_id, std::optional< std::string > *r_path)
bool blender::ui::context_copy_to_selected_check (PointerRNA *ptr, PointerRNA *ptr_link, PropertyRNA *prop, const char *path, bool use_path_from_id, PointerRNA *r_ptr, PropertyRNA **r_prop)
static bool blender::ui::copy_to_selected_button (bContext *C, bool all, bool poll)
static bool blender::ui::copy_to_selected_button_poll (bContext *C)
static wmOperatorStatus blender::ui::copy_to_selected_button_exec (bContext *C, wmOperator *op)
static void blender::ui::UI_OT_copy_to_selected_button (wmOperatorType *ot)
Copy Driver To Selected Operator
static bool blender::ui::copy_driver_to_selected_button (bContext *C, bool copy_entire_array, const bool poll)
static bool blender::ui::copy_driver_to_selected_button_poll (bContext *C)
static wmOperatorStatus blender::ui::copy_driver_to_selected_button_exec (bContext *C, wmOperator *op)
static void blender::ui::UI_OT_copy_driver_to_selected_button (wmOperatorType *ot)
Jump to Target Operator
static bool blender::ui::jump_to_target_ptr (bContext *C, PointerRNA ptr, const bool poll)
static bool blender::ui::jump_to_target_button (bContext *C, bool poll)
bool blender::ui::jump_to_target_button_poll (bContext *C)
static wmOperatorStatus blender::ui::jump_to_target_button_exec (bContext *C, wmOperator *)
static void blender::ui::UI_OT_jump_to_target_button (wmOperatorType *ot)
Reload Translation Operator
static wmOperatorStatus blender::ui::reloadtranslation_exec (bContext *, wmOperator *)
static void blender::ui::UI_OT_reloadtranslation (wmOperatorType *ot)
Press Button Operator
static wmOperatorStatus blender::ui::button_press_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::ui::UI_OT_button_execute (wmOperatorType *ot)
Text Button Clear Operator
static wmOperatorStatus blender::ui::button_string_clear_exec (bContext *C, wmOperator *)
static void blender::ui::UI_OT_button_string_clear (wmOperatorType *ot)
Drop Color Operator
bool blender::ui::drop_color_poll (bContext *C, wmDrag *drag, const wmEvent *event)
void blender::ui::drop_color_copy (bContext *C, wmDrag *drag, wmDropBox *drop)
static wmOperatorStatus blender::ui::drop_color_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::ui::UI_OT_drop_color (wmOperatorType *ot)
Drop Name Operator
static bool blender::ui::drop_name_poll (bContext *C)
static wmOperatorStatus blender::ui::drop_name_invoke (bContext *C, wmOperator *op, const wmEvent *)
static void blender::ui::UI_OT_drop_name (wmOperatorType *ot)
UI List Search Operator
static bool blender::ui::uilist_focused_poll (bContext *C)
static bool blender::ui::uilist_unhide_filter_options (uiList *list)
static wmOperatorStatus blender::ui::uilist_start_filter_invoke (bContext *C, wmOperator *, const wmEvent *event)
static void blender::ui::UI_OT_list_start_filter (wmOperatorType *ot)
UI View Start Filter Operator
static AbstractView * blender::ui::get_view_focused (bContext *C)
static bool blender::ui::view_focused_poll (bContext *C)
static wmOperatorStatus blender::ui::view_start_filter_invoke (bContext *C, wmOperator *, const wmEvent *event)
static void blender::ui::UI_OT_view_start_filter (wmOperatorType *ot)
UI View Drop Operator
static bool blender::ui::view_drop_poll (bContext *C)
static wmOperatorStatus blender::ui::view_drop_invoke (bContext *C, wmOperator *, const wmEvent *event)
static void blender::ui::UI_OT_view_drop (wmOperatorType *ot)
UI View Scroll Operator
static bool blender::ui::view_scroll_poll (bContext *C)
static wmOperatorStatus blender::ui::view_scroll_invoke (bContext *C, wmOperator *, const wmEvent *event)
static void blender::ui::UI_OT_view_scroll (wmOperatorType *ot)
UI View Item Rename Operator

General purpose renaming operator for views. Thanks to this, to add a rename button to context menus for example, view API users don't have to implement their own renaming operators with the same logic as they already have for their #ui::AbstractViewItem::rename() override.

static AbstractViewItem * blender::ui::find_active_view_item (bContext *C)
static bool blender::ui::view_item_rename_poll (bContext *C)
static wmOperatorStatus blender::ui::view_item_rename_exec (bContext *C, wmOperator *)
static void blender::ui::UI_OT_view_item_rename (wmOperatorType *ot)
UI View Item Select Operator

Operator for selecting view items, supports multi-selection with SHIFT/CTRL.

static wmOperatorStatus blender::ui::view_item_click_select (bContext &C, AbstractViewItem *clicked_item, const AbstractView &view, const bool extend, const bool range_select, bool wait_to_deselect_others)
static std::pair< AbstractView *, AbstractViewItem * > blender::ui::select_operator_view_and_item_find_xy (const ARegion &region, const wmOperator &op)
static wmOperatorStatus blender::ui::view_item_select_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::ui::view_item_select_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::ui::UI_OT_view_item_select (wmOperatorType *ot)
UI View Item Delete Operator

Operator for deleting selected view items, bound to the X hotkey.

static wmOperatorStatus blender::ui::view_item_delete_invoke (bContext *C, wmOperator *, const wmEvent *)
static void blender::ui::UI_OT_view_item_delete (wmOperatorType *ot)
UI View Item Focus Operator

Operator to bring the active item into view by scrolling the view.

static wmOperatorStatus blender::ui::ui_view_item_focus_invoke (bContext *C, wmOperator *, const wmEvent *)
static void blender::ui::UI_OT_view_item_focus (wmOperatorType *ot)
Tree View Page Scroll Operator

Scroll the view to up/down by one page or to the top/bottom of the view.

static wmOperatorStatus blender::ui::ui_view_item_scroll_page_invoke (bContext *C, wmOperator *op, const wmEvent *)
static void blender::ui::UI_OT_view_item_page_scroll (wmOperatorType *ot)
Material Drag/Drop Operator
static bool blender::ui::drop_material_poll (bContext *C)
static wmOperatorStatus blender::ui::drop_material_exec (bContext *C, wmOperator *op)
static void blender::ui::UI_OT_drop_material (wmOperatorType *ot)
Start / Clear Region Search Filter Operators
static wmOperatorStatus blender::ui::region_start_filter_exec (bContext *C, wmOperator *)
static bool blender::ui::region_start_filter_poll (blender::bContext *C)
static void blender::ui::UI_OT_region_start_filter (wmOperatorType *ot)
static wmOperatorStatus blender::ui::region_clear_filter_exec (bContext *C, wmOperator *)
static bool blender::ui::region_clear_filter_poll (blender::bContext *C)
static void blender::ui::UI_OT_region_clear_filter (wmOperatorType *ot)
Operator & Keymap Registration
void blender::ui::operatortypes_ui ()
void blender::ui::keymap_ui (wmKeyConfig *keyconf)
 User Interface Keymap.

UI View Item Navigate Operator

Operator for navigating in view with arrow keys.

enum class  blender::ui::Direction { blender::ui::UP , blender::ui::Down , blender::ui::LEFT , blender::ui::RIGHT }
static wmOperatorStatus blender::ui::ui_view_item_navigate_invoke (bContext *C, wmOperator *op, const wmEvent *)
static void blender::ui::UI_OT_view_item_navigate (wmOperatorType *ot)