Blender
V3.3
|
#include <math.h>
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_layer.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "MEM_guardedalloc.h"
#include "ED_object.h"
#include "ED_screen.h"
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 struct wmEvent *event) |
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 *UNUSED(C), 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) |
Value Interaction Helper | |
Possible additions (add as needed).
| |
typedef struct ValueInteraction | ValueInteraction |
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) |
Utilities for Implementing Operators
Definition in file wm_operator_utils.c.
typedef struct ValueInteraction ValueInteraction |
|
static |
Definition at line 105 of file wm_operator_utils.c.
References ValueInteraction::area, ValueInteraction::context_vars, ED_area_status_text(), and NULL.
Referenced by op_generic_value_exit().
|
static |
Definition at line 77 of file wm_operator_utils.c.
References ValueInteraction::area, C, 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 95 of file wm_operator_utils.c.
References C, 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 110 of file wm_operator_utils.c.
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 201 of file wm_operator_utils.c.
References op_generic_value_exit().
Referenced by WM_operator_type_modal_from_exec_for_object_edit_coords().
|
static |
Definition at line 172 of file wm_operator_utils.c.
References wmOperator::customdata, ED_object_data_xform_destroy(), G, G_TRANSFORM_EDIT, ObCustomData_ForEditMode::inter, interactive_value_exit(), MEM_freeN, NULL, ObCustomData_ForEditMode::objects, ObCustomData_ForEditMode::objects_len, and ObCustomData_ForEditMode::objects_xform.
Referenced by op_generic_value_cancel(), and op_generic_value_modal().
|
static |
Definition at line 206 of file wm_operator_utils.c.
References BKE_view_layer_array_from_objects_in_edit_mode_unique_data, C, CTX_data_view_layer(), CTX_wm_view3d(), wmOperator::customdata, Object::data, 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, MEM_callocN, MEM_freeN, ObCustomData_ForEditMode::objects, ObCustomData_ForEditMode::objects_len, ObCustomData_ForEditMode::objects_xform, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, wmOperatorType::prop, wmOperator::ptr, RNA_boolean_get(), RNA_property_is_set(), wmOperator::type, wmEvent::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 248 of file wm_operator_utils.c.
References C, 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(), wmOperator::type, wmEvent::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 192 of file wm_operator_utils.c.
References wmOperator::customdata, ED_object_data_xform_restore(), ED_object_data_xform_tag_update(), ObCustomData_ForEditMode::objects_len, and ObCustomData_ForEditMode::objects_xform.
Referenced by op_generic_value_modal().
int WM_operator_flag_only_pass_through_on_press | ( | int | retval, |
const struct wmEvent * | event | ||
) |
Only finish + pass through for press events (allowing press-tweak).
Definition at line 33 of file wm_operator_utils.c.
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(), gpencil_select_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 | ( | struct 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 329 of file wm_operator_utils.c.
References BLI_assert, wmOperatorType::cancel, wmOperatorType::invoke, wmOperatorType::modal, NULL, 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 TRANSFORM_OT_vertex_random().