|
Blender V4.3
|
#include <cmath>#include "BLI_array.hh"#include "BLI_string.h"#include "BLI_utildefines.h"#include "BKE_context.hh"#include "BKE_global.hh"#include "BKE_layer.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "WM_api.hh"#include "WM_types.hh"#include "MEM_guardedalloc.h"#include "ED_object.hh"#include "ED_screen.hh"Go to the source code of this file.
Classes | |
| struct | ValueInteraction |
| struct | ObCustomData_ForEditMode |
Functions | |
Generic Utilities | |
| int | WM_operator_flag_only_pass_through_on_press (int retval, const wmEvent *event) |
Value Interaction Helper | |
Possible additions (add as needed).
| |
| static void | interactive_value_init (bContext *C, ValueInteraction *inter, const wmEvent *event, const float value_final, const float range[2]) |
| static void | interactive_value_init_from_property (bContext *C, ValueInteraction *inter, const wmEvent *event, PointerRNA *ptr, PropertyRNA *prop) |
| static void | interactive_value_exit (ValueInteraction *inter) |
| static bool | interactive_value_update (ValueInteraction *inter, const wmEvent *event, float *r_value_final) |
Object Edit Mode Coords (Modal Callbacks) | |
| |
| static void | op_generic_value_exit (wmOperator *op) |
| static void | op_generic_value_restore (wmOperator *op) |
| static void | op_generic_value_cancel (bContext *, wmOperator *op) |
| static int | op_generic_value_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static int | op_generic_value_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| void | WM_operator_type_modal_from_exec_for_object_edit_coords (wmOperatorType *ot) |
Utilities for Implementing Operators
Definition in file wm_operator_utils.cc.
|
static |
Definition at line 111 of file wm_operator_utils.cc.
References ValueInteraction::area, ValueInteraction::context_vars, and ED_area_status_text().
Referenced by op_generic_value_exit().
|
static |
Definition at line 83 of file wm_operator_utils.cc.
References ValueInteraction::area, ValueInteraction::context_vars, CTX_wm_area(), CTX_wm_region(), ValueInteraction::init, ValueInteraction::mval, ValueInteraction::prev, ValueInteraction::prop_value, ValueInteraction::range, and ValueInteraction::region.
Referenced by interactive_value_init_from_property().
|
static |
Definition at line 101 of file wm_operator_utils.cc.
References interactive_value_init(), ptr, RNA_property_float_get(), and RNA_property_float_ui_range().
Referenced by op_generic_value_invoke(), and op_generic_value_modal().
|
static |
Definition at line 116 of file wm_operator_utils.cc.
References ValueInteraction::area, ValueInteraction::context_vars, ED_area_status_text(), float, ValueInteraction::init, ValueInteraction::is_precise, ValueInteraction::is_snap, KM_CTRL, KM_SHIFT, wmEvent::modifier, ValueInteraction::mval, ValueInteraction::prev, ValueInteraction::prop_value, ValueInteraction::range, ValueInteraction::region, snap(), SNPRINTF, str, and ARegion::winx.
Referenced by op_generic_value_modal().
|
static |
Definition at line 202 of file wm_operator_utils.cc.
References op_generic_value_exit().
Referenced by WM_operator_type_modal_from_exec_for_object_edit_coords().
|
static |
Definition at line 176 of file wm_operator_utils.cc.
References wmOperator::customdata, blender::ed::object::data_xform_destroy(), G, ObCustomData_ForEditMode::inter, interactive_value_exit(), and ObCustomData_ForEditMode::objects_xform.
Referenced by op_generic_value_cancel(), and op_generic_value_modal().
|
static |
Definition at line 207 of file wm_operator_utils.cc.
References BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), wmOperator::customdata, Object::data, blender::ed::object::data_xform_create_from_edit_mode(), G, G_TRANSFORM_EDIT, ObCustomData_ForEditMode::inter, interactive_value_init_from_property(), ObCustomData_ForEditMode::is_active, ObCustomData_ForEditMode::is_first, ObCustomData_ForEditMode::launch_event, ObCustomData_ForEditMode::objects_xform, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, wmOperatorType::prop, wmOperator::ptr, blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), RNA_boolean_get(), RNA_property_is_set(), wmEvent::type, wmOperator::type, ObCustomData_ForEditMode::wait_for_input, WM_event_add_modal_handler(), WM_operator_call_notest(), and WM_userdef_event_type_from_keymap_type().
Referenced by WM_operator_type_modal_from_exec_for_object_edit_coords().
|
static |
Definition at line 246 of file wm_operator_utils.cc.
References CTX_wm_manager(), wmOperator::customdata, EVT_ESCKEY, EVT_LEFTCTRLKEY, EVT_LEFTSHIFTKEY, EVT_PADENTER, EVT_RETKEY, EVT_RIGHTCTRLKEY, EVT_RIGHTSHIFTKEY, wmOperatorType::exec, ObCustomData_ForEditMode::inter, interactive_value_init_from_property(), interactive_value_update(), ObCustomData_ForEditMode::is_active, ObCustomData_ForEditMode::is_first, KM_PRESS, KM_RELEASE, ObCustomData_ForEditMode::launch_event, LEFTMOUSE, MOUSEMOVE, op_generic_value_exit(), op_generic_value_restore(), wmWindowManager::op_undo_depth, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RETVAL_CHECK, OPERATOR_RUNNING_MODAL, wmOperatorType::prop, wmOperator::ptr, RIGHTMOUSE, RNA_property_float_set(), wmEvent::type, wmOperator::type, wmEvent::val, and ObCustomData_ForEditMode::wait_for_input.
Referenced by WM_operator_type_modal_from_exec_for_object_edit_coords().
|
static |
Definition at line 193 of file wm_operator_utils.cc.
References wmOperator::customdata, blender::ed::object::data_xform_restore(), blender::ed::object::data_xform_tag_update(), and ObCustomData_ForEditMode::objects_xform.
Referenced by op_generic_value_modal().
Indented for use in a selection (picking) operators wmOperatorType::invoke callback to implement click-drag, where the initial click selects and the drag action grabs or performs box-select (for example).
OPERATOR_FINISHED causes the PRESS event to be handled and prevents further CLICK (on release) or DRAG (on cursor motion) from being generated & handled.OPERATOR_FINISHED | OPERATOR_PASS_THROUGH allows for CLICK/DRAG but only makes sense if the event's value is PRESS. If the operator was already mapped to a CLICK/DRAG event, a single CLICK/DRAG could invoke multiple operators.This function handles the details of checking the operator return value, clearing OPERATOR_PASS_THROUGH when the wmEvent::val is not KM_PRESS.
Definition at line 39 of file wm_operator_utils.cc.
References BLI_assert, KM_PRESS, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, and wmEvent::val.
Referenced by add_vertex_invoke(), animchannels_mouseclick_invoke(), armature_click_extrude_invoke(), edbm_dupli_extrude_cursor_invoke(), blender::ed::space_node::node_select_invoke(), select_invoke(), sequencer_select_invoke(), uv_select_edge_ring_invoke(), uv_select_invoke(), uv_select_loop_invoke(), and view3d_select_invoke().
| void WM_operator_type_modal_from_exec_for_object_edit_coords | ( | wmOperatorType * | ot | ) |
Allow an operator with only and execute function to run modally, re-doing the action, using vertex coordinate store/restore instead of operator undo.
Definition at line 327 of file wm_operator_utils.cc.
References BLI_assert, wmOperatorType::cancel, wmOperatorType::invoke, wmOperatorType::modal, op_generic_value_cancel(), op_generic_value_invoke(), op_generic_value_modal(), ot, wmOperatorType::prop, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by MESH_OT_vertices_smooth(), and blender::ed::object::TRANSFORM_OT_vertex_random().