Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c20
-rw-r--r--source/blender/editors/space_view3d/view3d_camera_control.c16
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c58
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c8
-rw-r--r--source/blender/editors/space_view3d/view3d_intern.h66
-rw-r--r--source/blender/editors/space_view3d/view3d_iterators.c10
-rw-r--r--source/blender/editors/space_view3d/view3d_navigate_fly.c1
-rw-r--r--source/blender/editors/space_view3d/view3d_navigate_walk.c1
-rw-r--r--source/blender/editors/space_view3d/view3d_project.c127
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_utils.c150
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c37
13 files changed, 70 insertions, 432 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index e54ef3c931a..6cc15c638a2 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -91,7 +91,6 @@
/* ******************** manage regions ********************* */
-/* function to always find a regionview3d context inside 3D window */
RegionView3D *ED_view3d_context_rv3d(bContext *C)
{
RegionView3D *rv3d = CTX_wm_region_view3d(C);
@@ -108,8 +107,6 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C)
return rv3d;
}
-/* ideally would return an rv3d but in some cases the region is needed too
- * so return that, the caller can then access the region->regiondata */
bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_region)
{
ScrArea *area = CTX_wm_area(C);
@@ -140,10 +137,6 @@ bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_regi
return false;
}
-/**
- * Similar to #ED_view3d_context_user_region() but does not use context. Always performs a lookup.
- * Also works if \a v3d is not the active space.
- */
bool ED_view3d_area_user_region(const ScrArea *area, const View3D *v3d, ARegion **r_region)
{
RegionView3D *rv3d = NULL;
@@ -182,17 +175,6 @@ bool ED_view3d_area_user_region(const ScrArea *area, const View3D *v3d, ARegion
return false;
}
-/* Most of the time this isn't needed since you could assume the view matrix was
- * set while drawing, however when functions like mesh_foreachScreenVert are
- * called by selection tools, we can't be sure this object was the last.
- *
- * for example, transparent objects are drawn after editmode and will cause
- * the rv3d mat's to change and break selection.
- *
- * 'ED_view3d_init_mats_rv3d' should be called before
- * view3d_project_short_clip and view3d_project_short_noclip in cases where
- * these functions are not used during draw_object
- */
void ED_view3d_init_mats_rv3d(const struct Object *ob, struct RegionView3D *rv3d)
{
/* local viewmat and persmat, to calculate projections */
@@ -214,7 +196,6 @@ void ED_view3d_init_mats_rv3d_gl(const struct Object *ob, struct RegionView3D *r
}
#ifdef DEBUG
-/* ensure we correctly initialize */
void ED_view3d_clear_mats_rv3d(struct RegionView3D *rv3d)
{
zero_m4(rv3d->viewmatob);
@@ -1878,7 +1859,6 @@ static void view3d_id_remap(ScrArea *area, SpaceLink *slink, ID *old_id, ID *new
}
}
-/* only called once, from space/spacetypes.c */
void ED_spacetype_view3d(void)
{
SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype view3d");
diff --git a/source/blender/editors/space_view3d/view3d_camera_control.c b/source/blender/editors/space_view3d/view3d_camera_control.c
index 8380c87b999..535a65c8f0c 100644
--- a/source/blender/editors/space_view3d/view3d_camera_control.c
+++ b/source/blender/editors/space_view3d/view3d_camera_control.c
@@ -102,9 +102,6 @@ BLI_INLINE Object *view3d_cameracontrol_object(const View3DCameraControl *vctrl)
return vctrl->root_parent ? vctrl->root_parent : vctrl->ctx_v3d->camera;
}
-/**
- * Returns the object which is being manipulated or NULL.
- */
Object *ED_view3d_cameracontrol_object_get(View3DCameraControl *vctrl)
{
RegionView3D *rv3d = vctrl->ctx_rv3d;
@@ -116,10 +113,6 @@ Object *ED_view3d_cameracontrol_object_get(View3DCameraControl *vctrl)
return NULL;
}
-/**
- * Creates a #View3DCameraControl handle and sets up
- * the view for first-person style navigation.
- */
struct View3DCameraControl *ED_view3d_cameracontrol_acquire(Depsgraph *depsgraph,
Scene *scene,
View3D *v3d,
@@ -243,9 +236,6 @@ static bool object_apply_mat4_with_protect(Object *ob,
return view_changed;
}
-/**
- * Updates cameras from the `rv3d` values, optionally auto-keyframing.
- */
void ED_view3d_cameracontrol_update(View3DCameraControl *vctrl,
/* args for keyframing */
const bool use_autokey,
@@ -317,12 +307,6 @@ void ED_view3d_cameracontrol_update(View3DCameraControl *vctrl,
}
}
-/**
- * Release view control.
- *
- * \param restore: Sets the view state to the values that were set
- * before #ED_view3d_control_acquire was called.
- */
void ED_view3d_cameracontrol_release(View3DCameraControl *vctrl, const bool restore)
{
View3D *v3d = vctrl->ctx_v3d;
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 5639a498d8a..a7d170982ed 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -108,9 +108,6 @@
/** \name General Functions
* \{ */
-/**
- * \note keep this synced with #ED_view3d_mats_rv3d_backup/#ED_view3d_mats_rv3d_restore
- */
void ED_view3d_update_viewmat(Depsgraph *depsgraph,
const Scene *scene,
View3D *v3d,
@@ -355,9 +352,6 @@ static void view3d_xr_mirror_setup(const wmWindowManager *wm,
}
#endif /* WITH_XR_OPENXR */
-/**
- * Set the correct matrices
- */
void ED_view3d_draw_setup_view(const wmWindowManager *wm,
wmWindow *win,
Depsgraph *depsgraph,
@@ -848,7 +842,6 @@ static void drawrenderborder(ARegion *region, View3D *v3d)
/** \name Other Elements
* \{ */
-/** could move this elsewhere, but tied into #ED_view3d_grid_scale */
float ED_scene_grid_scale(const Scene *scene, const char **r_grid_unit)
{
/* apply units */
@@ -921,9 +914,6 @@ void ED_view3d_grid_steps(const Scene *scene,
}
}
-/* Simulates the grid scale that is actually viewed.
- * The actual code is seen in `object_grid_frag.glsl` (see `grid_res`).
- * Currently the simulation is only done when RV3D_VIEW_IS_AXIS. */
float ED_view3d_grid_view_scale(Scene *scene,
View3D *v3d,
ARegion *region,
@@ -1472,9 +1462,6 @@ static void draw_grid_unit_name(
}
}
-/**
- * Information drawn on top of the solid plates and composed data
- */
void view3d_draw_region_info(const bContext *C, ARegion *region)
{
RegionView3D *rv3d = region->regiondata;
@@ -1751,10 +1738,6 @@ void ED_view3d_draw_offscreen(Depsgraph *depsgraph,
G.f &= ~G_FLAG_RENDER_VIEWPORT;
}
-/**
- * Creates own fake 3d views (wrapping #ED_view3d_draw_offscreen). Similar too
- * #ED_view_draw_offscreen_imbuf_simple, but takes view/projection matrices as arguments.
- */
void ED_view3d_draw_offscreen_simple(Depsgraph *depsgraph,
Scene *scene,
View3DShading *shading_override,
@@ -1853,12 +1836,6 @@ void ED_view3d_draw_offscreen_simple(Depsgraph *depsgraph,
viewport);
}
-/**
- * Utility func for ED_view3d_draw_offscreen
- *
- * \param ofs: Optional off-screen buffer, can be NULL.
- * (avoids re-creating when doing multiple GL renders).
- */
ImBuf *ED_view3d_draw_offscreen_imbuf(Depsgraph *depsgraph,
Scene *scene,
eDrawType drawtype,
@@ -2008,14 +1985,6 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Depsgraph *depsgraph,
return ibuf;
}
-/**
- * Creates own fake 3d views (wrapping #ED_view3d_draw_offscreen_imbuf)
- *
- * \param ofs: Optional off-screen buffer can be NULL.
- * (avoids re-creating when doing multiple GL renders).
- *
- * \note used by the sequencer
- */
ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Depsgraph *depsgraph,
Scene *scene,
View3DShading *shading_override,
@@ -2146,15 +2115,6 @@ static bool view3d_clipping_test(const float co[3], const float clip[6][4])
return true;
}
-/**
- * Return true when `co` is hidden by the 3D views clipping planes.
- *
- * \param local: When true use local (object-space) #ED_view3d_clipping_local must run first,
- * then all comparisons can be done in local-space.
- * \return True when `co` is outside all clipping planes.
- *
- * \note Callers should check #RV3D_CLIPPING_ENABLED first.
- */
bool ED_view3d_clipping_test(const RegionView3D *rv3d, const float co[3], const bool is_local)
{
return view3d_clipping_test(co, is_local ? rv3d->clip_local : rv3d->clip);
@@ -2240,10 +2200,6 @@ void ED_view3d_select_id_validate(ViewContext *vc)
validate_object_select_id(vc->depsgraph, vc->view_layer, vc->region, vc->v3d, vc->obact);
}
-/**
- * allow for small values [0.5 - 2.5],
- * and large values, FLT_MAX by clamping by the area size
- */
int ED_view3d_backbuf_sample_size_clamp(ARegion *region, const float dist)
{
return (int)min_ff(ceilf(dist), (float)max_ii(region->winx, region->winx));
@@ -2320,7 +2276,6 @@ static ViewDepths *view3d_depths_create(ARegion *region)
return d;
}
-/* Utility function to find the closest Z value, use for auto-depth. */
float view3d_depth_near(ViewDepths *d)
{
/* Convert to float for comparisons. */
@@ -2344,14 +2299,6 @@ float view3d_depth_near(ViewDepths *d)
return far == far_real ? FLT_MAX : far;
}
-/**
- * Redraw the viewport depth buffer.
- *
- * \param mode: V3D_DEPTH_NO_GPENCIL - Redraw viewport without Grease Pencil and Annotations.
- * V3D_DEPTH_GPENCIL_ONLY - Redraw viewport with Grease Pencil and Annotations only.
- * V3D_DEPTH_OBJECT_ONLY - Redraw viewport with active object only.
- * \param update_cache: If true, store the entire depth buffer in #rv3d->depths.
- */
void ED_view3d_depth_override(Depsgraph *depsgraph,
ARegion *region,
View3D *v3d,
@@ -2466,7 +2413,6 @@ void ED_view3d_datamask(const bContext *C,
}
}
-/* Goes over all modes and view3d settings. */
void ED_view3d_screen_datamask(const bContext *C,
const Scene *scene,
const bScreen *screen,
@@ -2536,10 +2482,6 @@ void ED_view3d_mats_rv3d_restore(struct RegionView3D *rv3d, struct RV3DMatrixSto
/** \name FPS Drawing
* \{ */
-/**
- * \note The info that this uses is updated in #ED_refresh_viewport_fps,
- * which currently gets called during #SCREEN_OT_animation_step.
- */
void ED_scene_draw_fps(const Scene *scene, int xoffset, int *yoffset)
{
ScreenFrameRateInfo *fpsi = scene->fps_info;
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 34baf68ccdd..830f7cbeff1 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -618,7 +618,6 @@ enum {
VIEWROT_MODAL_SWITCH_ROTATE = 6,
};
-/* Called in transform_ops.c, on each regeneration of key-maps. */
void viewrotate_modal_keymap(wmKeyConfig *keyconf)
{
static const EnumPropertyItem modal_items[] = {
@@ -1250,9 +1249,6 @@ static void view3d_ndof_orbit(const struct wmNDOFMotionData *ndof,
}
}
-/**
- * Called from both fly mode and walk mode,
- */
void view3d_ndof_fly(const wmNDOFMotionData *ndof,
View3D *v3d,
RegionView3D *rv3d,
@@ -1685,7 +1681,6 @@ void VIEW3D_OT_ndof_all(struct wmOperatorType *ot)
/* NOTE: these defines are saved in keymap files, do not change values but just add new ones */
-/* Called in transform_ops.c, on each regeneration of key-maps. */
void viewmove_modal_keymap(wmKeyConfig *keyconf)
{
static const EnumPropertyItem modal_items[] = {
@@ -1882,7 +1877,6 @@ void VIEW3D_OT_move(wmOperatorType *ot)
* \{ */
/* #viewdolly_modal_keymap has an exact copy of this, apply fixes to both. */
-/* Called in transform_ops.c, on each regeneration of key-maps. */
void viewzoom_modal_keymap(wmKeyConfig *keyconf)
{
static const EnumPropertyItem modal_items[] = {
@@ -2446,7 +2440,6 @@ void VIEW3D_OT_zoom(wmOperatorType *ot)
* \{ */
/* This is an exact copy of #viewzoom_modal_keymap. */
-/* Called in transform_ops.c, on each regeneration of key-maps. */
void viewdolly_modal_keymap(wmKeyConfig *keyconf)
{
static const EnumPropertyItem modal_items[] = {
@@ -5027,7 +5020,6 @@ void VIEW3D_OT_clip_border(wmOperatorType *ot)
* \{ */
/* cursor position in vec, result in vec, mval in region coords */
-/* NOTE: cannot use `event->mval` here, called by #object_add(). */
void ED_view3d_cursor3d_position(bContext *C,
const int mval[2],
const bool use_depth,
diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h
index a21fc006b02..7388004125c 100644
--- a/source/blender/editors/space_view3d/view3d_intern.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -91,7 +91,13 @@ void VIEW3D_OT_zoom_border(struct wmOperatorType *ot);
void VIEW3D_OT_toggle_shading(struct wmOperatorType *ot);
void VIEW3D_OT_toggle_xray(struct wmOperatorType *ot);
+/**
+ * For home, center etc.
+ */
void view3d_boxview_copy(struct ScrArea *area, struct ARegion *region);
+/**
+ * Sync center/zoom view of region to others, for view transforms.
+ */
void view3d_boxview_sync(struct ScrArea *area, struct ARegion *region);
void view3d_orbit_apply_dyn_ofs(float r_ofs[3],
@@ -103,6 +109,9 @@ void view3d_orbit_apply_dyn_ofs(float r_ofs[3],
#ifdef WITH_INPUT_NDOF
struct wmNDOFMotionData;
+/**
+ * Called from both fly mode and walk mode,
+ */
void view3d_ndof_fly(const struct wmNDOFMotionData *ndof,
struct View3D *v3d,
struct RegionView3D *rv3d,
@@ -113,17 +122,24 @@ void view3d_ndof_fly(const struct wmNDOFMotionData *ndof,
#endif /* WITH_INPUT_NDOF */
/* view3d_navigate_fly.c */
+
void view3d_keymap(struct wmKeyConfig *keyconf);
void VIEW3D_OT_fly(struct wmOperatorType *ot);
/* view3d_navigate_walk.c */
+
void VIEW3D_OT_walk(struct wmOperatorType *ot);
/* view3d_draw.c */
+
void view3d_main_region_draw(const struct bContext *C, struct ARegion *region);
+/**
+ * Information drawn on top of the solid plates and composed data.
+ */
void view3d_draw_region_info(const struct bContext *C, struct ARegion *region);
/* view3d_draw_legacy.c */
+
void ED_view3d_draw_select_loop(struct Depsgraph *depsgraph,
ViewContext *vc,
Scene *scene,
@@ -139,6 +155,9 @@ void ED_view3d_draw_depth_loop(struct Depsgraph *depsgraph,
View3D *v3d);
void view3d_depths_rect_create(struct ARegion *region, struct rcti *rect, struct ViewDepths *r_d);
+/**
+ * Utility function to find the closest Z value, use for auto-depth.
+ */
float view3d_depth_near(struct ViewDepths *d);
/* view3d_select.c */
@@ -175,6 +194,9 @@ typedef struct V3D_SmoothParams {
const float *dyn_ofs;
} V3D_SmoothParams;
+/**
+ * The arguments are the desired situation.
+ */
void ED_view3d_smooth_view_ex(const struct Depsgraph *depsgraph,
struct wmWindowManager *wm,
struct wmWindow *win,
@@ -190,20 +212,41 @@ void ED_view3d_smooth_view(struct bContext *C,
const int smooth_viewtx,
const V3D_SmoothParams *sview);
+/**
+ * Apply the smooth-view immediately, use when we need to start a new view operation.
+ * (so we don't end up half-applying a view operation when pressing keys quickly).
+ */
void ED_view3d_smooth_view_force_finish(struct bContext *C,
struct View3D *v3d,
struct ARegion *region);
+/**
+ * \param rect: optional for picking (can be NULL).
+ */
void view3d_winmatrix_set(struct Depsgraph *depsgraph,
struct ARegion *region,
const View3D *v3d,
const rcti *rect);
+/**
+ * Sets #RegionView3D.viewmat
+ *
+ * \param depsgraph: Depsgraph.
+ * \param scene: Scene for camera and cursor location.
+ * \param v3d: View 3D space data.
+ * \param rv3d: 3D region which stores the final matrices.
+ * \param rect_scale: Optional 2D scale argument,
+ * Use when displaying a sub-region, eg: when #view3d_winmatrix_set takes a 'rect' argument.
+ *
+ * \note don't set windows active in here, is used by renderwin too.
+ */
void view3d_viewmatrix_set(struct Depsgraph *depsgraph,
const struct Scene *scene,
const View3D *v3d,
RegionView3D *rv3d,
const float rect_scale[2]);
+/* Called in transform_ops.c, on each regeneration of key-maps. */
+
void fly_modal_keymap(struct wmKeyConfig *keyconf);
void walk_modal_keymap(struct wmKeyConfig *keyconf);
void viewrotate_modal_keymap(struct wmKeyConfig *keyconf);
@@ -213,23 +256,46 @@ void viewdolly_modal_keymap(struct wmKeyConfig *keyconf);
void viewplace_modal_keymap(struct wmKeyConfig *keyconf);
/* view3d_buttons.c */
+
void VIEW3D_OT_object_mode_pie_or_toggle(struct wmOperatorType *ot);
void view3d_buttons_register(struct ARegionType *art);
/* view3d_camera_control.c */
+
+/**
+ * Creates a #View3DCameraControl handle and sets up
+ * the view for first-person style navigation.
+ */
struct View3DCameraControl *ED_view3d_cameracontrol_acquire(struct Depsgraph *depsgraph,
Scene *scene,
View3D *v3d,
RegionView3D *rv3d);
+/**
+ * Updates cameras from the `rv3d` values, optionally auto-keyframing.
+ */
void ED_view3d_cameracontrol_update(struct View3DCameraControl *vctrl,
const bool use_autokey,
struct bContext *C,
const bool do_rotate,
const bool do_translate);
+/**
+ * Release view control.
+ *
+ * \param restore: Sets the view state to the values that were set
+ * before #ED_view3d_control_acquire was called.
+ */
void ED_view3d_cameracontrol_release(struct View3DCameraControl *vctrl, const bool restore);
+/**
+ * Returns the object which is being manipulated or NULL.
+ */
struct Object *ED_view3d_cameracontrol_object_get(struct View3DCameraControl *vctrl);
/* view3d_snap.c */
+
+/**
+ * Calculates the bounding box corners (min and max) for \a obedit.
+ * The returned values are in global space.
+ */
bool ED_view3d_minmax_verts(struct Object *obedit, float min[3], float max[3]);
void VIEW3D_OT_snap_selected_to_grid(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_view3d/view3d_iterators.c b/source/blender/editors/space_view3d/view3d_iterators.c
index 20e00356152..16d9b9182cf 100644
--- a/source/blender/editors/space_view3d/view3d_iterators.c
+++ b/source/blender/editors/space_view3d/view3d_iterators.c
@@ -486,10 +486,6 @@ static void mesh_foreachScreenEdge_clip_bb_segment__mapFunc(void *userData,
data->func(data->userData, eed, screen_co_a, screen_co_b, index);
}
-/**
- * A version of #mesh_foreachScreenEdge that clips the segment when
- * there is a clipping bounding box.
- */
void mesh_foreachScreenEdge_clip_bb_segment(ViewContext *vc,
void (*func)(void *userData,
BMEdge *eed,
@@ -691,7 +687,6 @@ void nurbs_foreachScreenVert(ViewContext *vc,
/** \name Edit-Meta: For Each Screen Meta-Element
* \{ */
-/* ED_view3d_init_mats_rv3d must be called first */
void mball_foreachScreenElem(struct ViewContext *vc,
void (*func)(void *userData,
struct MetaElem *ml,
@@ -756,7 +751,6 @@ void lattice_foreachScreenVert(ViewContext *vc,
/** \name Edit-Armature: For Each Screen Bone
* \{ */
-/* ED_view3d_init_mats_rv3d must be called first */
void armature_foreachScreenBone(struct ViewContext *vc,
void (*func)(void *userData,
struct EditBone *ebone,
@@ -824,8 +818,6 @@ void armature_foreachScreenBone(struct ViewContext *vc,
/** \name Pose: For Each Screen Bone
* \{ */
-/* ED_view3d_init_mats_rv3d must be called first */
-/* almost _exact_ copy of #armature_foreachScreenBone */
void pose_foreachScreenBone(struct ViewContext *vc,
void (*func)(void *userData,
struct bPoseChannel *pchan,
@@ -834,6 +826,8 @@ void pose_foreachScreenBone(struct ViewContext *vc,
void *userData,
const eV3DProjTest clip_flag)
{
+ /* Almost _exact_ copy of #armature_foreachScreenBone */
+
const Object *ob_eval = DEG_get_evaluated_object(vc->depsgraph, vc->obact);
const bArmature *arm_eval = ob_eval->data;
bPose *pose = vc->obact->pose;
diff --git a/source/blender/editors/space_view3d/view3d_navigate_fly.c b/source/blender/editors/space_view3d/view3d_navigate_fly.c
index f48e436e014..2e9cb419e2e 100644
--- a/source/blender/editors/space_view3d/view3d_navigate_fly.c
+++ b/source/blender/editors/space_view3d/view3d_navigate_fly.c
@@ -101,7 +101,6 @@ typedef enum eFlyPanState {
FLY_AXISLOCK_STATE_ACTIVE = 2,
} eFlyPanState;
-/* Called in transform_ops.c, on each regeneration of key-maps. */
void fly_modal_keymap(wmKeyConfig *keyconf)
{
static const EnumPropertyItem modal_items[] = {
diff --git a/source/blender/editors/space_view3d/view3d_navigate_walk.c b/source/blender/editors/space_view3d/view3d_navigate_walk.c
index 83b8c04acb6..ed76b10c95a 100644
--- a/source/blender/editors/space_view3d/view3d_navigate_walk.c
+++ b/source/blender/editors/space_view3d/view3d_navigate_walk.c
@@ -142,7 +142,6 @@ typedef enum eWalkLockState {
WALK_AXISLOCK_STATE_DONE = 3,
} eWalkLockState;
-/* Called in transform_ops.c, on each regeneration of key-maps. */
void walk_modal_keymap(wmKeyConfig *keyconf)
{
static const EnumPropertyItem modal_items[] = {
diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c
index 88efc530484..8c2e0df0275 100644
--- a/source/blender/editors/space_view3d/view3d_project.c
+++ b/source/blender/editors/space_view3d/view3d_project.c
@@ -43,9 +43,6 @@
/* Non Clipping Projection Functions
* ********************************* */
-/**
- * \note use #ED_view3d_ob_project_mat_get to get the projection matrix
- */
void ED_view3d_project_float_v2_m4(const ARegion *region,
const float co[3],
float r_co[2],
@@ -68,9 +65,6 @@ void ED_view3d_project_float_v2_m4(const ARegion *region,
}
}
-/**
- * \note use #ED_view3d_ob_project_mat_get to get projecting mat
- */
void ED_view3d_project_float_v3_m4(const ARegion *region,
const float co[3],
float r_co[3],
@@ -231,7 +225,6 @@ eV3DProjStatus ED_view3d_project_float_ex(const ARegion *region,
return ret;
}
-/* --- short --- */
eV3DProjStatus ED_view3d_project_short_global(const ARegion *region,
const float co[3],
short r_co[2],
@@ -240,7 +233,6 @@ eV3DProjStatus ED_view3d_project_short_global(const ARegion *region,
RegionView3D *rv3d = region->regiondata;
return ED_view3d_project_short_ex(region, rv3d->persmat, false, co, r_co, flag);
}
-/* object space, use ED_view3d_init_mats_rv3d before calling */
eV3DProjStatus ED_view3d_project_short_object(const ARegion *region,
const float co[3],
short r_co[2],
@@ -251,7 +243,6 @@ eV3DProjStatus ED_view3d_project_short_object(const ARegion *region,
return ED_view3d_project_short_ex(region, rv3d->persmatob, true, co, r_co, flag);
}
-/* --- int --- */
eV3DProjStatus ED_view3d_project_int_global(const ARegion *region,
const float co[3],
int r_co[2],
@@ -260,7 +251,6 @@ eV3DProjStatus ED_view3d_project_int_global(const ARegion *region,
RegionView3D *rv3d = region->regiondata;
return ED_view3d_project_int_ex(region, rv3d->persmat, false, co, r_co, flag);
}
-/* object space, use ED_view3d_init_mats_rv3d before calling */
eV3DProjStatus ED_view3d_project_int_object(const ARegion *region,
const float co[3],
int r_co[2],
@@ -271,7 +261,6 @@ eV3DProjStatus ED_view3d_project_int_object(const ARegion *region,
return ED_view3d_project_int_ex(region, rv3d->persmatob, true, co, r_co, flag);
}
-/* --- float --- */
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region,
const float co[3],
float r_co[2],
@@ -280,7 +269,6 @@ eV3DProjStatus ED_view3d_project_float_global(const ARegion *region,
RegionView3D *rv3d = region->regiondata;
return ED_view3d_project_float_ex(region, rv3d->persmat, false, co, r_co, flag);
}
-/* object space, use ED_view3d_init_mats_rv3d before calling */
eV3DProjStatus ED_view3d_project_float_object(const ARegion *region,
const float co[3],
float r_co[2],
@@ -304,9 +292,6 @@ float ED_view3d_pixel_size_no_ui_scale(const RegionView3D *rv3d, const float co[
return mul_project_m4_v3_zfac(rv3d->persmat, co) * rv3d->pixsize;
}
-/**
- * Calculate a depth value from \a co, use with #ED_view3d_win_to_delta
- */
float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3], bool *r_flip)
{
float zfac = mul_project_m4_v3_zfac(rv3d->persmat, co);
@@ -330,9 +315,6 @@ float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3], bool *r_f
return zfac;
}
-/**
- * Calculate a depth value from `co` (result should only be used for comparison).
- */
float ED_view3d_calc_depth_for_comparison(const RegionView3D *rv3d, const float co[3])
{
if (rv3d->is_persp) {
@@ -388,22 +370,6 @@ bool ED_view3d_clip_segment(const RegionView3D *rv3d, float ray_start[3], float
return true;
}
-/**
- * Calculate a 3d viewpoint and direction vector from 2d window coordinates.
- * This ray_start is located at the viewpoint, ray_normal is the direction towards mval.
- * ray_start is clipped by the view near limit so points in front of it are always in view.
- * In orthographic view the resulting ray_normal will match the view vector.
- * This version also returns the ray_co point of the ray on window plane, useful to fix precision
- * issues esp. with ortho view, where default ray_start is set rather far away.
- * \param region: The region (used for the window width and height).
- * \param v3d: The 3d viewport (used for near clipping value).
- * \param mval: The area relative 2d location (such as event->mval, converted into float[2]).
- * \param r_ray_co: The world-space point where the ray intersects the window plane.
- * \param r_ray_normal: The normalized world-space direction of towards mval.
- * \param r_ray_start: The world-space starting point of the ray.
- * \param do_clip_planes: Optionally clip the start of the ray by the view clipping planes.
- * \return success, false if the ray is totally clipped.
- */
bool ED_view3d_win_to_ray_clipped_ex(struct Depsgraph *depsgraph,
const ARegion *region,
const View3D *v3d,
@@ -426,19 +392,6 @@ bool ED_view3d_win_to_ray_clipped_ex(struct Depsgraph *depsgraph,
return true;
}
-/**
- * Calculate a 3d viewpoint and direction vector from 2d window coordinates.
- * This ray_start is located at the viewpoint, ray_normal is the direction towards mval.
- * ray_start is clipped by the view near limit so points in front of it are always in view.
- * In orthographic view the resulting ray_normal will match the view vector.
- * \param region: The region (used for the window width and height).
- * \param v3d: The 3d viewport (used for near clipping value).
- * \param mval: The area relative 2d location (such as event->mval, converted into float[2]).
- * \param r_ray_start: The world-space point where the ray intersects the window plane.
- * \param r_ray_normal: The normalized world-space direction of towards mval.
- * \param do_clip_planes: Optionally clip the start of the ray by the view clipping planes.
- * \return success, false if the ray is totally clipped.
- */
bool ED_view3d_win_to_ray_clipped(struct Depsgraph *depsgraph,
const ARegion *region,
const View3D *v3d,
@@ -451,17 +404,6 @@ bool ED_view3d_win_to_ray_clipped(struct Depsgraph *depsgraph,
depsgraph, region, v3d, mval, NULL, r_ray_normal, r_ray_start, do_clip_planes);
}
-/**
- * Calculate a 3d viewpoint and direction vector from 2d window coordinates.
- * This ray_start is located at the viewpoint, ray_normal is the direction towards mval.
- * \param region: The region (used for the window width and height).
- * \param mval: The area relative 2d location (such as event->mval, converted into float[2]).
- * \param r_ray_start: The world-space point where the ray intersects the window plane.
- * \param r_ray_normal: The normalized world-space direction of towards mval.
- *
- * \note Ignores view near/far clipping,
- * to take this into account use #ED_view3d_win_to_ray_clipped.
- */
void ED_view3d_win_to_ray(const ARegion *region,
const float mval[2],
float r_ray_start[3],
@@ -471,13 +413,6 @@ void ED_view3d_win_to_ray(const ARegion *region,
ED_view3d_win_to_vector(region, mval, r_ray_normal);
}
-/**
- * Calculate a normalized 3d direction vector from the viewpoint towards a global location.
- * In orthographic view the resulting vector will match the view vector.
- * \param rv3d: The region (used for the window width and height).
- * \param coord: The world-space location.
- * \param vec: The resulting normalized vector.
- */
void ED_view3d_global_to_vector(const RegionView3D *rv3d, const float coord[3], float vec[3])
{
if (rv3d->is_persp) {
@@ -536,13 +471,6 @@ bool view3d_get_view_aligned_coordinate(ARegion *region,
}
#endif
-/**
- * Calculate a 3d location from 2d window coordinates.
- * \param region: The region (used for the window width and height).
- * \param depth_pt: The reference location used to calculate the Z depth.
- * \param mval: The area relative location (such as event->mval converted to floats).
- * \param r_out: The resulting world-space location.
- */
void ED_view3d_win_to_3d(const View3D *v3d,
const ARegion *region,
const float depth_pt[3],
@@ -636,13 +564,6 @@ bool ED_view3d_win_to_3d_on_plane_int(const ARegion *region,
return ED_view3d_win_to_3d_on_plane(region, plane, mval_fl, do_clip, r_out);
}
-/**
- * A wrapper for #ED_view3d_win_to_3d_on_plane that projects onto \a plane_fallback
- * then maps this back to \a plane.
- *
- * This is intended to be used when \a plane is orthogonal to the views Z axis where
- * projecting the \a mval doesn't work well (or fail completely when exactly aligned).
- */
bool ED_view3d_win_to_3d_on_plane_with_fallback(const ARegion *region,
const float plane[4],
const float mval[2],
@@ -678,14 +599,6 @@ bool ED_view3d_win_to_3d_on_plane_with_fallback(const ARegion *region,
return true;
}
-/**
- * Calculate a 3d difference vector from 2d window offset.
- * note that #ED_view3d_calc_zfac() must be called first to determine
- * the depth used to calculate the delta.
- * \param region: The region (used for the window width and height).
- * \param mval: The area relative 2d difference (such as event->mval[0] - other_x).
- * \param out: The resulting world-space delta.
- */
void ED_view3d_win_to_delta(const ARegion *region,
const float mval[2],
float out[3],
@@ -702,16 +615,6 @@ void ED_view3d_win_to_delta(const ARegion *region,
out[2] = (rv3d->persinv[0][2] * dx + rv3d->persinv[1][2] * dy);
}
-/**
- * Calculate a 3d origin from 2d window coordinates.
- * \note Orthographic views have a less obvious origin,
- * Since far clip can be a very large value resulting in numeric precision issues,
- * the origin in this case is close to zero coordinate.
- *
- * \param region: The region (used for the window width and height).
- * \param mval: The area relative 2d location (such as event->mval converted to floats).
- * \param out: The resulting normalized world-space direction vector.
- */
void ED_view3d_win_to_origin(const ARegion *region, const float mval[2], float out[3])
{
RegionView3D *rv3d = region->regiondata;
@@ -733,19 +636,6 @@ void ED_view3d_win_to_origin(const ARegion *region, const float mval[2], float o
}
}
-/**
- * Calculate a 3d direction vector from 2d window coordinates.
- * This direction vector starts and the view in the direction of the 2d window coordinates.
- * In orthographic view all window coordinates yield the same vector.
- *
- * \note doesn't rely on ED_view3d_calc_zfac
- * for perspective view, get the vector direction to
- * the mouse cursor as a normalized vector.
- *
- * \param region: The region (used for the window width and height).
- * \param mval: The area relative 2d location (such as event->mval converted to floats).
- * \param out: The resulting normalized world-space direction vector.
- */
void ED_view3d_win_to_vector(const ARegion *region, const float mval[2], float out[3])
{
RegionView3D *rv3d = region->regiondata;
@@ -763,20 +653,6 @@ void ED_view3d_win_to_vector(const ARegion *region, const float mval[2], float o
normalize_v3(out);
}
-/**
- * Calculate a 3d segment from 2d window coordinates.
- * This ray_start is located at the viewpoint, ray_end is a far point.
- * ray_start and ray_end are clipped by the view near and far limits
- * so points along this line are always in view.
- * In orthographic view all resulting segments will be parallel.
- * \param region: The region (used for the window width and height).
- * \param v3d: The 3d viewport (used for near and far clipping range).
- * \param mval: The area relative 2d location (such as event->mval, converted into float[2]).
- * \param r_ray_start: The world-space starting point of the segment.
- * \param r_ray_end: The world-space end point of the segment.
- * \param do_clip_planes: Optionally clip the ray by the view clipping planes.
- * \return success, false if the segment is totally clipped.
- */
bool ED_view3d_win_to_segment_clipped(struct Depsgraph *depsgraph,
const ARegion *region,
View3D *v3d,
@@ -817,9 +693,6 @@ void ED_view3d_ob_project_mat_get_from_obmat(const RegionView3D *rv3d,
mul_m4_m4m4(r_pmat, rv3d->winmat, vmat);
}
-/**
- * Convert between region relative coordinates (x,y) and depth component z and
- * a point in world space. */
void ED_view3d_project_v3(const struct ARegion *region, const float world[3], float r_region_co[3])
{
/* Viewport is set up to make coordinates relative to the region, not window. */
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 8d441b08205..cc8aac21a6e 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -119,9 +119,10 @@ float ED_view3d_select_dist_px(void)
return 75.0f * U.pixelsize;
}
-/* TODO: should return whether there is valid context to continue */
void ED_view3d_viewcontext_init(bContext *C, ViewContext *vc, Depsgraph *depsgraph)
{
+ /* TODO: should return whether there is valid context to continue. */
+
memset(vc, 0, sizeof(ViewContext));
vc->C = C;
vc->region = CTX_wm_region(C);
@@ -2195,7 +2196,6 @@ static Base *ed_view3d_give_base_under_cursor_ex(bContext *C,
return basact;
}
-/* mval comes from event->mval, only use within region handlers */
Base *ED_view3d_give_base_under_cursor(bContext *C, const int mval[2])
{
return ed_view3d_give_base_under_cursor_ex(C, mval, NULL);
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index 583a9ad75c2..53bd181f544 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -1013,10 +1013,6 @@ void VIEW3D_OT_snap_cursor_to_center(wmOperatorType *ot)
/** \name Min/Max Object Vertices Utility
* \{ */
-/**
- * Calculates the bounding box corners (min and max) for \a obedit.
- * The returned values are in global space.
- */
bool ED_view3d_minmax_verts(Object *obedit, float r_min[3], float r_max[3])
{
TransVertStore tvs = {NULL};
diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c
index f01955a6468..8b75ce63cde 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -122,9 +122,6 @@ void ED_view3d_dist_range_get(const View3D *v3d, float r_dist_range[2])
r_dist_range[1] = v3d->clip_end * 10.0f;
}
-/**
- * \note copies logic of #ED_view3d_viewplane_get(), keep in sync.
- */
bool ED_view3d_clip_range_get(Depsgraph *depsgraph,
const View3D *v3d,
const RegionView3D *rv3d,
@@ -191,10 +188,6 @@ bool ED_view3d_viewplane_get(Depsgraph *depsgraph,
/** \name View State/Context Utilities
* \{ */
-/**
- * Use this call when executing an operator,
- * event system doesn't set for each event the OpenGL drawing context.
- */
void view3d_operator_needs_opengl(const bContext *C)
{
wmWindow *win = CTX_wm_window(C);
@@ -218,9 +211,6 @@ void view3d_region_operator_needs_opengl(wmWindow *UNUSED(win), ARegion *region)
}
}
-/**
- * Use instead of: `GPU_polygon_offset(rv3d->dist, ...)` see bug T37727.
- */
void ED_view3d_polygon_offset(const RegionView3D *rv3d, const float dist)
{
if (rv3d->rflag & RV3D_ZOFFSET_DISABLED) {
@@ -339,18 +329,6 @@ static void points_in_planes_minmax_fn(
minmax_v3v3_v3(user_data->min, user_data->max, co);
}
-/**
- * Clamp min/max by the viewport clipping.
- *
- * \note This is an approximation, with the limitation that the bounding box from the (mix, max)
- * calculation might not have any geometry inside the clipped region.
- * Performing a clipping test on each vertex would work well enough for most cases,
- * although it's not perfect either as edges/faces may intersect the clipping without having any
- * of their vertices inside it.
- * A more accurate result would be quite involved.
- *
- * \return True when the arguments were clamped.
- */
bool ED_view3d_clipping_clamp_minmax(const RegionView3D *rv3d, float min[3], float max[3])
{
/* 6 planes for the cube, 4..6 for the current view clipping planes. */
@@ -481,9 +459,6 @@ bool ED_view3d_offset_lock_check(const View3D *v3d, const RegionView3D *rv3d)
return (rv3d->persp != RV3D_CAMOB) && (v3d->ob_center_cursor || v3d->ob_center);
}
-/**
- * Use to store the last view, before entering camera view.
- */
void ED_view3d_lastview_store(RegionView3D *rv3d)
{
copy_qt_qt(rv3d->lviewquat, rv3d->viewquat);
@@ -503,13 +478,6 @@ void ED_view3d_lock_clear(View3D *v3d)
v3d->flag2 &= ~V3D_LOCK_CAMERA;
}
-/**
- * For viewport operators that exit camera perspective.
- *
- * \note This differs from simply setting `rv3d->persp = persp` because it
- * sets the `ofs` and `dist` values of the viewport so it matches the camera,
- * otherwise switching out of camera view may jump to a different part of the scene.
- */
void ED_view3d_persp_switch_from_camera(const Depsgraph *depsgraph,
View3D *v3d,
RegionView3D *rv3d,
@@ -528,12 +496,6 @@ void ED_view3d_persp_switch_from_camera(const Depsgraph *depsgraph,
rv3d->persp = persp;
}
}
-/**
- * Action to take when rotating the view,
- * handle auto-perspective and logic for switching out of views.
- *
- * shared with NDOF.
- */
bool ED_view3d_persp_ensure(const Depsgraph *depsgraph, View3D *v3d, ARegion *region)
{
RegionView3D *rv3d = region->regiondata;
@@ -569,19 +531,12 @@ bool ED_view3d_persp_ensure(const Depsgraph *depsgraph, View3D *v3d, ARegion *re
* Lock the camera to the 3D Viewport, allowing view manipulation to transform the camera.
* \{ */
-/**
- * \return true when the 3D Viewport is locked to its camera.
- */
bool ED_view3d_camera_lock_check(const View3D *v3d, const RegionView3D *rv3d)
{
return ((v3d->camera) && (!ID_IS_LINKED(v3d->camera)) && (v3d->flag2 & V3D_LOCK_CAMERA) &&
(rv3d->persp == RV3D_CAMOB));
}
-/**
- * Apply the camera object transformation to the 3D Viewport.
- * (needed so we can use regular 3D Viewport manipulation operators, that sync back to the camera).
- */
void ED_view3d_camera_lock_init_ex(const Depsgraph *depsgraph,
View3D *v3d,
RegionView3D *rv3d,
@@ -603,11 +558,6 @@ void ED_view3d_camera_lock_init(const Depsgraph *depsgraph, View3D *v3d, RegionV
ED_view3d_camera_lock_init_ex(depsgraph, v3d, rv3d, true);
}
-/**
- * Apply the 3D Viewport transformation back to the camera object.
- *
- * \return true if the camera is moved.
- */
bool ED_view3d_camera_lock_sync(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
{
if (ED_view3d_camera_lock_check(v3d, rv3d)) {
@@ -701,12 +651,6 @@ bool ED_view3d_camera_autokey(const Scene *scene,
return false;
}
-/**
- * Call after modifying a locked view.
- *
- * \note Not every view edit currently auto-keys (num-pad for eg),
- * this is complicated because of smooth-view.
- */
bool ED_view3d_camera_lock_autokey(View3D *v3d,
RegionView3D *rv3d,
struct bContext *C,
@@ -885,7 +829,6 @@ static void view3d_boxview_sync_axis(RegionView3D *rv3d_dst, RegionView3D *rv3d_
}
}
-/* sync center/zoom view of region to others, for view transforms */
void view3d_boxview_sync(ScrArea *area, ARegion *region)
{
RegionView3D *rv3d = region->regiondata;
@@ -910,7 +853,6 @@ void view3d_boxview_sync(ScrArea *area, ARegion *region)
}
}
-/* for home, center etc */
void view3d_boxview_copy(ScrArea *area, ARegion *region)
{
RegionView3D *rv3d = region->regiondata;
@@ -935,7 +877,6 @@ void view3d_boxview_copy(ScrArea *area, ARegion *region)
}
}
-/* 'clip' is used to know if our clip setting has changed */
void ED_view3d_quadview_update(ScrArea *area, ARegion *region, bool do_clip)
{
ARegion *region_sync = NULL;
@@ -1023,14 +964,6 @@ static float view_autodist_depth_margin(ARegion *region, const int mval[2], int
return depth_close;
}
-/**
- * Get the world-space 3d location from a screen-space 2d point.
- * TODO: Implement #alphaoverride. We don't want to zoom into billboards.
- *
- * \param mval: Input screen-space pixel location.
- * \param mouse_worldloc: Output world-space location.
- * \param fallback_depth_pt: Use this points depth when no depth can be found.
- */
bool ED_view3d_autodist(Depsgraph *depsgraph,
ARegion *region,
View3D *v3d,
@@ -1069,7 +1002,6 @@ bool ED_view3d_autodist(Depsgraph *depsgraph,
return false;
}
-/* no 4x4 sampling, run #ED_view3d_depth_override first */
bool ED_view3d_autodist_simple(ARegion *region,
const int mval[2],
float mouse_worldloc[3],
@@ -1157,31 +1089,6 @@ float ED_view3d_radius_to_dist_ortho(const float lens, const float radius)
return radius / (DEFAULT_SENSOR_WIDTH / lens);
}
-/**
- * Return a new RegionView3D.dist value to fit the \a radius.
- *
- * \note Depth isn't taken into account, this will fit a flat plane exactly,
- * but points towards the view (with a perspective projection),
- * may be within the radius but outside the view. eg:
- *
- * <pre>
- * +
- * pt --> + /^ radius
- * / |
- * / |
- * view + +
- * \ |
- * \ |
- * \|
- * +
- * </pre>
- *
- * \param region: Can be NULL if \a use_aspect is false.
- * \param persp: Allow the caller to tell what kind of perspective to use (ortho/view/camera)
- * \param use_aspect: Increase the distance to account for non 1:1 view aspect.
- * \param radius: The radius will be fitted exactly,
- * typically pre-scaled by a margin (#VIEW3D_MARGIN).
- */
float ED_view3d_radius_to_dist(const View3D *v3d,
const ARegion *region,
const struct Depsgraph *depsgraph,
@@ -1262,18 +1169,6 @@ float ED_view3d_radius_to_dist(const View3D *v3d,
/** \name View Distance Utilities
* \{ */
-/**
- * This function solves the problem of having to switch between camera and non-camera views.
- *
- * When viewing from the perspective of \a mat, and having the view center \a ofs,
- * this calculates a distance from \a ofs to the matrix \a mat.
- * Using \a fallback_dist when the distance would be too small.
- *
- * \param mat: A matrix use for the view-point (typically the camera objects matrix).
- * \param ofs: Orbit center (negated), matching #RegionView3D.ofs, which is typically passed in.
- * \param fallback_dist: The distance to use if the object is too near or in front of \a ofs.
- * \returns A newly calculated distance or the fallback.
- */
float ED_view3d_offset_distance(const float mat[4][4],
const float ofs[3],
const float fallback_dist)
@@ -1295,11 +1190,6 @@ float ED_view3d_offset_distance(const float mat[4][4],
return dist;
}
-/**
- * Set the dist without moving the view (compensate with #RegionView3D.ofs)
- *
- * \note take care that viewinv is up to date, #ED_view3d_update_viewmat first.
- */
void ED_view3d_distance_set(RegionView3D *rv3d, const float dist)
{
float viewinv[4];
@@ -1320,13 +1210,6 @@ void ED_view3d_distance_set(RegionView3D *rv3d, const float dist)
rv3d->dist = dist;
}
-/**
- * Change the distance & offset to match the depth of \a dist_co along the view axis.
- *
- * \param dist_co: A world-space location to use for the new depth.
- * \param dist_min: Resulting distances below this will be ignored.
- * \return Success if the distance was set.
- */
bool ED_view3d_distance_set_from_location(RegionView3D *rv3d,
const float dist_co[3],
const float dist_min)
@@ -1485,14 +1368,6 @@ bool ED_view3d_lock(RegionView3D *rv3d)
/** \name View Transform Utilities
* \{ */
-/**
- * Set the view transformation from a 4x4 matrix.
- *
- * \param mat: The view 4x4 transformation matrix to assign.
- * \param ofs: The view offset, normally from RegionView3D.ofs.
- * \param quat: The view rotation, quaternion normally from RegionView3D.viewquat.
- * \param dist: The view distance from ofs, normally from RegionView3D.dist.
- */
void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const float *dist)
{
float nmat[3][3];
@@ -1519,14 +1394,6 @@ void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const
}
}
-/**
- * Calculate the view transformation matrix from RegionView3D input.
- * The resulting matrix is equivalent to RegionView3D.viewinv
- * \param mat: The view 4x4 transformation matrix to calculate.
- * \param ofs: The view offset, normally from RegionView3D.ofs.
- * \param quat: The view rotation, quaternion normally from RegionView3D.viewquat.
- * \param dist: The view distance from ofs, normally from RegionView3D.dist.
- */
void ED_view3d_to_m4(float mat[4][4], const float ofs[3], const float quat[4], const float dist)
{
const float iviewquat[4] = {-quat[0], quat[1], quat[2], quat[3]};
@@ -1537,14 +1404,6 @@ void ED_view3d_to_m4(float mat[4][4], const float ofs[3], const float quat[4], c
sub_v3_v3v3(mat[3], dvec, ofs);
}
-/**
- * Set the RegionView3D members from an objects transformation and optionally lens.
- * \param ob: The object to set the view to.
- * \param ofs: The view offset to be set, normally from RegionView3D.ofs.
- * \param quat: The view rotation to be set, quaternion normally from RegionView3D.viewquat.
- * \param dist: The view distance from ofs to be set, normally from RegionView3D.dist.
- * \param lens: The view lens angle set for cameras and lights, normally from View3D.lens.
- */
void ED_view3d_from_object(const Object *ob, float ofs[3], float quat[4], float *dist, float *lens)
{
ED_view3d_from_m4(ob->obmat, ofs, quat, dist);
@@ -1558,15 +1417,6 @@ void ED_view3d_from_object(const Object *ob, float ofs[3], float quat[4], float
}
}
-/**
- * Set the object transformation from RegionView3D members.
- * \param depsgraph: The depsgraph to get the evaluated object parent
- * for the transformation calculation.
- * \param ob: The object which has the transformation assigned.
- * \param ofs: The view offset, normally from RegionView3D.ofs.
- * \param quat: The view rotation, quaternion normally from RegionView3D.viewquat.
- * \param dist: The view distance from ofs, normally from RegionView3D.dist.
- */
void ED_view3d_to_object(const Depsgraph *depsgraph,
Object *ob,
const float ofs[3],
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 6f0ce6c9326..e5794eb8401 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -123,7 +123,6 @@ static void view3d_smooth_view_state_restore(const struct SmoothView3DState *sms
}
/* will start timer if appropriate */
-/* the arguments are the desired situation */
void ED_view3d_smooth_view_ex(
/* avoid passing in the context */
const Depsgraph *depsgraph,
@@ -407,10 +406,6 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), const w
return OPERATOR_FINISHED;
}
-/**
- * Apply the smooth-view immediately, use when we need to start a new view operation.
- * (so we don't end up half-applying a view operation when pressing keys quickly).
- */
void ED_view3d_smooth_view_force_finish(bContext *C, View3D *v3d, ARegion *region)
{
RegionView3D *rv3d = region->regiondata;
@@ -696,9 +691,6 @@ void VIEW3D_OT_object_as_camera(wmOperatorType *ot)
/** \name Window and View Matrix Calculation
* \{ */
-/**
- * \param rect: optional for picking (can be NULL).
- */
void view3d_winmatrix_set(Depsgraph *depsgraph,
ARegion *region,
const View3D *v3d,
@@ -761,18 +753,6 @@ static void obmat_to_viewmat(RegionView3D *rv3d, Object *ob)
mat4_normalized_to_quat(rv3d->viewquat, rv3d->viewmat);
}
-/**
- * Sets #RegionView3D.viewmat
- *
- * \param depsgraph: Depsgraph.
- * \param scene: Scene for camera and cursor location.
- * \param v3d: View 3D space data.
- * \param rv3d: 3D region which stores the final matrices.
- * \param rect_scale: Optional 2D scale argument,
- * Use when displaying a sub-region, eg: when #view3d_winmatrix_set takes a 'rect' argument.
- *
- * \note don't set windows active in here, is used by renderwin too.
- */
void view3d_viewmatrix_set(Depsgraph *depsgraph,
const Scene *scene,
const View3D *v3d,
@@ -862,11 +842,6 @@ void view3d_viewmatrix_set(Depsgraph *depsgraph,
/** \name OpenGL Select Utilities
* \{ */
-/**
- * Optionally cache data for multiple calls to #view3d_opengl_select
- *
- * just avoid GPU_select headers outside this file
- */
void view3d_opengl_select_cache_begin(void)
{
GPU_select_cache_begin();
@@ -943,13 +918,6 @@ static bool drw_select_filter_object_mode_lock_for_weight_paint(Object *ob, void
return ob_pose_list && (BLI_linklist_index(ob_pose_list, DEG_get_original_object(ob)) != -1);
}
-/**
- * \warning be sure to account for a negative return value
- * This is an error, "Too many objects in select buffer"
- * and no action should be taken (can crash blender) if this happens
- *
- * \note (vc->obedit == NULL) can be set to explicitly skip edit-object selection.
- */
int view3d_opengl_select_ex(ViewContext *vc,
uint *buffer,
uint bufsize,
@@ -1621,11 +1589,6 @@ static void view3d_local_collections_reset(Main *bmain, const uint local_view_bi
}
}
-/**
- * See if current uuid is valid, otherwise set a valid uuid to v3d,
- * Try to keep the same uuid previously used to allow users to
- * quickly toggle back and forth.
- */
bool ED_view3d_local_collections_set(Main *bmain, struct View3D *v3d)
{
if ((v3d->flag & V3D_LOCAL_COLLECTIONS) == 0) {