Changeset View
Standalone View
source/blender/makesdna/DNA_brush_types.h
| Show All 38 Lines | |||||
| //#ifndef MAX_MTEX // XXX Not used? | //#ifndef MAX_MTEX // XXX Not used? | ||||
| //#define MAX_MTEX 18 | //#define MAX_MTEX 18 | ||||
| //#endif | //#endif | ||||
| struct CurveMapping; | struct CurveMapping; | ||||
| struct MTex; | struct MTex; | ||||
| struct Image; | struct Image; | ||||
| struct Material; | |||||
| typedef struct BrushClone { | typedef struct BrushClone { | ||||
| struct Image *image; /* image for clone tool */ | struct Image *image; /* image for clone tool */ | ||||
| float offset[2]; /* offset of clone image from canvas */ | float offset[2]; /* offset of clone image from canvas */ | ||||
| float alpha, pad; /* transparency for drawing of clone image */ | float alpha, pad; /* transparency for drawing of clone image */ | ||||
| } BrushClone; | } BrushClone; | ||||
| typedef struct BrushGpencilSettings { | |||||
| float draw_smoothfac; /* amount of smoothing to apply to newly created strokes */ | |||||
| float draw_sensitivity; /* amount of sensivity to apply to newly created strokes */ | |||||
| float draw_strength; /* amount of alpha strength to apply to newly created strokes */ | |||||
| float draw_jitter; /* amount of jitter to apply to newly created strokes */ | |||||
| float draw_angle; /* angle when the brush has full thickness */ | |||||
| float draw_angle_factor; /* factor to apply when angle change (only 90 degrees) */ | |||||
| float draw_random_press; /* factor of randomness for pressure */ | |||||
| float draw_random_strength; /* factor of strength for strength */ | |||||
| float draw_random_sub; /* factor of randomness for subdivision */ | |||||
| short draw_smoothlvl; /* number of times to apply smooth factor to new strokes */ | |||||
| short draw_subdivide; /* number of times to subdivide new strokes */ | |||||
| short flag; /* internal grease pencil drawing flags */ | |||||
| short thick_smoothlvl; /* number of times to apply thickness smooth factor to new strokes */ | |||||
| float thick_smoothfac; /* amount of thickness smoothing to apply to newly created strokes */ | |||||
| float fill_threshold; /* factor for transparency */ | |||||
| short fill_leak; /* number of pixel to consider the leak is too small (x 2) */ | |||||
| char pad_1[6]; | |||||
| int fill_simplylvl; /* number of simplify steps */ | |||||
| int fill_draw_mode; /* type of control lines drawing mode */ | |||||
| int icon_id; /* icon identifier */ | |||||
| int input_samples; /* maximum distance before generate new point for very fast mouse movements */ | |||||
| float uv_random; /* random factor for UV rotation */ | |||||
| int brush_type; /* type of brush (draw, fill, erase, etc..) */ | |||||
| int eraser_mode; /* soft, hard or stroke */ | |||||
| float active_smooth; /* smooth while drawing factor */ | |||||
| char pad_2[4]; | |||||
| struct CurveMapping *curve_sensitivity; | |||||
| struct CurveMapping *curve_strength; | |||||
| struct CurveMapping *curve_jitter; | |||||
| /* optional link of material to replace default in context */ | |||||
| struct Material *material; /* material */ | |||||
| } BrushGpencilSettings; | |||||
| /* BrushGpencilSettings->gp_flag */ | |||||
| typedef enum eGPDbrush_Flag { | |||||
| /* brush use pressure */ | |||||
| GP_BRUSH_USE_PRESSURE = (1 << 0), | |||||
| /* brush use pressure for alpha factor */ | |||||
| GP_BRUSH_USE_STENGTH_PRESSURE = (1 << 1), | |||||
| /* brush use pressure for alpha factor */ | |||||
| GP_BRUSH_USE_JITTER_PRESSURE = (1 << 2), | |||||
| /* enable screen cursor */ | |||||
| GP_BRUSH_ENABLE_CURSOR = (1 << 5), | |||||
| /* fill hide transparent */ | |||||
| GP_BRUSH_FILL_HIDE = (1 << 6), | |||||
| /* show fill help lines */ | |||||
| GP_BRUSH_FILL_SHOW_HELPLINES = (1 << 7), | |||||
| /* lazy mouse */ | |||||
| GP_BRUSH_STABILIZE_MOUSE = (1 << 8), | |||||
| /* lazy mouse override (internal only) */ | |||||
| GP_BRUSH_STABILIZE_MOUSE_TEMP = (1 << 9), | |||||
| /* default eraser brush for quick switch */ | |||||
| GP_BRUSH_DEFAULT_ERASER = (1 << 10), | |||||
| /* settings group */ | |||||
| GP_BRUSH_GROUP_SETTINGS = (1 << 11), | |||||
| /* Random settings group */ | |||||
| GP_BRUSH_GROUP_RANDOM = (1 << 12) | |||||
| } eGPDbrush_Flag; | |||||
| /* BrushGpencilSettings->gp_fill_draw_mode */ | |||||
| typedef enum eGP_FillDrawModes { | |||||
| GP_FILL_DMODE_BOTH = 0, | |||||
| GP_FILL_DMODE_STROKE = 1, | |||||
| GP_FILL_DMODE_CONTROL = 2, | |||||
| } eGP_FillDrawModes; | |||||
| /* BrushGpencilSettings->brush type */ | |||||
| typedef enum eGP_BrushType { | |||||
| GP_BRUSH_TYPE_DRAW = 0, | |||||
| GP_BRUSH_TYPE_FILL = 1, | |||||
| GP_BRUSH_TYPE_ERASE = 2, | |||||
| } eGP_BrushType; | |||||
| /* BrushGpencilSettings->gp_eraser_mode */ | |||||
| typedef enum eGP_BrushEraserMode { | |||||
| GP_BRUSH_ERASER_SOFT = 0, | |||||
| GP_BRUSH_ERASER_HARD = 1, | |||||
| GP_BRUSH_ERASER_STROKE = 2, | |||||
| } eGP_BrushEraserMode; | |||||
| /* BrushGpencilSettings default brush icons */ | |||||
| typedef enum eGP_BrushIcons { | |||||
campbellbarton: Why not use brush size? | |||||
| GP_BRUSH_ICON_PENCIL = 1, | |||||
| GP_BRUSH_ICON_PEN = 2, | |||||
| GP_BRUSH_ICON_INK = 3, | |||||
| GP_BRUSH_ICON_INKNOISE = 4, | |||||
| GP_BRUSH_ICON_BLOCK = 5, | |||||
| GP_BRUSH_ICON_MARKER = 6, | |||||
| GP_BRUSH_ICON_FILL = 7, | |||||
| GP_BRUSH_ICON_ERASE_SOFT = 8, | |||||
| GP_BRUSH_ICON_ERASE_HARD = 9, | |||||
| GP_BRUSH_ICON_ERASE_STROKE = 10 | |||||
| } eGP_BrushIcons; | |||||
| typedef struct Brush { | typedef struct Brush { | ||||
| ID id; | ID id; | ||||
Not Done Inline ActionsThese duplicate existing struct members - jitter, strength. This should be resolved before merge. campbellbarton: These duplicate existing struct members - jitter, strength. This should be resolved before… | |||||
Not Done Inline ActionsI have been looking at the existing fields and the definition of the ranges is different of the valid values for grease pencil. Maybe the fields have similar names, but they are used in a different way. For brush size I have reused existing field, but not for these fields. antoniov: I have been looking at the existing fields and the definition of the ranges is different of the… | |||||
| struct BrushClone clone; | struct BrushClone clone; | ||||
| struct CurveMapping *curve; /* falloff curve */ | struct CurveMapping *curve; /* falloff curve */ | ||||
| struct MTex mtex; | struct MTex mtex; | ||||
Not Done Inline ActionsShould use curve_ prefix. campbellbarton: Should use `curve_` prefix. | |||||
| struct MTex mask_mtex; | struct MTex mask_mtex; | ||||
| struct Brush *toggle_brush; | struct Brush *toggle_brush; | ||||
| struct ImBuf *icon_imbuf; | struct ImBuf *icon_imbuf; | ||||
| PreviewImage *preview; | PreviewImage *preview; | ||||
| struct ColorBand *gradient; /* color gradient */ | struct ColorBand *gradient; /* color gradient */ | ||||
| struct PaintCurve *paint_curve; | struct PaintCurve *paint_curve; | ||||
Not Done Inline ActionsBrushes already have an icon id... why have another? campbellbarton: Brushes already have an icon id... why have another? | |||||
| char icon_filepath[1024]; /* 1024 = FILE_MAX */ | char icon_filepath[1024]; /* 1024 = FILE_MAX */ | ||||
| float normal_weight; | float normal_weight; | ||||
Not Done Inline ActionsName 'lazy' should be 'smooth' ? - Why not use existing "smooth stroke" option? campbellbarton: Name 'lazy' should be 'smooth' ? - Why not use existing "smooth stroke" option? | |||||
| float rake_factor; /* rake actual data (not texture), used for sculpt */ | float rake_factor; /* rake actual data (not texture), used for sculpt */ | ||||
| short blend; /* blend mode */ | short blend; /* blend mode */ | ||||
| short ob_mode; /* eObjectMode: to see if the brush is compatible, use for display only. */ | short ob_mode; /* eObjectMode: to see if the brush is compatible, use for display only. */ | ||||
| float weight; /* brush weight */ | float weight; /* brush weight */ | ||||
| int size; /* brush diameter */ | int size; /* brush diameter */ | ||||
| int flag; /* general purpose flag */ | int flag; /* general purpose flag */ | ||||
| int mask_pressure; /* pressure influence for mask */ | int mask_pressure; /* pressure influence for mask */ | ||||
| float jitter; /* jitter the position of the brush */ | float jitter; /* jitter the position of the brush */ | ||||
| int jitter_absolute; /* absolute jitter in pixels */ | int jitter_absolute; /* absolute jitter in pixels */ | ||||
Not Done Inline ActionsWould prefer these go into their own sub-struct, besides anything which is generic - eg CurveMapping. campbellbarton: Would prefer these go into their own sub-struct, besides anything which is generic - eg… | |||||
| int overlay_flags; | int overlay_flags; | ||||
| int spacing; /* spacing of paint operations */ | int spacing; /* spacing of paint operations */ | ||||
| int smooth_stroke_radius; /* turning radius (in pixels) for smooth stroke */ | int smooth_stroke_radius; /* turning radius (in pixels) for smooth stroke */ | ||||
| float smooth_stroke_factor; /* higher values limit fast changes in the stroke direction */ | float smooth_stroke_factor; /* higher values limit fast changes in the stroke direction */ | ||||
| float rate; /* paint operations / second (airbrush) */ | float rate; /* paint operations / second (airbrush) */ | ||||
| float rgb[3]; /* color */ | float rgb[3]; /* color */ | ||||
| float alpha; /* opacity */ | float alpha; /* opacity */ | ||||
| Show All 14 Lines | typedef struct Brush { | ||||
| char sculpt_tool; /* active sculpt tool */ | char sculpt_tool; /* active sculpt tool */ | ||||
| char vertexpaint_tool; /* active vertex/weight paint blend mode (poorly named) */ | char vertexpaint_tool; /* active vertex/weight paint blend mode (poorly named) */ | ||||
| char imagepaint_tool; /* active image paint tool */ | char imagepaint_tool; /* active image paint tool */ | ||||
| char mask_tool; /* enum eBrushMaskTool, only used if sculpt_tool is SCULPT_TOOL_MASK */ | char mask_tool; /* enum eBrushMaskTool, only used if sculpt_tool is SCULPT_TOOL_MASK */ | ||||
| float autosmooth_factor; | float autosmooth_factor; | ||||
| float crease_pinch_factor; | float crease_pinch_factor; | ||||
Not Done Inline Actionsuse GP_BRUSH_ prefix. campbellbarton: use `GP_BRUSH_` prefix. | |||||
| float plane_trim; | float plane_trim; | ||||
| float height; /* affectable height of brush (layer height for layer tool, i.e.) */ | float height; /* affectable height of brush (layer height for layer tool, i.e.) */ | ||||
| float texture_sample_bias; | float texture_sample_bias; | ||||
| /* overlay */ | /* overlay */ | ||||
| int texture_overlay_alpha; | int texture_overlay_alpha; | ||||
| int mask_overlay_alpha; | int mask_overlay_alpha; | ||||
| int cursor_overlay_alpha; | int cursor_overlay_alpha; | ||||
| float unprojected_radius; | float unprojected_radius; | ||||
| /* soften/sharpen */ | /* soften/sharpen */ | ||||
| float sharp_threshold; | float sharp_threshold; | ||||
| int blur_kernel_radius; | int blur_kernel_radius; | ||||
| int blur_mode; | int blur_mode; | ||||
| /* fill tool */ | /* fill tool */ | ||||
| float fill_threshold; | float fill_threshold; | ||||
Not Done Inline Actionsuse GP_BRUSH_ICON_ prefix campbellbarton: use `GP_BRUSH_ICON_` prefix | |||||
| float add_col[3]; | float add_col[3]; | ||||
| float sub_col[3]; | float sub_col[3]; | ||||
| float stencil_pos[2]; | float stencil_pos[2]; | ||||
| float stencil_dimension[2]; | float stencil_dimension[2]; | ||||
| float mask_stencil_pos[2]; | float mask_stencil_pos[2]; | ||||
| float mask_stencil_dimension[2]; | float mask_stencil_dimension[2]; | ||||
| } Brush; | |||||
| struct BrushGpencilSettings *gpencil_settings; | |||||
| } Brush; | |||||
| typedef struct PaletteColor { | typedef struct PaletteColor { | ||||
| struct PaletteColor *next, *prev; | struct PaletteColor *next, *prev; | ||||
| /* two values, one to store rgb, other to store values for sculpt/weight */ | /* two values, one to store rgb, other to store values for sculpt/weight */ | ||||
| float rgb[3]; | float rgb[3]; | ||||
| float value; | float value; | ||||
| } PaletteColor; | } PaletteColor; | ||||
| typedef struct Palette { | typedef struct Palette { | ||||
| ID id; | ID id; | ||||
Not Done Inline ActionsPalette is like a tool setting. I don't see why you want to those. It is like animating sculpt brush size -- not that useful at all, only gives issues. sergey: Palette is like a tool setting. I don't see why you want to those. It is like animating sculpt… | |||||
Not Done Inline ActionsNot really. Palettes group colors and color properties can be animated. It's not a tool is a property of the strokes. antoniov: Not really. Palettes group colors and color properties can be animated. It's not a tool is a… | |||||
Not Done Inline ActionsIt is used for strokes in GP, but it was not before (was bGPPalette or so before). And as far as i remember it was only used by tools. sergey: It is used for strokes in GP, but it was not before (was bGPPalette or so before). And as far… | |||||
Not Done Inline ActionsYes, before the Blender palettes were used only as tools, but after change GP to use Blender palettes instead of bGPDpalette, it was necessary to add animation options for colors and setttings. antoniov: Yes, before the Blender palettes were used only as tools, but after change GP to use Blender… | |||||
| /* pointer to individual colours */ | /* pointer to individual colours */ | ||||
| ListBase colors; | ListBase colors; | ||||
| int active_color; | int active_color; | ||||
| int pad; | int pad; | ||||
| } Palette; | } Palette; | ||||
| typedef struct PaintCurvePoint { | typedef struct PaintCurvePoint { | ||||
| ▲ Show 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | |||||
| /* 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, | ||||
| }; | }; | ||||
| #define MAX_BRUSH_PIXEL_RADIUS 500 | #define MAX_BRUSH_PIXEL_RADIUS 500 | ||||
| #define GP_MAX_BRUSH_PIXEL_RADIUS 1000 | |||||
| #endif /* __DNA_BRUSH_TYPES_H__ */ | #endif /* __DNA_BRUSH_TYPES_H__ */ | ||||
Why not use brush size?