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:
authorCampbell Barton <ideasman42@gmail.com>2019-02-16 04:21:44 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-16 04:26:07 +0300
commit2f737c4f475a5625f9140b84ffd55435ca2fd805 (patch)
tree900754833493ba12e26aefdeb9fde9bd1776b4cb /source/blender/editors
parentec471a9b1c14ea5dcb855de7e570e27ad70661c5 (diff)
DNA: rename near/far -> clip_start/clip_end
Rename for Camera, View3D (also CameraParams & Render not DNA)
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/gpencil/gpencil_fill.c10
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c16
-rw-r--r--source/blender/editors/space_image/image_draw.c12
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c18
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_project.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_utils.c22
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c2
-rw-r--r--source/blender/editors/transform/transform.c6
-rw-r--r--source/blender/editors/transform/transform_constraints.c2
-rw-r--r--source/blender/editors/transform/transform_generics.c2
13 files changed, 52 insertions, 50 deletions
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 4069a6a9fcf..649b4c7f911 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -315,14 +315,16 @@ static void gp_render_offscreen(tGPDfill *tgpf)
ImBuf *ibuf = IMB_allocImBuf(tgpf->sizex, tgpf->sizey, 32, flag);
rctf viewplane;
- float clipsta, clipend;
+ float clip_start, clip_end;
- is_ortho = ED_view3d_viewplane_get(tgpf->depsgraph, tgpf->v3d, tgpf->rv3d, tgpf->sizex, tgpf->sizey, &viewplane, &clipsta, &clipend, NULL);
+ is_ortho = ED_view3d_viewplane_get(
+ tgpf->depsgraph, tgpf->v3d, tgpf->rv3d, tgpf->sizex, tgpf->sizey,
+ &viewplane, &clip_start, &clip_end, NULL);
if (is_ortho) {
- orthographic_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, -clipend, clipend);
+ orthographic_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, -clip_end, clip_end);
}
else {
- perspective_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend);
+ perspective_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clip_start, clip_end);
}
/* set temporary new size */
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 814c1581f77..3f2ad33ed8c 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -1448,7 +1448,7 @@ static bool point_is_visible(
/* avoid projecting behind the viewpoint */
if (kcd->is_ortho && (kcd->vc.rv3d->persp != RV3D_CAMOB)) {
- dist = kcd->vc.v3d->far * 2.0f;
+ dist = kcd->vc.v3d->clip_end * 2.0f;
}
if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index d87b6c860ba..cd0023eaced 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -166,7 +166,7 @@ BLI_INLINE unsigned char f_to_char(const float val)
#define PROJ_SRC_VIEW_FILL 4
#define PROJ_VIEW_DATA_ID "view_data"
-/* viewmat + winmat + clipsta + clipend + is_ortho */
+/* viewmat + winmat + clip_start + clip_end + is_ortho */
#define PROJ_VIEW_DATA_SIZE (4 * 4 + 4 * 4 + 3)
#define PROJ_BUCKET_NULL 0
@@ -337,7 +337,7 @@ typedef struct ProjPaintState {
float viewDir[3];
/** View location in object relative 3D space, so can compare to verts. */
float viewPos[3];
- float clipsta, clipend;
+ float clip_start, clip_end;
/* reproject vars */
Image *reproject_image;
@@ -3254,7 +3254,7 @@ static void proj_paint_state_viewport_init(ProjPaintState *ps, const char symmet
ED_view3d_ob_project_mat_get_from_obmat(ps->rv3d, ps->obmat, ps->projectMat);
- ps->is_ortho = ED_view3d_clip_range_get(ps->depsgraph, ps->v3d, ps->rv3d, &ps->clipsta, &ps->clipend, true);
+ ps->is_ortho = ED_view3d_clip_range_get(ps->depsgraph, ps->v3d, ps->rv3d, &ps->clip_start, &ps->clip_end, true);
}
else {
/* re-projection */
@@ -3274,8 +3274,8 @@ static void proj_paint_state_viewport_init(ProjPaintState *ps, const char symmet
/* use image array, written when creating image */
memcpy(winmat, array, sizeof(winmat)); array += sizeof(winmat) / sizeof(float);
memcpy(viewmat, array, sizeof(viewmat)); array += sizeof(viewmat) / sizeof(float);
- ps->clipsta = array[0];
- ps->clipend = array[1];
+ ps->clip_start = array[0];
+ ps->clip_end = array[1];
ps->is_ortho = array[2] ? 1 : 0;
invert_m4_m4(viewinv, viewmat);
@@ -3296,8 +3296,8 @@ static void proj_paint_state_viewport_init(ProjPaintState *ps, const char symmet
BKE_camera_params_compute_matrix(&params);
copy_m4_m4(winmat, params.winmat);
- ps->clipsta = params.clipsta;
- ps->clipend = params.clipend;
+ ps->clip_start = params.clip_start;
+ ps->clip_end = params.clip_end;
ps->is_ortho = params.is_ortho;
}
else {
@@ -3358,7 +3358,7 @@ static void proj_paint_state_screen_coords_init(ProjPaintState *ps, const int di
mul_m4_v4(ps->projectMat, projScreenCo);
- if (projScreenCo[3] > ps->clipsta) {
+ if (projScreenCo[3] > ps->clip_start) {
/* screen space, not clamped */
projScreenCo[0] = (float)(ps->winx * 0.5f) + (ps->winx * 0.5f) * projScreenCo[0] / projScreenCo[3];
projScreenCo[1] = (float)(ps->winy * 0.5f) + (ps->winy * 0.5f) * projScreenCo[1] / projScreenCo[3];
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 9ddd5c2d2aa..51715fae20e 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -436,24 +436,24 @@ static void sima_draw_zbuf_pixels(float x1, float y1, int rectx, int recty, int
static void sima_draw_zbuffloat_pixels(Scene *scene, float x1, float y1, int rectx, int recty,
float *rect_float, float zoomx, float zoomy)
{
- float bias, scale, *rectf, clipend;
+ float bias, scale, *rectf, clip_end;
int a;
float red[4] = {1.0f, 0.0f, 0.0f, 0.0f};
if (scene->camera && scene->camera->type == OB_CAMERA) {
- bias = ((Camera *)scene->camera->data)->clipsta;
- clipend = ((Camera *)scene->camera->data)->clipend;
- scale = 1.0f / (clipend - bias);
+ bias = ((Camera *)scene->camera->data)->clip_start;
+ clip_end = ((Camera *)scene->camera->data)->clip_end;
+ scale = 1.0f / (clip_end - bias);
}
else {
bias = 0.1f;
scale = 0.01f;
- clipend = 100.0f;
+ clip_end = 100.0f;
}
rectf = MEM_mallocN(rectx * recty * sizeof(float), "temp");
for (a = rectx * recty - 1; a >= 0; a--) {
- if (rect_float[a] > clipend)
+ if (rect_float[a] > clip_end)
rectf[a] = 0.0f;
else if (rect_float[a] < bias)
rectf[a] = 1.0f;
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 7648a67da8b..f0f80cf2bee 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -338,8 +338,8 @@ static SpaceLink *view3d_new(const ScrArea *UNUSED(sa), const Scene *scene)
v3d->flag2 = V3D_SHOW_RECONSTRUCTION | V3D_SHOW_ANNOTATION;
v3d->lens = 50.0f;
- v3d->near = 0.01f;
- v3d->far = 1000.0f;
+ v3d->clip_start = 0.01f;
+ v3d->clip_end = 1000.0f;
v3d->overlay.gpencil_paper_opacity = 0.5f;
v3d->overlay.gpencil_grid_opacity = 0.9f;
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index a8a6187a347..428e7e7a76e 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -312,8 +312,8 @@ static void view3d_camera_border(
/* get camera viewplane */
BKE_camera_params_init(&params);
/* fallback for non camera objects */
- params.clipsta = v3d->near;
- params.clipend = v3d->far;
+ params.clip_start = v3d->clip_start;
+ params.clip_end = v3d->clip_end;
BKE_camera_params_from_object(&params, camera_eval);
if (no_shift) {
params.shiftx = 0.0f;
@@ -1517,8 +1517,8 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(
BKE_camera_params_init(&params);
/* fallback for non camera objects */
- params.clipsta = v3d->near;
- params.clipend = v3d->far;
+ params.clip_start = v3d->clip_start;
+ params.clip_end = v3d->clip_end;
BKE_camera_params_from_object(&params, camera_eval);
BKE_camera_multiview_params(&scene->r, &params, camera_eval, viewname);
BKE_camera_params_compute_viewplane(&params, sizex, sizey, scene->r.xasp, scene->r.yasp);
@@ -1531,14 +1531,14 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(
}
else {
rctf viewplane;
- float clipsta, clipend;
+ float clip_start, clipend;
- is_ortho = ED_view3d_viewplane_get(depsgraph, v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend, NULL);
+ is_ortho = ED_view3d_viewplane_get(depsgraph, v3d, rv3d, sizex, sizey, &viewplane, &clip_start, &clipend, NULL);
if (is_ortho) {
orthographic_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, -clipend, clipend);
}
else {
- perspective_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend);
+ perspective_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clip_start, clipend);
}
}
@@ -1705,8 +1705,8 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(
BKE_camera_params_compute_matrix(&params);
copy_m4_m4(rv3d.winmat, params.winmat);
- v3d.near = params.clipsta;
- v3d.far = params.clipend;
+ v3d.clip_start = params.clip_start;
+ v3d.clip_end = params.clip_end;
v3d.lens = params.lens;
}
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 4e04de36dfd..6994b048698 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -2639,7 +2639,7 @@ static void view3d_from_minmax(
new_dist = ED_view3d_radius_to_dist(v3d, ar, CTX_data_depsgraph(C), persp, true, (size / 2) * VIEW3D_MARGIN);
if (rv3d->is_persp) {
/* don't zoom closer than the near clipping plane */
- new_dist = max_ff(new_dist, v3d->near * 1.5f);
+ new_dist = max_ff(new_dist, v3d->clip_start * 1.5f);
}
}
}
@@ -3438,7 +3438,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
new_dist = len_v3(dvec);
/* ignore dist_range min */
- dist_range[0] = v3d->near * 1.5f;
+ dist_range[0] = v3d->clip_start * 1.5f;
}
else { /* othographic */
/* find the current window width and height */
diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c
index baee99663bd..b22f4edcba5 100644
--- a/source/blender/editors/space_view3d/view3d_project.c
+++ b/source/blender/editors/space_view3d/view3d_project.c
@@ -321,7 +321,7 @@ static void view3d_win_to_ray_segment(
ED_view3d_win_to_vector(ar, mval, r_ray_dir);
if ((rv3d->is_persp == false) && (rv3d->persp != RV3D_CAMOB)) {
- end_offset = v3d->far / 2.0f;
+ end_offset = v3d->clip_end / 2.0f;
start_offset = -end_offset;
}
else {
diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c
index 08eceb8ebc3..7c49ea061cc 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -114,7 +114,7 @@ void ED_view3d_dist_range_get(
float r_dist_range[2])
{
r_dist_range[0] = v3d->grid * 0.001f;
- r_dist_range[1] = v3d->far * 10.0f;
+ r_dist_range[1] = v3d->clip_end * 10.0f;
}
/**
@@ -132,13 +132,13 @@ bool ED_view3d_clip_range_get(
BKE_camera_params_from_view3d(&params, depsgraph, v3d, rv3d);
if (use_ortho_factor && params.is_ortho) {
- const float fac = 2.0f / (params.clipend - params.clipsta);
- params.clipsta *= fac;
- params.clipend *= fac;
+ const float fac = 2.0f / (params.clip_end - params.clip_start);
+ params.clip_start *= fac;
+ params.clip_end *= fac;
}
- if (r_clipsta) *r_clipsta = params.clipsta;
- if (r_clipend) *r_clipend = params.clipend;
+ if (r_clipsta) *r_clipsta = params.clip_start;
+ if (r_clipend) *r_clipend = params.clip_end;
return params.is_ortho;
}
@@ -146,7 +146,7 @@ bool ED_view3d_clip_range_get(
bool ED_view3d_viewplane_get(
Depsgraph *depsgraph,
const View3D *v3d, const RegionView3D *rv3d, int winx, int winy,
- rctf *r_viewplane, float *r_clipsta, float *r_clipend, float *r_pixsize)
+ rctf *r_viewplane, float *r_clip_start, float *r_clip_end, float *r_pixsize)
{
CameraParams params;
@@ -155,8 +155,8 @@ bool ED_view3d_viewplane_get(
BKE_camera_params_compute_viewplane(&params, winx, winy, 1.0f, 1.0f);
if (r_viewplane) *r_viewplane = params.viewplane;
- if (r_clipsta) *r_clipsta = params.clipsta;
- if (r_clipend) *r_clipend = params.clipend;
+ if (r_clip_start) *r_clip_start = params.clip_start;
+ if (r_clip_end) *r_clip_end = params.clip_end;
if (r_pixsize) *r_pixsize = params.viewdx;
return params.is_ortho;
@@ -1090,8 +1090,8 @@ float ED_view3d_radius_to_dist(
if (persp == RV3D_CAMOB) {
CameraParams params;
BKE_camera_params_init(&params);
- params.clipsta = v3d->near;
- params.clipend = v3d->far;
+ params.clip_start = v3d->clip_start;
+ params.clip_end = v3d->clip_end;
Object *camera_eval = DEG_get_evaluated_object(depsgraph, v3d->camera);
BKE_camera_params_from_object(&params, camera_eval);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index da12c6357d6..aa2867390ba 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1233,7 +1233,7 @@ static bool view3d_localview_init(
if (rv3d->persp == RV3D_PERSP) {
/* Don't zoom closer than the near clipping plane. */
- dist_new = max_ff(dist_new, v3d->near * 1.5f);
+ dist_new = max_ff(dist_new, v3d->clip_start * 1.5f);
}
}
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index bcd6ae8426e..7e479217997 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1261,7 +1261,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
float fac = 1.0f + 0.005f *(event->y - event->prevy);
t->prop_size *= fac;
if (t->spacetype == SPACE_VIEW3D && t->persp != RV3D_ORTHO) {
- t->prop_size = max_ff(min_ff(t->prop_size, ((View3D *)t->view)->far), T_PROP_SIZE_MIN);
+ t->prop_size = max_ff(min_ff(t->prop_size, ((View3D *)t->view)->clip_end), T_PROP_SIZE_MIN);
}
else {
t->prop_size = max_ff(min_ff(t->prop_size, T_PROP_SIZE_MAX), T_PROP_SIZE_MIN);
@@ -1275,7 +1275,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
if (t->flag & T_PROP_EDIT) {
t->prop_size *= (t->modifiers & MOD_PRECISION) ? 1.01f : 1.1f;
if (t->spacetype == SPACE_VIEW3D && t->persp != RV3D_ORTHO) {
- t->prop_size = min_ff(t->prop_size, ((View3D *)t->view)->far);
+ t->prop_size = min_ff(t->prop_size, ((View3D *)t->view)->clip_end);
}
else {
t->prop_size = min_ff(t->prop_size, T_PROP_SIZE_MAX);
@@ -1465,7 +1465,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
if (event->alt && t->flag & T_PROP_EDIT) {
t->prop_size *= (t->modifiers & MOD_PRECISION) ? 1.01f : 1.1f;
if (t->spacetype == SPACE_VIEW3D && t->persp != RV3D_ORTHO)
- t->prop_size = min_ff(t->prop_size, ((View3D *)t->view)->far);
+ t->prop_size = min_ff(t->prop_size, ((View3D *)t->view)->clip_end);
calculatePropRatio(t);
t->redraw = TREDRAW_HARD;
handled = true;
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index b0ce411ca23..239b18cba2b 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -167,7 +167,7 @@ static void viewAxisCorrectCenter(const TransInfo *t, float t_con_center[3])
{
if (t->spacetype == SPACE_VIEW3D) {
// View3D *v3d = t->sa->spacedata.first;
- const float min_dist = 1.0f; /* v3d->near; */
+ const float min_dist = 1.0f; /* v3d->clip_start; */
float dir[3];
float l;
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 20d3245779e..6e6bd4e13dd 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1142,7 +1142,7 @@ void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis
GPU_matrix_push();
copy_v3_v3(v3, dir);
- mul_v3_fl(v3, v3d->far);
+ mul_v3_fl(v3, v3d->clip_end);
sub_v3_v3v3(v2, center, v3);
add_v3_v3v3(v1, center, v3);