Blender V5.0
DNA_brush_defaults.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
12
13/* clang-format off */
14
15/* -------------------------------------------------------------------- */
18
19#define _DNA_DEFAULT_Brush \
20 { \
21 .blend = 0, \
22 .flag = (BRUSH_ALPHA_PRESSURE | BRUSH_SPACE | BRUSH_SPACE_ATTEN), \
23 .sampling_flag = (BRUSH_PAINT_ANTIALIASING), \
24 \
25 .ob_mode = OB_MODE_ALL_PAINT, \
26 \
27 /* BRUSH SCULPT BRUSH SETTINGS */ \
28 .weight = 1.0f, /* weight of brush 0 - 1.0 */ \
29 .size = 70, /* diameter of the brush in pixels */ \
30 .unprojected_size = 0.10f, /* diameter of the brush in Blender units */ \
31 .alpha = 1.0f, /* brush strength/intensity probably variable should be renamed? */ \
32 .autosmooth_factor = 0.0f, \
33 .topology_rake_factor = 0.0f, \
34 .crease_pinch_factor = 0.5f, \
35 .normal_radius_factor = 0.5f, \
36 .wet_paint_radius_factor = 0.5f, \
37 .area_radius_factor = 0.5f, \
38 .disconnected_distance_max = 0.1f, \
39 .sculpt_plane = SCULPT_DISP_DIR_AREA, \
40 .cloth_damping = 0.01, \
41 .cloth_mass = 1, \
42 .cloth_sim_limit = 2.5f, \
43 .cloth_sim_falloff = 0.75f, \
44 /* How far above or below the plane that is found by averaging the faces. */ \
45 .plane_offset = 0.0f, \
46 .plane_trim = 0.5f, \
47 .normal_weight = 0.0f, \
48 .fill_threshold = 0.2f, \
49 \
50 /* BRUSH PAINT BRUSH SETTINGS */ \
51 /* Default rgb color of the brush when painting - white. Initialize both
52 * linear and deprecated sRGB values. */ \
53 .color = {1.0f, 1.0f, 1.0f}, \
54 .rgb = {1.0f, 1.0f, 1.0f}, \
55 \
56 .secondary_color = {0, 0, 0}, \
57 .secondary_rgb = {0, 0, 0}, \
58 \
59 /* BRUSH STROKE SETTINGS */ \
60 /* How far each brush dot should be spaced as a percentage of brush diameter. */ \
61 .spacing = 10, \
62 \
63 .smooth_stroke_radius = 75, \
64 .smooth_stroke_factor = 0.9f, \
65 \
66 /* Time delay between dots of paint or sculpting when doing airbrush mode. */ \
67 .rate = 0.1f, \
68 \
69 .jitter = 0.0f, \
70 \
71 .input_samples = 1, \
72 /* Dash */ \
73 .dash_ratio = 1.0f, \
74 .dash_samples = 20, \
75 \
76 .texture_sample_bias = 0, /* value to added to texture samples */ \
77 .texture_overlay_alpha = 33, \
78 .mask_overlay_alpha = 33, \
79 .cursor_overlay_alpha = 33, \
80 .overlay_flags = 0, \
81 \
82 /* Brush appearance. */ \
83 \
84 /* add mode color is light red */ \
85 .add_col = {1.0, 0.39, 0.39, 0.9}, \
86 \
87 /* subtract mode color is light blue */ \
88 .sub_col = {0.39, 0.39, 1.0, 0.9}, \
89 \
90 .stencil_pos = {256, 256}, \
91 .stencil_dimension = {256, 256}, \
92 .mask_stencil_pos = {256, 256}, \
93 .mask_stencil_dimension = {256, 256}, \
94 \
95 /* sculpting defaults to the draw brush for new brushes */ \
96 .sculpt_brush_type = SCULPT_BRUSH_TYPE_DRAW, \
97 .pose_smooth_iterations = 4, \
98 .pose_ik_segments = 1, \
99 .hardness = 0.0f, \
100 \
101 .automasking_boundary_edges_propagation_steps = 1, \
102 .automasking_start_normal_limit = 0.34906585f, /* 20 degrees */ \
103 .automasking_start_normal_falloff = 0.25f, \
104 .automasking_view_normal_limit = 1.570796, /* 90 degrees */ \
105 .automasking_view_normal_falloff = 0.25f, \
106 .automasking_cavity_blur_steps = 0,\
107 .automasking_cavity_factor = 1.0f,\
108 \
109 /* A kernel radius of 1 has almost no effect (#63233). */ \
110 .blur_kernel_radius = 2, \
111 \
112 .mtex = _DNA_DEFAULT_MTex, \
113 .mask_mtex = _DNA_DEFAULT_MTex, \
114 .falloff_shape = 0,\
115 .tip_scale_x = 1.0f,\
116 .tip_roundness = 1.0f,\
117 }
118
120
121/* clang-format on */