diff options
Diffstat (limited to 'source/blender/makesdna')
25 files changed, 1319 insertions, 185 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index ec71f28cb23..634819b33ce 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -564,6 +564,7 @@ enum { INDEX_ID_IP, INDEX_ID_AC, INDEX_ID_KE, + INDEX_ID_PAL, INDEX_ID_GD, INDEX_ID_NT, INDEX_ID_IM, @@ -581,7 +582,6 @@ enum { INDEX_ID_TXT, INDEX_ID_SO, INDEX_ID_GR, - INDEX_ID_PAL, INDEX_ID_PC, INDEX_ID_BR, INDEX_ID_PA, diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 0546dcb1a6c..55e1a43925d 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -82,9 +82,9 @@ typedef struct bMotionPath { int flag; /* baking settings - eMotionPath_Flag */ /* Used for drawing. */ - struct Gwn_VertBuf *points_vbo; - struct Gwn_Batch *batch_line; - struct Gwn_Batch *batch_points; + struct GPUVertBuf *points_vbo; + struct GPUBatch *batch_line; + struct GPUBatch *batch_points; void *pad; } bMotionPath; diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index fc3b4afe18d..dcb7fbd344b 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -44,6 +44,7 @@ struct CurveMapping; struct MTex; struct Image; +struct Material; typedef struct BrushClone { struct Image *image; /* image for clone tool */ @@ -51,6 +52,109 @@ typedef struct BrushClone { float alpha, pad; /* transparency for drawing of clone image */ } 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 { + 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 { ID id; @@ -139,8 +243,10 @@ typedef struct Brush { float mask_stencil_pos[2]; float mask_stencil_dimension[2]; -} Brush; + struct BrushGpencilSettings *gpencil_settings; + +} Brush; typedef struct PaletteColor { struct PaletteColor *next, *prev; /* two values, one to store rgb, other to store values for sculpt/weight */ @@ -355,5 +461,6 @@ enum { }; #define MAX_BRUSH_PIXEL_RADIUS 500 +#define GP_MAX_BRUSH_PIXEL_RADIUS 1000 #endif /* __DNA_BRUSH_TYPES_H__ */ diff --git a/source/blender/makesdna/DNA_color_types.h b/source/blender/makesdna/DNA_color_types.h index 8ed38b0b05d..4f860e16b88 100644 --- a/source/blender/makesdna/DNA_color_types.h +++ b/source/blender/makesdna/DNA_color_types.h @@ -99,6 +99,7 @@ typedef enum eCurveMappingPreset { CURVE_PRESET_MID9 = 4, CURVE_PRESET_ROUND = 5, CURVE_PRESET_ROOT = 6, + CURVE_PRESET_GAUSS = 7, } eCurveMappingPreset; /* histogram->mode */ diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h new file mode 100644 index 00000000000..ae3621576f2 --- /dev/null +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -0,0 +1,415 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file DNA_gpencil_modifier_types.h + * \ingroup DNA + */ + +#ifndef __DNA_GPENCIL_MODIFIER_TYPES_H__ +#define __DNA_GPENCIL_MODIFIER_TYPES_H__ + +#include "DNA_defs.h" +#include "DNA_listBase.h" + +/* WARNING ALERT! TYPEDEF VALUES ARE WRITTEN IN FILES! SO DO NOT CHANGE! + * (ONLY ADD NEW ITEMS AT THE END) + */ + +struct RNG; + +typedef enum GpencilModifierType { + eGpencilModifierType_None = 0, + eGpencilModifierType_Noise = 1, + eGpencilModifierType_Subdiv = 2, + eGpencilModifierType_Thick = 3, + eGpencilModifierType_Tint = 4, + eGpencilModifierType_Instance = 5, + eGpencilModifierType_Build = 6, + eGpencilModifierType_Opacity = 7, + eGpencilModifierType_Color = 8, + eGpencilModifierType_Lattice = 9, + eGpencilModifierType_Simplify = 10, + eGpencilModifierType_Smooth = 11, + eGpencilModifierType_Hook = 12, + eGpencilModifierType_Offset = 13, + eGpencilModifierType_Mirror = 14, + NUM_GREASEPENCIL_MODIFIER_TYPES +} GpencilModifierType; + +typedef enum GpencilModifierMode { + eGpencilModifierMode_Realtime = (1 << 0), + eGpencilModifierMode_Render = (1 << 1), + eGpencilModifierMode_Editmode = (1 << 2), + eGpencilModifierMode_Expanded = (1 << 3), +} GpencilModifierMode; + +typedef enum { + /* This modifier has been inserted in local override, and hence can be fully edited. */ + eGpencilModifierFlag_StaticOverride_Local = (1 << 0), +} GpencilModifierFlag; + +typedef struct GpencilModifierData { + struct GpencilModifierData *next, *prev; + + int type, mode; + int stackindex; + short flag; + short pad; + char name[64]; /* MAX_NAME */ + + char *error; +} GpencilModifierData; + +typedef struct NoiseGpencilModifierData { + GpencilModifierData modifier; + char layername[64]; /* layer name */ + char vgname[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ + int pass_index; /* custom index for passes */ + int flag; /* several flags */ + float factor; /* factor of noise */ + int step; /* how many frames before recalculate randoms */ + int gp_frame; /* last gp frame used */ + int scene_frame; /* last scene frame used */ + float vrand1, vrand2; /* random values */ + struct RNG *rng; +} NoiseGpencilModifierData; + +typedef enum eNoiseGpencil_Flag { + GP_NOISE_USE_RANDOM = (1 << 0), + GP_NOISE_MOD_LOCATION = (1 << 1), + GP_NOISE_MOD_STRENGTH = (1 << 2), + GP_NOISE_MOD_THICKNESS = (1 << 3), + GP_NOISE_FULL_STROKE = (1 << 4), + GP_NOISE_MOVE_EXTREME = (1 << 5), + GP_NOISE_INVERT_LAYER = (1 << 6), + GP_NOISE_INVERT_PASS = (1 << 7), + GP_NOISE_INVERT_VGROUP = (1 << 8), + GP_NOISE_MOD_UV = (1 << 9), +} eNoiseGpencil_Flag; + +typedef struct SubdivGpencilModifierData { + GpencilModifierData modifier; + char layername[64]; /* layer name */ + int pass_index; /* custom index for passes */ + int flag; /* flags */ + int level; /* factor of subdivision */ + char pad[4]; +} SubdivGpencilModifierData; + +typedef enum eSubdivGpencil_Flag { + GP_SUBDIV_SIMPLE = (1 << 0), + GP_SUBDIV_INVERT_LAYER = (1 << 1), + GP_SUBDIV_INVERT_PASS = (1 << 2), +} eSubdivGpencil_Flag; + +typedef struct ThickGpencilModifierData { + GpencilModifierData modifier; + char layername[64]; /* layer name */ + char vgname[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ + int pass_index; /* custom index for passes */ + int flag; /* flags */ + int thickness; /* Thickness change */ + char pad[4]; + struct CurveMapping *curve_thickness; +} ThickGpencilModifierData; + +typedef enum eThickGpencil_Flag { + GP_THICK_INVERT_LAYER = (1 << 0), + GP_THICK_INVERT_PASS = (1 << 1), + GP_THICK_INVERT_VGROUP = (1 << 2), + GP_THICK_CUSTOM_CURVE = (1 << 3), + GP_THICK_NORMALIZE = (1 << 4), +} eThickGpencil_Flag; + +typedef enum eModifyColorGpencil_Flag { + GP_MODIFY_COLOR_BOTH = 0, + GP_MODIFY_COLOR_STROKE = 1, + GP_MODIFY_COLOR_FILL = 2 +} eModifyColorGpencil_Flag; + +typedef struct TintGpencilModifierData { + GpencilModifierData modifier; + char layername[64]; /* layer name */ + int pass_index; /* custom index for passes */ + int flag; /* flags */ + float rgb[3]; /* Tint color */ + float factor; /* Mix factor */ + char modify_color; /* modify stroke, fill or both */ + char pad[7]; +} TintGpencilModifierData; + +typedef enum eTintGpencil_Flag { + GP_TINT_CREATE_COLORS = (1 << 0), + GP_TINT_INVERT_LAYER = (1 << 1), + GP_TINT_INVERT_PASS = (1 << 2), +} eTintGpencil_Flag; + +typedef struct ColorGpencilModifierData { + GpencilModifierData modifier; + char layername[64]; /* layer name */ + int pass_index; /* custom index for passes */ + int flag; /* flags */ + float hsv[3]; /* hsv factors */ + char modify_color; /* modify stroke, fill or both */ + char pad[3]; +} ColorGpencilModifierData; + +typedef enum eColorGpencil_Flag { + GP_COLOR_CREATE_COLORS = (1 << 0), + GP_COLOR_INVERT_LAYER = (1 << 1), + GP_COLOR_INVERT_PASS = (1 << 2), +} eColorGpencil_Flag; + +typedef struct OpacityGpencilModifierData { + GpencilModifierData modifier; + char layername[64]; /* layer name */ + char vgname[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ + int pass_index; /* custom index for passes */ + int flag; /* flags */ + float factor; /* Main Opacity factor */ + char modify_color; /* modify stroke, fill or both */ + char pad[3]; +} OpacityGpencilModifierData; + +typedef enum eOpacityGpencil_Flag { + GP_OPACITY_INVERT_LAYER = (1 << 0), + GP_OPACITY_INVERT_PASS = (1 << 1), + GP_OPACITY_INVERT_VGROUP = (1 << 2), + GP_OPACITY_CREATE_COLORS = (1 << 3), +} eOpacityGpencil_Flag; + +typedef struct InstanceGpencilModifierData { + GpencilModifierData modifier; + int count[3]; /* number of elements in array */ + int flag; /* several flags */ + float offset[3]; /* Location increments */ + float shift[3]; /* shift increment */ + float rnd_size; /* random size factor */ + float rnd_rot; /* random size factor */ + float rot[3]; /* Rotation changes */ + float scale[3]; /* Scale changes */ + float rnd[20]; /* (first element is the index) random values */ + int lock_axis; /* lock shift to one axis */ + + int pass_index; /* custom index for passes */ + char layername[64]; /* layer name */ +} InstanceGpencilModifierData; + +typedef enum eInstanceGpencil_Flag { + GP_INSTANCE_RANDOM_SIZE = (1 << 0), + GP_INSTANCE_RANDOM_ROT = (1 << 1), + GP_INSTANCE_INVERT_LAYER = (1 << 2), + GP_INSTANCE_INVERT_PASS = (1 << 3), + GP_INSTANCE_MAKE_OBJECTS = (1 << 4), +} eInstanceGpencil_Flag; + +typedef struct BuildGpencilModifierData { + GpencilModifierData modifier; + + char layername[64]; /* if set, restrict modifier to operating on this layer */ + int pass_index; + + int pad; + + float start_frame; /* If GP_BUILD_RESTRICT_TIME is set, the defines the frame range where GP frames are considered */ + float end_frame; + + float start_delay; /* For each pair of gp keys, number of frames before strokes start appearing */ + float length; /* For each pair of gp keys, number of frames that build effect must be completed within */ + + short flag; /* (eGpencilBuild_Flag) Options for controlling modifier behaviour */ + + short mode; /* (eGpencilBuild_Mode) How are strokes ordered */ + short transition; /* (eGpencilBuild_Transition) In what order do stroke points appear/disappear */ + + short time_alignment; /* (eGpencilBuild_TimeAlignment) For the "Concurrent" mode, when should "shorter" strips start/end */ +} BuildGpencilModifierData; + +typedef enum eBuildGpencil_Mode { + /* Strokes are shown one by one until all have appeared */ + GP_BUILD_MODE_SEQUENTIAL = 0, + /* All strokes start at the same time */ + GP_BUILD_MODE_CONCURRENT = 1, +} eBuildGpencil_Mode; + +typedef enum eBuildGpencil_Transition { + /* Show in forward order */ + GP_BUILD_TRANSITION_GROW = 0, + /* Hide in reverse order */ + GP_BUILD_TRANSITION_SHRINK = 1, + /* Hide in forward order */ + GP_BUILD_TRANSITION_FADE = 2, +} eBuildGpencil_Transition; + +typedef enum eBuildGpencil_TimeAlignment { + /* All strokes start at same time */ + GP_BUILD_TIMEALIGN_START = 0, + /* All strokes end at same time */ + GP_BUILD_TIMEALIGN_END = 1, + + /* TODO: Random Offsets, Stretch-to-Fill */ +} eBuildGpencil_TimeAlignment; + +typedef enum eBuildGpencil_Flag { + /* Restrict modifier to particular layer/passes? */ + GP_BUILD_INVERT_LAYER = (1 << 0), + GP_BUILD_INVERT_PASS = (1 << 1), + + /* Restrict modifier to only operating between the nominated frames */ + GP_BUILD_RESTRICT_TIME = (1 << 2), +} eBuildGpencil_Flag; + +typedef struct LatticeGpencilModifierData { + GpencilModifierData modifier; + struct Object *object; + char layername[64]; /* layer name */ + char vgname[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ + int pass_index; /* custom index for passes */ + int flag; /* flags */ + float strength; + char pad[4]; + void *cache_data; /* runtime only (LatticeDeformData) */ +} LatticeGpencilModifierData; + +typedef enum eLatticeGpencil_Flag { + GP_LATTICE_INVERT_LAYER = (1 << 0), + GP_LATTICE_INVERT_PASS = (1 << 1), + GP_LATTICE_INVERT_VGROUP = (1 << 2), +} eLatticeGpencil_Flag; + +typedef struct MirrorGpencilModifierData { + GpencilModifierData modifier; + struct Object *object; + char layername[64]; /* layer name */ + int pass_index; /* custom index for passes */ + int flag; /* flags */ +} MirrorGpencilModifierData; + +typedef enum eMirrorGpencil_Flag { + GP_MIRROR_INVERT_LAYER = (1 << 0), + GP_MIRROR_INVERT_PASS = (1 << 1), + GP_MIRROR_CLIPPING = (1 << 2), + GP_MIRROR_AXIS_X = (1 << 3), + GP_MIRROR_AXIS_Y = (1 << 4), + GP_MIRROR_AXIS_Z = (1 << 5), +} eMirrorGpencil_Flag; + +typedef struct HookGpencilModifierData { + GpencilModifierData modifier; + + struct Object *object; + char subtarget[64]; /* optional name of bone target, MAX_ID_NAME-2 */ + char layername[64]; /* layer name */ + char vgname[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ + int pass_index; /* custom index for passes */ + + int flag; + char falloff_type; /* use enums from WarpGpencilModifier (exact same functionality) */ + char pad[3]; + float parentinv[4][4]; /* matrix making current transform unmodified */ + float cent[3]; /* visualization of hook */ + float falloff; /* if not zero, falloff is distance where influence zero */ + float force; + struct CurveMapping *curfalloff; +} HookGpencilModifierData; + +typedef enum eHookGpencil_Flag { + GP_HOOK_INVERT_LAYER = (1 << 0), + GP_HOOK_INVERT_PASS = (1 << 1), + GP_HOOK_INVERT_VGROUP = (1 << 2), + GP_HOOK_UNIFORM_SPACE = (1 << 3), +} eHookGpencil_Flag; + +typedef enum eHookGpencil_Falloff { + eGPHook_Falloff_None = 0, + eGPHook_Falloff_Curve = 1, + eGPHook_Falloff_Sharp = 2, + eGPHook_Falloff_Smooth = 3, + eGPHook_Falloff_Root = 4, + eGPHook_Falloff_Linear = 5, + eGPHook_Falloff_Const = 6, + eGPHook_Falloff_Sphere = 7, + eGPHook_Falloff_InvSquare = 8, +} eHookGpencil_Falloff; + +typedef struct SimplifyGpencilModifierData { + GpencilModifierData modifier; + char layername[64]; /* layer name */ + int pass_index; /* custom index for passes */ + int flag; /* flags */ + float factor; /* factor of simplify */ + short mode; /* type of simplify */ + short step; /* every n vertex to keep */ +} SimplifyGpencilModifierData; + +typedef enum eSimplifyGpencil_Flag { + GP_SIMPLIFY_INVERT_LAYER = (1 << 0), + GP_SIMPLIFY_INVERT_PASS = (1 << 1), +} eSimplifyGpencil_Flag; + +typedef enum eSimplifyGpencil_Mode { + /* Keep only one vertex every n vertices */ + GP_SIMPLIFY_FIXED = 0, + /* Use RDP algorithm */ + GP_SIMPLIFY_ADAPTATIVE = 1, +} eSimplifyGpencil_Mode; + +typedef struct OffsetGpencilModifierData { + GpencilModifierData modifier; + char layername[64]; /* layer name */ + char vgname[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ + int pass_index; /* custom index for passes */ + int flag; /* flags */ + float loc[3]; + float rot[3]; + float scale[3]; + char pad[4]; +} OffsetGpencilModifierData; + +typedef enum eOffsetGpencil_Flag { + GP_OFFSET_INVERT_LAYER = (1 << 0), + GP_OFFSET_INVERT_PASS = (1 << 1), + GP_OFFSET_INVERT_VGROUP = (1 << 2) +} eOffsetGpencil_Flag; + +typedef struct SmoothGpencilModifierData { + GpencilModifierData modifier; + char layername[64]; /* layer name */ + char vgname[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ + int pass_index; /* custom index for passes */ + int flag; /* several flags */ + float factor; /* factor of noise */ + int step; /* how many times apply smooth */ +} SmoothGpencilModifierData; + +typedef enum eSmoothGpencil_Flag { + GP_SMOOTH_MOD_LOCATION = (1 << 0), + GP_SMOOTH_MOD_STRENGTH = (1 << 1), + GP_SMOOTH_MOD_THICKNESS = (1 << 2), + GP_SMOOTH_INVERT_LAYER = (1 << 3), + GP_SMOOTH_INVERT_PASS = (1 << 4), + GP_SMOOTH_INVERT_VGROUP = (1 << 5), + GP_SMOOTH_MOD_UV = (1 << 6), +} eSmoothGpencil_Flag; + +#define MOD_MESHSEQ_READ_ALL \ + (MOD_MESHSEQ_READ_VERT | MOD_MESHSEQ_READ_POLY | MOD_MESHSEQ_READ_UV | MOD_MESHSEQ_READ_COLOR) + +#endif /* __DNA_GPENCIL_MODIFIER_TYPES_H__ */ diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index e2ee561de7f..8febfbc8ffc 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -36,6 +36,17 @@ struct AnimData; struct CurveMapping; +struct GHash; +struct MDeformVert; + +/* TODO: add size as userprefs parameter */ +#define GP_OBGPENCIL_DEFAULT_SIZE 0.2f +#define GP_DEFAULT_PIX_FACTOR 1.0f +#define GP_DEFAULT_GRID_LINES 4 +#define GP_MAX_INPUT_SAMPLES 10 + +/* ***************************************** */ +/* GP Stroke Points */ /* Grease-Pencil Annotations - 'Stroke Point' * -> Coordinates may either be 2d or 3d depending on settings at the time @@ -47,7 +58,10 @@ typedef struct bGPDspoint { float pressure; /* pressure of input device (from 0 to 1) at this point */ float strength; /* color strength (used for alpha factor) */ float time; /* seconds since start of stroke */ - int flag; /* additional options (NOTE: can shrink this field down later if needed) */ + int flag; /* additional options */ + + float uv_fac; /* factor of uv along the stroke */ + float uv_rot; /* uv rotation for dot mode */ } bGPDspoint; /* bGPDspoint->flag */ @@ -59,54 +73,24 @@ typedef enum eGPDspoint_Flag { GP_SPOINT_TAG = (1 << 1), } eGPSPoint_Flag; +/* ***************************************** */ +/* GP Fill - Triangle Tesselation Data */ + /* Grease-Pencil Annotations - 'Triangle' - * A triangle contains the index of three vertices for filling the stroke - * This is only used if high quality fill is enabled. - * (not saved to blend file). + * -> A triangle contains the index of three vertices for filling the stroke + * This is only used if high quality fill is enabled */ typedef struct bGPDtriangle { /* indices for tesselated triangle used for GP Fill */ unsigned int verts[3]; + /* texture coordinates for verts */ + float uv[3][2]; } bGPDtriangle; -/* GP brush (used for new strokes) */ -typedef struct bGPDbrush { - struct bGPDbrush *next, *prev; +/* ***************************************** */ - char info[64]; /* Brush name. Must be unique. */ - short thickness; /* thickness to apply to strokes */ - short flag; - 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 sublevel; /* 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 sensitivity and strength */ - float draw_random_sub; /* factor of randomness for subdivision */ - struct CurveMapping *cur_sensitivity; - struct CurveMapping *cur_strength; - struct CurveMapping *cur_jitter; -} bGPDbrush; - -/* bGPDbrush->flag */ -typedef enum eGPDbrush_Flag { - /* brush is active */ - GP_BRUSH_ACTIVE = (1 << 0), - /* brush use pressure */ - GP_BRUSH_USE_PRESSURE = (1 << 1), - /* brush use pressure for alpha factor */ - GP_BRUSH_USE_STENGTH_PRESSURE = (1 << 2), - /* brush use pressure for alpha factor */ - GP_BRUSH_USE_JITTER_PRESSURE = (1 << 3), - /* brush use random for pressure */ - GP_BRUSH_USE_RANDOM_PRESSURE = (1 << 4), - /* brush use random for strength */ - GP_BRUSH_USE_RANDOM_STRENGTH = (1 << 5) -} eGPDbrush_Flag; +/* ***************************************** */ +/* GP Palettes (Deprecated - 2.78 - 2.79 only) */ /* color of palettes */ typedef struct bGPDpalettecolor { @@ -129,9 +113,7 @@ typedef enum eGPDpalettecolor_Flag { /* do onion skinning */ PC_COLOR_ONIONSKIN = (1 << 3), /* "volumetric" strokes */ - PC_COLOR_VOLUMETRIC = (1 << 4), - /* Use High quality fill */ - PC_COLOR_HQ_FILL = (1 << 5) + PC_COLOR_VOLUMETRIC = (1 << 4) } eGPDpalettecolor_Flag; /* palette of colors */ @@ -152,6 +134,21 @@ typedef enum eGPDpalette_Flag { PL_PALETTE_ACTIVE = (1 << 0) } eGPDpalette_Flag; +/* ***************************************** */ +/* GP Strokes */ + +/* Runtime temp data for bGPDstroke */ +typedef struct bGPDstroke_runtime { + /* runtime final colors (result of original colors and modifiers) */ + float tmp_stroke_rgba[4]; + float tmp_fill_rgba[4]; + + /* temporary layer name only used during copy/paste to put the stroke in the original layer */ + char tmp_layerinfo[128]; + + float multi_frame_falloff; /* runtime falloff factor (only for transform) */ +} bGPDstroke_runtime; + /* Grease-Pencil Annotations - 'Stroke' * -> A stroke represents a (simplified version) of the curve * drawn by the user in one 'mousedown'->'mouseup' operation @@ -168,14 +165,16 @@ typedef struct bGPDstroke { short flag, pad[2]; /* various settings about this stroke */ double inittime; /* Init time of stroke */ - /* The pointer to color is only used during drawing, but not saved - * colorname is the join with the palette, but when draw, the pointer is update if the value is NULL - * to speed up the drawing - */ - char colorname[128]; /* color name */ - bGPDpalettecolor *palcolor; /* current palette color */ - /* temporary layer name only used during copy/paste to put the stroke in the original layer */ - char tmp_layerinfo[128]; + + char colorname[128] DNA_DEPRECATED; /* color name */ + + int mat_nr; /* material index */ + char pad_[4]; + + struct MDeformVert *dvert; /* vertex weight data */ + + bGPDstroke_runtime runtime; + char pad_1[4]; } bGPDstroke; /* bGPDstroke->flag */ @@ -190,14 +189,22 @@ typedef enum eGPDstroke_Flag { GP_STROKE_SELECT = (1 << 3), /* Recalculate triangulation for high quality fill (when true, force a new recalc) */ GP_STROKE_RECALC_CACHES = (1 << 4), - /* Recalculate the color pointer using the name as index (true force a new recalc) */ - GP_STROKE_RECALC_COLOR = (1 << 5), /* Flag used to indicate that stroke is closed and draw edge between last and first point */ GP_STROKE_CYCLIC = (1 << 7), + /* Flag used to indicate that stroke is used for fill close and must use fill color for stroke and no fill area */ + GP_STROKE_NOFILL = (1 << 8), /* only for use with stroke-buffer (while drawing eraser) */ GP_STROKE_ERASER = (1 << 15) } eGPDstroke_Flag; +/* ***************************************** */ +/* GP Frame */ + +/* Runtime temp data for bGPDframe */ +typedef struct bGPDframe_runtime { + float viewmatrix[4][4]; /* parent matrix for drawing */ +} bGPDframe_runtime; + /* Grease-Pencil Annotations - 'Frame' * -> Acts as storage for the 'image' formed by strokes */ @@ -210,6 +217,8 @@ typedef struct bGPDframe { short flag; /* temp settings */ short key_type; /* keyframe type (eBezTriple_KeyframeType) */ + + bGPDframe_runtime runtime; } bGPDframe; /* bGPDframe->flag */ @@ -220,6 +229,16 @@ typedef enum eGPDframe_Flag { GP_FRAME_SELECT = (1 << 1) } eGPDframe_Flag; +/* ***************************************** */ +/* GP Layer */ + +/* Runtime temp data for bGPDlayer */ +typedef struct bGPDlayer_runtime { + struct GHash *derived_data; /* runtime data created by modifiers */ + int icon_id; /* id for dynamic icon used to show annotation color preview for layer */ + char pad[4]; +} bGPDlayer_runtime; + /* Grease-Pencil Annotations - 'Layer' */ typedef struct bGPDlayer { struct bGPDlayer *next, *prev; @@ -228,27 +247,27 @@ typedef struct bGPDlayer { bGPDframe *actframe; /* active frame (should be the frame that is currently being displayed) */ short flag; /* settings for layer */ - short thickness; /* current thickness to apply to strokes */ - - short gstep; /* Ghosts Before: max number of ghost frames to show between active frame and the one before it (0 = only the ghost itself) */ - short gstep_next; /* Ghosts After: max number of ghost frames to show after active frame and the following it (0 = only the ghost itself) */ + short onion_flag; /* Per-layer onion-skinning flags (eGPDlayer_OnionFlag) */ - float gcolor_prev[3]; /* optional color for ghosts before the active frame */ - float gcolor_next[3]; /* optional color for ghosts after the active frame */ + float color[4]; /* Color for strokes in layers. Used for annotations, and for ruler (which uses GPencil internally) */ + float fill[4]; /* Fill color for strokes in layers. Not used anymore (was only for) */ - float color[4]; /* Color for strokes in layers (replaced by palettecolor). Only used for ruler (which uses GPencil internally) */ - float fill[4]; /* Fill color for strokes in layers. Not used and replaced by palettecolor fill */ + char info[128]; /* name/reference info for this layer (i.e. "director's comments, 12/3") + * needs to be kept unique, as it's used as the layer identifier */ - char info[128]; /* optional reference info about this layer (i.e. "director's comments, 12/3") - * this is used for the name of the layer too and kept unique. */ + short thickness; /* thickness to apply to strokes (Annotations) */ + char pad_1[2]; struct Object *parent; /* parent object */ float inverse[4][4]; /* inverse matrix (only used if parented) */ char parsubstr[64]; /* String describing subobject info, MAX_ID_NAME-2 */ - short partype, pad; + short partype; + short line_change; /* Thickness adjustment */ float tintcolor[4]; /* Color used to tint layer, alpha value is used as factor */ float opacity; /* Opacity of the layer */ + + bGPDlayer_runtime runtime; } bGPDlayer; /* bGPDlayer->flag */ @@ -261,51 +280,89 @@ typedef enum eGPDlayer_Flag { GP_LAYER_ACTIVE = (1 << 2), /* draw points of stroke for debugging purposes */ GP_LAYER_DRAWDEBUG = (1 << 3), - /* do onion skinning */ - GP_LAYER_ONIONSKIN = (1 << 4), /* for editing in Action Editor */ GP_LAYER_SELECT = (1 << 5), /* current frame for layer can't be changed */ GP_LAYER_FRAMELOCK = (1 << 6), /* don't render xray (which is default) */ GP_LAYER_NO_XRAY = (1 << 7), - /* use custom color for ghosts before current frame */ - GP_LAYER_GHOST_PREVCOL = (1 << 8), - /* use custom color for ghosts after current frame */ - GP_LAYER_GHOST_NEXTCOL = (1 << 9), /* "volumetric" strokes */ GP_LAYER_VOLUMETRIC = (1 << 10), - /* Use high quality fill (instead of buggy legacy OpenGL Fill) */ - GP_LAYER_HQ_FILL = (1 << 11), /* Unlock color */ GP_LAYER_UNLOCK_COLOR = (1 << 12), - /* always show onion skins (i.e. even during renders/animation playback) */ - GP_LAYER_GHOST_ALWAYS = (1 << 13), } eGPDlayer_Flag; +/* bGPDlayer->onion_flag */ +typedef enum eGPDlayer_OnionFlag { + /* do onion skinning */ + GP_LAYER_ONIONSKIN = (1 << 0), +} eGPDlayer_OnionFlag; + +/* ***************************************** */ +/* GP Datablock */ + +/* Runtime temp data for bGPdata */ +typedef struct bGPdata_runtime { + /* Drawing Manager cache */ + struct GHash *batch_cache_data; + void *sbuffer; /* stroke buffer (can hold GP_STROKE_BUFFER_MAX) */ + + /* GP Object drawing */ + float scolor[4]; /* buffer stroke color */ + float sfill[4]; /* buffer fill color */ + short mode; /* settings for color */ + short bstroke_style; /* buffer style for drawing strokes (used to select shader type) */ + short bfill_style; /* buffer style for filling areas (used to select shader type) */ + + /* Stroke Buffer data (only used during paint-session) + * - buffer must be initialized before use, but freed after + * whole paint operation is over + */ + short sbuffer_size; /* number of elements currently in cache */ + short sbuffer_sflag; /* flags for stroke that cache represents */ + char pad_[6]; +} bGPdata_runtime; + /* Grease-Pencil Annotations - 'DataBlock' */ typedef struct bGPdata { ID id; /* Grease Pencil data is a datablock */ struct AnimData *adt; /* animation data - for animating draw settings */ - /* saved Grease-Pencil data */ + /* Grease-Pencil data */ ListBase layers; /* bGPDlayers */ int flag; /* settings for this datablock */ - /* not-saved stroke buffer data (only used during paint-session) - * - buffer must be initialized before use, but freed after - * whole paint operation is over - */ - short sbuffer_size; /* number of elements currently in cache */ - short sbuffer_sflag; /* flags for stroke that cache represents */ - void *sbuffer; /* stroke buffer (can hold GP_STROKE_BUFFER_MAX) */ - float scolor[4]; /* buffer color using palettes */ - float sfill[4]; /* buffer fill color */ - char pad[6]; /* padding for compiler alignment error */ - short sflag; /* settings for palette color */ - - /* saved palettes */ - ListBase palettes; + short xray_mode; /* xray mode for strokes (eGP_DepthOrdering) */ + char pad_1[2]; + + /* Palettes */ + ListBase palettes DNA_DEPRECATED; /* list of bGPDpalette's - Deprecated (2.78 - 2.79 only) */ + + /* 3D Viewport/Appearance Settings */ + float pixfactor; /* factor to define pixel size conversion */ + float line_color[4]; /* color for edit line */ + + /* Onion skinning */ + float onion_factor; /* onion alpha factor change */ + int onion_mode; /* onion skinning range (eGP_OnionModes) */ + int onion_flag; /* onion skinning flags (eGPD_OnionFlag) */ + short gstep; /* Ghosts Before: max number of ghost frames to show between active frame and the one before it (0 = only the ghost itself) */ + short gstep_next; /* Ghosts After: max number of ghost frames to show after active frame and the following it (0 = only the ghost itself) */ + + float gcolor_prev[3]; /* optional color for ghosts before the active frame */ + float gcolor_next[3]; /* optional color for ghosts after the active frame */ + + char pad[4]; + struct Material **mat; /* materials array */ + short totcol; /* total materials */ + + /* stats */ + short totlayer; + short totframe; + short totstroke; + short totpoint; + char pad_2[6]; + bGPdata_runtime runtime; } bGPdata; /* bGPdata->flag */ @@ -314,8 +371,12 @@ typedef struct bGPdata { * changes made during the porting process. */ typedef enum eGPdata_Flag { - /* don't allow painting to occur at all */ - /* GP_DATA_LMBPLOCK = (1 << 0), */ + /* datablock is used for "annotations" + * NOTE: This flag used to be used in 2.4x, but should hardly ever have been set. + * We can use this freely now, as all GP datablocks from pre-2.8 will get + * set on file load (as many old use cases are for "annotations" only) + */ + GP_DATA_ANNOTATIONS = (1 << 0), /* show debugging info in viewport (i.e. status print) */ GP_DATA_DISPINFO = (1 << 1), @@ -339,10 +400,80 @@ typedef enum eGPdata_Flag { /* Stroke Editing Mode - Toggle to enable alternative keymap for easier editing of stroke points */ GP_DATA_STROKE_EDITMODE = (1 << 8), - /* Convenience/cache flag to make it easier to quickly toggle onion skinning on/off */ + /* Main flag to switch onion skinning on/off */ 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) + GP_DATA_SHOW_DIRECTION = (1 << 10), + + /* Batch drawing cache need to be recalculated */ + GP_DATA_CACHE_IS_DIRTY = (1 << 11), + + /* Stroke Paint Mode - Toggle paint mode */ + GP_DATA_STROKE_PAINTMODE = (1 << 12), + /* Stroke Editing Mode - Toggle sculpt mode */ + GP_DATA_STROKE_SCULPTMODE = (1 << 13), + /* Stroke Editing Mode - Toggle weight paint mode */ + GP_DATA_STROKE_WEIGHTMODE = (1 << 14), + + /* keep stroke thickness unchanged when zoom change */ + GP_DATA_STROKE_KEEPTHICKNESS = (1 << 15), + + /* Allow edit several frames at the same time */ + GP_DATA_STROKE_MULTIEDIT = (1 << 16), } eGPdata_Flag; +/* gpd->onion_flag */ +typedef enum eGPD_OnionFlag { + /* use custom color for ghosts before current frame */ + GP_ONION_GHOST_PREVCOL = (1 << 0), + /* use custom color for ghosts after current frame */ + GP_ONION_GHOST_NEXTCOL = (1 << 1), + /* always show onion skins (i.e. even during renders/animation playback) */ + GP_ONION_GHOST_ALWAYS = (1 << 2), + /* use fade color in onion skin */ + GP_ONION_FADE = (1 << 3), + /* Loop showing first frame after last frame */ + GP_ONION_LOOP = (1 << 4), +} eGPD_OnionFlag; + +/* gpd->onion_mode */ +typedef enum eGP_OnionModes { + GP_ONION_MODE_ABSOLUTE = 0, + GP_ONION_MODE_RELATIVE = 1, + GP_ONION_MODE_SELECTED = 2, +} eGP_OnionModes; + +/* xray modes (Depth Ordering) */ +typedef enum eGP_DepthOrdering { + GP_XRAY_FRONT = 0, + GP_XRAY_3DSPACE = 1, + GP_XRAY_BACK = 2 +} eGP_DepthOrdering; + +/* ***************************************** */ +/* Mode Checking Macros */ + +/* Check if 'multiedit sessions' is enabled */ +#define GPENCIL_MULTIEDIT_SESSIONS_ON(gpd) \ + ((gpd) && (gpd->flag & \ + (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)) && \ + (gpd->flag & GP_DATA_STROKE_MULTIEDIT)) + +/* Macros to check grease pencil modes */ +#define GPENCIL_ANY_MODE(gpd) \ + ((gpd) && (gpd->flag & \ + (GP_DATA_STROKE_PAINTMODE | GP_DATA_STROKE_EDITMODE | \ + GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE))) +#define GPENCIL_ANY_EDIT_MODE(gpd) \ + ((gpd) && (gpd->flag & (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_SCULPT_OR_WEIGHT_MODE(gpd) \ + ((gpd) && (gpd->flag & (GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE))) +#define GPENCIL_NONE_EDIT_MODE(gpd) \ + ((gpd) && ((gpd->flag & (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)) == 0)) +#define GPENCIL_LAZY_MODE(brush, shift) \ + (((brush) && ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) && (shift == 0))) || \ + (((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && (shift == 1))) + #endif /* __DNA_GPENCIL_TYPES_H__ */ diff --git a/source/blender/makesdna/DNA_layer_types.h b/source/blender/makesdna/DNA_layer_types.h index bfdd21807b8..e6b1bda7cf5 100644 --- a/source/blender/makesdna/DNA_layer_types.h +++ b/source/blender/makesdna/DNA_layer_types.h @@ -104,6 +104,8 @@ enum { BASE_ENABLED_VIEWPORT = (1 << 6), /* Object is enabled in viewport. */ BASE_ENABLED_RENDER = (1 << 7), /* Object is enabled in final render */ BASE_ENABLED = (1 << 9), /* Object is enabled. */ + BASE_HOLDOUT = (1 << 10), /* Object masked out from render */ + BASE_INDIRECT_ONLY = (1 << 11), /* Object only contributes indirectly to render */ }; /* LayerCollection->flag */ @@ -113,6 +115,8 @@ enum { /* LAYER_COLLECTION_DEPRECATED2 = (1 << 2), */ /* LAYER_COLLECTION_DEPRECATED3 = (1 << 3), */ LAYER_COLLECTION_EXCLUDE = (1 << 4), + LAYER_COLLECTION_HOLDOUT = (1 << 5), + LAYER_COLLECTION_INDIRECT_ONLY = (1 << 6), }; /* Layer Collection->runtime_flag */ diff --git a/source/blender/makesdna/DNA_lightprobe_types.h b/source/blender/makesdna/DNA_lightprobe_types.h index 81286e5e4d0..490e2574a33 100644 --- a/source/blender/makesdna/DNA_lightprobe_types.h +++ b/source/blender/makesdna/DNA_lightprobe_types.h @@ -68,11 +68,9 @@ typedef struct LightProbe { struct Image *image; /* Image to use on as lighting data */ struct Collection *visibility_grp; /* Object visibility group, inclusive or exclusive */ - float data_draw_size; - /* Runtime display data */ float distfalloff, distgridinf; - float pad; + float pad[2]; } LightProbe; /* Probe->type */ diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index eb469895fd7..9d4da91aaed 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -54,6 +54,59 @@ typedef struct TexPaintSlot { int pad; } TexPaintSlot; +typedef struct MaterialGPencilStyle { + struct Image *sima; /* Texture image for strokes */ + struct Image *ima; /* Texture image for filling */ + float stroke_rgba[4]; /* color for paint and strokes (alpha included) */ + float fill_rgba[4]; /* color that should be used for drawing "fills" for strokes (alpha included) */ + float mix_rgba[4]; /* secondary color used for gradients and other stuff */ + short flag; /* settings */ + 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 gradient_angle; /* angle used for gradients orientation */ + float gradient_radius; /* radius for radial gradients */ + float pattern_gridsize; /* cheesboard size */ + float gradient_scale[2]; /* uv coordinates scale */ + float gradient_shift[2]; /* factor to shift filling in 2d space */ + float texture_angle; /* angle used for texture orientation */ + float texture_scale[2]; /* texture scale (separated of uv scale) */ + float texture_offset[2]; /* factor to shift texture in 2d space */ + float texture_opacity; /* texture opacity */ + float texture_pixsize; /* pixel size for uv along the stroke */ + int mode; /* drawing mode (line or dots) */ + + int gradient_type; /* type of gradient */ + char pad[4]; +} MaterialGPencilStyle; + +/* MaterialGPencilStyle->flag */ +typedef enum eMaterialGPencilStyle_Flag { + /* Fill Texture is a pattern */ + GP_STYLE_FILL_PATTERN = (1 << 0), + /* don't display color */ + GP_STYLE_COLOR_HIDE = (1 << 1), + /* protected from further editing */ + GP_STYLE_COLOR_LOCKED = (1 << 2), + /* do onion skinning */ + GP_STYLE_COLOR_ONIONSKIN = (1 << 3), + /* clamp texture */ + GP_STYLE_COLOR_TEX_CLAMP = (1 << 4), + /* mix texture */ + GP_STYLE_COLOR_TEX_MIX = (1 << 5), + /* Flip fill colors */ + GP_STYLE_COLOR_FLIP_FILL = (1 << 6), + /* Stroke Texture is a pattern */ + GP_STYLE_STROKE_PATTERN = (1 << 7) +} eMaterialGPencilStyle_Flag; + +typedef enum eMaterialGPencilStyle_Mode { + GP_STYLE_MODE_LINE = 0, /* line */ + GP_STYLE_MODE_DOTS = 1, /* dots */ + GP_STYLE_MODE_BOX = 2, /* rectangles */ +} eMaterialGPencilStyle_Mode; + typedef struct Material { ID id; struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */ @@ -107,6 +160,9 @@ typedef struct Material { /* Runtime cache for GLSL materials. */ ListBase gpumaterial; + + /* grease pencil color */ + struct MaterialGPencilStyle *gp_style; } Material; /* **************** MATERIAL ********************* */ @@ -217,7 +273,7 @@ enum { enum { MA_BL_HIDE_BACKSIDE = (1 << 0), MA_BL_SS_REFRACTION = (1 << 1), - MA_BL_SS_SUBSURFACE = (1 << 2), + MA_BL_SS_SUBSURFACE = (1 << 2), /* DEPRECATED */ MA_BL_TRANSLUCENCY = (1 << 3), }; @@ -229,4 +285,24 @@ enum { MA_BS_HASHED, }; +/* Grease Pencil Stroke styles */ +enum { + GP_STYLE_STROKE_STYLE_SOLID = 0, + GP_STYLE_STROKE_STYLE_TEXTURE +}; + +/* Grease Pencil Fill styles */ +enum { + GP_STYLE_FILL_STYLE_SOLID = 0, + GP_STYLE_FILL_STYLE_GRADIENT, + GP_STYLE_FILL_STYLE_CHESSBOARD, + GP_STYLE_FILL_STYLE_TEXTURE +}; + +/* Grease Pencil Gradient Types */ +enum { + GP_STYLE_GRADIENT_LINEAR = 0, + GP_STYLE_GRADIENT_RADIAL +}; + #endif diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index 6e8c1d10c91..5a69db4e0b4 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -392,7 +392,7 @@ enum { /* SELECT = (1 << 0), */ ME_VERT_TMP_TAG = (1 << 2), ME_HIDE = (1 << 4), - ME_VERT_MERGED = (1 << 6), +/* ME_VERT_MERGED = (1 << 6), */ ME_VERT_PBVH_UPDATE = (1 << 7), }; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index e3d02cdc0c8..5000a4d248a 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -90,7 +90,8 @@ typedef enum ModifierType { eModifierType_CorrectiveSmooth = 51, eModifierType_MeshSequenceCache = 52, eModifierType_SurfaceDeform = 53, - eModifierType_Hair = 54, + eModifierType_WeightedNormal = 54, + eModifierType_Hair = 55, NUM_MODIFIER_TYPES } ModifierType; @@ -124,13 +125,6 @@ typedef enum { eModifierFlag_SharedCaches = (1 << 1), } ModifierFlag; -typedef enum { - eSubsurfModifierFlag_Incremental = (1 << 0), - eSubsurfModifierFlag_DebugIncr = (1 << 1), - eSubsurfModifierFlag_ControlEdges = (1 << 2), - eSubsurfModifierFlag_SubsurfUv = (1 << 3), -} SubsurfModifierFlag; - /* not a real modifier */ typedef struct MappingInfoModifierData { ModifierData modifier; @@ -142,6 +136,18 @@ typedef struct MappingInfoModifierData { int texmapping; } MappingInfoModifierData; +typedef enum { + eSubsurfModifierFlag_Incremental = (1 << 0), + eSubsurfModifierFlag_DebugIncr = (1 << 1), + eSubsurfModifierFlag_ControlEdges = (1 << 2), + eSubsurfModifierFlag_SubsurfUv = (1 << 3), +} SubsurfModifierFlag; + +typedef enum { + SUBSURF_TYPE_CATMULL_CLARK = 0, + SUBSURF_TYPE_SIMPLE = 1, +} eSubsurfModifierType; + typedef struct SubsurfModifierData { ModifierData modifier; @@ -318,6 +324,10 @@ enum { MOD_EDGESPLIT_FROMFLAG = (1 << 2), }; +typedef struct BevelModNorEditData { + struct GHash *faceHash; +} BevelModNorEditData; + typedef struct BevelModifierData { ModifierData modifier; @@ -328,13 +338,16 @@ typedef struct BevelModifierData { short lim_flags; /* flags to tell the tool how to limit the bevel */ short e_flags; /* flags to direct how edge weights are applied to verts */ short mat; /* material index if >= 0, else material inherited from surrounding faces */ - short pad; + short edge_flags; int pad2; float profile; /* controls profile shape (0->1, .5 is round) */ /* if the MOD_BEVEL_ANGLE is set, this will be how "sharp" an edge must be before it gets beveled */ float bevel_angle; /* if the MOD_BEVEL_VWEIGHT option is set, this will be the name of the vert group, MAX_VGROUP_NAME */ + int hnmode; + float hn_strength; char defgrp_name[64]; + struct BevelModNorEditData clnordata; } BevelModifierData; /* BevelModifierData->flags and BevelModifierData->lim_flags */ @@ -355,6 +368,7 @@ enum { /* MOD_BEVEL_DIST = (1 << 12), */ /* same as above */ MOD_BEVEL_OVERLAP_OK = (1 << 13), MOD_BEVEL_EVEN_WIDTHS = (1 << 14), + MOD_BEVEL_SET_WN_STR = (1 << 15), }; /* BevelModifierData->val_flags (not used as flags any more) */ @@ -365,6 +379,20 @@ enum { MOD_BEVEL_AMT_PERCENT = 3, }; +/* BevelModifierData->edge_flags */ +enum { + MOD_BEVEL_MARK_SEAM = (1 << 0), + MOD_BEVEL_MARK_SHARP = (1 << 1), +}; + +/* BevelModifierData->hnmode */ +enum { + MOD_BEVEL_HN_NONE, + MOD_BEVEL_HN_FACE, + MOD_BEVEL_HN_ADJ, + MOD_BEVEL_FIX_SHA, +}; + typedef struct SmokeModifierData { ModifierData modifier; @@ -1636,6 +1664,32 @@ enum { MOD_SDEF_MODE_CENTROID = 2, }; +typedef struct WeightedNormalModifierData { + ModifierData modifier; + + char defgrp_name[64]; /* MAX_VGROUP_NAME */ + char mode, flag; + short weight; + float thresh; +} WeightedNormalModifierData; + +/* Name/id of the generic PROP_INT cdlayer storing face weights. */ +#define MOD_WEIGHTEDNORMALS_FACEWEIGHT_CDLAYER_ID "__mod_weightednormals_faceweight" + +/* WeightedNormalModifierData.mode */ +enum { + MOD_WEIGHTEDNORMAL_MODE_FACE = 0, + MOD_WEIGHTEDNORMAL_MODE_ANGLE = 1, + MOD_WEIGHTEDNORMAL_MODE_FACE_ANGLE = 2, +}; + +/* WeightedNormalModifierData.flag */ +enum { + MOD_WEIGHTEDNORMAL_KEEP_SHARP = (1 << 0), + MOD_WEIGHTEDNORMAL_INVERT_VGROUP = (1 << 1), + MOD_WEIGHTEDNORMAL_FACE_INFLUENCE = (1 << 2), +}; + #define MOD_MESHSEQ_READ_ALL \ (MOD_MESHSEQ_READ_VERT | MOD_MESHSEQ_READ_POLY | MOD_MESHSEQ_READ_UV | MOD_MESHSEQ_READ_COLOR) diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index ca01ffc2b29..31a5931dde4 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -905,6 +905,14 @@ typedef struct NodeSunBeams { float ray_length; } NodeSunBeams; +typedef struct NodeCryptomatte { + float add[3]; + float remove[3]; + char *matte_id; + int num_inputs; + int pad; +} NodeCryptomatte; + /* script node mode */ #define NODE_SCRIPT_INTERNAL 0 #define NODE_SCRIPT_EXTERNAL 1 @@ -953,6 +961,11 @@ typedef struct NodeSunBeams { #define SHD_HAIR_REFLECTION 0 #define SHD_HAIR_TRANSMISSION 1 +/* principled hair parametrization */ +#define SHD_PRINCIPLED_HAIR_REFLECTANCE 0 +#define SHD_PRINCIPLED_HAIR_PIGMENT_CONCENTRATION 1 +#define SHD_PRINCIPLED_HAIR_DIRECT_ABSORPTION 2 + /* blend texture */ #define SHD_BLEND_LINEAR 0 #define SHD_BLEND_QUADRATIC 1 diff --git a/source/blender/makesdna/DNA_object_enums.h b/source/blender/makesdna/DNA_object_enums.h index 802ca6c7d0d..01228376174 100644 --- a/source/blender/makesdna/DNA_object_enums.h +++ b/source/blender/makesdna/DNA_object_enums.h @@ -37,7 +37,10 @@ typedef enum eObjectMode { OB_MODE_TEXTURE_PAINT = 1 << 4, OB_MODE_PARTICLE_EDIT = 1 << 5, OB_MODE_POSE = 1 << 6, - OB_MODE_GPENCIL = 1 << 7, /* NOTE: Just a dummy to make the UI nicer */ + OB_MODE_GPENCIL_EDIT = 1 << 7, + OB_MODE_GPENCIL_PAINT = 1 << 8, + OB_MODE_GPENCIL_SCULPT = 1 << 9, + OB_MODE_GPENCIL_WEIGHT = 1 << 10, } eObjectMode; /* Any mode where the brush system is used. */ diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 999ebe0ccc3..1f6f7cd9bf2 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -142,6 +142,10 @@ typedef struct Object_Runtime { * It has deforemation only modifiers applied on it. */ struct Mesh *mesh_deform_eval; + + + /* Runtime evaluated curve-specific data, not stored in the file. */ + struct CurveCache *curve_cache; } Object_Runtime; typedef struct Object { @@ -176,7 +180,9 @@ typedef struct Object { ListBase effect DNA_DEPRECATED; // XXX deprecated... keep for readfile ListBase defbase; /* list of bDeformGroup (vertex groups) names and flag only */ ListBase modifiers; /* list of ModifierData structures */ + ListBase greasepencil_modifiers; /* list of GpencilModifierData structures */ ListBase fmaps; /* list of facemaps */ + ListBase shader_fx; /* list of viewport effects. Actually only used by grease pencil */ int mode; /* Local object mode */ int restore_mode; @@ -280,10 +286,6 @@ typedef struct Object { uint64_t lastDataMask; /* the custom data layer mask that was last used to calculate derivedDeform and derivedFinal */ uint64_t customdata_mask; /* (extra) custom data layer mask to use for creating derivedmesh, set by depsgraph */ - /* Runtime valuated curve-specific data, not stored in the file */ - struct CurveCache *curve_cache; - - ListBase gpulamp; /* runtime, for glsl lamp display only */ ListBase pc_ids; struct RigidBodyOb *rigidbody_object; /* settings for Bullet rigid body */ @@ -351,6 +353,9 @@ enum { /* 23 and 24 are for life and sector (old file compat.) */ OB_ARMATURE = 25, +/* Grease Pencil object used in 3D view but not used for annotation in 2D */ + OB_GPENCIL = 26, + OB_TYPE_MAX, }; @@ -361,9 +366,9 @@ enum { /* check if the object type supports materials */ #define OB_TYPE_SUPPORT_MATERIAL(_type) \ - ((_type) >= OB_MESH && (_type) <= OB_MBALL) + (((_type) >= OB_MESH && (_type) <= OB_MBALL) || ((_type) == OB_GPENCIL)) #define OB_TYPE_SUPPORT_VGROUP(_type) \ - (ELEM(_type, OB_MESH, OB_LATTICE)) + (ELEM(_type, OB_MESH, OB_LATTICE, OB_GPENCIL)) #define OB_TYPE_SUPPORT_EDITMODE(_type) \ (ELEM(_type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)) #define OB_TYPE_SUPPORT_PARVERT(_type) \ @@ -375,10 +380,10 @@ enum { /* is this ID type used as object data */ #define OB_DATA_SUPPORT_ID(_id_type) \ - (ELEM(_id_type, ID_ME, ID_CU, ID_MB, ID_LA, ID_SPK, ID_LP, ID_CA, ID_LT, ID_AR)) + (ELEM(_id_type, ID_ME, ID_CU, ID_MB, ID_LA, ID_SPK, ID_LP, ID_CA, ID_LT, ID_GD, ID_AR)) #define OB_DATA_SUPPORT_ID_CASE \ - ID_ME: case ID_CU: case ID_MB: case ID_LA: case ID_SPK: case ID_LP: case ID_CA: case ID_LT: case ID_AR + ID_ME: case ID_CU: case ID_MB: case ID_LA: case ID_SPK: case ID_LP: case ID_CA: case ID_LT: case ID_GD: case ID_AR /* partype: first 4 bits: type */ enum { @@ -466,6 +471,13 @@ enum { OB_EMPTY_IMAGE = 8, }; +/* gpencil add types */ +enum { + GP_EMPTY = 0, + GP_STROKE = 1, + GP_MONKEY = 2 +}; + /* boundtype */ enum { OB_BOUND_BOX = 0, diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h index 449f71905f0..75d0ce493f5 100644 --- a/source/blender/makesdna/DNA_outliner_types.h +++ b/source/blender/makesdna/DNA_outliner_types.h @@ -60,6 +60,10 @@ enum { TSE_CHILDSEARCH = (1 << 3), TSE_SEARCHMATCH = (1 << 4), TSE_HIGHLIGHTED = (1 << 5), + TSE_DRAG_INTO = (1 << 6), + TSE_DRAG_BEFORE = (1 << 7), + TSE_DRAG_AFTER = (1 << 8), + TSE_DRAG_ANY = (TSE_DRAG_INTO | TSE_DRAG_BEFORE | TSE_DRAG_AFTER), }; /* TreeStoreElem->types */ diff --git a/source/blender/makesdna/DNA_rigidbody_types.h b/source/blender/makesdna/DNA_rigidbody_types.h index 693707b8b7a..a99d5b409be 100644 --- a/source/blender/makesdna/DNA_rigidbody_types.h +++ b/source/blender/makesdna/DNA_rigidbody_types.h @@ -220,7 +220,8 @@ typedef struct RigidBodyCon { int flag; /* (eRigidBodyCon_Flag) */ float breaking_threshold; /* breaking impulse threshold */ - float pad; + char spring_type; /* spring implementation to use */ + char pad[3]; /* limits */ /* translation limits */ @@ -290,9 +291,15 @@ typedef enum eRigidBodyCon_Type { /* Simplified spring constraint with only once axis that's automatically placed between the connected bodies */ RBC_TYPE_SPRING, /* dirves bodies by applying linear and angular forces */ - RBC_TYPE_MOTOR + RBC_TYPE_MOTOR, } eRigidBodyCon_Type; +/* Spring implementation type for RigidBodyOb */ +typedef enum eRigidBodyCon_SpringType { + RBC_SPRING_TYPE1 = 0, /* btGeneric6DofSpringConstraint */ + RBC_SPRING_TYPE2, /* btGeneric6DofSpring2Constraint */ +} eRigidBodyCon_SpringType; + /* Flags for RigidBodyCon */ typedef enum eRigidBodyCon_Flag { /* constraint influences rigid body motion */ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 0c4c0a00f1a..262c24164df 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -66,7 +66,6 @@ struct AnimData; struct Editing; struct SceneStats; struct bGPdata; -struct bGPDbrush; struct MovieClip; struct ColorSpace; struct SceneCollection; @@ -686,7 +685,8 @@ typedef struct RenderData { /* render simplify */ short simplify_subsurf; short simplify_subsurf_render; - short pad9, pad10; + short simplify_gpencil; + short pad10; float simplify_particles; float simplify_particles_render; @@ -905,6 +905,11 @@ typedef struct UvSculpt { Paint paint; } UvSculpt; +/* grease pencil drawing brushes */ +typedef struct GpPaint { + Paint paint; +} GpPaint; + /* ------------------------------------------- */ /* Vertex Paint */ @@ -929,15 +934,18 @@ enum { typedef enum eGP_EditBrush_Types { GP_EDITBRUSH_TYPE_SMOOTH = 0, GP_EDITBRUSH_TYPE_THICKNESS = 1, - GP_EDITBRUSH_TYPE_GRAB = 2, - GP_EDITBRUSH_TYPE_PUSH = 3, - GP_EDITBRUSH_TYPE_TWIST = 4, - GP_EDITBRUSH_TYPE_PINCH = 5, - GP_EDITBRUSH_TYPE_RANDOMIZE = 6, - GP_EDITBRUSH_TYPE_SUBDIVIDE = 7, - GP_EDITBRUSH_TYPE_SIMPLIFY = 8, - GP_EDITBRUSH_TYPE_CLONE = 9, - GP_EDITBRUSH_TYPE_STRENGTH = 10, + GP_EDITBRUSH_TYPE_STRENGTH = 2, + GP_EDITBRUSH_TYPE_GRAB = 3, + GP_EDITBRUSH_TYPE_PUSH = 4, + GP_EDITBRUSH_TYPE_TWIST = 5, + GP_EDITBRUSH_TYPE_PINCH = 6, + GP_EDITBRUSH_TYPE_RANDOMIZE = 7, + GP_EDITBRUSH_TYPE_CLONE = 8, + GP_EDITBRUSH_TYPE_SUBDIVIDE = 9, + GP_EDITBRUSH_TYPE_SIMPLIFY = 10, + /* add any sculpt brush above this value */ + GP_EDITBRUSH_TYPE_WEIGHT = 11, + /* add any weight paint brush below this value. Do no mix brushes */ /* !!! Update GP_EditBrush_Data brush[###]; below !!! */ TOT_GP_EDITBRUSH_TYPES @@ -956,6 +964,8 @@ typedef struct GP_EditBrush_Data { short size; /* radius of brush */ short flag; /* eGP_EditBrush_Flag */ float strength; /* strength of effect */ + float curcolor_add[3]; /* cursor color for add */ + float curcolor_sub[3]; /* cursor color for sub */ } GP_EditBrush_Data; /* GP_EditBrush_Data.flag */ @@ -969,20 +979,31 @@ typedef enum eGP_EditBrush_Flag { GP_EDITBRUSH_FLAG_USE_FALLOFF = (1 << 2), /* smooth brush affects pressure values as well */ - GP_EDITBRUSH_FLAG_SMOOTH_PRESSURE = (1 << 3) + GP_EDITBRUSH_FLAG_SMOOTH_PRESSURE = (1 << 3), + /* enable screen cursor */ + GP_EDITBRUSH_FLAG_ENABLE_CURSOR = (1 << 4), + /* temporary invert action */ + GP_EDITBRUSH_FLAG_TMP_INVERT = (1 << 5), } eGP_EditBrush_Flag; /* GPencil Stroke Sculpting Settings */ typedef struct GP_BrushEdit_Settings { - GP_EditBrush_Data brush[11]; /* TOT_GP_EDITBRUSH_TYPES */ + GP_EditBrush_Data brush[12]; /* TOT_GP_EDITBRUSH_TYPES */ void *paintcursor; /* runtime */ - int brushtype; /* eGP_EditBrush_Types */ + int brushtype; /* eGP_EditBrush_Types (sculpt) */ int flag; /* eGP_BrushEdit_SettingsFlag */ int lock_axis; /* eGP_Lockaxis_Types lock drawing to one axis */ - float alpha; /* alpha factor for selection color */ + char pad1[4]; + + /* weight paint is a submode of sculpt but use its own index. All weight paint + * brushes must be defined at the end of the brush array. + */ + int weighttype; /* eGP_EditBrush_Types (weight paint) */ + char pad[4]; + struct CurveMapping *cur_falloff; /* multiframe edit falloff effect by frame */ } GP_BrushEdit_Settings; /* GP_BrushEdit_Settings.flag */ @@ -995,6 +1016,12 @@ typedef enum eGP_BrushEdit_SettingsFlag { GP_BRUSHEDIT_FLAG_APPLY_STRENGTH = (1 << 2), /* apply brush to thickness */ GP_BRUSHEDIT_FLAG_APPLY_THICKNESS = (1 << 3), + /* apply brush to thickness */ + GP_BRUSHEDIT_FLAG_WEIGHT_MODE = (1 << 4), + /* enable falloff for multiframe editing */ + GP_BRUSHEDIT_FLAG_FRAME_FALLOFF = (1 << 5), + /* apply brush to uv data */ + GP_BRUSHEDIT_FLAG_APPLY_UV = (1 << 6), } eGP_BrushEdit_SettingsFlag; @@ -1213,6 +1240,7 @@ typedef struct ToolSettings { VPaint *wpaint; /* weight paint */ Sculpt *sculpt; UvSculpt *uvsculpt; /* uv smooth */ + GpPaint *gp_paint; /* gpencil paint */ /* Vertex group weight - used only for editmode, not weight * paint */ @@ -1236,19 +1264,19 @@ typedef struct ToolSettings { /* Auto-IK */ short autoik_chainlen; /* runtime only */ - /* SCE_MPR_LOC/SCAL */ - char gizmo_flag; - /* Grease Pencil */ char gpencil_flags; /* flags/options for how the tool works */ - char gpencil_src; /* for main 3D view Grease Pencil, where data comes from */ char gpencil_v3d_align; /* stroke placement settings: 3D View */ char gpencil_v2d_align; /* : General 2D Editor */ char gpencil_seq_align; /* : Sequencer Preview */ char gpencil_ima_align; /* : Image Editor */ - char _pad3[3]; + /* Annotations */ + char annotate_v3d_align; /* stroke placement settings - 3D View */ + + short annotate_thickness; /* default stroke thickness for annotation strokes */ + char _pad3[2]; /* Grease Pencil Sculpt */ struct GP_BrushEdit_Settings gp_sculpt; @@ -1256,10 +1284,7 @@ typedef struct ToolSettings { /* Grease Pencil Interpolation Tool(s) */ struct GP_Interpolate_Settings gp_interpolate; - /* Grease Pencil Drawing Brushes (bGPDbrush) */ - ListBase gp_brushes; - - /* Image Paint (8 byttse aligned please!) */ + /* Image Paint (8 bytes aligned please!) */ struct ImagePaintSettings imapaint; /* Particle Editing */ @@ -1281,7 +1306,9 @@ typedef struct ToolSettings { /* Alt+RMB option */ char edge_mode; char edge_mode_live_unwrap; - char _pad1; + + /* SCE_MPR_LOC/SCAL */ + char gizmo_flag; /* Transform */ char transform_pivot_point; @@ -1322,6 +1349,10 @@ typedef struct ToolSettings { struct CurvePaintSettings curve_paint_settings; struct MeshStatVis statvis; + + /* Normal Editing */ + float normal_vector[3]; + int face_strength; } ToolSettings; /* *************************************************************** */ @@ -1381,6 +1412,9 @@ typedef struct SceneDisplay { float matcap_ssao_attenuation; int matcap_ssao_samples; int pad; + + /* OpenGL render engine settings. */ + View3DShading shading; } SceneDisplay; typedef struct SceneEEVEE { @@ -1500,7 +1534,7 @@ typedef struct Scene { /* Units */ struct UnitSettings unit; - /* Grease Pencil */ + /* Grease Pencil - Annotations */ struct bGPdata *gpd; /* Movie Tracking */ @@ -1512,6 +1546,7 @@ typedef struct Scene { uint64_t customdata_mask; /* XXX. runtime flag for drawing, actually belongs in the window, only used by BKE_object_handle_update() */ uint64_t customdata_mask_modal; /* XXX. same as above but for temp operator use (gl renders) */ + /* Color Management */ ColorManagedViewSettings view_settings; ColorManagedDisplaySettings display_settings; @@ -1707,7 +1742,7 @@ enum { /* RenderData.engine (scene.c) */ extern const char *RE_engine_id_BLENDER_EEVEE; -extern const char *RE_engine_id_BLENDER_WORKBENCH; +extern const char *RE_engine_id_BLENDER_OPENGL; extern const char *RE_engine_id_CYCLES; /* **************** SCENE ********************* */ @@ -1853,6 +1888,13 @@ enum { OB_DRAW_GROUPUSER_ALL = 2 }; +/* toolsettings->face_strength */ +enum { + FACE_STRENGTH_WEAK = -16384, + FACE_STRENGTH_MEDIUM = 0, + FACE_STRENGTH_STRONG = 16384, +}; + /* object_vgroup.c */ /* ToolSettings.vgroupsubset */ typedef enum eVGroupSelect { @@ -2011,25 +2053,39 @@ typedef enum eImagePaintMode { #define EDGE_MODE_TAG_FREESTYLE 5 /* ToolSettings.gizmo_flag */ -#define SCE_MANIP_TRANSLATE 1 -#define SCE_MANIP_ROTATE 2 -#define SCE_MANIP_SCALE 4 +enum { + SCE_MANIP_TRANSLATE = (1 << 0), + SCE_MANIP_ROTATE = (1 << 1), + SCE_MANIP_SCALE = (1 << 2), + + SCE_MANIP_DISABLE_APRON = (1 << 3), +}; /* ToolSettings.gpencil_flags */ typedef enum eGPencil_Flags { - /* "Continuous Drawing" - The drawing operator enters a mode where multiple strokes can be drawn */ - GP_TOOL_FLAG_PAINTSESSIONS_ON = (1 << 0), /* When creating new frames, the last frame gets used as the basis for the new one */ GP_TOOL_FLAG_RETAIN_LAST = (1 << 1), /* Add the strokes below all strokes in the layer */ - GP_TOOL_FLAG_PAINT_ONBACK = (1 << 2) + GP_TOOL_FLAG_PAINT_ONBACK = (1 << 2), + /* Show compact list of colors */ + GP_TOOL_FLAG_THUMBNAIL_LIST = (1 << 3), } eGPencil_Flags; -/* ToolSettings.gpencil_src */ -typedef enum eGPencil_Source_3D { - GP_TOOL_SOURCE_SCENE = 0, - GP_TOOL_SOURCE_OBJECT = 1 -} eGPencil_Source_3d; +/* scene->r.simplify_gpencil */ +typedef enum eGPencil_SimplifyFlags { + /* Simplify */ + SIMPLIFY_GPENCIL_ENABLE = (1 << 0), + /* Simplify on play */ + SIMPLIFY_GPENCIL_ON_PLAY = (1 << 1), + /* Simplify fill on viewport */ + SIMPLIFY_GPENCIL_FILL = (1 << 2), + /* Simplify modifier on viewport */ + SIMPLIFY_GPENCIL_MODIFIER = (1 << 3), + /* Remove fill external line */ + SIMPLIFY_GPENCIL_REMOVE_FILL_LINE = (1 << 4), + /* Simplify Shader FX */ + SIMPLIFY_GPENCIL_FX = (1 << 5) +} eGPencil_SimplifyFlags; /* ToolSettings.gpencil_*_align - Stroke Placement mode flags */ typedef enum eGPencil_Placement_Flags { @@ -2045,6 +2101,7 @@ typedef enum eGPencil_Placement_Flags { /* "Use Endpoints" */ GP_PROJECT_DEPTH_STROKE_ENDPOINTS = (1 << 4), + GP_PROJECT_CURSOR = (1 << 5), } eGPencil_Placement_Flags; /* ToolSettings.particle flag */ @@ -2093,7 +2150,7 @@ enum { SCE_EEVEE_VOLUMETRIC_ENABLED = (1 << 0), SCE_EEVEE_VOLUMETRIC_LIGHTS = (1 << 1), SCE_EEVEE_VOLUMETRIC_SHADOWS = (1 << 2), - SCE_EEVEE_VOLUMETRIC_COLORED = (1 << 3), +// SCE_EEVEE_VOLUMETRIC_COLORED = (1 << 3), /* Unused */ SCE_EEVEE_GTAO_ENABLED = (1 << 4), SCE_EEVEE_GTAO_BENT_NORMALS = (1 << 5), SCE_EEVEE_GTAO_BOUNCE = (1 << 6), diff --git a/source/blender/makesdna/DNA_shader_fx_types.h b/source/blender/makesdna/DNA_shader_fx_types.h new file mode 100644 index 00000000000..f3c9f06c8dc --- /dev/null +++ b/source/blender/makesdna/DNA_shader_fx_types.h @@ -0,0 +1,196 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file DNA_shader_fx_types.h + * \ingroup DNA + */ + +#ifndef __DNA_SHADER_FX_TYPES_H__ +#define __DNA_SHADER_FX_TYPES_H__ + +#include "DNA_defs.h" +#include "DNA_listBase.h" + +struct DRWShadingGroup; + +/* WARNING ALERT! TYPEDEF VALUES ARE WRITTEN IN FILES! SO DO NOT CHANGE! + * (ONLY ADD NEW ITEMS AT THE END) + */ + +typedef enum ShaderFxType { + eShaderFxType_None = 0, + eShaderFxType_Blur = 1, + eShaderFxType_Flip = 2, + eShaderFxType_Light = 3, + eShaderFxType_Pixel = 4, + eShaderFxType_Swirl = 5, + eShaderFxType_Wave = 6, + eShaderFxType_Rim = 7, + eShaderFxType_Colorize = 8, + NUM_SHADER_FX_TYPES +} ShaderFxType; + +typedef enum ShaderFxMode { + eShaderFxMode_Realtime = (1 << 0), + eShaderFxMode_Render = (1 << 1), + eShaderFxMode_Editmode = (1 << 2), + eShaderFxMode_Expanded = (1 << 3), +} ShaderFxMode; + +typedef enum { + /* This fx has been inserted in local override, and hence can be fully edited. */ + eShaderFxFlag_StaticOverride_Local = (1 << 0), +} ShaderFxFlag; + +typedef struct ShaderFxData { + struct ShaderFxData *next, *prev; + + int type, mode; + int stackindex; + short flag; + short pad; + char name[64]; /* MAX_NAME */ + + char *error; +} ShaderFxData; + +/* Runtime temp data */ +typedef struct ShaderFxData_runtime { + struct DRWShadingGroup *fx_sh; + struct DRWShadingGroup *fx_sh_b; + struct DRWShadingGroup *fx_sh_c; +} ShaderFxData_runtime; + +typedef struct BlurShaderFxData { + ShaderFxData shaderfx; + int radius[2]; + int flag; /* flags */ + int samples; /* number of samples */ + float coc; /* circle of confusion */ + int blur[2]; /* not visible in rna */ + char pad[4]; + ShaderFxData_runtime runtime; +} BlurShaderFxData; + +typedef enum eBlurShaderFx_Flag { + FX_BLUR_DOF_MODE = (1 << 0) +} eBlurShaderFx_Flag; + +typedef struct ColorizeShaderFxData { + ShaderFxData shaderfx; + int mode; + float low_color[4]; + float high_color[4]; + float factor; + int flag; /* flags */ + char pad[4]; + ShaderFxData_runtime runtime; +} ColorizeShaderFxData; + +typedef enum ColorizeShaderFxModes { + eShaderFxColorizeMode_GrayScale = 0, + eShaderFxColorizeMode_Sepia = 1, + eShaderFxColorizeMode_BiTone = 2, + eShaderFxColorizeMode_Custom = 3, + eShaderFxColorizeMode_Transparent = 4, +} ColorizeShaderFxModes; + +typedef struct FlipShaderFxData { + ShaderFxData shaderfx; + int flag; /* flags */ + int flipmode; /* internal, not visible in rna */ + ShaderFxData_runtime runtime; +} FlipShaderFxData; + +typedef enum eFlipShaderFx_Flag { + FX_FLIP_HORIZONTAL = (1 << 0), + FX_FLIP_VERTICAL = (1 << 1), +} eFlipShaderFx_Flag; + +typedef struct LightShaderFxData { + ShaderFxData shaderfx; + struct Object *object; + int flag; /* flags */ + float energy; + float ambient; + float loc[4]; /* internal, not visible in rna */ + char pad[4]; + ShaderFxData_runtime runtime; +} LightShaderFxData; + +typedef struct PixelShaderFxData { + ShaderFxData shaderfx; + int size[3]; /* last element used for shader only */ + int flag; /* flags */ + float rgba[4]; + ShaderFxData_runtime runtime; +} PixelShaderFxData; + +typedef enum ePixelShaderFx_Flag { + FX_PIXEL_USE_LINES = (1 << 0), +} ePixelShaderFx_Flag; + +typedef struct RimShaderFxData { + ShaderFxData shaderfx; + int offset[2]; + int flag; /* flags */ + float rim_rgb[3]; + float mask_rgb[3]; + int mode; + int blur[2]; + int samples; + char pad[4]; + ShaderFxData_runtime runtime; +} RimShaderFxData; + +typedef enum RimShaderFxModes { + eShaderFxRimMode_Normal = 0, + eShaderFxRimMode_Overlay = 1, + eShaderFxRimMode_Add = 2, + eShaderFxRimMode_Subtract = 3, + eShaderFxRimMode_Multiply = 4, + eShaderFxRimMode_Divide = 5, +} RimShaderFxModes; + +typedef struct SwirlShaderFxData { + ShaderFxData shaderfx; + struct Object *object; + int flag; /* flags */ + int radius; + float angle; + int transparent; /* not visible in rna */ + ShaderFxData_runtime runtime; +} SwirlShaderFxData; + +typedef enum eSwirlShaderFx_Flag { + FX_SWIRL_MAKE_TRANSPARENT = (1 << 0), +} eSwirlShaderFx_Flag; + +typedef struct WaveShaderFxData { + ShaderFxData shaderfx; + float amplitude; + float period; + float phase; + int orientation; + int flag; /* flags */ + char pad[4]; + ShaderFxData_runtime runtime; +} WaveShaderFxData; +#endif /* __DNA_SHADER_FX_TYPES_H__ */ diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h index 76b609b0c6c..443c6923ed0 100644 --- a/source/blender/makesdna/DNA_smoke_types.h +++ b/source/blender/makesdna/DNA_smoke_types.h @@ -137,6 +137,9 @@ typedef struct SmokeDomainSettings { struct GPUTexture *tex_wt; struct GPUTexture *tex_shadow; struct GPUTexture *tex_flame; + struct GPUTexture *tex_velocity_x; + struct GPUTexture *tex_velocity_y; + struct GPUTexture *tex_velocity_z; float *shadow; /* simulation data */ diff --git a/source/blender/makesdna/DNA_sound_types.h b/source/blender/makesdna/DNA_sound_types.h index aefe1a7d5a3..02d3aa928c7 100644 --- a/source/blender/makesdna/DNA_sound_types.h +++ b/source/blender/makesdna/DNA_sound_types.h @@ -65,13 +65,15 @@ typedef struct bSound { */ struct PackedFile *newpackedfile; struct Ipo *ipo; + float volume; float attenuation; float pitch; float min_gain; float max_gain; float distance; - int flags; + short flags; + short tags; /* Runtime only, always reset in readfile. */ int pad; /* unused currently @@ -116,13 +118,19 @@ enum { SND_CFRA_NUM = 2, }; +/* bSound->flags */ enum { #ifdef DNA_DEPRECATED SOUND_FLAGS_3D = (1 << 3), /* deprecated! used for sound actuator loading */ #endif SOUND_FLAGS_CACHING = (1 << 4), SOUND_FLAGS_MONO = (1 << 5), - SOUND_FLAGS_WAVEFORM_LOADING = (1 << 6), +}; + +/* bSound->tags */ +enum { + SOUND_TAGS_WAVEFORM_NO_RELOAD = 1 << 0, /* Do not free/reset waveform on sound load, only used by undo code. */ + SOUND_TAGS_WAVEFORM_LOADING = (1 << 6), }; /* to DNA_sound_types.h*/ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index d6d043b03ae..5404f4160fd 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -198,6 +198,7 @@ typedef enum eSpaceButtons_Context { BCONTEXT_VIEW_LAYER = 13, BCONTEXT_TOOL = 14, BCONTEXT_WORKSPACE = 15, + BCONTEXT_SHADERFX = 16, /* always as last... */ BCONTEXT_TOT @@ -1346,7 +1347,7 @@ typedef enum eSpaceClip_Flag { SC_SHOW_GRID = (1 << 9), SC_SHOW_STABLE = (1 << 10), SC_MANUAL_CALIBRATION = (1 << 11), - SC_SHOW_GPENCIL = (1 << 12), + SC_SHOW_ANNOTATION = (1 << 12), SC_SHOW_FILTERS = (1 << 13), SC_SHOW_GRAPH_FRAMES = (1 << 14), SC_SHOW_GRAPH_TRACKS_MOTION = (1 << 15), diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index cdfcf5598e8..cb2c69e2fa1 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -651,7 +651,9 @@ typedef struct UserDef { struct WalkNavigation walk_navigation; short opensubdiv_compute_type; - char pad5[6]; + short gpencil_multisamples; /* eMultiSample_Type, amount of samples for Grease Pencil */ + + char pad5[4]; } UserDef; extern UserDef U; /* from blenkernel blender.c */ @@ -862,7 +864,8 @@ typedef enum eOpenGL_AntiAliasMethod { /* text draw options * UserDef.text_render */ typedef enum eText_Draw_Options { - USER_TEXT_DISABLE_AA = (1 << 0), + USER_TEXT_DISABLE_AA = (1 << 0), + USER_TEXT_DISABLE_HINTING = (1 << 1), } eText_Draw_Options; /* tw_flag (transform widget) */ @@ -957,7 +960,7 @@ typedef enum eNdof_Flag { #define NDOF_PIXELS_PER_SECOND 600.0f -/* UserDef.ogl_multisamples */ +/* UserDef.ogl_multisamples and gpencil_multisamples */ typedef enum eMultiSample_Type { USER_MULTISAMPLE_NONE = 0, USER_MULTISAMPLE_2 = 2, diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 40551701627..317cde9009d 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -135,11 +135,16 @@ typedef struct View3DCursor { /* 3D Viewport Shading setings */ typedef struct View3DShading { + short type; /* Shading type (VIEW3D_SHADE_SOLID, ..) */ + short prev_type; /* Runtime, for toggle between rendered viewport. */ + short flag; short color_type; short light; - char pad[2]; + short background_type; + short pad2[2]; + char studio_light[256]; /* FILE_MAXFILE */ char matcap[256]; /* FILE_MAXFILE */ @@ -154,6 +159,10 @@ typedef struct View3DShading { float cavity_valley_factor; float cavity_ridge_factor; + + float background_color[3]; + int pad; + } View3DShading; /* 3D Viewport Overlay setings */ @@ -181,6 +190,14 @@ typedef struct View3DOverlay { float wireframe_threshold; char _pad0[4]; + /* grease pencil setttings */ + float gpencil_grid_scale; + float gpencil_paper_opacity; + int gpencil_grid_lines; + int gpencil_grid_axis; + float gpencil_grid_opacity; + char _pad1[4]; + } View3DOverlay; /* 3D ViewPort Struct */ @@ -219,8 +236,10 @@ typedef struct View3D { int layact; short ob_centre_cursor; /* optional bool for 3d cursor to define center */ - short scenelock, _pad1; - short flag, flag2, pad2; + short scenelock; + short gp_flag; + short flag; + int flag2; float lens, grid; float near, far; @@ -237,17 +256,18 @@ typedef struct View3D { char gridflag; /* transform gizmo info */ - char _pad5[2], mpr_flag; + char _pad5[2], gizmo_flag; - short flag3; + short _pad2; /* drawflags, denoting state */ - char _pad2; + char _pad3; char transp, xray; char multiview_eye; /* multiview current eye - for internal use */ - char pad3[4]; + /* actually only used to define the opacity of the grease pencil vertex in edit mode */ + float vertex_opacity; /* note, 'fx_settings.dof' is currently _not_ allocated, * instead set (temporarily) from camera */ @@ -267,9 +287,8 @@ typedef struct View3D { float stereo3d_convergence_alpha; /* Display settings */ - short drawtype; /* Shading mode (OB_SOLID, OB_TEXTURE, ..) */ - short prev_drawtype; /* Runtime, for toggle between rendered viewport. */ - int pad5; + short drawtype DNA_DEPRECATED; + short pad5[3]; View3DShading shading; View3DOverlay overlay; @@ -329,10 +348,10 @@ typedef struct View3D { #define RV3D_VIEW_IS_AXIS(view) \ (((view) >= RV3D_VIEW_FRONT) && ((view) <= RV3D_VIEW_BOTTOM)) -/* View3d->flag2 (short) */ +/* View3d->flag2 (int) */ #define V3D_RENDER_OVERRIDE (1 << 2) #define V3D_SOLID_TEX (1 << 3) -#define V3D_SHOW_GPENCIL (1 << 4) +#define V3D_SHOW_ANNOTATION (1 << 4) #define V3D_LOCK_CAMERA (1 << 5) #define V3D_RENDER_SHADOW (1 << 6) /* This is a runtime only flag that's used to tell draw_mesh_object() that we're doing a shadow pass instead of a regular draw */ #define V3D_SHOW_RECONSTRUCTION (1 << 7) @@ -345,9 +364,12 @@ typedef struct View3D { #define V3D_OCCLUDE_WIRE (1 << 14) #define V3D_SHOW_MODE_SHADE_OVERRIDE (1 << 15) /* XXX: DNA deprecated */ - -/* View3d->flag3 (short) */ -#define V3D_SHOW_WORLD (1 << 0) +/* View3d->gp_flag (short) */ +#define V3D_GP_SHOW_PAPER (1 << 0) /* Activate paper to cover all viewport */ +#define V3D_GP_SHOW_GRID (1 << 1) /* Activate paper grid */ +#define V3D_GP_SHOW_EDIT_LINES (1 << 2) +#define V3D_GP_SHOW_MULTIEDIT_LINES (1 << 3) +#define V3D_GP_SHOW_ONION_SKIN (1 << 4) /* main switch at view level */ /* View3DShading->light */ enum { @@ -376,6 +398,13 @@ enum { V3D_SHADING_TEXTURE_COLOR = 3, }; +/* View3DShading->background_type */ +enum { + V3D_SHADING_BACKGROUND_THEME = 0, + V3D_SHADING_BACKGROUND_WORLD = 1, + V3D_SHADING_BACKGROUND_VIEWPORT = 2, +}; + /* View3DOverlay->flag */ enum { V3D_OVERLAY_FACE_ORIENTATION = (1 << 0), @@ -467,4 +496,12 @@ enum { #define RV3D_CAMZOOM_MIN_FACTOR 0.1657359312880714853f #define RV3D_CAMZOOM_MAX_FACTOR 44.9852813742385702928f +/* View3d.gpencil_grid_axis */ +enum { + V3D_GP_GRID_AXIS_LOCK = (1 << 0), + V3D_GP_GRID_AXIS_X = (1 << 1), + V3D_GP_GRID_AXIS_Y = (1 << 2), + V3D_GP_GRID_AXIS_Z = (1 << 3), +}; + #endif diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 80ad3840a8f..25d9e50ff7a 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -184,7 +184,7 @@ typedef struct wmWindow { struct wmWindow *next, *prev; void *ghostwin; /* don't want to include ghost.h stuff */ - void *gwnctx; /* don't want to include gawin stuff */ + void *gpuctx; /* don't want to include gpu stuff */ struct wmWindow *parent; /* Parent window */ diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 61fa70e6e2a..14d42662cfc 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -113,6 +113,8 @@ static const char *includefiles[] = { "DNA_particle_types.h", "DNA_cloth_types.h", "DNA_gpencil_types.h", + "DNA_gpencil_modifier_types.h", + "DNA_shader_fx_types.h", "DNA_windowmanager_types.h", "DNA_anim_types.h", "DNA_boid_types.h", @@ -1338,6 +1340,8 @@ int main(int argc, char **argv) #include "DNA_particle_types.h" #include "DNA_cloth_types.h" #include "DNA_gpencil_types.h" +#include "DNA_gpencil_modifier_types.h" +#include "DNA_shader_fx_types.h" #include "DNA_windowmanager_types.h" #include "DNA_anim_types.h" #include "DNA_boid_types.h" |