Blender  V3.3
DNA_view3d_defaults.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #pragma once
8 
9 /* Struct members on own line. */
10 /* clang-format off */
11 
12 /* -------------------------------------------------------------------- */
16 #define _DNA_DEFAULT_View3DShading \
17  { \
18  .type = OB_SOLID, \
19  .prev_type = OB_SOLID, \
20  .flag = V3D_SHADING_SPECULAR_HIGHLIGHT | V3D_SHADING_XRAY_WIREFRAME | \
21  V3D_SHADING_SCENE_LIGHTS_RENDER | V3D_SHADING_SCENE_WORLD_RENDER, \
22  .light = V3D_LIGHTING_STUDIO, \
23  .shadow_intensity = 0.5f, \
24  .xray_alpha = 0.5f, \
25  .xray_alpha_wire = 0.5f, \
26  .cavity_valley_factor = 1.0f, \
27  .cavity_ridge_factor = 1.0f, \
28  .cavity_type = V3D_SHADING_CAVITY_CURVATURE, \
29  .curvature_ridge_factor = 1.0f, \
30  .curvature_valley_factor = 1.0f, \
31  .single_color = {0.8f, 0.8f, 0.8f}, \
32  .background_color = {0.05f, 0.05f, 0.05f}, \
33  .studiolight_intensity = 1.0f, \
34  .render_pass = SCE_PASS_COMBINED, \
35  }
36 
37 #define _DNA_DEFAULT_View3DOverlay \
38  { \
39  .wireframe_threshold = 1.0f, \
40  .wireframe_opacity = 1.0f, \
41  .xray_alpha_bone = 0.5f, \
42  .bone_wire_alpha = 1.0f, \
43  .fade_alpha = 0.40f, \
44  .texture_paint_mode_opacity = 1.0f, \
45  .weight_paint_mode_opacity = 1.0f, \
46  .vertex_paint_mode_opacity = 1.0f, \
47  /* Intentionally different to vertex/paint mode, \
48  * we typically want to see shading too. */ \
49  .sculpt_mode_mask_opacity = 0.75f, \
50  .sculpt_mode_face_sets_opacity = 1.0f, \
51  \
52  .edit_flag = V3D_OVERLAY_EDIT_FACES | V3D_OVERLAY_EDIT_SEAMS | \
53  V3D_OVERLAY_EDIT_SHARP | V3D_OVERLAY_EDIT_FREESTYLE_EDGE | \
54  V3D_OVERLAY_EDIT_FREESTYLE_FACE | V3D_OVERLAY_EDIT_EDGES | \
55  V3D_OVERLAY_EDIT_CREASES | V3D_OVERLAY_EDIT_BWEIGHTS, \
56  .handle_display = CURVE_HANDLE_SELECTED, \
57  \
58  .gpencil_paper_opacity = 0.5f, \
59  .gpencil_grid_opacity = 0.9f, \
60  .gpencil_vertex_paint_opacity = 1.0f, \
61  .normals_constant_screen_size = 7.0f, \
62  }
63 
64 #define _DNA_DEFAULT_View3DCursor \
65  { \
66  .rotation_mode = ROT_MODE_XYZ, \
67  .rotation_quaternion = {1, 0, 0, 0}, \
68  .rotation_axis = {0, 1, 0}, \
69  }
70 
71 #define _DNA_DEFAULT_View3D \
72  { \
73  .spacetype = SPACE_VIEW3D, \
74  .scenelock = true, \
75  .grid = 1.0f, \
76  .gridlines = 16, \
77  .gridsubdiv = 10, \
78  .shading = _DNA_DEFAULT_View3DShading, \
79  .overlay = _DNA_DEFAULT_View3DOverlay, \
80  \
81  .gridflag = V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_FLOOR | V3D_SHOW_ORTHO_GRID, \
82  \
83  .flag = V3D_SELECT_OUTLINE, \
84  .flag2 = V3D_SHOW_RECONSTRUCTION | V3D_SHOW_ANNOTATION, \
85  \
86  .lens = 50.0f, \
87  .clip_start = 0.01f, \
88  .clip_end = 1000.0f, \
89  \
90  .bundle_size = 0.2f, \
91  .bundle_drawtype = OB_PLAINAXES, \
92  \
93  /* stereo */ \
94  .stereo3d_camera = STEREO_3D_ID, \
95  .stereo3d_flag = V3D_S3D_DISPPLANE, \
96  .stereo3d_convergence_alpha = 0.15f, \
97  .stereo3d_volume_alpha = 0.05f, \
98  \
99  /* Grease pencil settings. */ \
100  .vertex_opacity = 1.0f, \
101  .gp_flag = V3D_GP_SHOW_EDIT_LINES, \
102  }
103 
106 /* clang-format on */