diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-14 16:05:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-14 16:05:54 +0300 |
commit | 1386a4a0f2b03f44f123381448240652788cca29 (patch) | |
tree | bddd06f4a45fac219ede15a0f7156a27dc813171 /source/blender/editors/space_view3d/view3d_utils.c | |
parent | 69a04c61402cf4e09927640d2588764bcfd2a357 (diff) |
Gizmo: get background color based on view option
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_utils.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_utils.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index 9b006bf4d9b..022fccd7ce7 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -36,6 +36,7 @@ #include "DNA_curve_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "DNA_world_types.h" #include "MEM_guardedalloc.h" @@ -65,6 +66,8 @@ #include "ED_screen.h" #include "ED_view3d.h" +#include "UI_resources.h" + #include "view3d_intern.h" /* own include */ /* -------------------------------------------------------------------- */ @@ -72,6 +75,22 @@ * * \{ */ +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: + 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; + } +} + View3DCursor *ED_view3d_cursor3d_get(Scene *scene, View3D *v3d) { if (v3d && v3d->localvd) { |