Blender  V2.93
DNA_brush_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 #include "DNA_texture_defaults.h"
24 
25 /* Struct members on own line. */
26 /* clang-format off */
27 
28 /* -------------------------------------------------------------------- */
32 #define _DNA_DEFAULT_Brush \
33  { \
34  .blend = 0, \
35  .flag = (BRUSH_ALPHA_PRESSURE | BRUSH_SPACE | BRUSH_SPACE_ATTEN), \
36  .sampling_flag = (BRUSH_PAINT_ANTIALIASING), \
37  \
38  .ob_mode = OB_MODE_ALL_PAINT, \
39  \
40  /* BRUSH SCULPT TOOL SETTINGS */ \
41  .weight = 1.0f, /* weight of brush 0 - 1.0 */ \
42  .size = 35, /* radius of the brush in pixels */ \
43  .alpha = 1.0f, /* brush strength/intensity probably variable should be renamed? */ \
44  .autosmooth_factor = 0.0f, \
45  .topology_rake_factor = 0.0f, \
46  .crease_pinch_factor = 0.5f, \
47  .normal_radius_factor = 0.5f, \
48  .wet_paint_radius_factor = 0.5f, \
49  .area_radius_factor = 0.5f, \
50  .disconnected_distance_max = 0.1f, \
51  .sculpt_plane = SCULPT_DISP_DIR_AREA, \
52  .cloth_damping = 0.01, \
53  .cloth_mass = 1, \
54  .cloth_sim_limit = 2.5f, \
55  .cloth_sim_falloff = 0.75f, \
56  /* How far above or below the plane that is found by averaging the faces. */ \
57  .plane_offset = 0.0f, \
58  .plane_trim = 0.5f, \
59  .clone.alpha = 0.5f, \
60  .normal_weight = 0.0f, \
61  .fill_threshold = 0.2f, \
62  \
63  /* BRUSH PAINT TOOL SETTINGS */ \
64  /* Default rgb color of the brush when painting - white. */ \
65  .rgb = {1.0f, 1.0f, 1.0f}, \
66  \
67  .secondary_rgb = {0, 0, 0}, \
68  \
69  /* BRUSH STROKE SETTINGS */ \
70  /* How far each brush dot should be spaced as a percentage of brush diameter. */ \
71  .spacing = 10, \
72  \
73  .smooth_stroke_radius = 75, \
74  .smooth_stroke_factor = 0.9f, \
75  \
76  /* Time delay between dots of paint or sculpting when doing airbrush mode. */ \
77  .rate = 0.1f, \
78  \
79  .jitter = 0.0f, \
80  \
81  /* Dash */ \
82  .dash_ratio = 1.0f, \
83  .dash_samples = 20, \
84  \
85  .texture_sample_bias = 0, /* value to added to texture samples */ \
86  .texture_overlay_alpha = 33, \
87  .mask_overlay_alpha = 33, \
88  .cursor_overlay_alpha = 33, \
89  .overlay_flags = 0, \
90  \
91  /* brush appearance */ \
92  \
93  /* add mode color is light red */ \
94  .add_col = {1.0, 0.39, 0.39, 0.9}, \
95  \
96  /* subtract mode color is light blue */ \
97  .sub_col = {0.39, 0.39, 1.0, 0.9}, \
98  \
99  .stencil_pos = {256, 256}, \
100  .stencil_dimension = {256, 256}, \
101  \
102  /* sculpting defaults to the draw tool for new brushes */ \
103  .sculpt_tool = SCULPT_TOOL_DRAW, \
104  .pose_smooth_iterations = 4, \
105  .pose_ik_segments = 1, \
106  .hardness = 0.0f, \
107  .automasking_boundary_edges_propagation_steps = 1, \
108  \
109  /* A kernel radius of 1 has almost no effect (T63233). */ \
110  .blur_kernel_radius = 2, \
111  \
112  .mtex = _DNA_DEFAULT_MTex, \
113  .mask_mtex = _DNA_DEFAULT_MTex, \
114  }
115 
118 /* clang-format on */