Blender V5.3
DNA_brush_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2005 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "DNA_ID.h"
12#include "DNA_brush_enums.h"
13#include "DNA_curve_types.h"
14#include "DNA_defs.h"
15#include "DNA_object_enums.h"
16#include "DNA_scene_types.h"
17#include "DNA_texture_types.h" /* for MTex */
18
19namespace blender {
20
21struct CurveMapping;
22struct Image;
23struct MTex;
24struct Material;
25
28
29
32 float fill_factor = 0;
34 float draw_strength = 0;
36 float draw_jitter = 0;
38 float draw_angle = 0;
46 short draw_smoothlvl = 0;
48 short draw_subdivide = 0;
51 short fill_direction = 0;
52
54 float fill_threshold = 0;
55 short fill_solver = 0;
56 /* Type of caps: eGPDstroke_Caps. */
58 char _pad1[1] = {};
59
61
68
72 float uv_random = 0;
78 float active_smooth = 0;
80 float era_strength_f = 0;
82 float era_thickness_f = 0;
85
87 float hardness = 0;
89 float aspect_ratio[2] = {};
91 float simplify_f = 0;
92
94 float vertex_factor = 0;
96
99 char _pad2[2] = {};
102
104 float random_hue = 0;
108 float random_value = 0;
109
111 char _pad3[4] = {};
112
117
119 struct CurveMapping *curve_strength = nullptr;
120 struct CurveMapping *curve_jitter = nullptr;
123 struct CurveMapping *curve_rand_uv = nullptr;
124 struct CurveMapping *curve_rand_hue = nullptr;
127
129 float outline_fac = 0;
131 float simplify_px = 0;
134 /* #CurveType Used for converting. */
136 char _pad4[3] = {};
137 /* Fill Tool gap detection factor. */
139 char _pad5[4] = {};
140
141 /* optional link of material to replace default in context */
143 struct Material *material = nullptr;
145 struct Material *material_alt = nullptr;
146};
147
168
170#define AUTOMASKING_BOUNDARY_EDGES_MAX_PROPAGATION_STEPS 20
175struct Brush {
176#ifdef __cplusplus
179 static constexpr ID_Type id_type = ID_BR;
180#endif
181
183
185 struct MTex mtex;
187
190 struct ColorBand *gradient = nullptr;
191 struct PaintCurve *paint_curve = nullptr;
192
193 float normal_weight = 0.0f;
195 float rake_factor = 0;
196
198 short blend = 0;
202 float weight = 1.0f; /* weight of brush 0 - 1.0 */
204 int size = 70; /* diameter of the brush in pixels */
209
214 char _pad[7] = {};
217
221 float jitter = 0.0f;
226 int spacing = 10;
232 float rate = 0.1f;
233
235 float color[3] = {1.0f, 1.0f, 1.0f};
237 float hsv_jitter[3] = {};
238
240 struct CurveMapping *curve_rand_hue = nullptr;
243
244 struct CurveMapping *curve_size = nullptr;
245 struct CurveMapping *curve_strength = nullptr;
246 struct CurveMapping *curve_jitter = nullptr;
247 struct CurveMapping *curve_hardness = nullptr;
249 struct CurveMapping *curve_spacing = nullptr;
250
252 float alpha = 1.0f; /* brush strength/intensity probably variable should be renamed? */
254 float hardness = 0.0f;
256 float flow = 0;
258 float wet_mix = 0;
261 float density = 0;
263
265 /* Factor that controls the shape of the brush tip by rounding the corners of a square. */
266 /* 0.0 value produces a square, 1.0 produces a circle. */
267 float tip_roundness = 1.0f;
268 float tip_scale_x = 1.0f;
269
271 float secondary_color[3] = {0, 0, 0};
272
273 /* Deprecated sRGB color for forward compatibility. */
274 DNA_DEPRECATED float rgb[3] = {1.0f, 1.0f, 1.0f};
275 DNA_DEPRECATED float secondary_rgb[3] = {0, 0, 0};
276
278 float dash_ratio = 1.0f;
279 int dash_samples = 20;
280
283
285 float plane_offset = 0.0f;
286
292
298
302
323
324 char _pad1[2] = {};
325
326 float autosmooth_factor = 0.0f;
327
329
331
333
335 float area_radius_factor = 0.5f;
337
338 float plane_trim = 0.5f;
340 float height = 0;
341
342 /* Plane Brush */
343 float plane_height = 0;
344 float plane_depth = 0;
348
349 float texture_sample_bias = 0; /* value to added to texture samples */
350
357
358 /* Maximum distance to search fake neighbors from a vertex. */
360
362
363 /* automasking */
366
367 DNA_DEPRECATED float automasking_start_normal_limit = 0.34906585f; /* 20 degrees */
369 DNA_DEPRECATED float automasking_view_normal_limit = 1.570796; /* 90 degrees */
371
374
375 /* snake hook */
377
378 /* pose */
380 float pose_offset = 0;
384
385 /* boundary */
389
390 /* cloth */
394
395 float cloth_mass = 1;
396 float cloth_damping = 0.01;
397
398 float cloth_sim_limit = 2.5f;
399 float cloth_sim_falloff = 0.75f;
400
402
403 /* smooth */
408
409 /* multiplane scrape */
411
412 /* smear */
414
415 /* slide/relax */
417
418 /* Scene Project brush */
420 char _pad2[3] = {};
421 float minimum_distance = 0.0f;
422
423 /* overlay */
427
428 float unprojected_size = 0.10f; /* diameter of the brush in Blender units */
429
430 /* soften/sharpen */
434
435 /* fill tool */
436 float fill_threshold = 0.2f;
437
438 float add_col[4] = {1.0, 0.39, 0.39, 0.9};
439 float sub_col[4] = {0.39, 0.39, 1.0, 0.9};
440
441 float stencil_pos[2] = {256, 256};
442 float stencil_dimension[2] = {256, 256};
443
444 float mask_stencil_pos[2] = {256, 256};
445 float mask_stencil_dimension[2] = {256, 256};
446
449
452
457 char _pad3[4] = {};
458};
459
461 struct PaletteColor *next = nullptr, *prev = nullptr;
462 /* Two values, one to store color, other to store values for sculpt/weight. */
463 float color[3] = {};
464 float value = 0;
465
466 /* For forward compatibility. */
467 DNA_DEPRECATED float rgb[3] = {};
468 float _pad = {};
469};
470
471struct Palette {
472#ifdef __cplusplus
474 static constexpr ID_Type id_type = ID_PAL;
475#endif
476
478
480 ListBaseT<PaletteColor> colors = {nullptr, nullptr};
481
483 char _pad[4] = {};
484};
485
490 float pressure = 0;
491};
492
494#ifdef __cplusplus
496 static constexpr ID_Type id_type = ID_PC;
497#endif
498
502 int tot_points = 0;
504 int add_index = 0;
505};
506
507} // namespace blender
ID and Library types, which are fundamental for SDNA.
#define DNA_DEFINE_CXX_METHODS(class_name)
Definition DNA_defs.h:104
#define DNA_DEPRECATED
Definition DNA_defs.h:21
#define OB_MODE_ALL_PAINT_MESH
BMesh Iterators.
@ BRUSH_BOUNDARY_DEFORM_BEND
@ BRUSH_GRADIENT_LINEAR
@ GPWEIGHT_BRUSH_TYPE_DRAW
@ BRUSH_GRADIENT_PRESSURE
@ BRUSH_SNAKE_HOOK_DEFORM_FALLOFF
@ BRUSH_SLIDE_DEFORM_DRAG
eBrushColorJitterSettings_Flag
@ PAINT_FALLOFF_SHAPE_SPHERE
@ WPAINT_BRUSH_TYPE_DRAW
@ BRUSH_PLANE_INVERT_DISPLACEMENT
@ BRUSH_SMOOTH_DEFORM_LAPLACIAN
@ BRUSH_BOUNDARY_FALLOFF_CONSTANT
@ BRUSH_CLOTH_DEFORM_DRAG
@ SCULPT_BRUSH_TYPE_DRAW
@ GPSCULPT_BRUSH_TYPE_SMOOTH
@ BRUSH_POSE_DEFORM_ROTATE_TWIST
@ BRUSH_POSE_ORIGIN_TOPOLOGY
@ BRUSH_ELASTIC_DEFORM_GRAB
@ GP_FILL_GPLMODE_VISIBLE
@ GPAINT_BRUSH_TYPE_DRAW
@ BRUSH_PAINT_ANTIALIASING
@ IMAGE_PAINT_BRUSH_TYPE_DRAW
@ CURVES_SCULPT_BRUSH_TYPE_COMB
@ GPVERTEX_BRUSH_TYPE_DRAW
@ BRUSH_USE_UNIFIED_PAINT_SIZE
@ BRUSH_USE_UNIFIED_PAINT_COLOR
@ BRUSH_DEFORM_TARGET_GEOMETRY
@ BRUSH_PROJECT_RAY_DIRECTION_VIEW_NORMAL
@ BRUSH_SMEAR_DEFORM_DRAG
eBrushClothSimulationAreaType
@ BRUSH_CLOTH_SIMULATION_AREA_LOCAL
signed char int8_t
Definition BKE_text.h:76
eBrushCurvesSculptDensityMode
@ BRUSH_CURVES_SCULPT_DENSITY_MODE_AUTO
eBrushClothForceFalloffType
@ BRUSH_CLOTH_FORCE_FALLOFF_RADIAL
@ VPAINT_BRUSH_TYPE_DRAW
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
eBrushCurvesSculptDensityMode density_mode
struct CurveMapping * curve_parameter_falloff
struct CurveMapping * curve_rand_saturation
eGP_FillLayerModes fill_layer_mode
eGP_FillExtendModes fill_extend_mode
struct CurveMapping * curve_sensitivity
struct CurveMapping * curve_jitter
struct CurveMapping * curve_rand_strength
struct CurveMapping * curve_rand_uv
struct CurveMapping * curve_rand_hue
eGP_BrushEraserMode eraser_mode
struct CurveMapping * curve_rand_pressure
struct CurveMapping * curve_strength
struct CurveMapping * curve_rand_value
eGP_Sculpt_Mode_Flag sculpt_mode_flag
eBrushColorJitterSettings_Flag color_jitter_flag
eBrushGPVertexType gpencil_vertex_brush_type
eBrushPoseOriginType pose_origin_type
DNA_DEPRECATED int automasking_boundary_edges_propagation_steps
eBrushGPWeightType gpencil_weight_brush_type
float mask_stencil_dimension[2]
float elastic_deform_volume_preservation
struct CurveMapping * curve_rand_value
struct CurveMapping * curve_rand_saturation
struct BrushGpencilSettings * gpencil_settings
struct ColorBand * gradient
eBrushImagePaintType image_brush_type
DNA_DEPRECATED float automasking_view_normal_falloff
eBrushGPaintType gpencil_brush_type
eBrushSculptType sculpt_brush_type
eBrushElasticDeformType elastic_deform_type
eBrushBoundaryDeformType boundary_deform_type
struct MTex mask_mtex
float surface_smooth_current_vertex
struct CurveMapping * curve_jitter
eBrushFlags2 flag2
eBrushSmearDeformType smear_deform_type
eBrushCurvePreset curve_distance_falloff_preset
PreviewImage * preview
eBrushClothDeformType cloth_deform_type
DNA_DEPRECATED struct CurveMapping * automasking_cavity_curve
struct CurveMapping * curve_distance_falloff
float wet_paint_radius_factor
eBrushClothForceFalloffType cloth_force_falloff_type
float secondary_color[3]
DNA_DEPRECATED float automasking_cavity_factor
struct CurveMapping * curve_spacing
struct CurveMapping * curve_auto_smooth
eBrushSculpt_DispDir sculpt_plane
eBrushProjectRayDirection project_ray_direction_type
eBrushGradientSourceFill gradient_fill_mode
eBrushVertexPaintType vertex_brush_type
float stencil_dimension[2]
DNA_DEPRECATED int automasking_flags
DNA_DEPRECATED float automasking_start_normal_falloff
struct PaintCurve * paint_curve
eBrushBoundaryFalloffType boundary_falloff_type
eBrushPlaneInversionMode plane_inversion_mode
DNA_DEPRECATED float rgb[3]
float disconnected_distance_max
DNA_DEPRECATED float secondary_rgb[3]
BrushMaskPressureFlags mask_pressure
eBrushColorJitterSettings_Flag color_jitter_flag
eBrushClothSimulationAreaType cloth_simulation_area_type
float multiplane_scrape_angle
eBrushWeightPaintType weight_brush_type
struct MeshAutomaskingSettings * mesh_automasking_settings
eBrushSmoothDeformType smooth_deform_type
eBrushCurvesSculptType curves_sculpt_brush_type
DNA_DEPRECATED int automasking_cavity_blur_steps
struct CurveMapping * curve_hardness
eBrushFalloffShape falloff_shape
float mask_stencil_pos[2]
eBlurKernelType blur_mode
eBrushPoseDeformType pose_deform_type
struct CurveMapping * curve_size
ePaintBrush_flag paint_flags
eOverlayFlags overlay_flags
eBrushGPSculptType gpencil_sculpt_brush_type
struct CurveMapping * curve_rand_hue
DNA_DEPRECATED float automasking_start_normal_limit
eBrushDeformTarget deform_target
float cloth_constraint_softbody_strength
BrushMaskTool mask_tool
eBrushSnakeHookDeformType snake_hook_deform_type
eBrushSlideDeformType slide_deform_type
float surface_smooth_shape_preservation
struct BrushCurvesSculptSettings * curves_sculpt_settings
eBrushUnifiedPaintFlags unified_paint_flags
DNA_DEPRECATED float automasking_view_normal_limit
eBrushSamplingFlags sampling_flag
eBrushGradientSourceStroke gradient_stroke_mode
struct CurveMapping * curve_strength
eBrushStrokeType stroke_method
PaintCurvePoint * points
struct PaletteColor * prev
struct PaletteColor * next
DNA_DEPRECATED float rgb[3]
ListBaseT< PaletteColor > colors