Changeset View
Standalone View
source/blender/makesdna/DNA_brush_types.h
| Show First 20 Lines • Show All 278 Lines • ▼ Show 20 Lines | typedef struct Brush { | ||||
| float plane_offset; | float plane_offset; | ||||
| int gradient_spacing; | int gradient_spacing; | ||||
| /** Source for stroke color gradient application. */ | /** Source for stroke color gradient application. */ | ||||
| char gradient_stroke_mode; | char gradient_stroke_mode; | ||||
| /** Source for fill tool color gradient application. */ | /** Source for fill tool color gradient application. */ | ||||
| char gradient_fill_mode; | char gradient_fill_mode; | ||||
| char _pad[5]; | char _pad[4]; | ||||
| /** Jitter unit (absolute, relative) */ | |||||
| char jitter_unit; | |||||
| /** Projection shape (sphere, circle). */ | /** Projection shape (sphere, circle). */ | ||||
| char falloff_shape; | char falloff_shape; | ||||
| float falloff_angle; | float falloff_angle; | ||||
| /** Active sculpt tool. */ | /** Active sculpt tool. */ | ||||
| char sculpt_tool; | char sculpt_tool; | ||||
| /** Active sculpt tool. */ | /** Active sculpt tool. */ | ||||
| char uv_sculpt_tool; | char uv_sculpt_tool; | ||||
| ▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | typedef enum eBrushFlags { | ||||
| BRUSH_EDGE_TO_EDGE = (1 << 22), | BRUSH_EDGE_TO_EDGE = (1 << 22), | ||||
| BRUSH_DRAG_DOT = (1 << 23), | BRUSH_DRAG_DOT = (1 << 23), | ||||
| BRUSH_INVERSE_SMOOTH_PRESSURE = (1 << 24), | BRUSH_INVERSE_SMOOTH_PRESSURE = (1 << 24), | ||||
| BRUSH_FRONTFACE_FALLOFF = (1 << 25), | BRUSH_FRONTFACE_FALLOFF = (1 << 25), | ||||
| BRUSH_PLANE_TRIM = (1 << 26), | BRUSH_PLANE_TRIM = (1 << 26), | ||||
| BRUSH_FRONTFACE = (1 << 27), | BRUSH_FRONTFACE = (1 << 27), | ||||
| BRUSH_CUSTOM_ICON = (1 << 28), | BRUSH_CUSTOM_ICON = (1 << 28), | ||||
| BRUSH_LINE = (1 << 29), | BRUSH_LINE = (1 << 29), | ||||
| BRUSH_ABSOLUTE_JITTER = (1 << 30), | |||||
Mets: Is this safe/good to remove from here? @mont29 | |||||
Not Done Inline ActionsNo it is not! At least not without some extra work. You need to handle all existing brush datablocks in doversion code, to 'transfer' that flag from the old one to the new one. That also imply not removing that flag from here, but rather tagging it as DNA_DEPRECATED, so that you can still access its value in code dealing with older DNA, like the .blend reading one. See e.g. how this is done in DNA for CD_MTEXPOLY or CD_MSTICKY deprecated enum values (in DNA_customdata_types.h). This ensures that deprecated enums are not available (and hence used) in normal code, but are still available for doversion of older files and such. Note that you do not necessarily have to update the minor version number of Blender, since you are adding a new member to DNA, you can rather use something like if (!DNA_struct_elem_find(fd->filesdna, "Brush", "chqr", "jitter_unit")) {<versionning code... >;}, just put in the end block (Versioning code until next subversion bump goes here.). Also, think you will have to handle updates of defaults for brushes as well? mont29: No it is not! At least not without some extra work.
You need to handle all existing brush… | |||||
| BRUSH_CURVE = (1u << 31), | BRUSH_CURVE = (1u << 31), | ||||
| } eBrushFlags; | } eBrushFlags; | ||||
| /* Brush.sampling_flag */ | /* Brush.sampling_flag */ | ||||
| typedef enum eBrushSamplingFlags { | typedef enum eBrushSamplingFlags { | ||||
| BRUSH_PAINT_ANTIALIASING = (1 << 0), | BRUSH_PAINT_ANTIALIASING = (1 << 0), | ||||
| } eBrushSamplingFlags; | } eBrushSamplingFlags; | ||||
| ▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | |||||
| } eBlurKernelType; | } eBlurKernelType; | ||||
| /* Brush.falloff_shape */ | /* Brush.falloff_shape */ | ||||
| enum { | enum { | ||||
| PAINT_FALLOFF_SHAPE_SPHERE = 0, | PAINT_FALLOFF_SHAPE_SPHERE = 0, | ||||
| PAINT_FALLOFF_SHAPE_TUBE = 1, | PAINT_FALLOFF_SHAPE_TUBE = 1, | ||||
| }; | }; | ||||
| /* Brush.jitter_unit */ | |||||
| enum { | |||||
| BRUSH_ABSOLUTE_JITTER = 0, | |||||
Not Done Inline ActionsShould be renamed to something like BRUSH_JITTER_UNIT_ABSOLUTE (and same for the other one of course). mont29: Should be renamed to something like `BRUSH_JITTER_UNIT_ABSOLUTE` (and same for the other one of… | |||||
| BRUSH_RELATIVE_JITTER = 1, | |||||
| }; | |||||
| #define MAX_BRUSH_PIXEL_RADIUS 500 | #define MAX_BRUSH_PIXEL_RADIUS 500 | ||||
| #define GP_MAX_BRUSH_PIXEL_RADIUS 1000 | #define GP_MAX_BRUSH_PIXEL_RADIUS 1000 | ||||
| #endif /* __DNA_BRUSH_TYPES_H__ */ | #endif /* __DNA_BRUSH_TYPES_H__ */ | ||||
Is this safe/good to remove from here? @Bastien Montagne (mont29)