Blender  V2.93
DNA_view3d_defaults.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 /* Struct members on own line. */
24 /* clang-format off */
25 
26 /* -------------------------------------------------------------------- */
30 #define _DNA_DEFAULT_View3DShading \
31  { \
32  .type = OB_SOLID, \
33  .prev_type = OB_SOLID, \
34  .flag = V3D_SHADING_SPECULAR_HIGHLIGHT | V3D_SHADING_XRAY_WIREFRAME | \
35  V3D_SHADING_SCENE_LIGHTS_RENDER | V3D_SHADING_SCENE_WORLD_RENDER, \
36  .light = V3D_LIGHTING_STUDIO, \
37  .shadow_intensity = 0.5f, \
38  .xray_alpha = 0.5f, \
39  .xray_alpha_wire = 0.5f, \
40  .cavity_valley_factor = 1.0f, \
41  .cavity_ridge_factor = 1.0f, \
42  .cavity_type = V3D_SHADING_CAVITY_CURVATURE, \
43  .curvature_ridge_factor = 1.0f, \
44  .curvature_valley_factor = 1.0f, \
45  .single_color = {0.8f, 0.8f, 0.8f}, \
46  .background_color = {0.05f, 0.05f, 0.05f}, \
47  .studiolight_intensity = 1.0f, \
48  .render_pass = SCE_PASS_COMBINED, \
49  }
50 
51 #define _DNA_DEFAULT_View3DOverlay \
52  { \
53  .wireframe_threshold = 1.0f, \
54  .wireframe_opacity = 1.0f, \
55  .xray_alpha_bone = 0.5f, \
56  .fade_alpha = 0.40f, \
57  .texture_paint_mode_opacity = 1.0f, \
58  .weight_paint_mode_opacity = 1.0f, \
59  .vertex_paint_mode_opacity = 1.0f, \
60  /* Intentionally different to vertex/paint mode, \
61  * we typically want to see shading too. */ \
62  .sculpt_mode_mask_opacity = 0.75f, \
63  .sculpt_mode_face_sets_opacity = 1.0f, \
64  \
65  .edit_flag = V3D_OVERLAY_EDIT_FACES | V3D_OVERLAY_EDIT_SEAMS | \
66  V3D_OVERLAY_EDIT_SHARP | V3D_OVERLAY_EDIT_FREESTYLE_EDGE | \
67  V3D_OVERLAY_EDIT_FREESTYLE_FACE | V3D_OVERLAY_EDIT_EDGES | \
68  V3D_OVERLAY_EDIT_CREASES | V3D_OVERLAY_EDIT_BWEIGHTS, \
69  .handle_display = CURVE_HANDLE_SELECTED, \
70  \
71  .gpencil_paper_opacity = 0.5f, \
72  .gpencil_grid_opacity = 0.9f, \
73  }
74 
75 #define _DNA_DEFAULT_View3DCursor \
76  { \
77  .rotation_mode = ROT_MODE_XYZ, \
78  .rotation_quaternion = {1, 0, 0, 0}, \
79  .rotation_axis = {0, 1, 0}, \
80  }
81 
82 #define _DNA_DEFAULT_View3D \
83  { \
84  .spacetype = SPACE_VIEW3D, \
85  .scenelock = true, \
86  .grid = 1.0f, \
87  .gridlines = 16, \
88  .gridsubdiv = 10, \
89  .shading = _DNA_DEFAULT_View3DShading, \
90  .overlay = _DNA_DEFAULT_View3DOverlay, \
91  \
92  .gridflag = V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_FLOOR | V3D_SHOW_ORTHO_GRID, \
93  \
94  .flag = V3D_SELECT_OUTLINE, \
95  .flag2 = V3D_SHOW_RECONSTRUCTION | V3D_SHOW_ANNOTATION, \
96  \
97  .lens = 50.0f, \
98  .clip_start = 0.01f, \
99  .clip_end = 1000.0f, \
100  \
101  .bundle_size = 0.2f, \
102  .bundle_drawtype = OB_PLAINAXES, \
103  \
104  /* stereo */ \
105  .stereo3d_camera = STEREO_3D_ID, \
106  .stereo3d_flag = V3D_S3D_DISPPLANE, \
107  .stereo3d_convergence_alpha = 0.15f, \
108  .stereo3d_volume_alpha = 0.05f, \
109  \
110  /* Grease pencil settings. */ \
111  .vertex_opacity = 1.0f, \
112  .gp_flag = V3D_GP_SHOW_EDIT_LINES, \
113  }
114 
117 /* clang-format on */