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>2018-12-18 05:56:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-12-18 05:56:26 +0300
commit7721886eadffc3eb07ac2d8c19cf5f4d12cb3f1c (patch)
tree6da43ddc7e98bf443e1be418b878cbfb51f27544 /source/blender/editors/space_view3d
parentac80ceae7707918eb410dcef6df199adf1615ca7 (diff)
Fix T53544: Crash drawing scene w/o world
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_utils.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c
index 87f2e6b32d4..540806d4b67 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -77,18 +77,18 @@
void ED_view3d_background_color_get(const Scene *scene, const View3D *v3d, float r_color[3])
{
- switch (v3d->shading.background_type) {
- case V3D_SHADING_BACKGROUND_WORLD:
+ if (v3d->shading.background_type == V3D_SHADING_BACKGROUND_WORLD) {
+ if (scene->world) {
copy_v3_v3(r_color, &scene->world->horr);
- break;
- case V3D_SHADING_BACKGROUND_VIEWPORT:
- copy_v3_v3(r_color, v3d->shading.background_color);
- break;
- case V3D_SHADING_BACKGROUND_THEME:
- default:
- UI_GetThemeColor3fv(TH_HIGH_GRAD, r_color);
- break;
+ return;
+ }
}
+ else if (v3d->shading.background_type == V3D_SHADING_BACKGROUND_VIEWPORT) {
+ copy_v3_v3(r_color, v3d->shading.background_color);
+ return;
+ }
+
+ UI_GetThemeColor3fv(TH_HIGH_GRAD, r_color);
}
void ED_view3d_cursor3d_calc_mat3(const Scene *scene, float mat[3][3])