Blender V5.3
view3d_camera_control.cc File Reference
#include "DNA_camera_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_math_matrix_c.hh"
#include "BLI_math_rotation_c.hh"
#include "BLI_math_vector_c.hh"
#include "BKE_object.hh"
#include "DEG_depsgraph.hh"
#include "view3d_intern.hh"

Go to the source code of this file.

Classes

struct  blender::View3DCameraControl

Namespaces

namespace  blender
 BMesh Iterators.

Functions

BLI_INLINE Object * blender::view3d_cameracontrol_object (const View3DCameraControl *vctrl)
Object * blender::ED_view3d_cameracontrol_object_get (View3DCameraControl *vctrl)
View3DCameraControl * blender::ED_view3d_cameracontrol_acquire (Depsgraph *depsgraph, Scene *scene, View3D *v3d, RegionView3D *rv3d)
static bool blender::object_apply_mat4_with_protect (Object *ob, const float obmat[4][4], const bool use_parent, RegionView3D *rv3d, const float view_mat[4][4])
void blender::ED_view3d_cameracontrol_update (View3DCameraControl *vctrl, const bool use_autokey, bContext *C, const bool do_rotate, const bool do_translate)
void blender::ED_view3d_cameracontrol_release (View3DCameraControl *vctrl, const bool restore)

Detailed Description

The purpose of View3DCameraControl is to allow editing rv3d manipulation (mainly ofs and viewquat) for the purpose of view navigation without having to worry about positioning the camera, its parent... or other details. Typical view-control usage:

  • Acquire a view-control (#ED_view3d_cameracontrol_acquire).
  • Modify rv3d->ofs, rv3d->viewquat.
  • Update the view data (#ED_view3d_cameracontrol_acquire) - within a loop which draws the viewport.
  • Finish and release the view-control (#ED_view3d_cameracontrol_release), either keeping the current view or restoring the initial view.

Notes:

  • when acquiring rv3d->dist is set to zero (so rv3d->ofs is always the view-point)
  • updating can optionally keyframe the camera object.

Definition in file view3d_camera_control.cc.