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>2013-12-09 10:03:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-12-09 14:20:07 +0400
commit75348e6c132bca89aa70c2eb7e093ec55c07ad73 (patch)
tree58a35bcf92085dc09c16dae69ed7bbaa3c430028 /source/blender/editors/space_view3d
parent793b73edc269e7e801c2e72f4ae6d11951608f74 (diff)
View3D API: rename view3d_camera_get to ED_view3d_camera_data_get
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c10
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c10
2 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 19329765e1e..9dd6ab8f841 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -2996,12 +2996,12 @@ static void view3d_main_area_draw_engine_info(View3D *v3d, RegionView3D *rv3d, A
/* draw darkened background color. no alpha because border render does
* partial redraw and will not redraw the area behind this info bar */
float alpha = 1.0f - fill_color[3];
-
- if (rv3d->persp == RV3D_CAMOB && v3d->camera && v3d->camera->type == OB_CAMERA) {
- Camera *ca = v3d->camera->data;
+ Camera *camera = ED_view3d_camera_data_get(v3d, rv3d);
- if (ca && (ca->flag & CAM_SHOWPASSEPARTOUT))
- alpha *= (1.0f - ca->passepartalpha);
+ if (camera) {
+ if (camera->flag & CAM_SHOWPASSEPARTOUT) {
+ alpha *= (1.0f - camera->passepartalpha);
+ }
}
UI_GetThemeColor3fv(TH_HIGH_GRAD, fill_color);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 12e39f6c235..475f466c17b 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -110,6 +110,16 @@ float *ED_view3d_cursor3d_get(Scene *scene, View3D *v3d)
else return scene->cursor;
}
+Camera *ED_view3d_camera_data_get(View3D *v3d, RegionView3D *rv3d)
+{
+ /* establish the camera object, so we can default to view mapping if anything is wrong with it */
+ if ((rv3d->persp == RV3D_CAMOB) && v3d->camera && (v3d->camera->type == OB_CAMERA)) {
+ return v3d->camera->data;
+ }
+ else {
+ return NULL;
+ }
+}
/* ****************** smooth view operator ****************** */
/* This operator is one of the 'timer refresh' ones like animation playback */