diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-09-11 23:48:13 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-09-11 23:48:13 +0300 |
commit | ff085e85d3d9824cb0f0b11272e618f6d3272293 (patch) | |
tree | f7f79e73d812ee43f302974db7a505faaf38c618 /source/blender/makesdna | |
parent | 6db00065c5e7f0e16e6970d6351560c36a9536ba (diff) |
DNA: move View3D, View3DOverlay into DNA_view3d_defaults.h
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_view3d_defaults.h | 54 | ||||
-rw-r--r-- | source/blender/makesdna/intern/dna_defaults.c | 8 |
2 files changed, 61 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_view3d_defaults.h b/source/blender/makesdna/DNA_view3d_defaults.h index 2964e77a421..365b1993d80 100644 --- a/source/blender/makesdna/DNA_view3d_defaults.h +++ b/source/blender/makesdna/DNA_view3d_defaults.h @@ -48,6 +48,27 @@ .studiolight_intensity = 1.0f, \ } +#define _DNA_DEFAULT_View3DOverlay \ + { \ + .wireframe_threshold = 1.0f, \ + .xray_alpha_bone = 0.5f, \ + .texture_paint_mode_opacity = 1.0f, \ + .weight_paint_mode_opacity = 1.0f, \ + .vertex_paint_mode_opacity = 1.0f, \ + /* Intentionally different to vertex/paint mode, \ + * we typically want to see shading too. */ \ + .sculpt_mode_mask_opacity = 0.75f, \ + \ + .edit_flag = V3D_OVERLAY_EDIT_FACES | V3D_OVERLAY_EDIT_SEAMS | \ + V3D_OVERLAY_EDIT_SHARP | V3D_OVERLAY_EDIT_FREESTYLE_EDGE | \ + V3D_OVERLAY_EDIT_FREESTYLE_FACE | V3D_OVERLAY_EDIT_EDGES | \ + V3D_OVERLAY_EDIT_CREASES | V3D_OVERLAY_EDIT_BWEIGHTS | \ + V3D_OVERLAY_EDIT_CU_HANDLES | V3D_OVERLAY_EDIT_CU_NORMALS, \ + \ + .gpencil_paper_opacity = 0.5f, \ + .gpencil_grid_opacity = 0.9f, \ + } + #define _DNA_DEFAULT_View3DCursor \ { \ .rotation_mode = ROT_MODE_XYZ, \ @@ -55,6 +76,39 @@ .rotation_axis = {0, 1, 0}, \ } +#define _DNA_DEFAULT_View3D \ + { \ + .spacetype = SPACE_VIEW3D, \ + .scenelock = true, \ + .grid = 1.0f, \ + .gridlines = 16, \ + .gridsubdiv = 10, \ + .shading = _DNA_DEFAULT_View3DShading, \ + .overlay = _DNA_DEFAULT_View3DOverlay, \ + \ + .gridflag = V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_FLOOR | V3D_SHOW_ORTHO_GRID, \ + \ + .flag = V3D_SELECT_OUTLINE, \ + .flag2 = V3D_SHOW_RECONSTRUCTION | V3D_SHOW_ANNOTATION, \ + \ + .lens = 50.0f, \ + .clip_start = 0.01f, \ + .clip_end = 1000.0f, \ + \ + .bundle_size = 0.2f, \ + .bundle_drawtype = OB_PLAINAXES, \ + \ + /* stereo */ \ + .stereo3d_camera = STEREO_3D_ID, \ + .stereo3d_flag = V3D_S3D_DISPPLANE, \ + .stereo3d_convergence_alpha = 0.15f, \ + .stereo3d_volume_alpha = 0.05f, \ + \ + /* Grease pencil settings. */ \ + .vertex_opacity = 1.0f, \ + .gp_flag = V3D_GP_SHOW_EDIT_LINES, \ + } + /** \} */ /* clang-format on */ diff --git a/source/blender/makesdna/intern/dna_defaults.c b/source/blender/makesdna/intern/dna_defaults.c index 7aecbb1789e..289b2e1df34 100644 --- a/source/blender/makesdna/intern/dna_defaults.c +++ b/source/blender/makesdna/intern/dna_defaults.c @@ -69,6 +69,7 @@ #include "DNA_meta_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "DNA_space_types.h" #include "DNA_speaker_types.h" #include "DNA_texture_types.h" #include "DNA_world_types.h" @@ -145,6 +146,9 @@ SDNA_DEFAULT_DECL_STRUCT(Speaker); /* DNA_texture_defaults.h */ SDNA_DEFAULT_DECL_STRUCT(Tex); +/* DNA_view3d_defaults.h */ +SDNA_DEFAULT_DECL_STRUCT(View3D); + /* DNA_world_defaults.h */ SDNA_DEFAULT_DECL_STRUCT(World); @@ -250,7 +254,9 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = { SDNA_DEFAULT_DECL_EX(WalkNavigation, UserDef.walk_navigation), /* DNA_view3d_defaults.h */ - SDNA_DEFAULT_DECL_EX(View3DShading, Scene.display.shading), + SDNA_DEFAULT_DECL(View3D), + SDNA_DEFAULT_DECL_EX(View3DOverlay, View3D.overlay), + SDNA_DEFAULT_DECL_EX(View3DShading, View3D.shading), SDNA_DEFAULT_DECL_EX(View3DCursor, Scene.cursor), /* DNA_world_defaults.h */ |