Blender  V3.3
Classes
wm_operator_utils.c File Reference
#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)
Note
We could support object mode coords too, it's just not needed at the moment.
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).

  • Int support.
  • Configurable motion (x/y).
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)
 

Detailed Description

Utilities for Implementing Operators

Definition in file wm_operator_utils.c.

Typedef Documentation

◆ ValueInteraction

Function Documentation

◆ interactive_value_exit()

static void interactive_value_exit ( ValueInteraction inter)
static

◆ interactive_value_init()

static void interactive_value_init ( bContext C,
ValueInteraction inter,
const wmEvent event,
const float  value_final,
const float  range[2] 
)
static

◆ interactive_value_init_from_property()

static void interactive_value_init_from_property ( bContext C,
ValueInteraction inter,
const wmEvent event,
PointerRNA ptr,
PropertyRNA prop 
)
static

◆ interactive_value_update()

static bool interactive_value_update ( ValueInteraction inter,
const wmEvent event,
float r_value_final 
)
static

◆ op_generic_value_cancel()

static void op_generic_value_cancel ( bContext UNUSEDC,
wmOperator op 
)
static

◆ op_generic_value_exit()

static void op_generic_value_exit ( wmOperator op)
static

◆ op_generic_value_invoke()

static int op_generic_value_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ op_generic_value_modal()

static int op_generic_value_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ op_generic_value_restore()

static void op_generic_value_restore ( wmOperator op)
static

◆ WM_operator_flag_only_pass_through_on_press()

int WM_operator_flag_only_pass_through_on_press ( int  retval,
const struct wmEvent event 
)

◆ WM_operator_type_modal_from_exec_for_object_edit_coords()

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().