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:
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/CMakeLists.txt4
-rw-r--r--source/blender/makesdna/DNA_ID.h1
-rw-r--r--source/blender/makesdna/DNA_action_types.h1
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h8
-rw-r--r--source/blender/makesdna/DNA_freestyle_types.h130
-rw-r--r--source/blender/makesdna/DNA_linestyle_types.h410
-rw-r--r--source/blender/makesdna/DNA_material_types.h3
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h6
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h16
-rw-r--r--source/blender/makesdna/DNA_scene_types.h15
-rw-r--r--source/blender/makesdna/DNA_space_types.h1
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h1
-rw-r--r--source/blender/makesdna/SConscript6
-rw-r--r--source/blender/makesdna/intern/makesdna.c4
14 files changed, 601 insertions, 5 deletions
diff --git a/source/blender/makesdna/CMakeLists.txt b/source/blender/makesdna/CMakeLists.txt
index 638d618d785..c60907060f7 100644
--- a/source/blender/makesdna/CMakeLists.txt
+++ b/source/blender/makesdna/CMakeLists.txt
@@ -23,4 +23,8 @@
#
# ***** END GPL LICENSE BLOCK *****
+if(WITH_FREESTYLE)
+ add_definitions(-DWITH_FREESTYLE)
+endif()
+
add_subdirectory(intern)
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 9aa51e7c1df..875e01f8037 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -212,6 +212,7 @@ typedef struct PreviewImage {
#define ID_WM MAKE_ID2('W', 'M') /* WindowManager */
#define ID_MC MAKE_ID2('M', 'C') /* MovieClip */
#define ID_MSK MAKE_ID2('M', 'S') /* Mask */
+#define ID_LS MAKE_ID2('L', 'S') /* FreestyleLineStyle */
/* NOTE! Fake IDs, needed for g.sipo->blocktype or outliner */
#define ID_SEQ MAKE_ID2('S', 'Q')
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index b27abb519d9..eded0b4b76e 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -560,6 +560,7 @@ typedef enum eDopeSheet_FilterFlag {
ADS_FILTER_NONTREE = (1 << 19),
ADS_FILTER_NOTEX = (1 << 20),
ADS_FILTER_NOSPK = (1 << 21),
+ ADS_FILTER_NOLINESTYLE = (1 << 22),
/* NLA-specific filters */
ADS_FILTER_NLA_NOACT = (1 << 25), /* if the AnimData block has no NLA data, don't include to just show Action-line */
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index 4a3debe756b..8debadf24c3 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -63,7 +63,7 @@ typedef struct CustomDataExternal {
* layers, each with a data type (e.g. MTFace, MDeformVert, etc.). */
typedef struct CustomData {
CustomDataLayer *layers; /* CustomDataLayers, ordered by type */
- int typemap[37]; /* runtime only! - maps types to indices of first layer of that type,
+ int typemap[39]; /* runtime only! - maps types to indices of first layer of that type,
* MUST be >= CD_NUMTYPES, but we cant use a define here.
* Correct size is ensured in CustomData_update_typemap assert() */
int totlayer, maxlayer; /* number of layers, size of layers array */
@@ -114,7 +114,9 @@ typedef struct CustomData {
#define CD_PAINT_MASK 34
#define CD_GRID_PAINT_MASK 35
#define CD_MVERT_SKIN 36
-#define CD_NUMTYPES 37
+#define CD_FREESTYLE_EDGE 37
+#define CD_FREESTYLE_FACE 38
+#define CD_NUMTYPES 39
/* Bits for CustomDataMask */
#define CD_MASK_MVERT (1 << CD_MVERT)
@@ -156,6 +158,8 @@ typedef struct CustomData {
#define CD_MASK_PAINT_MASK (1LL << CD_PAINT_MASK)
#define CD_MASK_GRID_PAINT_MASK (1LL << CD_GRID_PAINT_MASK)
#define CD_MASK_MVERT_SKIN (1LL << CD_MVERT_SKIN)
+#define CD_MASK_FREESTYLE_EDGE (1LL << CD_FREESTYLE_EDGE)
+#define CD_MASK_FREESTYLE_FACE (1LL << CD_FREESTYLE_FACE)
/* CustomData.flag */
diff --git a/source/blender/makesdna/DNA_freestyle_types.h b/source/blender/makesdna/DNA_freestyle_types.h
new file mode 100644
index 00000000000..2c2d704922f
--- /dev/null
+++ b/source/blender/makesdna/DNA_freestyle_types.h
@@ -0,0 +1,130 @@
+/*
+ * ***** 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.
+ *
+ * The Original Code is Copyright (C) 2010 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __DNA_FREESTYLE_TYPES_H__
+#define __DNA_FREESTYLE_TYPES_H__
+
+#include "DNA_listBase.h"
+
+struct FreestyleLineStyle;
+struct Group;
+struct Text;
+
+/* FreestyleConfig::flags */
+#define FREESTYLE_SUGGESTIVE_CONTOURS_FLAG (1 << 0)
+#define FREESTYLE_RIDGES_AND_VALLEYS_FLAG (1 << 1)
+#define FREESTYLE_MATERIAL_BOUNDARIES_FLAG (1 << 2)
+#define FREESTYLE_FACE_SMOOTHNESS_FLAG (1 << 3)
+#define FREESTYLE_ADVANCED_OPTIONS_FLAG (1 << 4)
+#define FREESTYLE_CULLING (1 << 5)
+
+/* FreestyleConfig::mode */
+#define FREESTYLE_CONTROL_SCRIPT_MODE 1
+#define FREESTYLE_CONTROL_EDITOR_MODE 2
+
+/* FreestyleLineSet::flags */
+#define FREESTYLE_LINESET_CURRENT (1 << 0)
+#define FREESTYLE_LINESET_ENABLED (1 << 1)
+#define FREESTYLE_LINESET_FE_NOT (1 << 2)
+#define FREESTYLE_LINESET_FE_AND (1 << 3)
+#define FREESTYLE_LINESET_GR_NOT (1 << 4)
+#define FREESTYLE_LINESET_FM_NOT (1 << 5)
+#define FREESTYLE_LINESET_FM_BOTH (1 << 6)
+
+/* FreestyleLineSet::selection */
+#define FREESTYLE_SEL_VISIBILITY (1 << 0)
+#define FREESTYLE_SEL_EDGE_TYPES (1 << 1)
+#define FREESTYLE_SEL_GROUP (1 << 2)
+#define FREESTYLE_SEL_IMAGE_BORDER (1 << 3)
+#define FREESTYLE_SEL_FACE_MARK (1 << 4)
+
+/* FreestyleLineSet::edge_types, exclude_edge_types */
+#define FREESTYLE_FE_SILHOUETTE (1 << 0)
+#define FREESTYLE_FE_BORDER (1 << 1)
+#define FREESTYLE_FE_CREASE (1 << 2)
+#define FREESTYLE_FE_RIDGE_VALLEY (1 << 3)
+/* Note: FREESTYLE_FE_VALLEY = (1 << 4) is no longer used */
+#define FREESTYLE_FE_SUGGESTIVE_CONTOUR (1 << 5)
+#define FREESTYLE_FE_MATERIAL_BOUNDARY (1 << 6)
+#define FREESTYLE_FE_CONTOUR (1 << 7)
+#define FREESTYLE_FE_EXTERNAL_CONTOUR (1 << 8)
+#define FREESTYLE_FE_EDGE_MARK (1 << 9)
+
+/* FreestyleLineSet::qi */
+#define FREESTYLE_QI_VISIBLE 1
+#define FREESTYLE_QI_HIDDEN 2
+#define FREESTYLE_QI_RANGE 3
+
+/* FreestyleConfig::raycasting_algorithm */
+/* Defines should be replaced with ViewMapBuilder::visibility_algo */
+#define FREESTYLE_ALGO_REGULAR 1
+#define FREESTYLE_ALGO_FAST 2
+#define FREESTYLE_ALGO_VERYFAST 3
+#define FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL 4
+#define FREESTYLE_ALGO_ADAPTIVE_TRADITIONAL 5
+#define FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE 6
+#define FREESTYLE_ALGO_ADAPTIVE_CUMULATIVE 7
+
+typedef struct FreestyleLineSet {
+ struct FreestyleLineSet *next, *prev;
+
+ char name[64]; /* line set name, MAX_NAME */
+ int flags;
+
+ int selection; /* selection criteria */
+ short qi; /* quantitative invisibility */
+ short pad1;
+ int qi_start, qi_end;
+ int edge_types, exclude_edge_types; /* feature edge types */
+ int pad2;
+ struct Group *group; /* group of target objects */
+
+ struct FreestyleLineStyle *linestyle;
+} FreestyleLineSet;
+
+typedef struct FreestyleModuleConfig {
+ struct FreestyleModuleConfig *next, *prev;
+
+ struct Text *script;
+ short is_displayed;
+ short pad[3];
+} FreestyleModuleConfig;
+
+typedef struct FreestyleConfig {
+ ListBase modules;
+
+ int mode; /* scripting, editor */
+ int raycasting_algorithm; /* XXX deprecated */
+ int flags; /* suggestive contours, ridges/valleys, material boundaries */
+ float sphere_radius;
+ float dkr_epsilon;
+ float crease_angle; /* in radians! */
+
+ ListBase linesets;
+} FreestyleConfig;
+
+#endif
diff --git a/source/blender/makesdna/DNA_linestyle_types.h b/source/blender/makesdna/DNA_linestyle_types.h
new file mode 100644
index 00000000000..f5473d3d84a
--- /dev/null
+++ b/source/blender/makesdna/DNA_linestyle_types.h
@@ -0,0 +1,410 @@
+/*
+ * ***** 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.
+ *
+ * The Original Code is Copyright (C) 2010 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __DNA_LINESTYLE_TYPES_H__
+#define __DNA_LINESTYLE_TYPES_H__
+
+#include "DNA_listBase.h"
+#include "DNA_ID.h"
+
+struct ColorBand;
+struct CurveMapping;
+
+typedef struct LineStyleModifier {
+ struct LineStyleModifier *next, *prev;
+
+ char name[64]; /* MAX_NAME */
+ int type;
+ float influence;
+ int flags;
+ int blend;
+
+} LineStyleModifier;
+
+/* LineStyleModifier::type */
+#define LS_MODIFIER_ALONG_STROKE 1
+#define LS_MODIFIER_DISTANCE_FROM_CAMERA 2
+#define LS_MODIFIER_DISTANCE_FROM_OBJECT 3
+#define LS_MODIFIER_MATERIAL 4
+#define LS_MODIFIER_SAMPLING 5
+#define LS_MODIFIER_BEZIER_CURVE 6
+#define LS_MODIFIER_SINUS_DISPLACEMENT 7
+#define LS_MODIFIER_SPATIAL_NOISE 8
+#define LS_MODIFIER_PERLIN_NOISE_1D 9
+#define LS_MODIFIER_PERLIN_NOISE_2D 10
+#define LS_MODIFIER_BACKBONE_STRETCHER 11
+#define LS_MODIFIER_TIP_REMOVER 12
+#define LS_MODIFIER_CALLIGRAPHY 13
+#define LS_MODIFIER_POLYGONIZATION 14
+#define LS_MODIFIER_GUIDING_LINES 15
+#define LS_MODIFIER_BLUEPRINT 16
+#define LS_MODIFIER_2D_OFFSET 17
+#define LS_MODIFIER_2D_TRANSFORM 18
+#define LS_MODIFIER_NUM 19
+
+/* LineStyleModifier::flags */
+#define LS_MODIFIER_ENABLED 1
+#define LS_MODIFIER_EXPANDED 2
+
+/* flags (for color) */
+#define LS_MODIFIER_USE_RAMP 1
+
+/* flags (for alpha & thickness) */
+#define LS_MODIFIER_USE_CURVE 1
+#define LS_MODIFIER_INVERT 2
+
+/* blend (for alpha & thickness) */
+#define LS_VALUE_BLEND 0
+#define LS_VALUE_ADD 1
+#define LS_VALUE_MULT 2
+#define LS_VALUE_SUB 3
+#define LS_VALUE_DIV 4
+#define LS_VALUE_DIFF 5
+#define LS_VALUE_MIN 6
+#define LS_VALUE_MAX 7
+
+/* Along Stroke modifiers */
+
+typedef struct LineStyleColorModifier_AlongStroke {
+ struct LineStyleModifier modifier;
+
+ struct ColorBand *color_ramp;
+} LineStyleColorModifier_AlongStroke;
+
+typedef struct LineStyleAlphaModifier_AlongStroke {
+ struct LineStyleModifier modifier;
+
+ struct CurveMapping *curve;
+ int flags;
+ int pad;
+} LineStyleAlphaModifier_AlongStroke;
+
+typedef struct LineStyleThicknessModifier_AlongStroke {
+ struct LineStyleModifier modifier;
+
+ struct CurveMapping *curve;
+ int flags;
+ float value_min, value_max;
+ int pad;
+} LineStyleThicknessModifier_AlongStroke;
+
+/* Distance from Camera modifiers */
+
+typedef struct LineStyleColorModifier_DistanceFromCamera {
+ struct LineStyleModifier modifier;
+
+ struct ColorBand *color_ramp;
+ float range_min, range_max;
+} LineStyleColorModifier_DistanceFromCamera;
+
+typedef struct LineStyleAlphaModifier_DistanceFromCamera {
+ struct LineStyleModifier modifier;
+
+ struct CurveMapping *curve;
+ int flags;
+ float range_min, range_max;
+ int pad;
+} LineStyleAlphaModifier_DistanceFromCamera;
+
+typedef struct LineStyleThicknessModifier_DistanceFromCamera {
+ struct LineStyleModifier modifier;
+
+ struct CurveMapping *curve;
+ int flags;
+ float range_min, range_max;
+ float value_min, value_max;
+ int pad;
+} LineStyleThicknessModifier_DistanceFromCamera;
+
+/* Distance from Object modifiers */
+
+typedef struct LineStyleColorModifier_DistanceFromObject {
+ struct LineStyleModifier modifier;
+
+ struct Object *target;
+ struct ColorBand *color_ramp;
+ float range_min, range_max;
+} LineStyleColorModifier_DistanceFromObject;
+
+typedef struct LineStyleAlphaModifier_DistanceFromObject {
+ struct LineStyleModifier modifier;
+
+ struct Object *target;
+ struct CurveMapping *curve;
+ int flags;
+ float range_min, range_max;
+ int pad;
+} LineStyleAlphaModifier_DistanceFromObject;
+
+typedef struct LineStyleThicknessModifier_DistanceFromObject {
+ struct LineStyleModifier modifier;
+
+ struct Object *target;
+ struct CurveMapping *curve;
+ int flags;
+ float range_min, range_max;
+ float value_min, value_max;
+ int pad;
+} LineStyleThicknessModifier_DistanceFromObject;
+
+/* Material modifiers */
+
+/* mat_attr */
+#define LS_MODIFIER_MATERIAL_DIFF 1
+#define LS_MODIFIER_MATERIAL_DIFF_R 2
+#define LS_MODIFIER_MATERIAL_DIFF_G 3
+#define LS_MODIFIER_MATERIAL_DIFF_B 4
+#define LS_MODIFIER_MATERIAL_SPEC 5
+#define LS_MODIFIER_MATERIAL_SPEC_R 6
+#define LS_MODIFIER_MATERIAL_SPEC_G 7
+#define LS_MODIFIER_MATERIAL_SPEC_B 8
+#define LS_MODIFIER_MATERIAL_SPEC_HARD 9
+#define LS_MODIFIER_MATERIAL_ALPHA 10
+
+typedef struct LineStyleColorModifier_Material {
+ struct LineStyleModifier modifier;
+
+ struct ColorBand *color_ramp;
+ int flags;
+ int mat_attr;
+} LineStyleColorModifier_Material;
+
+typedef struct LineStyleAlphaModifier_Material {
+ struct LineStyleModifier modifier;
+
+ struct CurveMapping *curve;
+ int flags;
+ int mat_attr;
+} LineStyleAlphaModifier_Material;
+
+typedef struct LineStyleThicknessModifier_Material {
+ struct LineStyleModifier modifier;
+
+ struct CurveMapping *curve;
+ int flags;
+ float value_min, value_max;
+ int mat_attr;
+} LineStyleThicknessModifier_Material;
+
+/* Geometry modifiers */
+
+typedef struct LineStyleGeometryModifier_Sampling {
+ struct LineStyleModifier modifier;
+
+ float sampling;
+ int pad;
+} LineStyleGeometryModifier_Sampling;
+
+typedef struct LineStyleGeometryModifier_BezierCurve {
+ struct LineStyleModifier modifier;
+
+ float error;
+ int pad;
+} LineStyleGeometryModifier_BezierCurve;
+
+typedef struct LineStyleGeometryModifier_SinusDisplacement {
+ struct LineStyleModifier modifier;
+
+ float wavelength, amplitude, phase;
+ int pad;
+} LineStyleGeometryModifier_SinusDisplacement;
+
+/* LineStyleGeometryModifier_SpatialNoise::flags */
+#define LS_MODIFIER_SPATIAL_NOISE_SMOOTH 1
+#define LS_MODIFIER_SPATIAL_NOISE_PURERANDOM 2
+
+typedef struct LineStyleGeometryModifier_SpatialNoise {
+ struct LineStyleModifier modifier;
+
+ float amplitude, scale;
+ unsigned int octaves;
+ int flags;
+} LineStyleGeometryModifier_SpatialNoise;
+
+typedef struct LineStyleGeometryModifier_PerlinNoise1D {
+ struct LineStyleModifier modifier;
+
+ float frequency, amplitude;
+ float angle; /* in radians! */
+ unsigned int octaves;
+ int seed;
+ int pad1;
+} LineStyleGeometryModifier_PerlinNoise1D;
+
+typedef struct LineStyleGeometryModifier_PerlinNoise2D {
+ struct LineStyleModifier modifier;
+
+ float frequency, amplitude;
+ float angle; /* in radians! */
+ unsigned int octaves;
+ int seed;
+ int pad1;
+} LineStyleGeometryModifier_PerlinNoise2D;
+
+typedef struct LineStyleGeometryModifier_BackboneStretcher {
+ struct LineStyleModifier modifier;
+
+ float backbone_length;
+ int pad;
+} LineStyleGeometryModifier_BackboneStretcher;
+
+typedef struct LineStyleGeometryModifier_TipRemover {
+ struct LineStyleModifier modifier;
+
+ float tip_length;
+ int pad;
+} LineStyleGeometryModifier_TipRemover;
+
+typedef struct LineStyleGeometryModifier_Polygonalization {
+ struct LineStyleModifier modifier;
+
+ float error;
+ int pad;
+} LineStyleGeometryModifier_Polygonalization;
+
+typedef struct LineStyleGeometryModifier_GuidingLines {
+ struct LineStyleModifier modifier;
+
+ float offset;
+ int pad;
+} LineStyleGeometryModifier_GuidingLines;
+
+/* LineStyleGeometryModifier_BluePrintLines::shape */
+#define LS_MODIFIER_BLUEPRINT_CIRCLES 1
+#define LS_MODIFIER_BLUEPRINT_ELLIPSES 2
+#define LS_MODIFIER_BLUEPRINT_SQUARES 4
+
+typedef struct LineStyleGeometryModifier_Blueprint {
+ struct LineStyleModifier modifier;
+
+ int flags;
+ unsigned int rounds;
+ float backbone_length;
+ unsigned int random_radius;
+ unsigned int random_center;
+ unsigned int random_backbone;
+} LineStyleGeometryModifier_Blueprint;
+
+typedef struct LineStyleGeometryModifier_2DOffset {
+ struct LineStyleModifier modifier;
+
+ float start, end;
+ float x, y;
+} LineStyleGeometryModifier_2DOffset;
+
+/* LineStyleGeometryModifier_2DTransform::pivot */
+#define LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER 1
+#define LS_MODIFIER_2D_TRANSFORM_PIVOT_START 2
+#define LS_MODIFIER_2D_TRANSFORM_PIVOT_END 3
+#define LS_MODIFIER_2D_TRANSFORM_PIVOT_PARAM 4
+#define LS_MODIFIER_2D_TRANSFORM_PIVOT_ABSOLUTE 5
+
+typedef struct LineStyleGeometryModifier_2DTransform {
+ struct LineStyleModifier modifier;
+
+ int pivot;
+ float scale_x, scale_y;
+ float angle; /* in radians! */
+ float pivot_u;
+ float pivot_x, pivot_y;
+ int pad;
+} LineStyleGeometryModifier_2DTransform;
+
+/* Calligraphic thickness modifier */
+
+typedef struct LineStyleThicknessModifier_Calligraphy {
+ struct LineStyleModifier modifier;
+
+ float min_thickness, max_thickness;
+ float orientation; /* in radians! */
+ int pad;
+} LineStyleThicknessModifier_Calligraphy;
+
+/* FreestyleLineStyle::panel */
+#define LS_PANEL_STROKES 1
+#define LS_PANEL_COLOR 2
+#define LS_PANEL_ALPHA 3
+#define LS_PANEL_THICKNESS 4
+#define LS_PANEL_GEOMETRY 5
+#define LS_PANEL_MISC 6
+
+/* FreestyleLineStyle::flag */
+#define LS_DS_EXPAND (1 << 0) /* for animation editors */
+#define LS_SAME_OBJECT (1 << 1)
+#define LS_DASHED_LINE (1 << 2)
+#define LS_MATERIAL_BOUNDARY (1 << 3)
+#define LS_MIN_2D_LENGTH (1 << 4)
+#define LS_MAX_2D_LENGTH (1 << 5)
+#define LS_NO_CHAINING (1 << 6)
+#define LS_MIN_2D_ANGLE (1 << 7)
+#define LS_MAX_2D_ANGLE (1 << 8)
+#define LS_SPLIT_LENGTH (1 << 9)
+#define LS_SPLIT_PATTERN (1 << 10)
+
+/* FreestyleLineStyle::chaining */
+#define LS_CHAINING_PLAIN 1
+#define LS_CHAINING_SKETCHY 2
+
+/* FreestyleLineStyle::caps */
+#define LS_CAPS_BUTT 1
+#define LS_CAPS_ROUND 2
+#define LS_CAPS_SQUARE 3
+
+/* FreestyleLineStyle::thickness_position */
+#define LS_THICKNESS_CENTER 1
+#define LS_THICKNESS_INSIDE 2
+#define LS_THICKNESS_OUTSIDE 3
+#define LS_THICKNESS_RELATIVE 4 /* thickness_ratio is used */
+
+typedef struct FreestyleLineStyle {
+ ID id;
+ struct AnimData *adt;
+
+ float r, g, b, alpha;
+ float thickness;
+ int thickness_position;
+ float thickness_ratio;
+ int flag, caps;
+ int chaining;
+ unsigned int rounds;
+ float split_length;
+ float min_angle, max_angle; /* in radians, for splitting */
+ float min_length, max_length;
+ unsigned short split_dash1, split_gap1;
+ unsigned short split_dash2, split_gap2;
+ unsigned short split_dash3, split_gap3;
+ int pad;
+ unsigned short dash1, gap1, dash2, gap2, dash3, gap3;
+ int panel; /* for UI */
+
+ ListBase color_modifiers;
+ ListBase alpha_modifiers;
+ ListBase thickness_modifiers;
+ ListBase geometry_modifiers;
+} FreestyleLineStyle;
+
+#endif
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index fceea396507..e23b85b5a4e 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -177,6 +177,9 @@ typedef struct Material {
short shadowonly_flag; /* "shadowsonly" type */
short index; /* custom index for render passes */
+ short vcol_alpha;
+ short pad4[3];
+
ListBase gpumaterial; /* runtime */
} Material;
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 87f45c28ed9..532867a92d0 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -116,7 +116,8 @@ typedef struct Mesh {
float size[3];
float rot[3];
- short texflag, drawflag;
+ int drawflag;
+ short texflag, pad2[3];
short smoothresh, flag;
/* customdata flag, for bevel-weight and crease, which are now optional */
@@ -202,6 +203,9 @@ typedef struct TFace {
/* debug only option */
#define ME_DRAWEXTRA_INDICES (1 << 14)
+#define ME_DRAW_FREESTYLE_EDGE (1 << 15)
+#define ME_DRAW_FREESTYLE_FACE (1 << 16)
+
/* Subsurf Type */
#define ME_CC_SUBSURF 0
#define ME_SIMPLE_SUBSURF 1
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index a189219b211..d1e123cb826 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -279,6 +279,22 @@ typedef struct MVertSkin {
int flag;
} MVertSkin;
+typedef struct FreestyleEdge {
+ char flag;
+ char pad[3];
+} FreestyleEdge;
+
+/* FreestyleEdge->flag */
+#define FREESTYLE_EDGE_MARK 1
+
+typedef struct FreestyleFace {
+ char flag;
+ char pad[3];
+} FreestyleFace;
+
+/* FreestyleFace->flag */
+#define FREESTYLE_FACE_MARK 1
+
/* mvert->flag (1=SELECT) */
#define ME_SPHERETEST 2
#define ME_VERT_TMP_TAG 4
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 2b78a76b9fa..f9286052aeb 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -45,6 +45,7 @@ extern "C" {
#include "DNA_vec_types.h"
#include "DNA_listBase.h"
#include "DNA_ID.h"
+#include "DNA_freestyle_types.h"
struct Object;
struct Brush;
@@ -187,6 +188,8 @@ typedef struct SceneRenderLayer {
int samples;
int pad;
+
+ struct FreestyleConfig freestyleConfig;
} SceneRenderLayer;
/* srl->layflag */
@@ -196,7 +199,8 @@ typedef struct SceneRenderLayer {
#define SCE_LAY_EDGE 8
#define SCE_LAY_SKY 16
#define SCE_LAY_STRAND 32
- /* flags between 32 and 0x8000 are set to 1 already, for future options */
+#define SCE_LAY_FRS 64
+ /* flags between 128 and 0x8000 are set to 1 already, for future options */
#define SCE_LAY_ALL_Z 0x8000
#define SCE_LAY_XOR 0x10000
@@ -546,6 +550,10 @@ typedef struct RenderData {
float pad2;
struct Text *dometext DNA_DEPRECATED; // XXX deprecated since 2.5
+ /* Freestyle line thickness options */
+ int line_thickness_mode;
+ float unit_line_thickness; /* in pixels */
+
/* render engine */
char engine[32];
} RenderData;
@@ -1340,6 +1348,10 @@ typedef struct Scene {
/* simplify_flag */
#define R_SIMPLE_NO_TRIANGULATE 1
+/* line_thickness_mode */
+#define R_LINE_THICKNESS_ABSOLUTE 1
+#define R_LINE_THICKNESS_RELATIVE 2
+
/* sequencer seq_prev_type seq_rend_type */
@@ -1548,6 +1560,7 @@ typedef enum SculptFlags {
#define EDGE_MODE_TAG_SHARP 2
#define EDGE_MODE_TAG_CREASE 3
#define EDGE_MODE_TAG_BEVEL 4
+#define EDGE_MODE_TAG_FREESTYLE 5
/* toolsettings->gpencil_flags */
#define GP_TOOL_FLAG_PAINTSESSIONS_ON (1<<0)
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 8253bb570f6..02316461d95 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -183,6 +183,7 @@ typedef enum eSpaceButtons_Context {
BCONTEXT_MODIFIER = 10,
BCONTEXT_CONSTRAINT = 11,
BCONTEXT_BONE_CONSTRAINT = 12,
+ BCONTEXT_RENDER_LAYER = 13,
/* always as last... */
BCONTEXT_TOT
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 56c767b600f..a68d702594f 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -240,6 +240,7 @@ typedef struct ThemeSpace {
char bone_solid[4], bone_pose[4], bone_pose_active[4];
char strip[4], strip_select[4];
char cframe[4];
+ char freestyle_edge_mark[4], freestyle_face_mark[4];
char nurb_uline[4], nurb_vline[4];
char act_spline[4], nurb_sel_uline[4], nurb_sel_vline[4], lastsel_point[4];
diff --git a/source/blender/makesdna/SConscript b/source/blender/makesdna/SConscript
index 701ad12f2b8..dba0f84170e 100644
--- a/source/blender/makesdna/SConscript
+++ b/source/blender/makesdna/SConscript
@@ -28,10 +28,14 @@
Import ('env')
objs = []
+defs = []
o = SConscript('intern/SConscript')
objs += o
incs = '#/intern/guardedalloc . ../blenlib'
-env.BlenderLib ( 'bf_dna', objs, Split(incs), [], libtype=['core','player'], priority = [215,200] )
+if env['WITH_BF_FREESTYLE']:
+ defs.append('WITH_FREESTYLE')
+
+env.BlenderLib ( 'bf_dna', objs, Split(incs), defs, libtype=['core','player'], priority = [215,200] )
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index e22602aa7a2..da1811656a6 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -134,6 +134,8 @@ static const char *includefiles[] = {
"DNA_dynamicpaint_types.h",
"DNA_mask_types.h",
"DNA_rigidbody_types.h",
+ "DNA_freestyle_types.h",
+ "DNA_linestyle_types.h",
/* empty string to indicate end of includefiles */
""
@@ -1268,4 +1270,6 @@ int main(int argc, char **argv)
#include "DNA_dynamicpaint_types.h"
#include "DNA_mask_types.h"
#include "DNA_rigidbody_types.h"
+#include "DNA_freestyle_types.h"
+#include "DNA_linestyle_types.h"
/* end of list */