Changeset View
Standalone View
source/blender/makesdna/DNA_brush_types.h
| Context not available. | |||||
| struct CurveMapping; | struct CurveMapping; | ||||
| struct MTex; | struct MTex; | ||||
| struct Image; | struct Image; | ||||
| struct AnimData; | |||||
| struct Image; | |||||
| typedef struct BrushClone { | typedef struct BrushClone { | ||||
| struct Image *image; /* image for clone tool */ | struct Image *image; /* image for clone tool */ | ||||
| Context not available. | |||||
| float mask_stencil_pos[2]; | float mask_stencil_pos[2]; | ||||
| float mask_stencil_dimension[2]; | float mask_stencil_dimension[2]; | ||||
| /* grease pencil drawing brush data */ | |||||
campbellbarton: Why not use brush size? | |||||
| short thickness; /* thickness to apply to strokes */ | |||||
| short gp_flag; /* internal grease pencil drawing flags */ | |||||
| float draw_smoothfac; /* amount of smoothing to apply to newly created strokes */ | |||||
| short draw_smoothlvl; /* number of times to apply smooth factor to new strokes */ | |||||
| short draw_subdivide; /* number of times to subdivide new 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 */ | |||||
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… | |||||
| char pad2[4]; | |||||
| struct CurveMapping *cur_sensitivity; | |||||
| struct CurveMapping *cur_strength; | |||||
Not Done Inline ActionsShould use curve_ prefix. campbellbarton: Should use `curve_` prefix. | |||||
| struct CurveMapping *cur_jitter; | |||||
| float gp_thick_smoothfac; /* amount of thickness smoothing to apply to newly created strokes */ | |||||
| short gp_thick_smoothlvl; /* number of times to apply thickness smooth factor to new strokes */ | |||||
| short gp_fill_leak; /* number of pixel to consider the leak is too small (x 2) */ | |||||
| float gp_fill_threshold; /* factor for transparency */ | |||||
| int gp_fill_simplylvl; /* number of simplify steps */ | |||||
| int gp_fill_draw_mode; /* type of control lines drawing mode */ | |||||
Not Done Inline ActionsBrushes already have an icon id... why have another? campbellbarton: Brushes already have an icon id... why have another? | |||||
| int gp_icon_id; /* icon identifier */ | |||||
| int gp_lazy_radius; /* distance to last point to create new point */ | |||||
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 gp_lazy_factor; /* factor of smooth */ | |||||
| float gp_uv_random; /* random factor for UV rotation */ | |||||
| int gp_input_samples; /* maximum distance before generate new point for very fast mouse movements */ | |||||
| int gp_brush_type; /* type of brush (draw, fill, erase, etc..) */ | |||||
| int gp_eraser_mode; /* soft, hard or stroke */ | |||||
| float gp_active_smooth; /* smooth while drawing factor */ | |||||
| char pad_[4]; | |||||
| /* optional link of palette and color to replace default color in context */ | |||||
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… | |||||
| struct Palette *palette; /* palette linked */ | |||||
| char colorname[64]; /* color name */ | |||||
| } Brush; | } Brush; | ||||
| /* Brush->gp_flag */ | |||||
| typedef enum eGPDbrush_Flag { | |||||
| /* brush use pressure */ | |||||
| GP_BRUSH_USE_PRESSURE = (1 << 0), | |||||
| /* brush use pressure for alpha factor */ | |||||
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… | |||||
| 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; | |||||
| /* Brush->gp_fill_draw_mode */ | |||||
Not Done Inline Actionsuse GP_BRUSH_ prefix. campbellbarton: use `GP_BRUSH_` prefix. | |||||
| typedef enum eGP_FillDrawModes { | |||||
| GP_FILL_DMODE_BOTH = 0, | |||||
| GP_FILL_DMODE_STROKE = 1, | |||||
| GP_FILL_DMODE_CONTROL = 2, | |||||
| } eGP_FillDrawModes; | |||||
| /* Brush->brush type */ | |||||
| typedef enum eGP_BrushType { | |||||
| GP_BRUSH_TYPE_DRAW = 0, | |||||
| GP_BRUSH_TYPE_FILL = 1, | |||||
| GP_BRUSH_TYPE_ERASE = 2, | |||||
| } eGP_BrushType; | |||||
| /* Brush->gp_eraser_mode */ | |||||
| typedef enum eGP_BrushEraserMode { | |||||
| GP_BRUSH_ERASER_SOFT = 0, | |||||
| GP_BRUSH_ERASER_HARD = 1, | |||||
| GP_BRUSH_ERASER_STROKE = 2, | |||||
| } eGP_BrushEraserMode; | |||||
| /* default brush icons */ | |||||
Not Done Inline Actionsuse GP_BRUSH_ICON_ prefix campbellbarton: use `GP_BRUSH_ICON_` prefix | |||||
| typedef enum eGP_BrushIcons { | |||||
| GPBRUSH_CUSTOM = 0, | |||||
| GPBRUSH_PENCIL = 1, | |||||
| GPBRUSH_PEN = 2, | |||||
| GPBRUSH_INK = 3, | |||||
| GPBRUSH_INKNOISE = 4, | |||||
| GPBRUSH_BLOCK = 5, | |||||
| GPBRUSH_MARKER = 6, | |||||
| GPBRUSH_FILL = 7, | |||||
| GPBRUSH_ERASE_SOFT = 8, | |||||
| GPBRUSH_ERASE_HARD = 9, | |||||
| GPBRUSH_ERASE_STROKE = 10 | |||||
| } eGP_BrushIcons; | |||||
| 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 */ | struct Image *sima; /* Texture image for strokes */ | ||||
| float rgb[3]; | struct Image *ima; /* Texture image for filling */ | ||||
| float value; | float rgb[4]; /* color for paint and strokes (alpha included) */ | ||||
| float fill[4]; /* color that should be used for drawing "fills" for strokes (alpha included) */ | |||||
| float scolor[4]; /* secondary color used for gradients and other stuff */ | |||||
| char info[64]; /* color name. Must be unique. */ | |||||
| float value; /* sculpt/weight */ | |||||
| short flag; /* settings for palette color */ | |||||
| short index; /* custom index for passes */ | |||||
| short stroke_style; /* style for drawing strokes (used to select shader type) */ | |||||
| short fill_style; /* style for filling areas (used to select shader type) */ | |||||
| float mix_factor; /* factor used to define shader behavior (several uses) */ | |||||
| float g_angle; /* angle used for gradients orientation */ | |||||
| float g_radius; /* radius for radial gradients */ | |||||
| float g_boxsize; /* cheesboard size */ | |||||
| float g_scale[2]; /* uv coordinates scale */ | |||||
| float g_shift[2]; /* factor to shift filling in 2d space */ | |||||
| float t_angle; /* angle used for texture orientation */ | |||||
| float t_scale[2]; /* texture scale (separated of uv scale) */ | |||||
| float t_offset[2]; /* factor to shift texture in 2d space */ | |||||
| float t_opacity; /* texture opacity */ | |||||
| float t_pixsize; /* pixel size for uv along the stroke */ | |||||
| int mode; /* drawing mode (line or dots) */ | |||||
| char pad[4]; | |||||
| } PaletteColor; | } PaletteColor; | ||||
| /* PaletteColor->flag (mainly used by grease pencil) */ | |||||
| typedef enum ePaletteColor_Flag { | |||||
| /* don't display color */ | |||||
| PAC_COLOR_HIDE = (1 << 1), | |||||
| /* protected from further editing */ | |||||
| PAC_COLOR_LOCKED = (1 << 2), | |||||
| /* do onion skinning */ | |||||
| PAC_COLOR_ONIONSKIN = (1 << 3), | |||||
| /* clamp texture */ | |||||
| PAC_COLOR_TEX_CLAMP = (1 << 4), | |||||
| /* mix texture */ | |||||
| PAC_COLOR_TEX_MIX = (1 << 5), | |||||
| /* Flip fill colors */ | |||||
| PAC_COLOR_FLIP_FILL = (1 << 6), | |||||
| /* Stroke use Dots */ | |||||
| PAC_COLOR_DOT = (1 << 7), /* deprecated (only for old files) */ | |||||
| /* Texture is a pattern */ | |||||
| PAC_COLOR_PATTERN = (1 << 8) | |||||
| } ePaletteColor_Flag; | |||||
| typedef enum ePaletteColor_Mode { | |||||
| PAC_MODE_LINE = 0, /* line */ | |||||
| PAC_MODE_DOTS = 1, /* dots */ | |||||
| PAC_MODE_BOX = 2, /* rectangles */ | |||||
| } ePaletteColor_Mode; | |||||
| typedef struct Palette { | typedef struct Palette { | ||||
| ID id; | ID id; | ||||
| struct AnimData *adt; /* animation data - for animating draw settings */ | |||||
| /* pointer to individual colours */ | /* pointer to individual colours */ | ||||
| ListBase colors; | ListBase colors; | ||||
| int active_color; | int active_color; | ||||
| int pad; | int flag; | ||||
| } Palette; | } Palette; | ||||
| /* Palette->flag */ | |||||
| typedef enum ePalette_Flag { | |||||
| /* in Action Editor, show as expanded channel */ | |||||
| PALETTE_DATA_EXPAND = (1 << 1) | |||||
| } ePalette_Flag; | |||||
| typedef struct PaintCurvePoint { | typedef struct PaintCurvePoint { | ||||
| BezTriple bez; /* bezier handle */ | BezTriple bez; /* bezier handle */ | ||||
| float pressure; /* pressure on that point */ | float pressure; /* pressure on that point */ | ||||
| Context not available. | |||||
| }; | }; | ||||
| #define MAX_BRUSH_PIXEL_RADIUS 500 | #define MAX_BRUSH_PIXEL_RADIUS 500 | ||||
| #define GP_MAX_BRUSH_PIXEL_RADIUS 1000 | |||||
| /* Grease Pencil Stroke styles */ | |||||
| #define STROKE_STYLE_SOLID 0 | |||||
| #define STROKE_STYLE_TEXTURE 1 | |||||
| /* Grease Pencil Fill styles */ | |||||
| #define FILL_STYLE_SOLID 0 | |||||
| #define FILL_STYLE_GRADIENT 1 | |||||
| #define FILL_STYLE_RADIAL 2 | |||||
| #define FILL_STYLE_CHESSBOARD 3 | |||||
| #define FILL_STYLE_TEXTURE 4 | |||||
| #define FILL_STYLE_PATTERN 5 | |||||
| #endif /* __DNA_BRUSH_TYPES_H__ */ | #endif /* __DNA_BRUSH_TYPES_H__ */ | ||||
| Context not available. | |||||
Why not use brush size?