Blender  V2.93
Classes | Enumerations | Functions
view3d_edit.c File Reference
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "DNA_armature_types.h"
#include "DNA_camera_types.h"
#include "DNA_curve_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_action.h"
#include "BKE_armature.h"
#include "BKE_camera.h"
#include "BKE_context.h"
#include "BKE_font.h"
#include "BKE_gpencil_geom.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "WM_api.h"
#include "WM_message.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "ED_armature.h"
#include "ED_mesh.h"
#include "ED_particle.h"
#include "ED_screen.h"
#include "ED_transform.h"
#include "ED_transform_snap_object_context.h"
#include "ED_view3d.h"
#include "UI_resources.h"
#include "PIL_time.h"
#include "view3d_intern.h"

Go to the source code of this file.

Classes

struct  ViewOpsData
 

Enumerations

enum  { HAS_TRANSLATE = (1 << 0) , HAS_ROTATE = (1 << 0) }
 

Functions

static bool view3d_camera_user_poll (bContext *C)
 
static bool view3d_lock_poll (bContext *C)
 
static bool view3d_pan_poll (bContext *C)
 
static bool view3d_zoom_or_dolly_poll (bContext *C)
 
View Move (Pan) Operator
void viewmove_modal_keymap (wmKeyConfig *keyconf)
 
static void viewmove_apply (ViewOpsData *vod, int x, int y)
 
static int viewmove_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int viewmove_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void viewmove_cancel (bContext *C, wmOperator *op)
 
void VIEW3D_OT_move (wmOperatorType *ot)
 
View Zoom Operator
void viewzoom_modal_keymap (wmKeyConfig *keyconf)
 
static void view_zoom_to_window_xy_camera (Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, float dfac, const int zoom_xy[2])
 
static void view_zoom_to_window_xy_3d (ARegion *region, float dfac, const int zoom_xy[2])
 
static float viewzoom_scale_value (const rcti *winrct, const eViewZoom_Style viewzoom, const bool zoom_invert, const bool zoom_invert_force, const int xy_curr[2], const int xy_init[2], const float val, const float val_orig, double *r_timer_lastdraw)
 
static float viewzoom_scale_value_offset (const rcti *winrct, const eViewZoom_Style viewzoom, const bool zoom_invert, const bool zoom_invert_force, const int xy_curr[2], const int xy_init[2], const int xy_offset[2], const float val, const float val_orig, double *r_timer_lastdraw)
 
static void viewzoom_apply_camera (ViewOpsData *vod, const int xy[2], const eViewZoom_Style viewzoom, const bool zoom_invert, const bool zoom_to_pos)
 
static void viewzoom_apply_3d (ViewOpsData *vod, const int xy[2], const eViewZoom_Style viewzoom, const bool zoom_invert, const bool zoom_to_pos)
 
static void viewzoom_apply (ViewOpsData *vod, const int xy[2], const eViewZoom_Style viewzoom, const bool zoom_invert, const bool zoom_to_pos)
 
static int viewzoom_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int viewzoom_exec (bContext *C, wmOperator *op)
 
static int viewzoom_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void viewzoom_cancel (bContext *C, wmOperator *op)
 
void VIEW3D_OT_zoom (wmOperatorType *ot)
 
View Dolly Operator

Like zoom but translates the view offset along the view direction which avoids RegionView3D.dist approaching zero.

void viewdolly_modal_keymap (wmKeyConfig *keyconf)
 
static bool viewdolly_offset_lock_check (bContext *C, wmOperator *op)
 
static void view_dolly_to_vector_3d (ARegion *region, const float orig_ofs[3], const float dvec[3], float dfac)
 
static void viewdolly_apply (ViewOpsData *vod, const int xy[2], const short zoom_invert)
 
static int viewdolly_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int viewdolly_exec (bContext *C, wmOperator *op)
 
static int viewdolly_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void viewdolly_cancel (bContext *C, wmOperator *op)
 
void VIEW3D_OT_dolly (wmOperatorType *ot)
 
View All Operator

Move & Zoom the view to fit all of its contents.

static bool view3d_object_skip_minmax (const View3D *v3d, const RegionView3D *rv3d, const Object *ob, const bool skip_camera, bool *r_only_center)
 
static void view3d_object_calc_minmax (Depsgraph *depsgraph, Scene *scene, Object *ob_eval, const bool only_center, float min[3], float max[3])
 
static void view3d_from_minmax (bContext *C, View3D *v3d, ARegion *region, const float min[3], const float max[3], bool ok_dist, const int smooth_viewtx)
 
static void view3d_from_minmax_multi (bContext *C, View3D *v3d, const float min[3], const float max[3], const bool ok_dist, const int smooth_viewtx)
 
static int view3d_all_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_view_all (wmOperatorType *ot)
 
Frame Selected Operator

Move & Zoom the view to fit selected contents.

static int viewselected_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_view_selected (wmOperatorType *ot)
 
View Lock Clear Operator
static int view_lock_clear_exec (bContext *C, wmOperator *UNUSED(op))
 
void VIEW3D_OT_view_lock_clear (wmOperatorType *ot)
 
View Lock to Active Operator
static int view_lock_to_active_exec (bContext *C, wmOperator *UNUSED(op))
 
void VIEW3D_OT_view_lock_to_active (wmOperatorType *ot)
 
View Center Cursor Operator
static int viewcenter_cursor_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_view_center_cursor (wmOperatorType *ot)
 
View Center Pick Operator
static int viewcenter_pick_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void VIEW3D_OT_view_center_pick (wmOperatorType *ot)
 
Frame Camera Bounds Operator
static int view3d_center_camera_exec (bContext *C, wmOperator *UNUSED(op))
 
void VIEW3D_OT_view_center_camera (wmOperatorType *ot)
 
View Lock Center Operator
static int view3d_center_lock_exec (bContext *C, wmOperator *UNUSED(op))
 
void VIEW3D_OT_view_center_lock (wmOperatorType *ot)
 
Set Render Border Operator
static int render_border_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_render_border (wmOperatorType *ot)
 
Clear Render Border Operator
static int clear_render_border_exec (bContext *C, wmOperator *UNUSED(op))
 
void VIEW3D_OT_clear_render_border (wmOperatorType *ot)
 
Border Zoom Operator
static int view3d_zoom_border_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_zoom_border (wmOperatorType *ot)
 
Set Camera Zoom 1:1 Operator

Sets the view to 1:1 camera/render-pixel.

static void view3d_set_1_to_1_viewborder (Scene *scene, Depsgraph *depsgraph, ARegion *region, View3D *v3d)
 
static int view3d_zoom_1_to_1_camera_exec (bContext *C, wmOperator *UNUSED(op))
 
void VIEW3D_OT_zoom_camera_1_to_1 (wmOperatorType *ot)
 
View Camera Operator
static int view_camera_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_view_camera (wmOperatorType *ot)
 
View Pan Operator

Move (pan) in incremental steps. For interactive pan see VIEW3D_OT_move.

static int viewpan_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void VIEW3D_OT_view_pan (wmOperatorType *ot)
 
View Toggle Perspective/Orthographic Operator
static int viewpersportho_exec (bContext *C, wmOperator *UNUSED(op))
 
void VIEW3D_OT_view_persportho (wmOperatorType *ot)
 
View Navigate Operator

Wraps walk/fly modes.

static int view3d_navigate_invoke (bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
 
void VIEW3D_OT_navigate (wmOperatorType *ot)
 
Background Image Add Operator
static Camerabackground_image_camera_from_context (bContext *C)
 
static int background_image_add_exec (bContext *C, wmOperator *UNUSED(op))
 
static int background_image_add_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
static bool background_image_add_poll (bContext *C)
 
void VIEW3D_OT_background_image_add (wmOperatorType *ot)
 
Background Image Remove Operator
static int background_image_remove_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_background_image_remove (wmOperatorType *ot)
 
View Clipping Planes Operator

Draw border or toggle off.

static void calc_local_clipping (float clip_local[6][4], const BoundBox *clipbb, const float mat[4][4])
 
void ED_view3d_clipping_local (RegionView3D *rv3d, const float mat[4][4])
 
static int view3d_clipping_exec (bContext *C, wmOperator *op)
 
static int view3d_clipping_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void VIEW3D_OT_clip_border (wmOperatorType *ot)
 
Set Cursor Operator
void ED_view3d_cursor3d_position (bContext *C, const int mval[2], const bool use_depth, float cursor_co[3])
 
void ED_view3d_cursor3d_position_rotation (bContext *C, const int mval[2], const bool use_depth, enum eV3DCursorOrient orientation, float cursor_co[3], float cursor_quat[4])
 
void ED_view3d_cursor3d_update (bContext *C, const int mval[2], const bool use_depth, enum eV3DCursorOrient orientation)
 
static int view3d_cursor3d_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void VIEW3D_OT_cursor3d (wmOperatorType *ot)
 
Toggle XRay
static int toggle_xray_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_toggle_xray (wmOperatorType *ot)
 

Generic View Operator Custom-Data

#define TRACKBALLSIZE   (1.1f)
 
enum  eViewOpsFlag { VIEWOPS_FLAG_ORBIT_SELECT = (1 << 0) , VIEWOPS_FLAG_DEPTH_NAVIGATE = (1 << 1) , VIEWOPS_FLAG_PERSP_ENSURE = (1 << 2) , VIEWOPS_FLAG_USE_MOUSE_INIT = (1 << 3) }
 
typedef struct ViewOpsData ViewOpsData
 
static void calctrackballvec (const rcti *rect, const int event_xy[2], float r_dir[3])
 
static void viewops_data_alloc (bContext *C, wmOperator *op)
 
void view3d_orbit_apply_dyn_ofs (float r_ofs[3], const float ofs_old[3], const float viewquat_old[4], const float viewquat_new[4], const float dyn_ofs[3])
 
static bool view3d_orbit_calc_center (bContext *C, float r_dyn_ofs[3])
 
static enum eViewOpsFlag viewops_flag_from_args (bool use_select, bool use_depth)
 
static enum eViewOpsFlag viewops_flag_from_prefs (void)
 
static void viewops_data_create (bContext *C, wmOperator *op, const wmEvent *event, enum eViewOpsFlag viewops_flag)
 
static void viewops_data_free (bContext *C, wmOperator *op)
 

Generic View Operator Properties

enum  eV3D_OpPropFlag { V3D_OP_PROP_MOUSE_CO = (1 << 0) , V3D_OP_PROP_DELTA = (1 << 1) , V3D_OP_PROP_USE_ALL_REGIONS = (1 << 2) , V3D_OP_PROP_USE_MOUSE_INIT = (1 << 3) }
 
static void view3d_operator_properties_common (wmOperatorType *ot, const enum eV3D_OpPropFlag flag)
 

View Rotate Operator

enum  { VIEW_PASS = 0 , VIEW_APPLY , VIEW_CONFIRM }
 
enum  {
  VIEW_MODAL_CONFIRM = 1 , VIEWROT_MODAL_AXIS_SNAP_ENABLE = 2 , VIEWROT_MODAL_AXIS_SNAP_DISABLE = 3 , VIEWROT_MODAL_SWITCH_ZOOM = 4 ,
  VIEWROT_MODAL_SWITCH_MOVE = 5 , VIEWROT_MODAL_SWITCH_ROTATE = 6
}
 
void viewrotate_modal_keymap (wmKeyConfig *keyconf)
 
static void viewrotate_apply_dyn_ofs (ViewOpsData *vod, const float viewquat_new[4])
 
static void viewrotate_apply_snap (ViewOpsData *vod)
 
static void viewrotate_apply (ViewOpsData *vod, const int event_xy[2])
 
static int viewrotate_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int viewrotate_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void viewrotate_cancel (bContext *C, wmOperator *op)
 
void VIEW3D_OT_rotate (wmOperatorType *ot)
 

View Orbit Operator

Rotate (orbit) in incremental steps. For interactive orbit see VIEW3D_OT_rotate.

enum  { V3D_VIEW_STEPLEFT = 1 , V3D_VIEW_STEPRIGHT , V3D_VIEW_STEPDOWN , V3D_VIEW_STEPUP }
 
static const EnumPropertyItem prop_view_orbit_items []
 
static int vieworbit_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_view_orbit (wmOperatorType *ot)
 

View Roll Operator

enum  { V3D_VIEW_PANLEFT = 1 , V3D_VIEW_PANRIGHT , V3D_VIEW_PANDOWN , V3D_VIEW_PANUP }
 
static const EnumPropertyItem prop_view_roll_items []
 
static const EnumPropertyItem prop_view_pan_items []
 
static void view_roll_angle (ARegion *region, float quat[4], const float orig_quat[4], const float dvec[3], float angle)
 
static void viewroll_apply (ViewOpsData *vod, int x, int UNUSED(y))
 
static int viewroll_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int viewroll_exec (bContext *C, wmOperator *op)
 
static int viewroll_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void viewroll_cancel (bContext *C, wmOperator *op)
 
void VIEW3D_OT_view_roll (wmOperatorType *ot)
 

View Axis Operator

static const EnumPropertyItem prop_view_items []
 
static void axis_set_view (bContext *C, View3D *v3d, ARegion *region, const float quat_[4], char view, char view_axis_roll, int perspo, const float *align_to_quat, const int smooth_viewtx)
 
static int view_axis_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_view_axis (wmOperatorType *ot)
 

Toggle Shading Operator

static const EnumPropertyItem prop_shading_type_items []
 
static int toggle_shading_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_toggle_shading (wmOperatorType *ot)
 

Detailed Description

3D view manipulation/operators.

Definition in file view3d_edit.c.

Macro Definition Documentation

◆ TRACKBALLSIZE

#define TRACKBALLSIZE   (1.1f)

Size of the sphere being dragged for trackball rotation within the view bounds. also affects speed (smaller is faster).

Definition at line 242 of file view3d_edit.c.

Typedef Documentation

◆ ViewOpsData

typedef struct ViewOpsData ViewOpsData

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
HAS_TRANSLATE 
HAS_ROTATE 

Definition at line 83 of file view3d_edit.c.

◆ anonymous enum

anonymous enum
Enumerator
VIEW_PASS 
VIEW_APPLY 
VIEW_CONFIRM 

Definition at line 598 of file view3d_edit.c.

◆ anonymous enum

anonymous enum
Enumerator
VIEW_MODAL_CONFIRM 
VIEWROT_MODAL_AXIS_SNAP_ENABLE 
VIEWROT_MODAL_AXIS_SNAP_DISABLE 
VIEWROT_MODAL_SWITCH_ZOOM 
VIEWROT_MODAL_SWITCH_MOVE 
VIEWROT_MODAL_SWITCH_ROTATE 

Definition at line 605 of file view3d_edit.c.

◆ anonymous enum

anonymous enum
Enumerator
V3D_VIEW_STEPLEFT 
V3D_VIEW_STEPRIGHT 
V3D_VIEW_STEPDOWN 
V3D_VIEW_STEPUP 

Definition at line 4224 of file view3d_edit.c.

◆ anonymous enum

anonymous enum
Enumerator
V3D_VIEW_PANLEFT 
V3D_VIEW_PANRIGHT 
V3D_VIEW_PANDOWN 
V3D_VIEW_PANUP 

Definition at line 4610 of file view3d_edit.c.

◆ eV3D_OpPropFlag

Enumerator
V3D_OP_PROP_MOUSE_CO 
V3D_OP_PROP_DELTA 
V3D_OP_PROP_USE_ALL_REGIONS 
V3D_OP_PROP_USE_MOUSE_INIT 

Definition at line 138 of file view3d_edit.c.

◆ eViewOpsFlag

Enumerator
VIEWOPS_FLAG_ORBIT_SELECT 

When enabled, rotate around the selection.

VIEWOPS_FLAG_DEPTH_NAVIGATE 

When enabled, use the depth under the cursor for navigation.

VIEWOPS_FLAG_PERSP_ENSURE 

When enabled run ED_view3d_persp_ensure this may switch out of camera view when orbiting or switch from ortho to perspective when auto-persp is enabled. Some operations don't require this (view zoom/pan or ndof where subtle rotation is common so we don't want it to trigger auto-perspective).

VIEWOPS_FLAG_USE_MOUSE_INIT 

When set, ignore any options that depend on initial cursor location.

Definition at line 389 of file view3d_edit.c.

Function Documentation

◆ axis_set_view()

static void axis_set_view ( bContext C,
View3D v3d,
ARegion region,
const float  quat_[4],
char  view,
char  view_axis_roll,
int  perspo,
const float align_to_quat,
const int  smooth_viewtx 
)
static

◆ background_image_add_exec()

static int background_image_add_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ background_image_add_invoke()

static int background_image_add_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ background_image_add_poll()

static bool background_image_add_poll ( bContext C)
static

Definition at line 4815 of file view3d_edit.c.

References background_image_camera_from_context(), C, and NULL.

Referenced by VIEW3D_OT_background_image_add().

◆ background_image_camera_from_context()

static Camera* background_image_camera_from_context ( bContext C)
static

◆ background_image_remove_exec()

static int background_image_remove_exec ( bContext C,
wmOperator op 
)
static

◆ calc_local_clipping()

static void calc_local_clipping ( float  clip_local[6][4],
const BoundBox clipbb,
const float  mat[4][4] 
)
static

◆ calctrackballvec()

static void calctrackballvec ( const rcti rect,
const int  event_xy[2],
float  r_dir[3] 
)
static

◆ clear_render_border_exec()

static int clear_render_border_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ ED_view3d_clipping_local()

void ED_view3d_clipping_local ( RegionView3D rv3d,
const float  mat[4][4] 
)

◆ ED_view3d_cursor3d_position()

void ED_view3d_cursor3d_position ( bContext C,
const int  mval[2],
const bool  use_depth,
float  cursor_co[3] 
)

◆ ED_view3d_cursor3d_position_rotation()

void ED_view3d_cursor3d_position_rotation ( bContext C,
const int  mval[2],
const bool  use_depth,
enum eV3DCursorOrient  orientation,
float  cursor_co[3],
float  cursor_quat[4] 
)

◆ ED_view3d_cursor3d_update()

void ED_view3d_cursor3d_update ( bContext C,
const int  mval[2],
const bool  use_depth,
enum eV3DCursorOrient  orientation 
)

◆ render_border_exec()

static int render_border_exec ( bContext C,
wmOperator op 
)
static

◆ toggle_shading_exec()

static int toggle_shading_exec ( bContext C,
wmOperator op 
)
static

◆ toggle_xray_exec()

static int toggle_xray_exec ( bContext C,
wmOperator op 
)
static

◆ view3d_all_exec()

static int view3d_all_exec ( bContext C,
wmOperator op 
)
static

◆ view3d_camera_user_poll()

static bool view3d_camera_user_poll ( bContext C)
static

◆ view3d_center_camera_exec()

static int view3d_center_camera_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ view3d_center_lock_exec()

static int view3d_center_lock_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ view3d_clipping_exec()

static int view3d_clipping_exec ( bContext C,
wmOperator op 
)
static

◆ view3d_clipping_invoke()

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

◆ view3d_cursor3d_invoke()

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

◆ view3d_from_minmax()

static void view3d_from_minmax ( bContext C,
View3D v3d,
ARegion region,
const float  min[3],
const float  max[3],
bool  ok_dist,
const int  smooth_viewtx 
)
static

◆ view3d_from_minmax_multi()

static void view3d_from_minmax_multi ( bContext C,
View3D v3d,
const float  min[3],
const float  max[3],
const bool  ok_dist,
const int  smooth_viewtx 
)
static

◆ view3d_lock_poll()

static bool view3d_lock_poll ( bContext C)
static

◆ view3d_navigate_invoke()

static int view3d_navigate_invoke ( bContext C,
wmOperator UNUSEDop,
const wmEvent UNUSEDevent 
)
static

◆ view3d_object_calc_minmax()

static void view3d_object_calc_minmax ( Depsgraph depsgraph,
Scene scene,
Object ob_eval,
const bool  only_center,
float  min[3],
float  max[3] 
)
static

◆ view3d_object_skip_minmax()

static bool view3d_object_skip_minmax ( const View3D v3d,
const RegionView3D rv3d,
const Object ob,
const bool  skip_camera,
bool *  r_only_center 
)
static

◆ view3d_operator_properties_common()

static void view3d_operator_properties_common ( wmOperatorType ot,
const enum eV3D_OpPropFlag  flag 
)
static

◆ view3d_orbit_apply_dyn_ofs()

void view3d_orbit_apply_dyn_ofs ( float  r_ofs[3],
const float  ofs_old[3],
const float  viewquat_old[4],
const float  viewquat_new[4],
const float  dyn_ofs[3] 
)

◆ view3d_orbit_calc_center()

static bool view3d_orbit_calc_center ( bContext C,
float  r_dyn_ofs[3] 
)
static

◆ VIEW3D_OT_background_image_add()

void VIEW3D_OT_background_image_add ( wmOperatorType ot)

◆ VIEW3D_OT_background_image_remove()

void VIEW3D_OT_background_image_remove ( wmOperatorType ot)

◆ VIEW3D_OT_clear_render_border()

void VIEW3D_OT_clear_render_border ( wmOperatorType ot)

◆ VIEW3D_OT_clip_border()

void VIEW3D_OT_clip_border ( wmOperatorType ot)

◆ VIEW3D_OT_cursor3d()

void VIEW3D_OT_cursor3d ( wmOperatorType ot)

◆ VIEW3D_OT_dolly()

void VIEW3D_OT_dolly ( wmOperatorType ot)

◆ VIEW3D_OT_move()

void VIEW3D_OT_move ( wmOperatorType ot)

◆ VIEW3D_OT_navigate()

void VIEW3D_OT_navigate ( wmOperatorType ot)

◆ VIEW3D_OT_render_border()

void VIEW3D_OT_render_border ( wmOperatorType ot)

◆ VIEW3D_OT_rotate()

void VIEW3D_OT_rotate ( wmOperatorType ot)

◆ VIEW3D_OT_toggle_shading()

void VIEW3D_OT_toggle_shading ( wmOperatorType ot)

◆ VIEW3D_OT_toggle_xray()

void VIEW3D_OT_toggle_xray ( wmOperatorType ot)

◆ VIEW3D_OT_view_all()

void VIEW3D_OT_view_all ( wmOperatorType ot)

◆ VIEW3D_OT_view_axis()

void VIEW3D_OT_view_axis ( wmOperatorType ot)

◆ VIEW3D_OT_view_camera()

void VIEW3D_OT_view_camera ( wmOperatorType ot)

◆ VIEW3D_OT_view_center_camera()

void VIEW3D_OT_view_center_camera ( wmOperatorType ot)

◆ VIEW3D_OT_view_center_cursor()

void VIEW3D_OT_view_center_cursor ( wmOperatorType ot)

◆ VIEW3D_OT_view_center_lock()

void VIEW3D_OT_view_center_lock ( wmOperatorType ot)

◆ VIEW3D_OT_view_center_pick()

void VIEW3D_OT_view_center_pick ( wmOperatorType ot)

◆ VIEW3D_OT_view_lock_clear()

void VIEW3D_OT_view_lock_clear ( wmOperatorType ot)

◆ VIEW3D_OT_view_lock_to_active()

void VIEW3D_OT_view_lock_to_active ( wmOperatorType ot)

◆ VIEW3D_OT_view_orbit()

void VIEW3D_OT_view_orbit ( wmOperatorType ot)

◆ VIEW3D_OT_view_pan()

void VIEW3D_OT_view_pan ( wmOperatorType ot)

◆ VIEW3D_OT_view_persportho()

void VIEW3D_OT_view_persportho ( wmOperatorType ot)

◆ VIEW3D_OT_view_roll()

void VIEW3D_OT_view_roll ( wmOperatorType ot)

◆ VIEW3D_OT_view_selected()

void VIEW3D_OT_view_selected ( wmOperatorType ot)

◆ VIEW3D_OT_zoom()

void VIEW3D_OT_zoom ( wmOperatorType ot)

◆ VIEW3D_OT_zoom_border()

void VIEW3D_OT_zoom_border ( wmOperatorType ot)

◆ VIEW3D_OT_zoom_camera_1_to_1()

void VIEW3D_OT_zoom_camera_1_to_1 ( wmOperatorType ot)

◆ view3d_pan_poll()

static bool view3d_pan_poll ( bContext C)
static

◆ view3d_set_1_to_1_viewborder()

static void view3d_set_1_to_1_viewborder ( Scene scene,
Depsgraph depsgraph,
ARegion region,
View3D v3d 
)
static

◆ view3d_zoom_1_to_1_camera_exec()

static int view3d_zoom_1_to_1_camera_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ view3d_zoom_border_exec()

static int view3d_zoom_border_exec ( bContext C,
wmOperator op 
)
static

◆ view3d_zoom_or_dolly_poll()

static bool view3d_zoom_or_dolly_poll ( bContext C)
static

◆ view_axis_exec()

static int view_axis_exec ( bContext C,
wmOperator op 
)
static

◆ view_camera_exec()

static int view_camera_exec ( bContext C,
wmOperator op 
)
static

◆ view_dolly_to_vector_3d()

static void view_dolly_to_vector_3d ( ARegion region,
const float  orig_ofs[3],
const float  dvec[3],
float  dfac 
)
static

Definition at line 2501 of file view3d_edit.c.

References madd_v3_v3v3fl(), RegionView3D::ofs, and ARegion::regiondata.

Referenced by viewdolly_apply(), and viewdolly_exec().

◆ view_lock_clear_exec()

static int view_lock_clear_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ view_lock_to_active_exec()

static int view_lock_to_active_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ view_roll_angle()

static void view_roll_angle ( ARegion region,
float  quat[4],
const float  orig_quat[4],
const float  dvec[3],
float  angle 
)
static

◆ view_zoom_to_window_xy_3d()

static void view_zoom_to_window_xy_3d ( ARegion region,
float  dfac,
const int  zoom_xy[2] 
)
static
Parameters
zoom_xyOptionally zoom to window location (coords compatible w/ wmEvent.x, y). Use when not NULL.

Definition at line 1978 of file view3d_edit.c.

References add_v3_v3v3(), copy_v3_v3(), RegionView3D::dist, ED_view3d_calc_zfac(), ED_view3d_win_to_delta(), float(), madd_v3_v3v3fl(), negate_v3(), negate_v3_v3(), NULL, RegionView3D::ofs, ARegion::regiondata, ARegion::winrct, ARegion::winx, ARegion::winy, rcti::xmin, and rcti::ymin.

Referenced by viewzoom_apply_3d(), and viewzoom_exec().

◆ view_zoom_to_window_xy_camera()

static void view_zoom_to_window_xy_camera ( Scene scene,
Depsgraph depsgraph,
View3D v3d,
ARegion region,
float  dfac,
const int  zoom_xy[2] 
)
static

◆ viewcenter_cursor_exec()

static int viewcenter_cursor_exec ( bContext C,
wmOperator op 
)
static

◆ viewcenter_pick_invoke()

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

◆ viewdolly_apply()

static void viewdolly_apply ( ViewOpsData vod,
const int  xy[2],
const short  zoom_invert 
)
static

◆ viewdolly_cancel()

static void viewdolly_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 2734 of file view3d_edit.c.

References C, and viewops_data_free().

Referenced by VIEW3D_OT_dolly().

◆ viewdolly_exec()

static int viewdolly_exec ( bContext C,
wmOperator op 
)
static

◆ viewdolly_invoke()

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

◆ viewdolly_modal()

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

◆ viewdolly_modal_keymap()

void viewdolly_modal_keymap ( wmKeyConfig keyconf)

◆ viewdolly_offset_lock_check()

static bool viewdolly_offset_lock_check ( bContext C,
wmOperator op 
)
static

◆ viewmove_apply()

static void viewmove_apply ( ViewOpsData vod,
int  x,
int  y 
)
static

◆ viewmove_cancel()

static void viewmove_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 1856 of file view3d_edit.c.

References C, and viewops_data_free().

Referenced by VIEW3D_OT_move().

◆ viewmove_invoke()

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

◆ viewmove_modal()

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

◆ viewmove_modal_keymap()

void viewmove_modal_keymap ( wmKeyConfig keyconf)

◆ viewops_data_alloc()

static void viewops_data_alloc ( bContext C,
wmOperator op 
)
static

◆ viewops_data_create()

static void viewops_data_create ( bContext C,
wmOperator op,
const wmEvent event,
enum eViewOpsFlag  viewops_flag 
)
static

Calculate the values for ViewOpsData

Definition at line 426 of file view3d_edit.c.

References BLI_rcti_cent_x(), BLI_rcti_cent_y(), C, calctrackballvec(), ViewOpsData::camzoom, RegionView3D::camzoom, closest_to_line_v3(), copy_m3_m4(), copy_qt_qt(), copy_v3_v3(), CTX_data_ensure_evaluated_depsgraph(), ViewOpsData::curr, wmOperator::customdata, depsgraph, ViewOpsData::dist, RegionView3D::dist, ViewOpsData::dyn_ofs, ED_region_tag_redraw(), ED_view3d_autodist(), ED_view3d_calc_zfac(), ED_view3d_camera_lock_init(), ED_view3d_persp_ensure(), ED_view3d_win_to_3d(), ED_view3d_win_to_vector(), ViewOpsData::event_type, ViewOpsData::event_xy, ViewOpsData::event_xy_offset, float(), ViewOpsData::init, RegionView3D::is_persp, len_v3v3(), ViewOpsData::mousevec, mul_m3_v3(), wmEvent::mval, negate_v3(), negate_v3_v3(), NULL, ViewOpsData::ofs, RegionView3D::ofs, RegionView3D::persmat, ViewOpsData::persp, RegionView3D::persp, ViewOpsData::prev, ViewOpsData::quat, ViewOpsData::region, ViewOpsData::reverse, RegionView3D::rflag, ViewOpsData::rv3d, RV3D_NAVIGATING, sub_v3_v3v3(), ViewOpsData::trackvec, ViewOpsData::use_dyn_ofs, ViewOpsData::v3d, view3d_operator_needs_opengl(), view3d_orbit_calc_center(), RegionView3D::viewinv, VIEWOPS_FLAG_DEPTH_NAVIGATE, VIEWOPS_FLAG_ORBIT_SELECT, VIEWOPS_FLAG_PERSP_ENSURE, VIEWOPS_FLAG_USE_MOUSE_INIT, ViewOpsData::viewquat, RegionView3D::viewquat, ARegion::winrct, ARegion::winx, ARegion::winy, and ViewOpsData::zfac.

Referenced by viewdolly_invoke(), viewmove_invoke(), viewpan_invoke(), viewroll_invoke(), viewrotate_invoke(), and viewzoom_invoke().

◆ viewops_data_free()

static void viewops_data_free ( bContext C,
wmOperator op 
)
static

◆ viewops_flag_from_args()

static enum eViewOpsFlag viewops_flag_from_args ( bool  use_select,
bool  use_depth 
)
static

Definition at line 303 of file view3d_edit.c.

◆ viewops_flag_from_prefs()

static enum eViewOpsFlag viewops_flag_from_prefs ( void  )
static

◆ vieworbit_exec()

static int vieworbit_exec ( bContext C,
wmOperator op 
)
static

◆ viewpan_invoke()

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

◆ viewpersportho_exec()

static int viewpersportho_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ viewroll_apply()

static void viewroll_apply ( ViewOpsData vod,
int  x,
int   UNUSED
)
static

◆ viewroll_cancel()

static void viewroll_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 4573 of file view3d_edit.c.

References C, and viewops_data_free().

Referenced by VIEW3D_OT_view_roll().

◆ viewroll_exec()

static int viewroll_exec ( bContext C,
wmOperator op 
)
static

◆ viewroll_invoke()

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

◆ viewroll_modal()

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

◆ viewrotate_apply()

static void viewrotate_apply ( ViewOpsData vod,
const int  event_xy[2] 
)
static

◆ viewrotate_apply_dyn_ofs()

static void viewrotate_apply_dyn_ofs ( ViewOpsData vod,
const float  viewquat_new[4] 
)
static

◆ viewrotate_apply_snap()

static void viewrotate_apply_snap ( ViewOpsData vod)
static

◆ viewrotate_cancel()

static void viewrotate_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 1030 of file view3d_edit.c.

References C, and viewops_data_free().

Referenced by VIEW3D_OT_rotate().

◆ viewrotate_invoke()

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

◆ viewrotate_modal()

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

◆ viewrotate_modal_keymap()

void viewrotate_modal_keymap ( wmKeyConfig keyconf)

◆ viewselected_exec()

static int viewselected_exec ( bContext C,
wmOperator op 
)
static

Definition at line 3023 of file view3d_edit.c.

References BASE_SELECTED, BASE_SELECTED_EDITABLE, BKE_gpencil_stroke_minmax(), BKE_paint_select_face_test(), BKE_paint_stroke_get_average(), BKE_pose_minmax(), C, copy_v3_v3(), CTX_DATA_BEGIN, CTX_data_edit_object(), CTX_DATA_END, CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_view3d(), Object::data, DEG_get_evaluated_view_layer(), DEG_get_original_object(), depsgraph, ED_view3d_camera_lock_check(), ED_view3d_clipping_clamp_minmax(), ED_view3d_minmax_verts(), BezTriple::f1, BezTriple::f2, BezTriple::f3, ListBase::first, FIRSTBASE, View3D::flag2, FOREACH_OBJECT_IN_MODE_BEGIN, FOREACH_OBJECT_IN_MODE_END, ARegion::gizmo_map, GP_STROKE_3DSPACE, GP_STROKE_SELECT, GPENCIL_ANY_MODE, INIT_MINMAX, max, min, minmax_v3v3_v3(), Object::mode, mul_m4_v3(), Base::next, NULL, OB_ARMATURE, OB_GPENCIL, OB_MODE_PARTICLE_EDIT, OB_MODE_POSE, OB_MODE_SCULPT, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, OBACT, Base::object, ViewLayer::object_bases, Object::obmat, OPERATOR_FINISHED, paintface_minmax(), PE_minmax(), wmOperator::ptr, ARegion::regiondata, RNA_boolean_get(), RV3D_CLIPPING_ENABLED, scene, SELECT, Object::type, V3D_LOCK_CAMERA, BezTriple::vec, view3d_from_minmax(), view3d_from_minmax_multi(), view3d_object_calc_minmax(), view3d_object_skip_minmax(), WM_gizmomap_is_any_selected(), WM_gizmomap_minmax(), and WM_operator_smooth_viewtx_get().

Referenced by VIEW3D_OT_view_selected().

◆ viewzoom_apply()

static void viewzoom_apply ( ViewOpsData vod,
const int  xy[2],
const eViewZoom_Style  viewzoom,
const bool  zoom_invert,
const bool  zoom_to_pos 
)
static

◆ viewzoom_apply_3d()

static void viewzoom_apply_3d ( ViewOpsData vod,
const int  xy[2],
const eViewZoom_Style  viewzoom,
const bool  zoom_invert,
const bool  zoom_to_pos 
)
static

◆ viewzoom_apply_camera()

static void viewzoom_apply_camera ( ViewOpsData vod,
const int  xy[2],
const eViewZoom_Style  viewzoom,
const bool  zoom_invert,
const bool  zoom_to_pos 
)
static

◆ viewzoom_cancel()

static void viewzoom_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 2421 of file view3d_edit.c.

References C, and viewops_data_free().

Referenced by VIEW3D_OT_zoom().

◆ viewzoom_exec()

static int viewzoom_exec ( bContext C,
wmOperator op 
)
static

◆ viewzoom_invoke()

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

◆ viewzoom_modal()

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

◆ viewzoom_modal_keymap()

void viewzoom_modal_keymap ( wmKeyConfig keyconf)

◆ viewzoom_scale_value()

static float viewzoom_scale_value ( const rcti winrct,
const eViewZoom_Style  viewzoom,
const bool  zoom_invert,
const bool  zoom_invert_force,
const int  xy_curr[2],
const int  xy_init[2],
const float  val,
const float  val_orig,
double r_timer_lastdraw 
)
static

◆ viewzoom_scale_value_offset()

static float viewzoom_scale_value_offset ( const rcti winrct,
const eViewZoom_Style  viewzoom,
const bool  zoom_invert,
const bool  zoom_invert_force,
const int  xy_curr[2],
const int  xy_init[2],
const int  xy_offset[2],
const float  val,
const float  val_orig,
double r_timer_lastdraw 
)
static

Definition at line 2089 of file view3d_edit.c.

References viewzoom_scale_value().

Referenced by viewzoom_apply_3d(), and viewzoom_apply_camera().

Variable Documentation

◆ prop_shading_type_items

const EnumPropertyItem prop_shading_type_items[]
static
Initial value:
= {
{OB_WIRE, "WIREFRAME", 0, "Wireframe", "Toggle wireframe shading"},
{OB_SOLID, "SOLID", 0, "Solid", "Toggle solid shading"},
{OB_MATERIAL, "MATERIAL", 0, "Material Preview", "Toggle material preview shading"},
{OB_RENDER, "RENDERED", 0, "Rendered", "Toggle rendered shading"},
{0, NULL, 0, NULL, NULL},
}
@ OB_WIRE
@ OB_SOLID
@ OB_RENDER
@ OB_MATERIAL

Definition at line 5290 of file view3d_edit.c.

Referenced by VIEW3D_OT_toggle_shading().

◆ prop_view_items

const EnumPropertyItem prop_view_items[]
static
Initial value:
= {
{RV3D_VIEW_LEFT, "LEFT", ICON_TRIA_LEFT, "Left", "View from the left"},
{RV3D_VIEW_RIGHT, "RIGHT", ICON_TRIA_RIGHT, "Right", "View from the right"},
{RV3D_VIEW_BOTTOM, "BOTTOM", ICON_TRIA_DOWN, "Bottom", "View from the bottom"},
{RV3D_VIEW_TOP, "TOP", ICON_TRIA_UP, "Top", "View from the top"},
{RV3D_VIEW_FRONT, "FRONT", 0, "Front", "View from the front"},
{RV3D_VIEW_BACK, "BACK", 0, "Back", "View from the back"},
{0, NULL, 0, NULL, NULL},
}
#define RV3D_VIEW_BACK
#define RV3D_VIEW_BOTTOM
#define RV3D_VIEW_LEFT
#define RV3D_VIEW_RIGHT
#define RV3D_VIEW_TOP
#define RV3D_VIEW_FRONT

Definition at line 3855 of file view3d_edit.c.

Referenced by VIEW3D_OT_view_axis().

◆ prop_view_orbit_items

const EnumPropertyItem prop_view_orbit_items[]
static
Initial value:
= {
{V3D_VIEW_STEPLEFT, "ORBITLEFT", 0, "Orbit Left", "Orbit the view around to the left"},
{V3D_VIEW_STEPRIGHT, "ORBITRIGHT", 0, "Orbit Right", "Orbit the view around to the right"},
{V3D_VIEW_STEPUP, "ORBITUP", 0, "Orbit Up", "Orbit the view up"},
{V3D_VIEW_STEPDOWN, "ORBITDOWN", 0, "Orbit Down", "Orbit the view down"},
{0, NULL, 0, NULL, NULL},
}
@ V3D_VIEW_STEPRIGHT
Definition: view3d_edit.c:4226
@ V3D_VIEW_STEPUP
Definition: view3d_edit.c:4228
@ V3D_VIEW_STEPLEFT
Definition: view3d_edit.c:4225
@ V3D_VIEW_STEPDOWN
Definition: view3d_edit.c:4227

Definition at line 4231 of file view3d_edit.c.

Referenced by VIEW3D_OT_view_orbit().

◆ prop_view_pan_items

const EnumPropertyItem prop_view_pan_items[]
static
Initial value:
= {
{V3D_VIEW_PANLEFT, "PANLEFT", 0, "Pan Left", "Pan the view to the left"},
{V3D_VIEW_PANRIGHT, "PANRIGHT", 0, "Pan Right", "Pan the view to the right"},
{V3D_VIEW_PANUP, "PANUP", 0, "Pan Up", "Pan the view up"},
{V3D_VIEW_PANDOWN, "PANDOWN", 0, "Pan Down", "Pan the view down"},
{0, NULL, 0, NULL, NULL},
}
@ V3D_VIEW_PANLEFT
Definition: view3d_edit.c:4611
@ V3D_VIEW_PANDOWN
Definition: view3d_edit.c:4613
@ V3D_VIEW_PANUP
Definition: view3d_edit.c:4614
@ V3D_VIEW_PANRIGHT
Definition: view3d_edit.c:4612

Definition at line 4617 of file view3d_edit.c.

Referenced by VIEW3D_OT_view_pan().

◆ prop_view_roll_items

const EnumPropertyItem prop_view_roll_items[]
static
Initial value:
= {
{0, "ANGLE", 0, "Roll Angle", "Roll the view using an angle value"},
{V3D_VIEW_STEPLEFT, "LEFT", 0, "Roll Left", "Roll the view around to the left"},
{V3D_VIEW_STEPRIGHT, "RIGHT", 0, "Roll Right", "Roll the view around to the right"},
{0, NULL, 0, NULL, NULL},
}

Definition at line 4468 of file view3d_edit.c.

Referenced by VIEW3D_OT_view_roll().