Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2018-07-31 11:22:19 +0300
committerAntonioya <blendergit@gmail.com>2018-07-31 11:50:43 +0300
commit66da2f537ae80ce2b31d1eaf34ad8c03d858938d (patch)
tree4776b9d2e43e4280d01d6f0b7088e6d4f417db0f /source/blender/makesdna
parent27496cc46bbfd76e98ad3b1ccb8fea534763ffb5 (diff)
New Grease Pencil object for 2D animation
This commit merge the full development done in greasepencil-object branch and include mainly the following features. - New grease pencil object. - New drawing engine. - New grease pencil modes Draw/Sculpt/Edit and Weight Paint. - New brushes for grease pencil. - New modifiers for grease pencil. - New shaders FX. - New material system (replace old palettes and colors). - Split of annotations (old grease pencil) and new grease pencil object. - UI adapted to blender 2.8. You can get more info here: https://code.blender.org/2017/12/drawing-2d-animation-in-blender-2-8/ https://code.blender.org/2018/07/grease-pencil-status-update/ This is the result of nearly two years of development and I want thanks firstly the other members of the grease pencil team: Daniel M. Lara, Matias Mendiola and Joshua Leung for their support, ideas and to keep working in the project all the time, without them this project had been impossible. Also, I want thanks other Blender developers for their help, advices and to be there always to help me, and specially to Clément Foucault, Dalai Felinto, Pablo Vázquez and Campbell Barton.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_ID.h2
-rw-r--r--source/blender/makesdna/DNA_brush_types.h109
-rw-r--r--source/blender/makesdna/DNA_color_types.h1
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_types.h404
-rw-r--r--source/blender/makesdna/DNA_gpencil_types.h319
-rw-r--r--source/blender/makesdna/DNA_material_types.h76
-rw-r--r--source/blender/makesdna/DNA_object_enums.h5
-rw-r--r--source/blender/makesdna/DNA_object_types.h19
-rw-r--r--source/blender/makesdna/DNA_scene_types.h105
-rw-r--r--source/blender/makesdna/DNA_shader_fx_types.h196
-rw-r--r--source/blender/makesdna/DNA_space_types.h3
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h6
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h29
-rw-r--r--source/blender/makesdna/intern/makesdna.c4
14 files changed, 1136 insertions, 142 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_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..150b4a2d9f1
--- /dev/null
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -0,0 +1,404 @@
+/*
+ * ***** 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_greasepencil_modifier_types.h
+ * \ingroup DNA
+ */
+
+#ifndef __DNA_GREASEPENCIL_TYPES_H__
+#define __DNA_GREASEPENCIL_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 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 */
+} 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 pad[4];
+} 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 pad[4];
+} OpacityGpencilModifierData;
+
+typedef enum eOpacityGpencil_Flag {
+ GP_OPACITY_INVERT_LAYER = (1 << 0),
+ GP_OPACITY_INVERT_PASS = (1 << 1),
+ GP_OPACITY_INVERT_VGROUP = (1 << 2),
+} 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_GREASEPENCIL_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_material_types.h b/source/blender/makesdna/DNA_material_types.h
index eb469895fd7..50d9b890724 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 ********************* */
@@ -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_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 a8d50543e80..47fb2feb7f4 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -180,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;
@@ -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,12 @@ enum {
OB_EMPTY_IMAGE = 8,
};
+/* gpencil add types */
+enum {
+ GP_EMPTY = 0,
+ GP_MONKEY = 1
+};
+
/* boundtype */
enum {
OB_BOUND_BOX = 0,
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index a4235a07ed5..6629eeae3fa 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;
@@ -1503,7 +1530,7 @@ typedef struct Scene {
/* Units */
struct UnitSettings unit;
- /* Grease Pencil */
+ /* Grease Pencil - Annotations */
struct bGPdata *gpd;
/* Movie Tracking */
@@ -1515,6 +1542,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;
@@ -2020,19 +2048,27 @@ typedef enum eImagePaintMode {
/* 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)
+} eGPencil_SimplifyFlags;
/* ToolSettings.gpencil_*_align - Stroke Placement mode flags */
typedef enum eGPencil_Placement_Flags {
@@ -2048,6 +2084,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 */
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..15147cf2b6c
--- /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_SHADERFX_TYPES_H__
+#define __DNA_SHADERFX_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_SHADERFX_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 e7a540f9afc..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 */
@@ -958,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 bbbaf8bb957..27b07a317ed 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -190,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 */
@@ -256,7 +264,8 @@ typedef struct View3D {
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 */
@@ -340,7 +349,7 @@ typedef struct View3D {
/* View3d->flag2 (short) */
#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)
@@ -353,9 +362,13 @@ 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) /* LEGACY replaced by V3D_SHADING_BACKGROUND_WORLD */
+#define V3D_SHOW_WORLD (1 << 0) /* LEGACY replaced by V3D_SHADING_BACKGROUND_WORLD */
+#define V3D_GP_SHOW_PAPER (1 << 2) /* Activate paper to cover all viewport */
+#define V3D_GP_SHOW_GRID (1 << 3) /* Activate paper grid */
+#define V3D_GP_SHOW_EDIT_LINES (1 << 4)
+#define V3D_GP_SHOW_MULTIEDIT_LINES (1 << 5)
+#define V3D_GP_SHOW_ONION_SKIN (1 << 6) /* main switch at view level */
/* View3DShading->light */
enum {
@@ -482,4 +495,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/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index a1bfac66115..7b27ec05865 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",
@@ -1337,6 +1339,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"