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 AnimData; | |||||
| struct Image; | |||||
| 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 Brush { | typedef struct Brush { | ||||
| ▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | typedef struct Brush { | ||||
| 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; | } Brush; | ||||
campbellbarton: Why not use brush size? | |||||
| 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) */ | |||||
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… | |||||
| 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 */ | |||||
Not Done Inline ActionsShould use curve_ prefix. campbellbarton: Should use `curve_` prefix. | |||||
| 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_shift[2]; /* factor to shift texture in 2d space */ | |||||
| float t_opacity; /* texture opacity */ | |||||
| char pad[4]; | |||||
| } PaletteColor; | } PaletteColor; | ||||
| /* PaletteColor->flag (mainly used by grease pencil) */ | |||||
Not Done Inline ActionsBrushes already have an icon id... why have another? campbellbarton: Brushes already have an icon id... why have another? | |||||
| typedef enum ePaletteColor_Flag { | |||||
| /* don't display color */ | |||||
| PAC_COLOR_HIDE = (1 << 1), | |||||
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? | |||||
| /* 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), | |||||
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… | |||||
| /* Stroke use Dots */ | |||||
| PAC_COLOR_DOT = (1 << 7), | |||||
| /* Texture is a pattern */ | |||||
| PAC_COLOR_PATTERN = (1 << 8) | |||||
| } ePaletteColor_Flag; | |||||
| typedef struct Palette { | typedef struct Palette { | ||||
| ID id; | ID id; | ||||
| struct AnimData *adt; /* animation data - for animating draw settings */ | |||||
sergeyUnsubmitted 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… | |||||
antoniovAuthorUnsubmitted 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… | |||||
sergeyUnsubmitted 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… | |||||
antoniovAuthorUnsubmitted 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 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 */ | ||||
| } PaintCurvePoint; | } PaintCurvePoint; | ||||
| typedef struct PaintCurve { | typedef struct PaintCurve { | ||||
| ID id; | ID id; | ||||
| PaintCurvePoint *points; /* points of curve */ | PaintCurvePoint *points; /* points of curve */ | ||||
Not Done Inline Actionsuse GP_BRUSH_ prefix. campbellbarton: use `GP_BRUSH_` prefix. | |||||
| int tot_points; | int tot_points; | ||||
| int add_index; /* index where next point will be added */ | int add_index; /* index where next point will be added */ | ||||
| } PaintCurve; | } PaintCurve; | ||||
| /* Brush.gradient_source */ | /* Brush.gradient_source */ | ||||
| typedef enum eBrushGradientSourceStroke { | typedef enum eBrushGradientSourceStroke { | ||||
| BRUSH_GRADIENT_PRESSURE = 0, /* gradient from pressure */ | BRUSH_GRADIENT_PRESSURE = 0, /* gradient from pressure */ | ||||
| BRUSH_GRADIENT_SPACING_REPEAT = 1, /* gradient from spacing */ | BRUSH_GRADIENT_SPACING_REPEAT = 1, /* gradient from spacing */ | ||||
| BRUSH_GRADIENT_SPACING_CLAMP = 2 /* gradient from spacing */ | BRUSH_GRADIENT_SPACING_CLAMP = 2 /* gradient from spacing */ | ||||
| } eBrushGradientSourceStroke; | } eBrushGradientSourceStroke; | ||||
| typedef enum eBrushGradientSourceFill { | typedef enum eBrushGradientSourceFill { | ||||
| BRUSH_GRADIENT_LINEAR = 0, /* gradient from pressure */ | BRUSH_GRADIENT_LINEAR = 0, /* gradient from pressure */ | ||||
| BRUSH_GRADIENT_RADIAL = 1 /* gradient from spacing */ | BRUSH_GRADIENT_RADIAL = 1 /* gradient from spacing */ | ||||
| } eBrushGradientSourceFill; | } eBrushGradientSourceFill; | ||||
| /* Brush.flag */ | /* Brush.flag */ | ||||
| typedef enum eBrushFlags { | typedef enum eBrushFlags { | ||||
| BRUSH_AIRBRUSH = (1 << 0), | BRUSH_AIRBRUSH = (1 << 0), | ||||
| BRUSH_FLAG_DEPRECATED_1 = (1 << 1), | BRUSH_FLAG_DEPRECATED_1 = (1 << 1), | ||||
| BRUSH_ALPHA_PRESSURE = (1 << 2), | BRUSH_ALPHA_PRESSURE = (1 << 2), | ||||
Not Done Inline Actionsuse GP_BRUSH_ICON_ prefix campbellbarton: use `GP_BRUSH_ICON_` prefix | |||||
| BRUSH_SIZE_PRESSURE = (1 << 3), | BRUSH_SIZE_PRESSURE = (1 << 3), | ||||
| BRUSH_JITTER_PRESSURE = (1 << 4), | BRUSH_JITTER_PRESSURE = (1 << 4), | ||||
| BRUSH_SPACING_PRESSURE = (1 << 5), | BRUSH_SPACING_PRESSURE = (1 << 5), | ||||
| BRUSH_FLAG_DEPRECATED_2 = (1 << 6), | BRUSH_FLAG_DEPRECATED_2 = (1 << 6), | ||||
| BRUSH_FLAG_DEPRECATED_3 = (1 << 7), | BRUSH_FLAG_DEPRECATED_3 = (1 << 7), | ||||
| BRUSH_ANCHORED = (1 << 8), | BRUSH_ANCHORED = (1 << 8), | ||||
| BRUSH_DIR_IN = (1 << 9), | BRUSH_DIR_IN = (1 << 9), | ||||
| BRUSH_SPACE = (1 << 10), | BRUSH_SPACE = (1 << 10), | ||||
| ▲ Show 20 Lines • Show All 153 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 | ||||
| /* 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__ */ | ||||
Why not use brush size?