Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesdna/DNA_gpencil_types.h
| Show All 30 Lines | |||||
| struct ARegion; | struct ARegion; | ||||
| struct AnimData; | struct AnimData; | ||||
| struct MDeformVert; | struct MDeformVert; | ||||
| #define GP_DEFAULT_PIX_FACTOR 1.0f | #define GP_DEFAULT_PIX_FACTOR 1.0f | ||||
| #define GP_DEFAULT_GRID_LINES 4 | #define GP_DEFAULT_GRID_LINES 4 | ||||
| #define GP_MAX_INPUT_SAMPLES 10 | #define GP_MAX_INPUT_SAMPLES 10 | ||||
| #define GP_MATERIAL_BUFFER_LEN 256 | |||||
| /* ***************************************** */ | /* ***************************************** */ | ||||
| /* GP Stroke Points */ | /* GP Stroke Points */ | ||||
| /* 'Control Point' data for primitives and curves */ | /* 'Control Point' data for primitives and curves */ | ||||
| typedef struct bGPDcontrolpoint { | typedef struct bGPDcontrolpoint { | ||||
| /** X and y coordinates of control point. */ | /** X and y coordinates of control point. */ | ||||
| float x, y, z; | float x, y, z; | ||||
| /** Point color. */ | /** Point color. */ | ||||
| Show All 26 Lines | typedef struct bGPDspoint { | ||||
| float time; | float time; | ||||
| /** Additional options. */ | /** Additional options. */ | ||||
| int flag; | int flag; | ||||
| /** Factor of uv along the stroke. */ | /** Factor of uv along the stroke. */ | ||||
| float uv_fac; | float uv_fac; | ||||
| /** Uv rotation for dot mode. */ | /** Uv rotation for dot mode. */ | ||||
| float uv_rot; | float uv_rot; | ||||
| /** Uv for fill mode */ | |||||
| float uv_fill[2]; | |||||
| /** Vertex Color RGBA (A=mix factor). */ | |||||
| float vert_color[4]; | |||||
| /** Runtime data */ | /** Runtime data */ | ||||
| char _pad2[4]; | char _pad2[4]; | ||||
| bGPDspoint_Runtime runtime; | bGPDspoint_Runtime runtime; | ||||
| } bGPDspoint; | } bGPDspoint; | ||||
| /* bGPDspoint->flag */ | /* bGPDspoint->flag */ | ||||
| typedef enum eGPDspoint_Flag { | typedef enum eGPDspoint_Flag { | ||||
| /* stroke point is selected (for editing) */ | /* stroke point is selected (for editing) */ | ||||
| GP_SPOINT_SELECT = (1 << 0), | GP_SPOINT_SELECT = (1 << 0), | ||||
| /* stroke point is tagged (for some editing operation) */ | /* stroke point is tagged (for some editing operation) */ | ||||
| GP_SPOINT_TAG = (1 << 1), | GP_SPOINT_TAG = (1 << 1), | ||||
| /* stroke point is temp tagged (for some editing operation) */ | /* stroke point is temp tagged (for some editing operation) */ | ||||
| GP_SPOINT_TEMP_TAG = (1 << 2), | GP_SPOINT_TEMP_TAG = (1 << 2), | ||||
| } eGPSPoint_Flag; | } eGPSPoint_Flag; | ||||
| /* ***************************************** */ | /* ***************************************** */ | ||||
| /* GP Fill - Triangle Tessellation Data */ | /* GP Fill - Triangle Tessellation Data */ | ||||
| /* Grease-Pencil Annotations - 'Triangle' | /* Grease-Pencil Annotations - 'Triangle' | ||||
| * -> A triangle contains the index of three vertices for filling the stroke | * -> A triangle contains the index of three vertices for filling the stroke | ||||
| * This is only used if high quality fill is enabled | * This is only used if high quality fill is enabled | ||||
| */ | */ | ||||
| typedef struct bGPDtriangle { | typedef struct bGPDtriangle { | ||||
| /* indices for tessellated triangle used for GP Fill */ | /* indices for tessellated triangle used for GP Fill */ | ||||
| unsigned int verts[3]; | unsigned int verts[3]; | ||||
| /* texture coordinates for verts */ | |||||
| float uv[3][2]; | |||||
| } bGPDtriangle; | } bGPDtriangle; | ||||
| /* ***************************************** */ | /* ***************************************** */ | ||||
| /* ***************************************** */ | /* ***************************************** */ | ||||
| /* GP Palettes (Deprecated - 2.78 - 2.79 only) */ | /* GP Palettes (Deprecated - 2.78 - 2.79 only) */ | ||||
| /* color of palettes */ | /* color of palettes */ | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | typedef enum eGPDpalette_Flag { | ||||
| PL_PALETTE_ACTIVE = (1 << 0), | PL_PALETTE_ACTIVE = (1 << 0), | ||||
| } eGPDpalette_Flag; | } eGPDpalette_Flag; | ||||
| /* ***************************************** */ | /* ***************************************** */ | ||||
| /* GP Strokes */ | /* GP Strokes */ | ||||
| /* Runtime temp data for bGPDstroke */ | /* Runtime temp data for bGPDstroke */ | ||||
| typedef struct bGPDstroke_Runtime { | typedef struct bGPDstroke_Runtime { | ||||
| /** runtime final colors (result of original colors and modifiers) */ | |||||
| float tmp_stroke_rgba[4]; | |||||
| /** runtime final fill colors (result of original colors and modifiers) */ | |||||
| float tmp_fill_rgba[4]; | |||||
| /** temporary layer name only used during copy/paste to put the stroke in the original layer */ | /** temporary layer name only used during copy/paste to put the stroke in the original layer */ | ||||
| char tmp_layerinfo[128]; | char tmp_layerinfo[128]; | ||||
| /** Runtime falloff factor (only for transform). */ | /** Runtime falloff factor (only for transform). */ | ||||
| float multi_frame_falloff; | float multi_frame_falloff; | ||||
| char _pad[4]; | |||||
| /** Vertex offset in the vbo where this stroke starts. */ | |||||
| int stroke_start; | |||||
| /** Triangle offset in the ibo where this fill starts. */ | |||||
| int fill_start; | |||||
| int _pad[1]; | |||||
| /** Original stroke (used to dereference evaluated data) */ | /** Original stroke (used to dereference evaluated data) */ | ||||
| struct bGPDstroke *gps_orig; | struct bGPDstroke *gps_orig; | ||||
| void *_pad2; | void *_pad2; | ||||
| } bGPDstroke_Runtime; | } bGPDstroke_Runtime; | ||||
| /* Grease-Pencil Annotations - 'Stroke' | /* Grease-Pencil Annotations - 'Stroke' | ||||
| * -> A stroke represents a (simplified version) of the curve | * -> A stroke represents a (simplified version) of the curve | ||||
| Show All 23 Lines | typedef struct bGPDstroke { | ||||
| char colorname[128] DNA_DEPRECATED; | char colorname[128] DNA_DEPRECATED; | ||||
| /** Material index. */ | /** Material index. */ | ||||
| int mat_nr; | int mat_nr; | ||||
| /** Caps mode for each stroke extreme */ | /** Caps mode for each stroke extreme */ | ||||
| short caps[2]; | short caps[2]; | ||||
| /** gradient control along y for color */ | /** gradient control along y for color */ | ||||
| float gradient_f; | float hardeness; | ||||
| /** factor xy of shape for dots gradients */ | /** factor xy of shape for dots gradients */ | ||||
| float gradient_s[2]; | float aspect_ratio[2]; | ||||
| char _pad_3[4]; | |||||
| /** Factor of opacity for Fill color (used by opacity modifier). */ | |||||
| float fill_opacity_fac; | |||||
| /** Min of the bound box used to speedup painting operators. */ | |||||
| float boundbox_min[3]; | |||||
| /** Max of the bound box used to speedup painting operators. */ | |||||
| float boundbox_max[3]; | |||||
| /** UV rotation */ | |||||
| float uv_rotation; | |||||
| /** UV translation (X and Y axis) */ | |||||
| float uv_translation[2]; | |||||
| float uv_scale; | |||||
| /** Vertex weight data. */ | /** Vertex weight data. */ | ||||
| struct MDeformVert *dvert; | struct MDeformVert *dvert; | ||||
| void *_pad3; | void *_pad3; | ||||
| /** Vertex Color for Fill (one for all stroke, A=mix factor). */ | |||||
| float vert_color_fill[4]; | |||||
| bGPDstroke_Runtime runtime; | bGPDstroke_Runtime runtime; | ||||
| } bGPDstroke; | } bGPDstroke; | ||||
| /* bGPDstroke->flag */ | /* bGPDstroke->flag */ | ||||
| typedef enum eGPDstroke_Flag { | typedef enum eGPDstroke_Flag { | ||||
| /* stroke is in 3d-space */ | /* stroke is in 3d-space */ | ||||
| GP_STROKE_3DSPACE = (1 << 0), | GP_STROKE_3DSPACE = (1 << 0), | ||||
| /* stroke is in 2d-space */ | /* stroke is in 2d-space */ | ||||
| GP_STROKE_2DSPACE = (1 << 1), | GP_STROKE_2DSPACE = (1 << 1), | ||||
| /* stroke is in 2d-space (but with special 'image' scaling) */ | /* stroke is in 2d-space (but with special 'image' scaling) */ | ||||
| GP_STROKE_2DIMAGE = (1 << 2), | GP_STROKE_2DIMAGE = (1 << 2), | ||||
| /* stroke is selected */ | /* stroke is selected */ | ||||
| GP_STROKE_SELECT = (1 << 3), | GP_STROKE_SELECT = (1 << 3), | ||||
| /* Recalculate geometry data (triangulation, UVs, Bound Box,... | |||||
| * (when true, force a new recalc) */ | |||||
| GP_STROKE_RECALC_GEOMETRY = (1 << 4), | |||||
| /* Flag used to indicate that stroke is closed and draw edge between last and first point */ | /* Flag used to indicate that stroke is closed and draw edge between last and first point */ | ||||
| GP_STROKE_CYCLIC = (1 << 7), | GP_STROKE_CYCLIC = (1 << 7), | ||||
| /* Flag used to indicate that stroke is used for fill close and must use | /* Flag used to indicate that stroke is used for fill close and must use | ||||
| * fill color for stroke and no fill area */ | * fill color for stroke and no fill area */ | ||||
| GP_STROKE_NOFILL = (1 << 8), | GP_STROKE_NOFILL = (1 << 8), | ||||
| /* Tag for update geometry */ | |||||
| GP_STROKE_TAG = (1 << 14), | |||||
| /* only for use with stroke-buffer (while drawing eraser) */ | /* only for use with stroke-buffer (while drawing eraser) */ | ||||
| GP_STROKE_ERASER = (1 << 15), | GP_STROKE_ERASER = (1 << 15), | ||||
| } eGPDstroke_Flag; | } eGPDstroke_Flag; | ||||
| /* bGPDstroke->caps */ | /* bGPDstroke->caps */ | ||||
| typedef enum eGPDstroke_Caps { | typedef enum eGPDstroke_Caps { | ||||
| /* type of extreme */ | /* type of extreme */ | ||||
| GP_STROKE_CAP_ROUND = 0, | GP_STROKE_CAP_ROUND = 0, | ||||
| GP_STROKE_CAP_FLAT = 1, | GP_STROKE_CAP_FLAT = 1, | ||||
| GP_STROKE_CAP_MAX, | GP_STROKE_CAP_MAX, | ||||
| } GPDstroke_Caps; | } GPDstroke_Caps; | ||||
| /* ***************************************** */ | /* ***************************************** */ | ||||
| /* GP Frame */ | /* GP Frame */ | ||||
| /* Runtime temp data for bGPDframe */ | /* Runtime temp data for bGPDframe */ | ||||
| typedef struct bGPDframe_Runtime { | typedef struct bGPDframe_Runtime { | ||||
| /** Parent matrix for drawing. */ | /** Index of this frame in the listbase of frames. */ | ||||
| float parent_obmat[4][4]; | int frameid; | ||||
| /** Onion offset from active frame. 0 if not onion. INT_MAX to bypass frame. */ | |||||
| int onion_id; | |||||
| /** Original frame (used to dereference evaluated data) */ | |||||
| struct bGPDframe *gpf_orig; | |||||
| } bGPDframe_Runtime; | } bGPDframe_Runtime; | ||||
| /* Grease-Pencil Annotations - 'Frame' | /* Grease-Pencil Annotations - 'Frame' | ||||
| * -> Acts as storage for the 'image' formed by strokes | * -> Acts as storage for the 'image' formed by strokes | ||||
| */ | */ | ||||
| typedef struct bGPDframe { | typedef struct bGPDframe { | ||||
| struct bGPDframe *next, *prev; | struct bGPDframe *next, *prev; | ||||
| Show All 17 Lines | typedef enum eGPDframe_Flag { | ||||
| GP_FRAME_PAINT = (1 << 0), | GP_FRAME_PAINT = (1 << 0), | ||||
| /* for editing in Action Editor */ | /* for editing in Action Editor */ | ||||
| GP_FRAME_SELECT = (1 << 1), | GP_FRAME_SELECT = (1 << 1), | ||||
| } eGPDframe_Flag; | } eGPDframe_Flag; | ||||
| /* ***************************************** */ | /* ***************************************** */ | ||||
| /* GP Layer */ | /* GP Layer */ | ||||
| /* List of masking layers. */ | |||||
| typedef struct bGPDlayer_Mask { | |||||
| struct bGPDlayer_Mask *next, *prev; | |||||
| char name[128]; | |||||
| short flag; | |||||
| /** Index for sorting. Only valid while sorting algorithm is running. */ | |||||
| short sort_index; | |||||
| char _pad[4]; | |||||
| } bGPDlayer_Mask; | |||||
| /* bGPDlayer_Mask->flag */ | |||||
| typedef enum ebGPDlayer_Mask_Flag { | |||||
| /* Mask is hidden. */ | |||||
| GP_MASK_HIDE = (1 << 0), | |||||
| /* Mask is inverted. */ | |||||
| GP_MASK_INVERT = (1 << 1), | |||||
| } ebGPDlayer_Mask_Flag; | |||||
| /* Runtime temp data for bGPDlayer */ | /* Runtime temp data for bGPDlayer */ | ||||
| typedef struct bGPDlayer_Runtime { | typedef struct bGPDlayer_Runtime { | ||||
| /** Id for dynamic icon used to show annotation color preview for layer. */ | /** Id for dynamic icon used to show annotation color preview for layer. */ | ||||
| int icon_id; | int icon_id; | ||||
| char _pad[4]; | char _pad[4]; | ||||
| /** Original layer (used to dereference evaluated data) */ | |||||
| struct bGPDlayer *gpl_orig; | |||||
| } bGPDlayer_Runtime; | } bGPDlayer_Runtime; | ||||
| /* Grease-Pencil Annotations - 'Layer' */ | /* Grease-Pencil Annotations - 'Layer' */ | ||||
| typedef struct bGPDlayer { | typedef struct bGPDlayer { | ||||
| struct bGPDlayer *next, *prev; | struct bGPDlayer *next, *prev; | ||||
| /** List of annotations to display for frames (bGPDframe list). */ | /** List of annotations to display for frames (bGPDframe list). */ | ||||
| ListBase frames; | ListBase frames; | ||||
| Show All 34 Lines | typedef struct bGPDlayer { | ||||
| float tintcolor[4]; | float tintcolor[4]; | ||||
| /** Opacity of the layer. */ | /** Opacity of the layer. */ | ||||
| float opacity; | float opacity; | ||||
| /** Name of the layer used to filter render output. */ | /** Name of the layer used to filter render output. */ | ||||
| char viewlayername[64]; | char viewlayername[64]; | ||||
| /** Blend modes. */ | /** Blend modes. */ | ||||
| int blend_mode; | int blend_mode; | ||||
| char _pad[4]; | /** Vertex Paint opacity by Layer. */ | ||||
| float vertex_paint_opacity; | |||||
| /* annotation onion skin */ | /* annotation onion skin */ | ||||
| /** | /** | ||||
| * Ghosts Before: max number of ghost frames to show between | * Ghosts Before: max number of ghost frames to show between | ||||
| * active frame and the one before it (0 = only the ghost itself). | * active frame and the one before it (0 = only the ghost itself). | ||||
| */ | */ | ||||
| short gstep; | short gstep; | ||||
| /** | /** | ||||
| * Ghosts After: max number of ghost frames to show after | * Ghosts After: max number of ghost frames to show after | ||||
| * active frame and the following it (0 = only the ghost itself). | * active frame and the following it (0 = only the ghost itself). | ||||
| */ | */ | ||||
| short gstep_next; | short gstep_next; | ||||
| /** Color for ghosts before the active frame. */ | /** Color for ghosts before the active frame. */ | ||||
| float gcolor_prev[3]; | float gcolor_prev[3]; | ||||
| /** Color for ghosts after the active frame. */ | /** Color for ghosts after the active frame. */ | ||||
| float gcolor_next[3]; | float gcolor_next[3]; | ||||
| char _pad1[4]; | char _pad1[4]; | ||||
| /** Mask list (bGPDlayer_Mask). */ | |||||
| ListBase mask_layers; | |||||
| /** Current Mask index (noted base 1). */ | |||||
| int act_mask; | |||||
| char _pad2[4]; | |||||
| bGPDlayer_Runtime runtime; | bGPDlayer_Runtime runtime; | ||||
| } bGPDlayer; | } bGPDlayer; | ||||
| /* bGPDlayer->flag */ | /* bGPDlayer->flag */ | ||||
| typedef enum eGPDlayer_Flag { | typedef enum eGPDlayer_Flag { | ||||
| /* don't display layer */ | /* don't display layer */ | ||||
| GP_LAYER_HIDE = (1 << 0), | GP_LAYER_HIDE = (1 << 0), | ||||
| /* protected from further editing */ | /* protected from further editing */ | ||||
| GP_LAYER_LOCKED = (1 << 1), | GP_LAYER_LOCKED = (1 << 1), | ||||
| /* layer is 'active' layer being edited */ | /* layer is 'active' layer being edited */ | ||||
| GP_LAYER_ACTIVE = (1 << 2), | GP_LAYER_ACTIVE = (1 << 2), | ||||
| /* draw points of stroke for debugging purposes */ | /* draw points of stroke for debugging purposes */ | ||||
| GP_LAYER_DRAWDEBUG = (1 << 3), | GP_LAYER_DRAWDEBUG = (1 << 3), | ||||
| /* Flag used to display in Paint mode only layers with keyframe */ | |||||
| GP_LAYER_SOLO_MODE = (1 << 4), | |||||
| /* for editing in Action Editor */ | /* for editing in Action Editor */ | ||||
| GP_LAYER_SELECT = (1 << 5), | GP_LAYER_SELECT = (1 << 5), | ||||
| /* current frame for layer can't be changed */ | /* current frame for layer can't be changed */ | ||||
| GP_LAYER_FRAMELOCK = (1 << 6), | GP_LAYER_FRAMELOCK = (1 << 6), | ||||
| /* don't render xray (which is default) */ | /* don't render xray (which is default) */ | ||||
| GP_LAYER_NO_XRAY = (1 << 7), | GP_LAYER_NO_XRAY = (1 << 7), | ||||
| /* "volumetric" strokes */ | /* "volumetric" strokes */ | ||||
| GP_LAYER_VOLUMETRIC = (1 << 10), | GP_LAYER_VOLUMETRIC = (1 << 10), | ||||
| /* Use Scene lights */ | |||||
| GP_LAYER_USE_LIGHTS = (1 << 11), | |||||
| /* Unlock color */ | /* Unlock color */ | ||||
| GP_LAYER_UNLOCK_COLOR = (1 << 12), | GP_LAYER_UNLOCK_COLOR = (1 << 12), | ||||
| /* Mask Layer */ | /* Mask Layer */ | ||||
| GP_LAYER_USE_MASK = (1 << 13), | GP_LAYER_USE_MASK = (1 << 13), /*TODO: DEPRECATED */ | ||||
| /* Flag used to display in Paint mode only layers with keyframe */ | |||||
| GP_LAYER_SOLO_MODE = (1 << 4), | |||||
| /* Ruler Layer */ | /* Ruler Layer */ | ||||
| GP_LAYER_IS_RULER = (1 << 14), | GP_LAYER_IS_RULER = (1 << 14), | ||||
| } eGPDlayer_Flag; | } eGPDlayer_Flag; | ||||
| /* bGPDlayer->onion_flag */ | /* bGPDlayer->onion_flag */ | ||||
| typedef enum eGPDlayer_OnionFlag { | typedef enum eGPDlayer_OnionFlag { | ||||
| /* do onion skinning */ | /* do onion skinning */ | ||||
| GP_LAYER_ONIONSKIN = (1 << 0), | GP_LAYER_ONIONSKIN = (1 << 0), | ||||
| Show All 13 Lines | |||||
| /* GP Datablock */ | /* GP Datablock */ | ||||
| /* Runtime temp data for bGPdata */ | /* Runtime temp data for bGPdata */ | ||||
| typedef struct bGPdata_Runtime { | typedef struct bGPdata_Runtime { | ||||
| /** Last region where drawing was originated. */ | /** Last region where drawing was originated. */ | ||||
| struct ARegion *ar; | struct ARegion *ar; | ||||
| /** Stroke buffer. */ | /** Stroke buffer. */ | ||||
| void *sbuffer; | void *sbuffer; | ||||
| /** Temp batches cleared after drawing. */ | |||||
| /* GP Object drawing */ | struct GPUBatch *sbuffer_stroke_batch; | ||||
| /** Buffer stroke color. */ | struct GPUBatch *sbuffer_fill_batch; | ||||
| float scolor[4]; | /** Temp stroke used for drawing. */ | ||||
| /** Buffer fill color. */ | struct bGPDstroke *sbuffer_gps; | ||||
| float sfill[4]; | |||||
| /** Settings for color. */ | char _pad[2]; | ||||
| short mode; | /** Material index of the stroke. */ | ||||
| /** Buffer style for drawing strokes (used to select shader type). */ | short matid; | ||||
| short bstroke_style; | |||||
| /** Buffer style for filling areas (used to select shader type). */ | |||||
| short bfill_style; | |||||
| /* Stroke Buffer data (only used during paint-session) | /* Stroke Buffer data (only used during paint-session) | ||||
| * - buffer must be initialized before use, but freed after | * - buffer must be initialized before use, but freed after | ||||
| * whole paint operation is over | * whole paint operation is over | ||||
| */ | */ | ||||
| /** Flags for stroke that cache represents. */ | /** Flags for stroke that cache represents. */ | ||||
| short sbuffer_sflag; | short sbuffer_sflag; | ||||
| char _pad1[2]; | |||||
| /** Number of elements currently used in cache. */ | /** Number of elements currently used in cache. */ | ||||
| int sbuffer_used; | int sbuffer_used; | ||||
| /** Number of total elements available in cache. */ | /** Number of total elements available in cache. */ | ||||
| int sbuffer_size; | int sbuffer_size; | ||||
| /** Vertex Color applied to point (while drawing). */ | |||||
| float vert_color[4]; | |||||
| /** Vertex Color applied to Fill (while drawing). */ | |||||
| float vert_color_fill[4]; | |||||
| /** Number of control-points for stroke. */ | /** Number of control-points for stroke. */ | ||||
| int tot_cp_points; | int tot_cp_points; | ||||
| char _pad_[4]; | char _pad2[4]; | ||||
| /** Array of control-points for stroke. */ | /** Array of control-points for stroke. */ | ||||
| bGPDcontrolpoint *cp_points; | bGPDcontrolpoint *cp_points; | ||||
| /** Brush pointer */ | |||||
| Brush *sbuffer_brush; | |||||
| struct GpencilBatchCache *gpencil_cache; | |||||
| } bGPdata_Runtime; | } bGPdata_Runtime; | ||||
| /* grid configuration */ | /* grid configuration */ | ||||
| typedef struct bGPgrid { | typedef struct bGPgrid { | ||||
| float color[3]; | float color[3]; | ||||
| float scale[2]; | float scale[2]; | ||||
| float offset[2]; | float offset[2]; | ||||
| char _pad1[4]; | char _pad1[4]; | ||||
| int lines; | int lines; | ||||
| char _pad[4]; | char _pad[4]; | ||||
| } bGPgrid; | } bGPgrid; | ||||
| /* Grease-Pencil Annotations - 'DataBlock' */ | /* Grease-Pencil Annotations - 'DataBlock' */ | ||||
| typedef struct bGPdata { | typedef struct bGPdata { | ||||
| /** Grease Pencil data is a data-block. */ | /** Grease Pencil data is a data-block. */ | ||||
| ID id; | ID id; | ||||
| /** Animation data - for animating draw settings. */ | /** Animation data - for animating draw settings. */ | ||||
| struct AnimData *adt; | struct AnimData *adt; | ||||
| /* Grease-Pencil data */ | /* Grease-Pencil data */ | ||||
| /** BGPDlayers. */ | /** bGPDlayer. */ | ||||
| ListBase layers; | ListBase layers; | ||||
| /** Settings for this data-block. */ | /** Settings for this data-block. */ | ||||
| int flag; | int flag; | ||||
| char _pad1[4]; | char _pad1[4]; | ||||
| /* Palettes */ | /* Palettes */ | ||||
| /** List of bGPDpalette's - Deprecated (2.78 - 2.79 only). */ | /** List of bGPDpalette's - Deprecated (2.78 - 2.79 only). */ | ||||
| ListBase palettes DNA_DEPRECATED; | ListBase palettes DNA_DEPRECATED; | ||||
| ▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | typedef enum eGPdata_Flag { | ||||
| /* ------------------------------------------------ DEPRECATED */ | /* ------------------------------------------------ DEPRECATED */ | ||||
| /* Stroke Editing Mode - Toggle to enable alternative keymap | /* Stroke Editing Mode - Toggle to enable alternative keymap | ||||
| * for easier editing of stroke points */ | * for easier editing of stroke points */ | ||||
| GP_DATA_STROKE_EDITMODE = (1 << 8), | GP_DATA_STROKE_EDITMODE = (1 << 8), | ||||
| /* Main flag to switch onion skinning on/off */ | /* Main flag to switch onion skinning on/off */ | ||||
| GP_DATA_SHOW_ONIONSKINS = (1 << 9), | GP_DATA_SHOW_ONIONSKINS = (1 << 9), | ||||
| /* Draw a green and red point to indicate start and end of the stroke */ | |||||
| GP_DATA_SHOW_DIRECTION = (1 << 10), | |||||
| /* Batch drawing cache need to be recalculated */ | /* Batch drawing cache need to be recalculated */ | ||||
| GP_DATA_CACHE_IS_DIRTY = (1 << 11), | GP_DATA_CACHE_IS_DIRTY = (1 << 11), | ||||
| /* Stroke Paint Mode - Toggle paint mode */ | /* Stroke Paint Mode - Toggle paint mode */ | ||||
| GP_DATA_STROKE_PAINTMODE = (1 << 12), | GP_DATA_STROKE_PAINTMODE = (1 << 12), | ||||
| /* Stroke Editing Mode - Toggle sculpt mode */ | /* Stroke Editing Mode - Toggle sculpt mode */ | ||||
| GP_DATA_STROKE_SCULPTMODE = (1 << 13), | GP_DATA_STROKE_SCULPTMODE = (1 << 13), | ||||
| /* Stroke Editing Mode - Toggle weight paint mode */ | /* Stroke Editing Mode - Toggle weight paint mode */ | ||||
| GP_DATA_STROKE_WEIGHTMODE = (1 << 14), | GP_DATA_STROKE_WEIGHTMODE = (1 << 14), | ||||
| /* keep stroke thickness unchanged when zoom change */ | /* keep stroke thickness unchanged when zoom change */ | ||||
| GP_DATA_STROKE_KEEPTHICKNESS = (1 << 15), | GP_DATA_STROKE_KEEPTHICKNESS = (1 << 15), | ||||
| /* Allow edit several frames at the same time */ | /* Allow edit several frames at the same time */ | ||||
| GP_DATA_STROKE_MULTIEDIT = (1 << 16), | GP_DATA_STROKE_MULTIEDIT = (1 << 16), | ||||
| /* Force fill recalc if use deformation modifiers. | /* Vertex Paint Mode - Toggle paint mode */ | ||||
| * this is required if the stroke is deformed and the triangulation data is | GP_DATA_STROKE_VERTEXMODE = (1 << 18), | ||||
| * not valid. | |||||
| */ | |||||
| GP_DATA_STROKE_FORCE_RECALC = (1 << 17), | |||||
| /* Special mode drawing polygons */ | |||||
| GP_DATA_STROKE_POLYGON = (1 << 18), | |||||
| /* Use adaptive UV scales */ | |||||
| GP_DATA_UV_ADAPTIVE = (1 << 19), | |||||
| /* Autolock not active layers */ | /* Autolock not active layers */ | ||||
| GP_DATA_AUTOLOCK_LAYERS = (1 << 20), | GP_DATA_AUTOLOCK_LAYERS = (1 << 20), | ||||
| /* Internal flag for python update */ | /* Internal flag for python update */ | ||||
| GP_DATA_PYTHON_UPDATED = (1 << 21), | GP_DATA_PYTHON_UPDATED = (1 << 21), | ||||
| } eGPdata_Flag; | } eGPdata_Flag; | ||||
| /* gpd->onion_flag */ | /* gpd->onion_flag */ | ||||
| typedef enum eGPD_OnionFlag { | typedef enum eGPD_OnionFlag { | ||||
| Show All 29 Lines | |||||
| } eGP_DrawMode; | } eGP_DrawMode; | ||||
| /* ***************************************** */ | /* ***************************************** */ | ||||
| /* Mode Checking Macros */ | /* Mode Checking Macros */ | ||||
| /* Check if 'multiedit sessions' is enabled */ | /* Check if 'multiedit sessions' is enabled */ | ||||
| #define GPENCIL_MULTIEDIT_SESSIONS_ON(gpd) \ | #define GPENCIL_MULTIEDIT_SESSIONS_ON(gpd) \ | ||||
| ((gpd) && \ | ((gpd) && \ | ||||
| (gpd->flag & \ | (gpd->flag & (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | \ | ||||
| (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)) && \ | GP_DATA_STROKE_WEIGHTMODE | GP_DATA_STROKE_VERTEXMODE)) && \ | ||||
| (gpd->flag & GP_DATA_STROKE_MULTIEDIT)) | (gpd->flag & GP_DATA_STROKE_MULTIEDIT)) | ||||
| /* Macros to check grease pencil modes */ | /* Macros to check grease pencil modes */ | ||||
| #define GPENCIL_ANY_MODE(gpd) \ | #define GPENCIL_ANY_MODE(gpd) \ | ||||
| ((gpd) && (gpd->flag & (GP_DATA_STROKE_PAINTMODE | GP_DATA_STROKE_EDITMODE | \ | ((gpd) && \ | ||||
| GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE))) | (gpd->flag & (GP_DATA_STROKE_PAINTMODE | GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | \ | ||||
| #define GPENCIL_EDIT_MODE(gpd) ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE)) | GP_DATA_STROKE_WEIGHTMODE | GP_DATA_STROKE_VERTEXMODE))) | ||||
| #define GPENCIL_EDIT_MODE(gpd) ((gpd) && ((gpd)->flag & GP_DATA_STROKE_EDITMODE)) | |||||
| #define GPENCIL_ANY_EDIT_MODE(gpd) \ | #define GPENCIL_ANY_EDIT_MODE(gpd) \ | ||||
| ((gpd) && (gpd->flag & \ | ((gpd) && (gpd->flag & \ | ||||
| (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE))) | (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE))) | ||||
| #define GPENCIL_PAINT_MODE(gpd) ((gpd) && (gpd->flag & (GP_DATA_STROKE_PAINTMODE))) | #define GPENCIL_PAINT_MODE(gpd) ((gpd) && (gpd->flag & (GP_DATA_STROKE_PAINTMODE))) | ||||
| #define GPENCIL_SCULPT_MODE(gpd) ((gpd) && (gpd->flag & GP_DATA_STROKE_SCULPTMODE)) | #define GPENCIL_SCULPT_MODE(gpd) ((gpd) && (gpd->flag & GP_DATA_STROKE_SCULPTMODE)) | ||||
| #define GPENCIL_WEIGHT_MODE(gpd) ((gpd) && (gpd->flag & GP_DATA_STROKE_WEIGHTMODE)) | #define GPENCIL_WEIGHT_MODE(gpd) ((gpd) && (gpd->flag & GP_DATA_STROKE_WEIGHTMODE)) | ||||
| #define GPENCIL_VERTEX_MODE(gpd) ((gpd) && (gpd->flag & (GP_DATA_STROKE_VERTEXMODE))) | |||||
| #define GPENCIL_SCULPT_OR_WEIGHT_MODE(gpd) \ | #define GPENCIL_SCULPT_OR_WEIGHT_MODE(gpd) \ | ||||
| ((gpd) && (gpd->flag & (GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE))) | ((gpd) && (gpd->flag & (GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE))) | ||||
| #define GPENCIL_NONE_EDIT_MODE(gpd) \ | #define GPENCIL_NONE_EDIT_MODE(gpd) \ | ||||
| ((gpd) && ((gpd->flag & (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | \ | ((gpd) && ((gpd->flag & (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | \ | ||||
| GP_DATA_STROKE_WEIGHTMODE)) == 0)) | GP_DATA_STROKE_WEIGHTMODE | GP_DATA_STROKE_VERTEXMODE)) == 0)) | ||||
| #define GPENCIL_LAZY_MODE(brush, shift) \ | #define GPENCIL_LAZY_MODE(brush, shift) \ | ||||
| (((brush) && ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) && (shift == 0))) || \ | (((brush) && ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) && (shift == 0))) || \ | ||||
| (((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && (shift == 1))) | (((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && (shift == 1))) | ||||
| #define GPENCIL_ANY_SCULPT_MASK(flag) \ | |||||
| ((flag & (GP_SCULPT_MASK_SELECTMODE_POINT | GP_SCULPT_MASK_SELECTMODE_STROKE | \ | |||||
| GP_SCULPT_MASK_SELECTMODE_SEGMENT))) | |||||
| #define GPENCIL_ANY_VERTEX_MASK(flag) \ | |||||
| ((flag & (GP_VERTEX_MASK_SELECTMODE_POINT | GP_VERTEX_MASK_SELECTMODE_STROKE | \ | |||||
| GP_VERTEX_MASK_SELECTMODE_SEGMENT))) | |||||
| #endif /* __DNA_GPENCIL_TYPES_H__ */ | #endif /* __DNA_GPENCIL_TYPES_H__ */ | ||||