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/DNA_ID.h178
-rw-r--r--source/blender/makesdna/DNA_action_types.h69
-rw-r--r--source/blender/makesdna/DNA_actuator_types.h583
-rw-r--r--source/blender/makesdna/DNA_anim_types.h11
-rw-r--r--source/blender/makesdna/DNA_armature_types.h16
-rw-r--r--source/blender/makesdna/DNA_brush_types.h115
-rw-r--r--source/blender/makesdna/DNA_camera_types.h57
-rw-r--r--source/blender/makesdna/DNA_cloth_types.h29
-rw-r--r--source/blender/makesdna/DNA_collection_types.h94
-rw-r--r--source/blender/makesdna/DNA_color_types.h10
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h37
-rw-r--r--source/blender/makesdna/DNA_controller_types.h95
-rw-r--r--source/blender/makesdna/DNA_curve_types.h10
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h8
-rw-r--r--source/blender/makesdna/DNA_defs.h6
-rw-r--r--source/blender/makesdna/DNA_dynamicpaint_types.h9
-rw-r--r--source/blender/makesdna/DNA_effect_types.h4
-rw-r--r--source/blender/makesdna/DNA_fileglobal_types.h6
-rw-r--r--source/blender/makesdna/DNA_freestyle_types.h4
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_types.h481
-rw-r--r--source/blender/makesdna/DNA_gpencil_types.h360
-rw-r--r--source/blender/makesdna/DNA_gpu_types.h2
-rw-r--r--source/blender/makesdna/DNA_group_types.h65
-rw-r--r--source/blender/makesdna/DNA_image_types.h39
-rw-r--r--source/blender/makesdna/DNA_key_types.h11
-rw-r--r--source/blender/makesdna/DNA_lamp_types.h120
-rw-r--r--source/blender/makesdna/DNA_lattice_types.h1
-rw-r--r--source/blender/makesdna/DNA_layer_types.h162
-rw-r--r--source/blender/makesdna/DNA_lightprobe_types.h184
-rw-r--r--source/blender/makesdna/DNA_material_types.h442
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h65
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h84
-rw-r--r--source/blender/makesdna/DNA_meta_types.h3
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h153
-rw-r--r--source/blender/makesdna/DNA_node_types.h51
-rw-r--r--source/blender/makesdna/DNA_object_enums.h11
-rw-r--r--source/blender/makesdna/DNA_object_force_types.h82
-rw-r--r--source/blender/makesdna/DNA_object_types.h278
-rw-r--r--source/blender/makesdna/DNA_outliner_types.h26
-rw-r--r--source/blender/makesdna/DNA_particle_types.h51
-rw-r--r--source/blender/makesdna/DNA_property_types.h65
-rw-r--r--source/blender/makesdna/DNA_rigidbody_types.h43
-rw-r--r--source/blender/makesdna/DNA_scene_types.h854
-rw-r--r--source/blender/makesdna/DNA_screen_types.h138
-rw-r--r--source/blender/makesdna/DNA_sensor_types.h334
-rw-r--r--source/blender/makesdna/DNA_shader_fx_types.h244
-rw-r--r--source/blender/makesdna/DNA_smoke_types.h16
-rw-r--r--source/blender/makesdna/DNA_space_types.h291
-rw-r--r--source/blender/makesdna/DNA_texture_types.h136
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h173
-rw-r--r--source/blender/makesdna/DNA_view2d_types.h4
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h332
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h45
-rw-r--r--source/blender/makesdna/DNA_workspace_types.h214
-rw-r--r--source/blender/makesdna/DNA_world_types.h111
-rw-r--r--source/blender/makesdna/intern/dna_genfile.c91
-rw-r--r--source/blender/makesdna/intern/makesdna.c35
57 files changed, 3922 insertions, 3216 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index e9bc0f41980..9e5e822c4d5 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -45,6 +45,27 @@ struct ID;
struct PackedFile;
struct GPUTexture;
+/* Runtime display data */
+struct DrawData;
+typedef void (*DrawDataInitCb)(struct DrawData *engine_data);
+typedef void (*DrawDataFreeCb)(struct DrawData *engine_data);
+
+#
+#
+typedef struct DrawData {
+ struct DrawData *next, *prev;
+ struct DrawEngineType *engine_type;
+ /* Only nested data, NOT the engine data itself. */
+ DrawDataFreeCb free;
+ /* Accumulated recalc flags, which corresponds to ID->recalc flags. */
+ int recalc;
+} DrawData;
+
+typedef struct DrawDataList {
+ struct DrawData *first, *last;
+} DrawDataList;
+
+
typedef struct IDPropertyData {
void *pointer;
ListBase group;
@@ -96,14 +117,104 @@ enum {
IDP_STRING_SUB_BYTE = 1, /* arbitrary byte array, _not_ null terminated */
};
+/* IDP_GROUP */
+enum {
+ IDP_GROUP_SUB_NONE = 0, /* default */
+ IDP_GROUP_SUB_MODE_OBJECT = 1, /* object mode settings */
+ IDP_GROUP_SUB_MODE_EDIT = 2, /* mesh edit mode settings */
+ IDP_GROUP_SUB_ENGINE_RENDER = 3, /* render engine settings */
+ IDP_GROUP_SUB_OVERRIDE = 4, /* data override */
+ IDP_GROUP_SUB_MODE_PAINT_WEIGHT = 5, /* weight paint mode settings */
+ IDP_GROUP_SUB_MODE_PAINT_VERTEX = 6, /* vertex paint mode settings */
+};
+
/*->flag*/
enum {
+ /* This IDProp may be statically overridden. Should only be used/be relevant for custom properties. */
+ IDP_FLAG_OVERRIDABLE_STATIC = 1 << 0,
+
IDP_FLAG_GHOST = 1 << 7, /* this means the property is set but RNA will return false when checking
* 'RNA_property_is_set', currently this is a runtime flag */
};
/* add any future new id property types here.*/
+
+/* Static ID override structs. */
+
+typedef struct IDOverrideStaticPropertyOperation {
+ struct IDOverrideStaticPropertyOperation *next, *prev;
+
+ /* Type of override. */
+ short operation;
+ short flag;
+ short pad_s1[2];
+
+ /* Sub-item references, if needed (for arrays or collections only).
+ * We need both reference and local values to allow e.g. insertion into collections (constraints, modifiers...).
+ * In collection case, if names are defined, they are used in priority.
+ * Names are pointers (instead of char[64]) to save some space, NULL when unset.
+ * Indices are -1 when unset. */
+ char *subitem_reference_name;
+ char *subitem_local_name;
+ int subitem_reference_index;
+ int subitem_local_index;
+} IDOverrideStaticPropertyOperation;
+
+/* IDOverridePropertyOperation->operation. */
+enum {
+ /* Basic operations. */
+ IDOVERRIDESTATIC_OP_NOOP = 0, /* Special value, forbids any overriding. */
+
+ IDOVERRIDESTATIC_OP_REPLACE = 1, /* Fully replace local value by reference one. */
+
+ /* Numeric-only operations. */
+ IDOVERRIDESTATIC_OP_ADD = 101, /* Add local value to reference one. */
+ /* Subtract local value from reference one (needed due to unsigned values etc.). */
+ IDOVERRIDESTATIC_OP_SUBTRACT = 102,
+ /* Multiply reference value by local one (more useful than diff for scales and the like). */
+ IDOVERRIDESTATIC_OP_MULTIPLY = 103,
+
+ /* Collection-only operations. */
+ IDOVERRIDESTATIC_OP_INSERT_AFTER = 201, /* Insert after given reference's subitem. */
+ IDOVERRIDESTATIC_OP_INSERT_BEFORE = 202, /* Insert before given reference's subitem. */
+ /* We can add more if needed (move, delete, ...). */
+};
+
+/* IDOverridePropertyOperation->flag. */
+enum {
+ IDOVERRIDESTATIC_FLAG_MANDATORY = 1 << 0, /* User cannot remove that override operation. */
+ IDOVERRIDESTATIC_FLAG_LOCKED = 1 << 1, /* User cannot change that override operation. */
+};
+
+/* A single overridden property, contain all operations on this one. */
+typedef struct IDOverrideStaticProperty {
+ struct IDOverrideStaticProperty *next, *prev;
+
+ /* Path from ID to overridden property. *Does not* include indices/names for final arrays/collections items. */
+ char *rna_path;
+
+ ListBase operations; /* List of overriding operations (IDOverridePropertyOperation) applied to this property. */
+} IDOverrideStaticProperty;
+
+/* Main container for all overriding data info of a data-block. */
+typedef struct IDOverrideStatic {
+ struct ID *reference; /* Reference linked ID which this one overrides. */
+ ListBase properties; /* List of IDOverrideProperty structs. */
+
+ short flag;
+ short pad[3];
+
+ /* Read/write data. */
+ /* Temp ID storing extra override data (used for differential operations only currently).
+ * Always NULL outside of read/write context. */
+ struct ID *storage;
+} IDOverrideStatic;
+
+enum eStaticOverride_Flag {
+ STATICOVERRIDE_AUTO = 1 << 0, /* Allow automatic generation of overriding rules. */
+};
+
/* watch it: Sequence has identical beginning. */
/**
* ID is the first thing included in all serializable types. It
@@ -134,6 +245,13 @@ typedef struct ID {
int pad;
IDProperty *properties;
+ IDOverrideStatic *override_static; /* Reference linked ID which this one overrides. */
+
+ /* Only set for datablocks which are coming from copy-on-write, points to
+ * the original version of it.
+ */
+ struct ID *orig_id;
+
void *py_instance;
} ID;
@@ -257,6 +375,8 @@ typedef enum ID_Type {
ID_PAL = MAKE_ID2('P', 'L'), /* Palette */
ID_PC = MAKE_ID2('P', 'C'), /* PaintCurve */
ID_CF = MAKE_ID2('C', 'F'), /* CacheFile */
+ ID_WS = MAKE_ID2('W', 'S'), /* WorkSpace */
+ ID_LP = MAKE_ID2('L', 'P'), /* LightProbe */
} ID_Type;
/* Only used as 'placeholder' in .blend files for directly linked datablocks. */
@@ -280,7 +400,7 @@ typedef enum ID_Type {
#define ID_REAL_USERS(id) (((ID *)id)->us - ID_FAKE_USERS(id))
#define ID_EXTRA_USERS(id) (((ID *)id)->tag & LIB_TAG_EXTRAUSER ? 1 : 0)
-#define ID_CHECK_UNDO(id) ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM))
+#define ID_CHECK_UNDO(id) ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM) && (GS((id)->name) != ID_WS))
#define ID_BLEND_PATH(_bmain, _id) ((_id)->lib ? (_id)->lib->filepath : BKE_main_blendfile_path((_bmain)))
#define ID_BLEND_PATH_FROM_GLOBAL(_id) ((_id)->lib ? (_id)->lib->filepath : BKE_main_blendfile_path_from_global())
@@ -289,6 +409,21 @@ typedef enum ID_Type {
#define ID_IS_LINKED(_id) (((ID *)(_id))->lib != NULL)
+#define ID_IS_STATIC_OVERRIDE(_id) (((ID *)(_id))->override_static != NULL && \
+ ((ID *)(_id))->override_static->reference != NULL)
+
+#define ID_IS_STATIC_OVERRIDE_TEMPLATE(_id) (((ID *)(_id))->override_static != NULL && \
+ ((ID *)(_id))->override_static->reference == NULL)
+
+#define ID_IS_STATIC_OVERRIDE_AUTO(_id) (!ID_IS_LINKED((_id)) && \
+ ID_IS_STATIC_OVERRIDE((_id)) && \
+ (((ID *)(_id))->override_static->flag & STATICOVERRIDE_AUTO))
+
+/* No copy-on-write for these types.
+ * Keep in sync with check_datablocks_copy_on_writable and deg_copy_on_write_is_needed */
+#define ID_TYPE_IS_COW(_id_type) \
+ (!ELEM(_id_type, ID_BR, ID_LS, ID_PAL, ID_IM))
+
#ifdef GS
# undef GS
#endif
@@ -300,7 +435,7 @@ typedef enum ID_Type {
/* id->flag (persitent). */
enum {
- LIB_FAKEUSER = 1 << 9,
+ LIB_FAKEUSER = 1 << 9,
};
/**
@@ -335,6 +470,11 @@ enum {
/* RESET_NEVER tag datablock as a place-holder (because the real one could not be linked from its library e.g.). */
LIB_TAG_MISSING = 1 << 6,
+ /* RESET_NEVER tag datablock as being up-to-date regarding its reference. */
+ LIB_TAG_OVERRIDESTATIC_REFOK = 1 << 9,
+ /* RESET_NEVER tag datablock as needing an auto-override execution, if enabled. */
+ LIB_TAG_OVERRIDESTATIC_AUTOREFRESH = 1 << 17,
+
/* tag datablock has having an extra user. */
LIB_TAG_EXTRAUSER = 1 << 2,
/* tag datablock has having actually increased usercount for the extra virtual user. */
@@ -349,21 +489,34 @@ enum {
/* RESET_AFTER_USE tag existing data before linking so we know what is new. */
LIB_TAG_PRE_EXISTING = 1 << 11,
+ /* The datablock is a copy-on-write/localized version. */
+ LIB_TAG_COPIED_ON_WRITE = 1 << 12,
+ LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT = 1 << 13,
+ LIB_TAG_LOCALIZED = 1 << 14,
+
/* RESET_NEVER tag datablock for freeing etc. behavior (usually set when copying real one into temp/runtime one). */
- LIB_TAG_NO_MAIN = 1 << 12, /* Datablock is not listed in Main database. */
- LIB_TAG_NO_USER_REFCOUNT = 1 << 13, /* Datablock does not refcount usages of other IDs. */
+ LIB_TAG_NO_MAIN = 1 << 15, /* Datablock is not listed in Main database. */
+ LIB_TAG_NO_USER_REFCOUNT = 1 << 16, /* Datablock does not refcount usages of other IDs. */
/* Datablock was not allocated by standard system (BKE_libblock_alloc), do not free its memory
* (usual type-specific freeing is called though). */
- LIB_TAG_NOT_ALLOCATED = 1 << 14,
+ LIB_TAG_NOT_ALLOCATED = 1 << 17,
};
+/* WARNING - when adding flags check on PSYS_RECALC */
enum {
/* RESET_AFTER_USE, used by update code (depsgraph). */
ID_RECALC_NONE = 0,
+ /* Generic recalc flag, when nothing else matches. */
ID_RECALC = 1 << 0,
- ID_RECALC_DATA = 1 << 1,
- ID_RECALC_SKIP_ANIM_TAG = 1 << 2,
- ID_RECALC_ALL = (ID_RECALC | ID_RECALC_DATA),
+ /* Per-component update flags. */
+ ID_RECALC_ANIMATION = 1 << 1,
+ ID_RECALC_DRAW = 1 << 2,
+ ID_RECALC_DRAW_CACHE = 1 << 3,
+ ID_RECALC_GEOMETRY = 1 << 4,
+ ID_RECALC_TRANSFORM = 1 << 5,
+ ID_RECALC_COPY_ON_WRITE = 1 << 6,
+ /* Special flag to check if SOMETHING was changed. */
+ ID_RECALC_ALL = (~(int)0),
};
/* To filter ID types (filter_id) */
@@ -401,15 +554,18 @@ enum {
FILTER_ID_WO = (1 << 26),
FILTER_ID_PA = (1 << 27),
FILTER_ID_CF = (1 << 28),
+ FILTER_ID_WS = (1 << 29),
+ FILTER_ID_LP = (1u << 31),
};
-/* IMPORTANT: this enum matches the order currently use in set_lisbasepointers,
+/* IMPORTANT: this enum matches the order currently use in set_listbasepointers,
* keep them in sync! */
enum {
INDEX_ID_LI = 0,
INDEX_ID_IP,
INDEX_ID_AC,
INDEX_ID_KE,
+ INDEX_ID_PAL,
INDEX_ID_GD,
INDEX_ID_NT,
INDEX_ID_IM,
@@ -427,20 +583,22 @@ enum {
INDEX_ID_TXT,
INDEX_ID_SO,
INDEX_ID_GR,
- INDEX_ID_PAL,
INDEX_ID_PC,
INDEX_ID_BR,
INDEX_ID_PA,
INDEX_ID_SPK,
+ INDEX_ID_LP,
INDEX_ID_WO,
INDEX_ID_MC,
INDEX_ID_SCR,
INDEX_ID_OB,
INDEX_ID_LS,
INDEX_ID_SCE,
+ INDEX_ID_WS,
INDEX_ID_WM,
INDEX_ID_MSK,
INDEX_ID_NULL,
+ INDEX_ID_MAX,
};
#ifdef __cplusplus
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index e255b85ebe3..d6991041ec6 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -43,7 +43,7 @@
struct SpaceLink;
struct Object;
-struct Group;
+struct Collection;
struct GHash;
/* ************************************************ */
@@ -61,7 +61,8 @@ typedef struct bMotionPathVert {
/* bMotionPathVert->flag */
typedef enum eMotionPathVert_Flag {
/* vert is selected */
- MOTIONPATH_VERT_SEL = (1 << 0)
+ MOTIONPATH_VERT_SEL = (1 << 0),
+ MOTIONPATH_VERT_KEY = (1 << 1),
} eMotionPathVert_Flag;
/* ........ */
@@ -79,6 +80,12 @@ typedef struct bMotionPath {
float color[3]; /* optional custom color */
int line_thickness; /* line thickness */
int flag; /* baking settings - eMotionPath_Flag */
+
+ /* Used for drawing. */
+ struct GPUVertBuf *points_vbo;
+ struct GPUBatch *batch_line;
+ struct GPUBatch *batch_points;
+ void *pad;
} bMotionPath;
/* bMotionPath->flag */
@@ -180,6 +187,18 @@ typedef enum eMotionPaths_BakeFlag {
MOTIONPATH_BAKE_HAS_PATHS = (1 << 2)
} eMotionPath_BakeFlag;
+/* runtime */
+#
+#
+typedef struct bPoseChannelDrawData {
+ float solid_color[4];
+ float wire_color[4];
+
+ int bbone_matrix_len;
+ /* keep last */
+ float bbone_matrix[0][4][4];
+} bPoseChannelDrawData;
+
/* ************************************************ */
/* Poses */
@@ -205,7 +224,7 @@ typedef struct bPoseChannel {
char constflag; /* for quick detecting which constraints affect this channel */
char selectflag; /* copy of bone flag, so you can work with library armatures, not for runtime use */
char drawflag;
- char bboneflag;
+ char bboneflag DNA_DEPRECATED;
char pad0[4];
struct Bone *bone; /* set on read file or rebuild pose */
@@ -238,6 +257,8 @@ typedef struct bPoseChannel {
float chan_mat[4][4]; /* matrix result of loc/quat/size, and where we put deform in, see next line */
float pose_mat[4][4]; /* constraints accumulate here. in the end, pose_mat = bone->arm_mat * chan_mat
* this matrix is object space */
+ float disp_mat[4][4]; /* for display, pose_mat with bone length applied */
+ float disp_tail_mat[4][4]; /* for display, pose_mat with bone length applied and translated to tail*/
float constinv[4][4]; /* inverse result of constraints.
* doesn't include effect of restposition, parent, and local transform*/
@@ -257,10 +278,15 @@ typedef struct bPoseChannel {
float ease1, ease2;
float scaleIn, scaleOut;
- struct bPoseChannel *bbone_prev; /* next/prev bones to use as handle references when calculating bbones (optional) */
+ struct bPoseChannel *bbone_prev; /* B-Bone custom handles; set on read file or rebuild pose based on pchan->bone data */
struct bPoseChannel *bbone_next;
void *temp; /* use for outliner */
+ /* Runtime data for color and bbone segment matrix. */
+ bPoseChannelDrawData *draw_data;
+
+ /* Points to an original pose channel. */
+ struct bPoseChannel *orig_pchan;
} bPoseChannel;
@@ -335,6 +361,7 @@ typedef enum ePchan_DrawFlag {
#define PCHAN_CUSTOM_DRAW_SIZE(pchan) \
(pchan)->custom_scale * (((pchan)->drawflag & PCHAN_DRAW_NO_CUSTOM_BONE_SIZE) ? 1.0f : (pchan)->bone->length)
+#ifdef DNA_DEPRECATED_ALLOW
/* PoseChannel->bboneflag */
typedef enum ePchan_BBoneFlag {
/* Use custom reference bones (for roll and handle alignment), instead of immediate neighbors */
@@ -344,6 +371,7 @@ typedef enum ePchan_BBoneFlag {
/* Evaluate end handle as being "relative" */
PCHAN_BBONE_CUSTOM_END_REL = (1 << 3),
} ePchan_BBoneFlag;
+#endif
/* PoseChannel->rotmode and Object->rotmode */
typedef enum eRotationModes {
@@ -418,8 +446,7 @@ typedef enum ePose_Flags {
POSE_RECALCPATHS = (1 << 4),
/* set by BKE_pose_rebuild to give a chance to the IK solver to rebuild IK tree */
POSE_WAS_REBUILT = (1 << 5),
- /* set by game_copy_pose to indicate that this pose is used in the game engine */
- POSE_GAME_ENGINE = (1 << 6),
+ POSE_FLAG_DEPRECATED = (1 << 6), /* deprecated. */
/* pose constraint flags needs to be updated */
POSE_CONSTRAINTS_NEED_UPDATE_FLAGS = (1 << 7),
} ePose_Flags;
@@ -573,8 +600,8 @@ typedef struct bDopeSheet {
ID *source; /* currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil) */
ListBase chanbase; /* cache for channels (only initialized when pinned) */ // XXX not used!
- struct Group *filter_grp; /* object group for ADS_FILTER_ONLYOBGROUP filtering option */
- char searchstr[64]; /* string to search for in displayed names of F-Curves for ADS_FILTER_BY_FCU_NAME filtering option */
+ struct Collection *filter_grp; /* object group for option to only include objects that belong to this Collection */
+ char searchstr[64]; /* string to search for in displayed names of F-Curves, or NlaTracks/GP Layers/etc. */
int filterflag; /* flags to use for filtering data */
int flag; /* standard flags */
@@ -596,7 +623,6 @@ typedef enum eDopeSheet_FilterFlag {
/* general filtering */
ADS_FILTER_SUMMARY = (1 << 4), /* for 'DopeSheet' Editors - include 'summary' line */
- ADS_FILTER_ONLYOBGROUP = (1 << 5), /* only the objects in the specified object group get used */
/* datatype-based filtering */
ADS_FILTER_NOSHAPEKEYS = (1 << 6),
@@ -625,7 +651,6 @@ typedef enum eDopeSheet_FilterFlag {
/* general filtering 3 */
ADS_FILTER_INCL_HIDDEN = (1 << 26), /* include 'hidden' channels too (i.e. those from hidden Objects/Bones) */
- ADS_FILTER_BY_FCU_NAME = (1 << 27), /* for F-Curves, filter by the displayed name (i.e. to isolate all Location curves only) */
ADS_FILTER_ONLY_ERRORS = (1 << 28), /* show only F-Curves which are disabled/have errors - for debugging drivers */
/* GPencil Mode */
@@ -662,9 +687,16 @@ typedef struct SpaceAction {
bAction *action; /* the currently active action */
bDopeSheet ads; /* the currently active context (when not showing action) */
- char mode, autosnap; /* mode: editing context; autosnap: automatic keyframe snapping mode */
- short flag; /* flag: bitmapped settings; */
float timeslide; /* for Time-Slide transform mode drawing - current frame? */
+
+ short flag;
+ /* Editing context */
+ char mode;
+ /* Storage for sub-space types. */
+ char mode_prev;
+ char autosnap; /* automatic keyframe snapping mode */
+ char cache_display; /* (eTimeline_Cache_Flag) */
+ char _pad1[6];
} SpaceAction;
/* SpaceAction flag */
@@ -709,6 +741,8 @@ typedef enum eAnimEdit_Context {
SACTCONT_MASK = 4,
/* cache file */
SACTCONT_CACHEFILE = 5,
+ /* timeline - replacement for the standalone "timeline editor" */
+ SACTCONT_TIMELINE = 6,
} eAnimEdit_Context;
/* SpaceAction AutoSnap Settings (also used by other Animation Editors) */
@@ -727,6 +761,17 @@ typedef enum eAnimEdit_AutoSnap {
SACTSNAP_TSTEP = 5
} eAnimEdit_AutoSnap;
+/* SAction->cache_display */
+typedef enum eTimeline_Cache_Flag {
+ TIME_CACHE_DISPLAY = (1 << 0),
+ TIME_CACHE_SOFTBODY = (1 << 1),
+ TIME_CACHE_PARTICLES = (1 << 2),
+ TIME_CACHE_CLOTH = (1 << 3),
+ TIME_CACHE_SMOKE = (1 << 4),
+ TIME_CACHE_DYNAMICPAINT = (1 << 5),
+ TIME_CACHE_RIGIDBODY = (1 << 6),
+} eTimeline_Cache_Flag;
+
/* ************************************************ */
/* Legacy Data */
diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h
deleted file mode 100644
index 6461ad5445f..00000000000
--- a/source/blender/makesdna/DNA_actuator_types.h
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
- * ***** 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) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file DNA_actuator_types.h
- * \ingroup DNA
- *
- * #bActuator type is specifically for use by Object logic-bricks in the game-engine.
- */
-
-#ifndef __DNA_ACTUATOR_TYPES_H__
-#define __DNA_ACTUATOR_TYPES_H__
-
-struct Object;
-struct Mesh;
-struct Scene;
-struct Group;
-struct Text;
-
-/* ****************** ACTUATORS ********************* */
-
-/* unused now, moved to editobjectactuator in 2.02. Still needed for dna */
-typedef struct bAddObjectActuator {
- int time, pad;
- struct Object *ob;
-} bAddObjectActuator;
-
-typedef struct bActionActuator {
- struct bAction *act; /* Pointer to action */
- short type, flag; /* Playback type */ // not in use
- float sta, end; /* Start & End frames */
- char name[64]; /* For property-driven playback, MAX_NAME */
- char frameProp[64]; /* Set this property to the actions current frame, MAX_NAME */
- short blendin; /* Number of frames of blending */
- short priority; /* Execution priority */
- short layer; /* Animation layer */
- short end_reset; /* Ending the actuator (negative pulse) wont reset the action to its starting frame */
- short strideaxis; /* Displacement axis */
- short blend_mode; /* Layer blending mode */
- float stridelength; /* Displacement incurred by cycle */ // not in use
- float layer_weight; /* How much of the previous layer to use for blending. (<0 = disable, 0 = add mode) */
-} bActionActuator;
-
-typedef struct Sound3D {
- float min_gain;
- float max_gain;
- float reference_distance;
- float max_distance;
- float rolloff_factor;
- float cone_inner_angle;
- float cone_outer_angle;
- float cone_outer_gain;
-} Sound3D;
-
-typedef struct bSoundActuator {
- short flag, sndnr;
- int pad1, pad2;
- short pad3[2];
- float volume, pitch;
- struct bSound *sound;
- struct Sound3D sound3D;
- short type, pad4;
- short pad5, pad6[1];
-} bSoundActuator;
-
-typedef struct bEditObjectActuator {
- int time;
- short type, flag;
- struct Object *ob;
- struct Mesh *me;
- char name[64]; /* MAX_NAME */
- float linVelocity[3]; /* initial lin. velocity on creation */
- float angVelocity[3]; /* initial ang. velocity on creation */
- float mass;
- short localflag; /* flag for the lin & ang. vel: apply locally */
- short dyn_operation;
- short upflag, trackflag; /* flag for up axis and track axis */
- int pad;
-} bEditObjectActuator;
-
-typedef struct bSceneActuator {
- short type, pad1;
- int pad;
- struct Scene *scene;
- struct Object *camera;
-} bSceneActuator;
-
-typedef struct bPropertyActuator {
- int pad, type;
- char name[64], value[64]; /* MAX_NAME */
- struct Object *ob;
-} bPropertyActuator;
-
-typedef struct bObjectActuator {
- short flag, type, otype;
- short damping;
- float forceloc[3], forcerot[3];
- float pad[3], pad1[3];
- float dloc[3], drot[3]; /* angle in radians */
- float linearvelocity[3], angularvelocity[3];
- struct Object *reference;
-} bObjectActuator;
-
-/* deprecated, handled by bActionActuator now */
-typedef struct bIpoActuator {
- short flag, type;
- float sta, end;
- char name[64]; /* MAX_NAME */
- char frameProp[64]; /* Set this property to the actions current frame, MAX_NAME */
-
- short pad1, pad2, pad3, pad4;
-
-} bIpoActuator;
-
-typedef struct bCameraActuator {
- struct Object *ob;
- float height, min, max;
- float damping;
- short pad1, axis;
- float pad2;
-} bCameraActuator;
-
-typedef struct bConstraintActuator {
- short type, mode;
- short flag, damp;
- short time, rotdamp;
- int pad;
- float minloc[3], maxloc[3];
- float minrot[3], maxrot[3];
- char matprop[64]; /* MAX_NAME */
-} bConstraintActuator;
-
-typedef struct bGroupActuator {
- short flag, type;
- int sta, end;
- char name[64]; /* property or groupkey, MAX_NAME */
-
- short pad[3], cur, butsta, butend;/* not referenced, can remove? */
- /* struct Group *group; not used, remove */
-
-} bGroupActuator;
-
-/* I added a few extra fields here, to facilitate conversions */
-typedef struct bRandomActuator {
- int seed;
- int distribution;
- int int_arg_1;
- int int_arg_2;
- float float_arg_1;
- float float_arg_2;
- char propname[64]; /* MAX_NAME */
-} bRandomActuator;
-
-typedef struct bMessageActuator {
- char toPropName[64]; /* Send to all objects with this propertyname. Empty to broadcast. MAX_NAME. */
- struct Object *toObject;/* (Possible future use) pointer to a single destination object. */
- char subject[64]; /* Message Subject to send. MAX_NAME. */
- short bodyType, pad1; /* bodyType is either 'User defined text' or PropName */
- int pad2;
- char body[64]; /* Either User Defined Text or our PropName to send value of, MAX_NAME */
-} bMessageActuator;
-
-typedef struct bGameActuator {
- short flag, type;
- int sta, end;
- char filename[64];
- char loadaniname[64];
-} bGameActuator;
-
-typedef struct bVisibilityActuator {
- /** bit 0: Is this object visible?
- ** bit 1: Apply recursively
- ** bit 2: Is this object an occluder? */
- int flag;
-} bVisibilityActuator;
-
-typedef struct bTwoDFilterActuator {
- char pad[4];
- /* Tells what type of 2D Filter */
- short type;
- /* (flag == 0) means 2D filter is activate and
- * (flag != 0) means 2D filter is inactive */
- short flag;
- int int_arg;
- /* a float argument */
- float float_arg;
- struct Text *text;
-} bTwoDFilterActuator;
-
-typedef struct bParentActuator {
- char pad[2];
- short flag;
- int type;
- struct Object *ob;
-} bParentActuator;
-
-typedef struct bStateActuator {
- int type; /* 0=Set, 1=Add, 2=Rem, 3=Chg */
- unsigned int mask; /* the bits to change */
-} bStateActuator;
-
-typedef struct bArmatureActuator {
- char posechannel[64]; /* MAX_NAME */
- char constraint[64]; /* MAX_NAME */
- int type; /* 0=run, 1=enable, 2=disable, 3=set target, 4=set weight */
- float weight;
- float influence;
- float pad;
- struct Object *target;
- struct Object *subtarget;
-} bArmatureActuator;
-
-typedef struct bSteeringActuator {
- char pad[5];
- char flag;
- short facingaxis;
- int type; /* 0=seek, 1=flee, 2=path following */
- float dist;
- float velocity;
- float acceleration;
- float turnspeed;
- int updateTime;
- struct Object *target;
- struct Object *navmesh;
-} bSteeringActuator;
-
-typedef struct bMouseActuator {
- short type; /* 0=Visibility, 1=Look */
- short flag;
-
- int object_axis[2];
- float threshold[2];
- float sensitivity[2];
- float limit_x[2];
- float limit_y[2];
-} bMouseActuator;
-
-
-typedef struct bActuator {
- struct bActuator *next, *prev, *mynew;
- short type;
- /**
- * Tells what type of actuator data \ref data holds.
- */
- short flag;
- short otype, go;
- char name[64]; /* MAX_NAME */
-
- /**
- * data must point to an object actuator type struct.
- */
- void *data;
-
- /**
- * For ipo's and props: to find out which object the actuator
- * belongs to */
- struct Object *ob;
-
-} bActuator;
-
-/* objectactuator->flag */
-#define ACT_FORCE_LOCAL 1
-#define ACT_TORQUE_LOCAL 2
-#define ACT_SERVO_LIMIT_X 2
-#define ACT_DLOC_LOCAL 4
-#define ACT_SERVO_LIMIT_Y 4
-#define ACT_DROT_LOCAL 8
-#define ACT_SERVO_LIMIT_Z 8
-#define ACT_LIN_VEL_LOCAL 16
-#define ACT_ANG_VEL_LOCAL 32
-//#define ACT_ADD_LIN_VEL_LOCAL 64
-#define ACT_ADD_LIN_VEL 64
-#define ACT_ADD_CHAR_LOC 128
-#define ACT_CHAR_JUMP 256
-
-/* objectactuator->type */
-#define ACT_OBJECT_NORMAL 0
-#define ACT_OBJECT_SERVO 1
-#define ACT_OBJECT_CHARACTER 2
-
-/* actuator->type */
-#define ACT_OBJECT 0
-#define ACT_IPO 1
-#define ACT_LAMP 2
-#define ACT_CAMERA 3
-#define ACT_MATERIAL 4
-#define ACT_SOUND 5
-#define ACT_PROPERTY 6
- /* these two obsolete since 2.02 */
-#define ACT_ADD_OBJECT 7
-#define ACT_END_OBJECT 8
-
-#define ACT_CONSTRAINT 9
-#define ACT_EDIT_OBJECT 10
-#define ACT_SCENE 11
-#define ACT_GROUP 12
-#define ACT_RANDOM 13
-#define ACT_MESSAGE 14
-#define ACT_ACTION 15 /* __ NLA */
-#define ACT_GAME 17
-#define ACT_VISIBILITY 18
-#define ACT_2DFILTER 19
-#define ACT_PARENT 20
-#define ACT_SHAPEACTION 21
-#define ACT_STATE 22
-#define ACT_ARMATURE 23
-#define ACT_STEERING 24
-#define ACT_MOUSE 25
-
-/* actuator flag */
-#define ACT_SHOW 1
-#define ACT_DEL 2
-#define ACT_NEW 4
-#define ACT_LINKED 8
-#define ACT_VISIBLE 16
-#define ACT_PIN 32
-#define ACT_DEACTIVATE 64
-
-/* link codes */
-#define LINK_SENSOR 0
-#define LINK_CONTROLLER 1
-#define LINK_ACTUATOR 2
-
-/* keyboardsensor->type */
-#define SENS_ALL_KEYS 1
-
-/* actionactuator->type */
-#define ACT_ACTION_PLAY 0
-#define ACT_ACTION_PINGPONG 1
-#define ACT_ACTION_FLIPPER 2
-#define ACT_ACTION_LOOP_STOP 3
-#define ACT_ACTION_LOOP_END 4
-#define ACT_ACTION_KEY2KEY 5
-#define ACT_ACTION_FROM_PROP 6
-#define ACT_ACTION_MOTION 7
-
-/* actionactuator->blend_mode */
-#define ACT_ACTION_BLEND 0
-#define ACT_ACTION_ADD 1
-
-/* ipoactuator->type */
-/* used for conversion from 2.01 */
-#define ACT_IPO_FROM_PROP 6
-
-/* groupactuator->type */
-#define ACT_GROUP_PLAY 0
-#define ACT_GROUP_PINGPONG 1
-#define ACT_GROUP_FLIPPER 2
-#define ACT_GROUP_LOOP_STOP 3
-#define ACT_GROUP_LOOP_END 4
-#define ACT_GROUP_FROM_PROP 5
-#define ACT_GROUP_SET 6
-
-/* ipoactuator->flag */
-#define ACT_IPOFORCE (1 << 0)
-#define ACT_IPOEND (1 << 1)
-#define ACT_IPOLOCAL (1 << 2)
-#define ACT_IPOCHILD (1 << 4)
-#define ACT_IPOADD (1 << 5)
-
-/* property actuator->type */
-#define ACT_PROP_ASSIGN 0
-#define ACT_PROP_ADD 1
-#define ACT_PROP_COPY 2
-#define ACT_PROP_TOGGLE 3
-#define ACT_PROP_LEVEL 4
-
-/* constraint flag */
-#define ACT_CONST_NONE 0
-#define ACT_CONST_LOCX 1
-#define ACT_CONST_LOCY 2
-#define ACT_CONST_LOCZ 4
-#define ACT_CONST_ROTX 8
-#define ACT_CONST_ROTY 16
-#define ACT_CONST_ROTZ 32
-#define ACT_CONST_NORMAL 64
-#define ACT_CONST_MATERIAL 128
-#define ACT_CONST_PERMANENT 256
-#define ACT_CONST_DISTANCE 512
-#define ACT_CONST_LOCAL 1024
-#define ACT_CONST_DOROTFH 2048
-
-/* constraint mode */
-#define ACT_CONST_DIRPX 1
-#define ACT_CONST_DIRPY 2
-#define ACT_CONST_DIRPZ 4
-#define ACT_CONST_DIRNX 8
-#define ACT_CONST_DIRNY 16
-#define ACT_CONST_DIRNZ 32
-
-/* constraint type */
-#define ACT_CONST_TYPE_LOC 0
-#define ACT_CONST_TYPE_DIST 1
-#define ACT_CONST_TYPE_ORI 2
-#define ACT_CONST_TYPE_FH 3
-
-/* editObjectActuator->type */
-#define ACT_EDOB_ADD_OBJECT 0
-#define ACT_EDOB_END_OBJECT 1
-#define ACT_EDOB_REPLACE_MESH 2
-#define ACT_EDOB_TRACK_TO 3
-#define ACT_EDOB_DYNAMICS 4
-
-/* editObjectActuator->localflag */
-#define ACT_EDOB_LOCAL_LINV 2
-#define ACT_EDOB_LOCAL_ANGV 4
-
-/* editObjectActuator->flag */
-#define ACT_TRACK_3D 1
-
-/* editObjectActuator->upflag */
-#define ACT_TRACK_UP_X 0
-#define ACT_TRACK_UP_Y 1
-#define ACT_TRACK_UP_Z 2
-
-/* editObjectActuator->trackflag */
-#define ACT_TRACK_TRAXIS_X 0
-#define ACT_TRACK_TRAXIS_Y 1
-#define ACT_TRACK_TRAXIS_Z 2
-#define ACT_TRACK_TRAXIS_NEGX 3
-#define ACT_TRACK_TRAXIS_NEGY 4
-#define ACT_TRACK_TRAXIS_NEGZ 5
-
-/* editObjectActuator->flag for replace mesh actuator */
-#define ACT_EDOB_REPLACE_MESH_NOGFX 2 /* use for replace mesh actuator */
-#define ACT_EDOB_REPLACE_MESH_PHYS 4
-
-/* editObjectActuator->dyn_operation */
-#define ACT_EDOB_RESTORE_DYN 0
-#define ACT_EDOB_SUSPEND_DYN 1
-#define ACT_EDOB_ENABLE_RB 2
-#define ACT_EDOB_DISABLE_RB 3
-#define ACT_EDOB_SET_MASS 4
-
-
-/* SceneActuator->type */
-#define ACT_SCENE_RESTART 0
-#define ACT_SCENE_SET 1
-#define ACT_SCENE_CAMERA 2
-#define ACT_SCENE_ADD_FRONT 3
-#define ACT_SCENE_ADD_BACK 4
-#define ACT_SCENE_REMOVE 5
-#define ACT_SCENE_SUSPEND 6
-#define ACT_SCENE_RESUME 7
-
-
-/* randomAct->distribution */
-#define ACT_RANDOM_BOOL_CONST 0
-#define ACT_RANDOM_BOOL_UNIFORM 1
-#define ACT_RANDOM_BOOL_BERNOUILLI 2
-#define ACT_RANDOM_INT_CONST 3
-#define ACT_RANDOM_INT_UNIFORM 4
-#define ACT_RANDOM_INT_POISSON 5
-#define ACT_RANDOM_FLOAT_CONST 6
-#define ACT_RANDOM_FLOAT_UNIFORM 7
-#define ACT_RANDOM_FLOAT_NORMAL 8
-#define ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL 9
-
-/* SoundActuator->flag */
-#define ACT_SND_3D_SOUND 1
-
-/* SoundActuator->type */
-#define ACT_SND_PLAY_STOP_SOUND 0
-#define ACT_SND_PLAY_END_SOUND 1
-#define ACT_SND_LOOP_STOP_SOUND 2
-#define ACT_SND_LOOP_END_SOUND 3
-#define ACT_SND_LOOP_BIDIRECTIONAL_SOUND 4
-#define ACT_SND_LOOP_BIDIRECTIONAL_STOP_SOUND 5
-
-/* messageactuator->type */
-#define ACT_MESG_MESG 0
-#define ACT_MESG_PROP 1
-
-/* gameactuator->type */
-#define ACT_GAME_LOAD 0
-#define ACT_GAME_START 1
-#define ACT_GAME_RESTART 2
-#define ACT_GAME_QUIT 3
-#define ACT_GAME_SAVECFG 4
-#define ACT_GAME_LOADCFG 5
-#define ACT_GAME_SCREENSHOT 6
-
-/* visibilityact->flag */
-/* Set means the object will become invisible */
-#define ACT_VISIBILITY_INVISIBLE (1 << 0)
-#define ACT_VISIBILITY_RECURSIVE (1 << 1)
-#define ACT_VISIBILITY_OCCLUSION (1 << 2)
-
-/* twodfilter->type */
-#define ACT_2DFILTER_ENABLED -2
-#define ACT_2DFILTER_DISABLED -1
-#define ACT_2DFILTER_NOFILTER 0
-#define ACT_2DFILTER_MOTIONBLUR 1
-#define ACT_2DFILTER_BLUR 2
-#define ACT_2DFILTER_SHARPEN 3
-#define ACT_2DFILTER_DILATION 4
-#define ACT_2DFILTER_EROSION 5
-#define ACT_2DFILTER_LAPLACIAN 6
-#define ACT_2DFILTER_SOBEL 7
-#define ACT_2DFILTER_PREWITT 8
-#define ACT_2DFILTER_GRAYSCALE 9
-#define ACT_2DFILTER_SEPIA 10
-#define ACT_2DFILTER_INVERT 11
-#define ACT_2DFILTER_CUSTOMFILTER 12
-#define ACT_2DFILTER_NUMBER_OF_FILTERS 13
-
-/* parentactuator->type */
-#define ACT_PARENT_SET 0
-#define ACT_PARENT_REMOVE 1
-
-/* parentactuator->flag */
-#define ACT_PARENT_COMPOUND 1
-#define ACT_PARENT_GHOST 2
-
-/* armatureactuator->type */
-#define ACT_ARM_RUN 0
-#define ACT_ARM_ENABLE 1
-#define ACT_ARM_DISABLE 2
-#define ACT_ARM_SETTARGET 3
-#define ACT_ARM_SETWEIGHT 4
-#define ACT_ARM_SETINFLUENCE 5
-/* update this define if more types are added */
-#define ACT_ARM_MAXTYPE 5
-
-/* stateactuator->type */
-#define ACT_STATE_SET 0
-#define ACT_STATE_ADD 1
-#define ACT_STATE_REMOVE 2
-#define ACT_STATE_CHANGE 3
-
-/* steeringactuator->type */
-#define ACT_STEERING_SEEK 0
-#define ACT_STEERING_FLEE 1
-#define ACT_STEERING_PATHFOLLOWING 2
-/* steeringactuator->flag */
-#define ACT_STEERING_SELFTERMINATED 1
-#define ACT_STEERING_ENABLEVISUALIZATION 2
-#define ACT_STEERING_AUTOMATICFACING 4
-#define ACT_STEERING_NORMALUP 8
-#define ACT_STEERING_LOCKZVEL 16
-
-/* mouseactuator->type */
-#define ACT_MOUSE_VISIBILITY 0
-#define ACT_MOUSE_LOOK 1
-
-/* mouseactuator->flag */
-#define ACT_MOUSE_VISIBLE (1 << 0)
-#define ACT_MOUSE_USE_AXIS_X (1 << 1)
-#define ACT_MOUSE_USE_AXIS_Y (1 << 2)
-#define ACT_MOUSE_RESET_X (1 << 3)
-#define ACT_MOUSE_RESET_Y (1 << 4)
-#define ACT_MOUSE_LOCAL_X (1 << 5)
-#define ACT_MOUSE_LOCAL_Y (1 << 6)
-
-/* mouseactuator->object_axis */
-#define ACT_MOUSE_OBJECT_AXIS_X 0
-#define ACT_MOUSE_OBJECT_AXIS_Y 1
-#define ACT_MOUSE_OBJECT_AXIS_Z 2
-
-#endif /* __DNA_ACTUATOR_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index d0a21b50d45..eed84ac7aac 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -415,6 +415,8 @@ typedef struct ChannelDriver {
char expression[256]; /* expression to compile for evaluation */
void *expr_comp; /* PyObject - compiled expression, don't save this */
+ struct ExprPyLike_Parsed *expr_simple; /* compiled simple arithmetic expression */
+
float curval; /* result of previous evaluation */
float influence; /* influence of driver on result */ // XXX to be implemented... this is like the constraint influence setting
@@ -438,6 +440,7 @@ typedef enum eDriver_Types {
} eDriver_Types;
/* driver flags */
+/* note: (1<<5) is deprecated; was "DRIVER_FLAG_SHOWDEBUG" */
typedef enum eDriver_Flags {
/* driver has invalid settings (internal flag) */
DRIVER_FLAG_INVALID = (1<<0),
@@ -450,8 +453,6 @@ typedef enum eDriver_Flags {
DRIVER_FLAG_RECOMPILE = (1<<3),
/* the names are cached so they don't need have python unicode versions created each time */
DRIVER_FLAG_RENAMEVAR = (1<<4),
- /* intermediate values of driver should be shown in the UI for debugging purposes */
- DRIVER_FLAG_SHOWDEBUG = (1<<5),
/* include 'self' in the drivers namespace. */
DRIVER_FLAG_USE_SELF = (1<<6),
} eDriver_Flags;
@@ -488,11 +489,13 @@ typedef struct FCurve {
/* value cache + settings */
float curval; /* value stored from last time curve was evaluated (not threadsafe, debug display only!) */
+ /* Value which comes from original DNA ddatablock at a time f-curve was evaluated. */
+ float orig_dna_val;
short flag; /* user-editable settings for this curve */
short extend; /* value-extending mode for this curve (does not cover */
char auto_smoothing; /* auto-handle smoothing mode */
- char pad[7];
+ char pad[3];
/* RNA - data link */
int array_index; /* if applicable, the index of the RNA-array item to get */
@@ -916,6 +919,8 @@ typedef struct AnimData {
ListBase drivers; /* standard user-created Drivers/Expressions (used as part of a rig) */
ListBase overrides; /* temp storage (AnimOverride) of values for settings that are animated (but the value hasn't been keyframed) */
+ FCurve **driver_array; /* runtime data, for depsgraph evaluation */
+
/* settings for animation evaluation */
int flag; /* user-defined settings */
int recalc; /* depsgraph recalculation flags */
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index a7c9c934304..3e68ddcb96b 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -78,8 +78,10 @@ typedef struct Bone {
int layer; /* layers that bone appears on */
short segments; /* for B-bones */
- short pad1;
-
+ char bbone_prev_type; /* Type of next/prev bone handles */
+ char bbone_next_type;
+ struct Bone *bbone_prev; /* Next/prev bones to use as handle references when calculating bbones (optional) */
+ struct Bone *bbone_next;
} Bone;
typedef struct bArmature {
@@ -99,8 +101,6 @@ typedef struct bArmature {
Bone *act_bone; /* active bone */
struct EditBone *act_edbone; /* active editbone (in editmode) */
- void *sketch; /* sketch struct for etch-a-ton */
-
int flag;
int drawtype;
int gevertdeformer; /* how vertex deformation is handled in the ge */
@@ -216,6 +216,14 @@ typedef enum eBone_Flag {
} eBone_Flag;
+/* bone->bbone_prev_type, bbone_next_type */
+typedef enum eBone_BBoneHandleType {
+ BBONE_HANDLE_AUTO = 0, /* Default mode based on parents & children. */
+ BBONE_HANDLE_ABSOLUTE, /* Custom handle in absolute position mode. */
+ BBONE_HANDLE_RELATIVE, /* Custom handle in relative position mode. */
+ BBONE_HANDLE_TANGENT, /* Custom handle in tangent mode (use direction, not location). */
+} eBone_BBoneHandleType;
+
#define MAXBONENAME 64
#endif
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index fc3b4afe18d..4801aee3c60 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,115 @@ 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 sensitivity 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 */
+ float era_strength_f; /* factor to apply to strength for soft eraser */
+ float era_thickness_f; /* factor to apply to thickness for soft eraser */
+ 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),
+ /* Keep material assigned to brush */
+ GP_BRUSH_MATERIAL_PINNED = (1 << 13),
+ /* Do not show fill color while drawing (no lasso mode) */
+ GP_BRUSH_DISSABLE_LASSO = (1 << 14),
+} 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 +249,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 +467,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_camera_types.h b/source/blender/makesdna/DNA_camera_types.h
index 961f32246d3..7bf89887d8c 100644
--- a/source/blender/makesdna/DNA_camera_types.h
+++ b/source/blender/makesdna/DNA_camera_types.h
@@ -34,6 +34,8 @@
#include "DNA_defs.h"
#include "DNA_gpu_types.h"
+#include "DNA_movieclip_types.h"
+#include "DNA_image_types.h"
#include "DNA_ID.h"
#ifdef __cplusplus
@@ -59,6 +61,20 @@ typedef struct CameraStereoSettings {
float pole_merge_angle_to;
} CameraStereoSettings;
+/* Background Picture */
+typedef struct CameraBGImage {
+ struct CameraBGImage *next, *prev;
+
+ struct Image *ima;
+ struct ImageUser iuser;
+ struct MovieClip *clip;
+ struct MovieClipUser cuser;
+ float offset[2], scale, rotation;
+ float alpha;
+ short flag;
+ short source;
+} CameraBGImage;
+
typedef struct Camera {
ID id;
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
@@ -82,9 +98,19 @@ typedef struct Camera {
struct Object *dof_ob;
struct GPUDOFSettings gpu_dof;
+ /* CameraBGImage reference images */
+ struct ListBase bg_images;
+
char sensor_fit;
char pad[7];
+ /* runtime only, used for drawing */
+ float drwcorners[4][2];
+ float drwtria[2][2];
+ float drwdepth, pad1;
+ float drwfocusmat[4][4];
+ float drwnormalmat[4][4];
+
/* Stereo settings */
struct CameraStereoSettings stereo;
} Camera;
@@ -124,6 +150,7 @@ enum {
#endif
CAM_SHOWSENSOR = (1 << 8),
CAM_SHOW_SAFE_CENTER = (1 << 9),
+ CAM_SHOW_BG_IMAGE = (1 << 10),
};
/* yafray: dof sampling switch */
@@ -136,8 +163,8 @@ enum {
CAMERA_SENSOR_FIT_VERT = 2,
};
-#define DEFAULT_SENSOR_WIDTH 32.0f
-#define DEFAULT_SENSOR_HEIGHT 18.0f
+#define DEFAULT_SENSOR_WIDTH 36.0f
+#define DEFAULT_SENSOR_HEIGHT 24.0f
/* stereo->convergence_mode */
enum {
@@ -159,6 +186,32 @@ enum {
CAM_S3D_POLE_MERGE = (1 << 1),
};
+/* CameraBGImage->flag */
+/* may want to use 1 for select ? */
+enum {
+ CAM_BGIMG_FLAG_EXPANDED = (1 << 1),
+ CAM_BGIMG_FLAG_CAMERACLIP = (1 << 2),
+ CAM_BGIMG_FLAG_DISABLED = (1 << 3),
+ CAM_BGIMG_FLAG_FOREGROUND = (1 << 4),
+
+ /* Camera framing options */
+ CAM_BGIMG_FLAG_CAMERA_ASPECT = (1 << 5), /* don't stretch to fit the camera view */
+ CAM_BGIMG_FLAG_CAMERA_CROP = (1 << 6), /* crop out the image */
+
+ /* Axis flip options */
+ CAM_BGIMG_FLAG_FLIP_X = (1 << 7),
+ CAM_BGIMG_FLAG_FLIP_Y = (1 << 8),
+};
+
+#define CAM_BGIMG_FLAG_EXPANDED (CAM_BGIMG_FLAG_EXPANDED | CAM_BGIMG_FLAG_CAMERACLIP)
+
+/* CameraBGImage->source */
+/* may want to use 1 for select ?*/
+enum {
+ CAM_BGIMG_SOURCE_IMAGE = 0,
+ CAM_BGIMG_SOURCE_MOVIE = 1,
+};
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/makesdna/DNA_cloth_types.h b/source/blender/makesdna/DNA_cloth_types.h
index 992cfedbc47..39a110d6ad4 100644
--- a/source/blender/makesdna/DNA_cloth_types.h
+++ b/source/blender/makesdna/DNA_cloth_types.h
@@ -49,17 +49,17 @@
typedef struct ClothSimSettings {
struct LinkNode *cache; /* UNUSED atm */
float mingoal; /* see SB */
- float Cdis; /* Mechanical damping of springs. */
+ float Cdis DNA_DEPRECATED; /* Mechanical damping of springs. */
float Cvi; /* Viscous/fluid damping. */
float gravity[3]; /* Gravity/external force vector. */
float dt; /* This is the duration of our time step, computed. */
float mass; /* The mass of the entire cloth. */
- float structural; /* Structural spring stiffness. */
+ float structural DNA_DEPRECATED; /* Structural spring stiffness. */
float shear; /* Shear spring stiffness. */
float bending; /* Flexion spring stiffness. */
float max_bend; /* max bending scaling value, min is "bending" */
- float max_struct; /* max structural scaling value, min is "structural" */
- float max_shear; /* max shear scaling value, UNUSED */
+ float max_struct DNA_DEPRECATED; /* max structural scaling value, min is "structural" */
+ float max_shear; /* max shear scaling value */
float max_sewing; /* max sewing force */
float avg_spring_len; /* used for normalized springs */
float timescale; /* parameter how fast cloth runs */
@@ -75,7 +75,7 @@ typedef struct ClothSimSettings {
float density_target; /* minimum density for hair */
float density_strength; /* influence of hair density */
float collider_friction; /* friction with colliders */
- float vel_damping; /* damp the velocity to speed up getting to the resting position */
+ float vel_damping DNA_DEPRECATED; /* damp the velocity to speed up getting to the resting position */
float shrink_min; /* min amount to shrink cloth by 0.0f (no shrink) - 1.0f (shrink to nothing) */
float shrink_max; /* max amount to shrink cloth by 0.0f (no shrink) - 1.0f (shrink to nothing) */
@@ -101,6 +101,16 @@ typedef struct ClothSimSettings {
char pad0[4];
struct EffectorWeights *effector_weights;
+
+ short bending_model;
+ short vgroup_shear; /* Vertex group for scaling structural stiffness. */
+ float tension;
+ float compression;
+ float max_tension;
+ float max_compression;
+ float tension_damp; /* Mechanical damping of tension springs. */
+ float compression_damp; /* Mechanical damping of compression springs. */
+ float shear_damp; /* Mechanical damping of shear springs. */
} ClothSimSettings;
@@ -111,14 +121,17 @@ typedef struct ClothCollSettings {
float friction; /* Friction/damping applied on contact with other object.*/
float damping; /* Collision restitution on contact with other object.*/
float selfepsilon; /* for selfcollision */
- float repel_force, distance_repel;
+ float repel_force DNA_DEPRECATED;
+ float distance_repel DNA_DEPRECATED;
int flags; /* collision flags defined in BKE_cloth.h */
- short self_loop_count; /* How many iterations for the selfcollision loop */
+ short self_loop_count DNA_DEPRECATED; /* How many iterations for the selfcollision loop */
short loop_count; /* How many iterations for the collision loop. */
int pad;
- struct Group *group; /* Only use colliders from this group of objects */
+ struct Collection *group; /* Only use colliders from this group of objects */
short vgroup_selfcol; /* vgroup to paint which vertices are used for self collisions */
short pad2[3];
+ float clamp; /* Impulse clamp for object collisions. */
+ float self_clamp; /* Impulse clamp for self collisions. */
} ClothCollSettings;
diff --git a/source/blender/makesdna/DNA_collection_types.h b/source/blender/makesdna/DNA_collection_types.h
new file mode 100644
index 00000000000..f08725e9fe0
--- /dev/null
+++ b/source/blender/makesdna/DNA_collection_types.h
@@ -0,0 +1,94 @@
+/*
+ * ***** 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): mar-2001 nzc
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file DNA_collection_types.h
+ * \ingroup DNA
+ *
+ * \brief Object groups, one object can be in many groups at once.
+ */
+
+#ifndef __DNA_COLLECTION_TYPES_H__
+#define __DNA_COLLECTION_TYPES_H__
+
+#include "DNA_defs.h"
+#include "DNA_listBase.h"
+#include "DNA_ID.h"
+
+struct Object;
+struct Collection;
+
+typedef struct CollectionObject {
+ struct CollectionObject *next, *prev;
+ struct Object *ob;
+} CollectionObject;
+
+
+typedef struct CollectionChild {
+ struct CollectionChild *next, *prev;
+ struct Collection *collection;
+} CollectionChild;
+
+
+typedef struct Collection {
+ ID id;
+
+ ListBase gobject; /* CollectionObject */
+ ListBase children; /* CollectionChild */
+
+ struct PreviewImage *preview;
+
+ unsigned int layer DNA_DEPRECATED;
+ float dupli_ofs[3];
+
+ short flag, pad[3];
+
+ /* Runtime. Cache of objects in this collection and all its
+ * children. This is created on demand when e.g. some physics
+ * simulation needs it, we don't want to have it for every
+ * collections due to memory usage reasons. */
+ ListBase object_cache;
+
+ /* Runtime. List of collections that are a parent of this
+ * datablock. */
+ ListBase parents;
+
+ /* Deprecated */
+ struct SceneCollection *collection DNA_DEPRECATED;
+ struct ViewLayer *view_layer DNA_DEPRECATED;
+} Collection;
+
+/* Collection->flag */
+enum {
+ COLLECTION_RESTRICT_VIEW = (1 << 0), /* Hidden in viewport. */
+ COLLECTION_RESTRICT_SELECT = (1 << 1), /* Not selectable in viewport. */
+ COLLECTION_DISABLED_DEPRECATED = (1 << 2), /* Not used anymore */
+ COLLECTION_RESTRICT_RENDER = (1 << 3), /* Hidden in renders. */
+ COLLECTION_HAS_OBJECT_CACHE = (1 << 4), /* Runtime: object_cache is populated. */
+ COLLECTION_IS_MASTER = (1 << 5), /* Is master collection embedded in the scene. */
+};
+
+#endif /* __DNA_COLLECTION_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_color_types.h b/source/blender/makesdna/DNA_color_types.h
index 8ed38b0b05d..01f0b06c178 100644
--- a/source/blender/makesdna/DNA_color_types.h
+++ b/source/blender/makesdna/DNA_color_types.h
@@ -82,6 +82,9 @@ typedef struct CurveMapping {
float bwmul[3]; /* black/white point multiply value, for speed */
float sample[3]; /* sample values, if flag set it draws line and intersection */
+
+ short tone;
+ short pad[3];
} CurveMapping;
/* cumapping->flag */
@@ -99,8 +102,15 @@ typedef enum eCurveMappingPreset {
CURVE_PRESET_MID9 = 4,
CURVE_PRESET_ROUND = 5,
CURVE_PRESET_ROOT = 6,
+ CURVE_PRESET_GAUSS = 7,
} eCurveMappingPreset;
+/* CurveMapping->tone */
+typedef enum eCurveMappingTone {
+ CURVE_TONE_STANDARD = 0,
+ CURVE_TONE_FILMLIKE = 2,
+} eCurveMappingTone;
+
/* histogram->mode */
enum {
HISTO_MODE_LUMA = 0,
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 0239c236e5c..fd98774e948 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -428,7 +428,10 @@ typedef struct bShrinkwrapConstraint {
char projAxis; /* axis to project/constrain */
char projAxisSpace; /* space to project axis in */
float projLimit; /* distance to search */
- char pad[4];
+ char shrinkMode; /* inside/outside/on surface (see MOD shrinkwrap) */
+ char flag; /* options */
+ char trackAxis; /* axis to align to normal */
+ char pad;
} bShrinkwrapConstraint;
/* Follow Track constraints */
@@ -488,7 +491,7 @@ typedef enum eBConstraint_Types {
CONSTRAINT_TYPE_DISTLIMIT = 14, /* limit distance */
CONSTRAINT_TYPE_STRETCHTO = 15, /* claiming this to be mine :) is in tuhopuu bjornmose */
CONSTRAINT_TYPE_MINMAX = 16, /* floor constraint */
- CONSTRAINT_TYPE_RIGIDBODYJOINT = 17, /* rigidbody constraint */
+ /* CONSTRAINT_TYPE_DEPRECATED = 17 */
CONSTRAINT_TYPE_CLAMPTO = 18, /* clampto constraint */
CONSTRAINT_TYPE_TRANSFORM = 19, /* transformation (loc/rot/size -> loc/rot/size) constraint */
CONSTRAINT_TYPE_SHRINKWRAP = 20, /* shrinkwrap (loc/rot) constraint */
@@ -524,8 +527,12 @@ typedef enum eBConstraint_Flags {
CONSTRAINT_PROXY_LOCAL = (1<<8),
/* indicates that constraint is temporarily disabled (only used in GE) */
CONSTRAINT_OFF = (1<<9),
- /* use bbone curve shape when calculating headtail values */
+ /* use bbone curve shape when calculating headtail values (also used by dependency graph!) */
CONSTRAINT_BBONE_SHAPE = (1<<10),
+ /* That constraint has been inserted in local override (i.e. it can be fully edited!). */
+ CONSTRAINT_STATICOVERRIDE_LOCAL = (1 << 11),
+ /* use full transformation (not just segment locations) - only set at runtime */
+ CONSTRAINT_BBONE_SHAPE_FULL = (1 << 12),
} eBConstraint_Flags;
/* bConstraint->ownspace/tarspace */
@@ -582,7 +589,8 @@ typedef enum eCopyScale_Flags {
SIZELIKE_X = (1<<0),
SIZELIKE_Y = (1<<1),
SIZELIKE_Z = (1<<2),
- SIZELIKE_OFFSET = (1<<3)
+ SIZELIKE_OFFSET = (1<<3),
+ SIZELIKE_MULTIPLY = (1<<4),
} eCopyScale_Flags;
/* bTransformConstraint.to/from */
@@ -629,6 +637,23 @@ typedef enum eTrackToAxis_Modes {
TRACK_nZ = 5
} eTrackToAxis_Modes;
+/* Shrinkwrap flags */
+typedef enum eShrinkwrap_Flags {
+ /* Also raycast in the opposite direction. */
+ CON_SHRINKWRAP_PROJECT_OPPOSITE = (1 << 0),
+ /* Invert the cull mode when projecting opposite. */
+ CON_SHRINKWRAP_PROJECT_INVERT_CULL = (1 << 1),
+ /* Align the specified axis to the target normal. */
+ CON_SHRINKWRAP_TRACK_NORMAL = (1 << 2),
+
+ /* Ignore front faces in project; same value as MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE */
+ CON_SHRINKWRAP_PROJECT_CULL_FRONTFACE = (1 << 3),
+ /* Ignore back faces in project; same value as MOD_SHRINKWRAP_CULL_TARGET_BACKFACE */
+ CON_SHRINKWRAP_PROJECT_CULL_BACKFACE = (1 << 4),
+} eShrinkwrap_Flags;
+
+#define CON_SHRINKWRAP_PROJECT_CULL_MASK (CON_SHRINKWRAP_PROJECT_CULL_FRONTFACE | CON_SHRINKWRAP_PROJECT_CULL_BACKFACE)
+
/* FollowPath flags */
typedef enum eFollowPath_Flags {
FOLLOWPATH_FOLLOW = (1<<0),
@@ -841,10 +866,6 @@ typedef enum eObjectSolver_Flags {
OBJECTSOLVER_ACTIVECLIP = (1<<0)
} eObjectSolver_Flags;
-/* Rigid-Body Constraint */
-#define CONSTRAINT_DRAW_PIVOT 0x40
-#define CONSTRAINT_DISABLE_LINKED_COLLISION 0x80
-
/* ObjectSolver Constraint -> flag */
typedef enum eStretchTo_Flags {
STRETCHTOCON_USE_BULGE_MIN = (1 << 0),
diff --git a/source/blender/makesdna/DNA_controller_types.h b/source/blender/makesdna/DNA_controller_types.h
deleted file mode 100644
index db0c8078211..00000000000
--- a/source/blender/makesdna/DNA_controller_types.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * ***** 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) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file DNA_controller_types.h
- * \ingroup DNA
- *
- * #bController type is specifically for use by Object logic-bricks in the game-engine.
- */
-
-#ifndef __DNA_CONTROLLER_TYPES_H__
-#define __DNA_CONTROLLER_TYPES_H__
-
-struct bActuator;
-struct Text;
-struct bSensor;
-
-/* ****************** CONTROLLERS ********************* */
-
-typedef struct bExpressionCont {
- char str[128];
-} bExpressionCont;
-
-typedef struct bPythonCont {
- struct Text *text;
- char module[64];
- int mode;
- int flag; /* only used for debug now */
-} bPythonCont;
-
-typedef struct bController {
- struct bController *next, *prev, *mynew;
- short type, flag, inputs, totlinks;
- short otype, totslinks, pad2, pad3;
-
- char name[64];
- void *data;
-
- struct bActuator **links;
-
- struct bSensor **slinks;
- short val, valo;
- unsigned int state_mask;
-
-} bController;
-
-/* controller->type */
-#define CONT_LOGIC_AND 0
-#define CONT_LOGIC_OR 1
-#define CONT_EXPRESSION 2
-#define CONT_PYTHON 3
-#define CONT_LOGIC_NAND 4
-#define CONT_LOGIC_NOR 5
-#define CONT_LOGIC_XOR 6
-#define CONT_LOGIC_XNOR 7
-
-/* controller->flag */
-#define CONT_SHOW 1
-#define CONT_DEL 2
-#define CONT_NEW 4
-#define CONT_MASK 8
-#define CONT_PRIO 16
-#define CONT_DEACTIVATE 32
-
-/* pyctrl->flag */
-#define CONT_PY_DEBUG 1
-
-/* pyctrl->mode */
-#define CONT_PY_SCRIPT 0
-#define CONT_PY_MODULE 1
-
-#endif /* __DNA_CONTROLLER_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index e4db69fb1b6..b8b1066e1a9 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -265,6 +265,7 @@ typedef struct Curve {
char pad2[2];
+ void *batch_cache;
} Curve;
#define CURVE_VFONT_ANY(cu) \
@@ -277,11 +278,13 @@ enum {
CU_AUTOSPACE = 1,
};
+#if 0 /* Moved to overlay options in 2.8 */
/* Curve.drawflag */
enum {
CU_HIDE_HANDLES = 1 << 0,
CU_HIDE_NORMALS = 1 << 1,
};
+#endif
/* Curve.flag */
enum {
@@ -333,7 +336,8 @@ enum {
CU_ALIGN_Y_TOP_BASELINE = 0,
CU_ALIGN_Y_TOP = 1,
CU_ALIGN_Y_CENTER = 2,
- CU_ALIGN_Y_BOTTOM = 3,
+ CU_ALIGN_Y_BOTTOM_BASELINE = 3,
+ CU_ALIGN_Y_BOTTOM = 4,
};
/* Nurb.flag */
@@ -441,8 +445,8 @@ typedef enum eBezTriple_KeyframeType {
/* checks if the given BezTriple is selected */
#define BEZT_ISSEL_ANY(bezt) \
(((bezt)->f2 & SELECT) || ((bezt)->f1 & SELECT) || ((bezt)->f3 & SELECT))
-#define BEZT_ISSEL_ANY_HIDDENHANDLES(cu, bezt) \
- (((cu)->drawflag & CU_HIDE_HANDLES) ? (bezt)->f2 & SELECT : BEZT_ISSEL_ANY(bezt))
+#define BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt) \
+ ((((v3d) != NULL) && ((v3d)->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_HANDLES) == 0) ? (bezt)->f2 & SELECT : BEZT_ISSEL_ANY(bezt))
#define BEZT_SEL_ALL(bezt) { (bezt)->f1 |= SELECT; (bezt)->f2 |= SELECT; (bezt)->f3 |= SELECT; } ((void)0)
#define BEZT_DESEL_ALL(bezt) { (bezt)->f1 &= ~SELECT; (bezt)->f2 &= ~SELECT; (bezt)->f3 &= ~SELECT; } ((void)0)
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index 2d1ffaa53eb..0e0b1d669d9 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -92,13 +92,13 @@ typedef enum CustomDataType {
CD_MCOL = 6,
CD_ORIGINDEX = 7,
CD_NORMAL = 8,
-/* CD_POLYINDEX = 9, */
+ CD_FACEMAP = 9, /* exclusive face group, each face can only be part of one */
CD_PROP_FLT = 10,
CD_PROP_INT = 11,
CD_PROP_STR = 12,
CD_ORIGSPACE = 13, /* for modifier stack face location mapping */
CD_ORCO = 14,
- CD_MTEXPOLY = 15,
+/* CD_MTEXPOLY = 15, */ /* deprecated */
CD_MLOOPUV = 16,
CD_MLOOPCOL = 17,
CD_TANGENT = 18,
@@ -143,13 +143,13 @@ typedef enum CustomDataType {
#define CD_MASK_MCOL (1 << CD_MCOL)
#define CD_MASK_ORIGINDEX (1 << CD_ORIGINDEX)
#define CD_MASK_NORMAL (1 << CD_NORMAL)
-// #define CD_MASK_POLYINDEX (1 << CD_POLYINDEX)
+#define CD_MASK_FACEMAP (1 << CD_FACEMAP)
#define CD_MASK_PROP_FLT (1 << CD_PROP_FLT)
#define CD_MASK_PROP_INT (1 << CD_PROP_INT)
#define CD_MASK_PROP_STR (1 << CD_PROP_STR)
#define CD_MASK_ORIGSPACE (1 << CD_ORIGSPACE)
#define CD_MASK_ORCO (1 << CD_ORCO)
-#define CD_MASK_MTEXPOLY (1 << CD_MTEXPOLY)
+// #define CD_MASK_MTEXPOLY (1 << CD_MTEXPOLY) /* DEPRECATED */
#define CD_MASK_MLOOPUV (1 << CD_MLOOPUV)
#define CD_MASK_MLOOPCOL (1 << CD_MLOOPCOL)
#define CD_MASK_TANGENT (1 << CD_TANGENT)
diff --git a/source/blender/makesdna/DNA_defs.h b/source/blender/makesdna/DNA_defs.h
index fc9dd8f06a9..bfa8da02707 100644
--- a/source/blender/makesdna/DNA_defs.h
+++ b/source/blender/makesdna/DNA_defs.h
@@ -44,6 +44,12 @@
# endif
#endif
+#ifdef __GNUC__
+# define DNA_PRIVATE_ATTR __attribute__ ((deprecated))
+#else
+# define DNA_PRIVATE_ATTR
+#endif
+
/* poison pragma */
#ifdef DNA_DEPRECATED_ALLOW
diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h
index b0afe99a77d..589135e1d58 100644
--- a/source/blender/makesdna/DNA_dynamicpaint_types.h
+++ b/source/blender/makesdna/DNA_dynamicpaint_types.h
@@ -104,7 +104,7 @@ typedef struct DynamicPaintSurface {
struct DynamicPaintCanvasSettings *canvas; /* for fast RNA access */
struct PaintSurfaceData *data;
- struct Group *brush_group;
+ struct Collection *brush_group;
struct EffectorWeights *effector_weights;
/* cache */
@@ -163,7 +163,7 @@ enum {
/* Canvas settings */
typedef struct DynamicPaintCanvasSettings {
struct DynamicPaintModifierData *pmd; /* for fast RNA access */
- struct DerivedMesh *dm;
+ struct Mesh *mesh;
struct ListBase surfaces;
short active_sur, flags;
@@ -177,7 +177,7 @@ typedef struct DynamicPaintCanvasSettings {
/* flags */
enum {
MOD_DPAINT_PART_RAD = 1 << 0, /* use particle radius */
- MOD_DPAINT_USE_MATERIAL = 1 << 1, /* use object material */
+ //MOD_DPAINT_USE_MATERIAL = 1 << 1, /* DNA_DEPRECATED */
MOD_DPAINT_ABS_ALPHA = 1 << 2, /* don't increase alpha unless paint alpha is higher than existing */
MOD_DPAINT_ERASE = 1 << 3, /* removes paint */
@@ -229,9 +229,8 @@ enum {
/* Brush settings */
typedef struct DynamicPaintBrushSettings {
struct DynamicPaintModifierData *pmd; /* for fast RNA access */
- struct DerivedMesh *dm;
+ struct Mesh *mesh;
struct ParticleSystem *psys;
- struct Material *mat;
int flags;
int collision;
diff --git a/source/blender/makesdna/DNA_effect_types.h b/source/blender/makesdna/DNA_effect_types.h
index 36c46b23c9e..373b1584c77 100644
--- a/source/blender/makesdna/DNA_effect_types.h
+++ b/source/blender/makesdna/DNA_effect_types.h
@@ -97,7 +97,7 @@ typedef struct Particle {
short mat_nr, rt;
} Particle;
-struct Group;
+struct Collection;
typedef struct PartEff {
struct PartEff *next, *prev;
@@ -122,7 +122,7 @@ typedef struct PartEff {
float imat[4][4]; /* inverse matrix of parent Object */
Particle *keys;
- struct Group *group;
+ struct Collection *group;
} PartEff;
diff --git a/source/blender/makesdna/DNA_fileglobal_types.h b/source/blender/makesdna/DNA_fileglobal_types.h
index 98d433d8454..24fb1c86627 100644
--- a/source/blender/makesdna/DNA_fileglobal_types.h
+++ b/source/blender/makesdna/DNA_fileglobal_types.h
@@ -32,9 +32,6 @@
#ifndef __DNA_FILEGLOBAL_TYPES_H__
#define __DNA_FILEGLOBAL_TYPES_H__
-struct bScreen;
-struct Scene;
-
/**
* FileGlobal stores a part of the current user-interface settings at
* the moment of saving, and the file-specific settings.
@@ -46,6 +43,9 @@ typedef struct FileGlobal {
char pad[6];
struct bScreen *curscreen;
struct Scene *curscene;
+ struct ViewLayer *cur_view_layer;
+ void *pad1;
+
int fileflags;
int globalf;
uint64_t build_commit_timestamp; /* commit timestamp from buildinfo */
diff --git a/source/blender/makesdna/DNA_freestyle_types.h b/source/blender/makesdna/DNA_freestyle_types.h
index b3c881d09fc..36cf151b76e 100644
--- a/source/blender/makesdna/DNA_freestyle_types.h
+++ b/source/blender/makesdna/DNA_freestyle_types.h
@@ -40,7 +40,7 @@ extern "C" {
#endif
struct FreestyleLineStyle;
-struct Group;
+struct Collection;
struct Text;
/* FreestyleConfig::flags */
@@ -125,7 +125,7 @@ typedef struct FreestyleLineSet {
int qi_start, qi_end;
int edge_types, exclude_edge_types; /* feature edge types */
int pad2;
- struct Group *group; /* group of target objects */
+ struct Collection *group; /* group of target objects */
struct FreestyleLineStyle *linestyle;
} FreestyleLineSet;
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..191588a9d36
--- /dev/null
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -0,0 +1,481 @@
+/*
+ * ***** 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_Array = 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,
+ eGpencilModifierType_Armature = 15,
+ eGpencilModifierType_Time = 16,
+ 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;
+ int layer_pass; /* custom index for passes */
+ char pad_[4];
+} 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),
+ GP_NOISE_INVERT_LAYERPASS = (1 << 10),
+} 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 */
+ int layer_pass; /* custom index for passes */
+} SubdivGpencilModifierData;
+
+typedef enum eSubdivGpencil_Flag {
+ GP_SUBDIV_SIMPLE = (1 << 0),
+ GP_SUBDIV_INVERT_LAYER = (1 << 1),
+ GP_SUBDIV_INVERT_PASS = (1 << 2),
+ GP_SUBDIV_INVERT_LAYERPASS = (1 << 3),
+} 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 */
+ int layer_pass; /* custom index for passes */
+ 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),
+ GP_THICK_INVERT_LAYERPASS = (1 << 5),
+} eThickGpencil_Flag;
+
+typedef struct TimeGpencilModifierData {
+ GpencilModifierData modifier;
+ char layername[64]; /* layer name */
+ int layer_pass; /* custom index for passes */
+ int flag; /* flags */
+ int offset;
+ float frame_scale; /* animation scale */
+ int mode;
+ char pad_[4];
+} TimeGpencilModifierData;
+
+typedef enum eTimeGpencil_Flag {
+ GP_TIME_INVERT_LAYER = (1 << 0),
+ GP_TIME_KEEP_LOOP = (1 << 1),
+ GP_TIME_INVERT_LAYERPASS = (1 << 2),
+} eTimeGpencil_Flag;
+
+typedef enum eTimeGpencil_Mode {
+ GP_TIME_MODE_NORMAL = 0,
+ GP_TIME_MODE_REVERSE = 1,
+ GP_TIME_MODE_FIX = 2
+} eTimeGpencil_Mode;
+
+
+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];
+ int layer_pass; /* custom index for passes */
+ char pad_[4];
+} TintGpencilModifierData;
+
+typedef enum eTintGpencil_Flag {
+ GP_TINT_CREATE_COLORS = (1 << 0),
+ GP_TINT_INVERT_LAYER = (1 << 1),
+ GP_TINT_INVERT_PASS = (1 << 2),
+ GP_TINT_INVERT_LAYERPASS = (1 << 3),
+} 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];
+ int layer_pass; /* custom index for passes */
+ 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),
+ GP_COLOR_INVERT_LAYERPASS = (1 << 3),
+} 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];
+ int layer_pass; /* custom index for passes */
+ 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),
+ GP_OPACITY_CREATE_COLORS = (1 << 3),
+ GP_OPACITY_INVERT_LAYERPASS = (1 << 4),
+} eOpacityGpencil_Flag;
+
+typedef struct ArrayGpencilModifierData {
+ GpencilModifierData modifier;
+ struct Object *object;
+ int count; /* 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 */
+ char pad_[4];
+
+ int pass_index; /* custom index for passes */
+ char layername[64]; /* layer name */
+ int mat_rpl; /* material replace (0 keep default) */
+ int layer_pass; /* custom index for passes */
+} ArrayGpencilModifierData;
+
+typedef enum eArrayGpencil_Flag {
+ GP_ARRAY_RANDOM_SIZE = (1 << 0),
+ GP_ARRAY_RANDOM_ROT = (1 << 1),
+ GP_ARRAY_INVERT_LAYER = (1 << 2),
+ GP_ARRAY_INVERT_PASS = (1 << 3),
+ GP_ARRAY_KEEP_ONTOP = (1 << 4),
+ GP_ARRAY_INVERT_LAYERPASS = (1 << 5),
+} eArrayGpencil_Flag;
+
+typedef struct BuildGpencilModifierData {
+ GpencilModifierData modifier;
+
+ char layername[64]; /* if set, restrict modifier to operating on this layer */
+ int pass_index;
+
+ int layer_pass; /* custom index for passes */
+
+ 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),
+ GP_BUILD_INVERT_LAYERPASS = (1 << 3),
+} 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;
+ int layer_pass; /* custom index for passes */
+ 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),
+ GP_LATTICE_INVERT_LAYERPASS = (1 << 3),
+} 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 */
+ int layer_pass; /* custom index for passes */
+ char pad_[4];
+} 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),
+ GP_MIRROR_INVERT_LAYERPASS = (1 << 6),
+} 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 layer_pass; /* custom index for passes */
+ char pad_[4];
+
+ 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),
+ GP_HOOK_INVERT_LAYERPASS = (1 << 4),
+} 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 */
+ int layer_pass; /* custom index for passes */
+ char pad_[4];
+} SimplifyGpencilModifierData;
+
+typedef enum eSimplifyGpencil_Flag {
+ GP_SIMPLIFY_INVERT_LAYER = (1 << 0),
+ GP_SIMPLIFY_INVERT_PASS = (1 << 1),
+ GP_SIMPLIFY_INVERT_LAYERPASS = (1 << 2),
+} 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];
+ int layer_pass; /* custom index for passes */
+} OffsetGpencilModifierData;
+
+typedef enum eOffsetGpencil_Flag {
+ GP_OFFSET_INVERT_LAYER = (1 << 0),
+ GP_OFFSET_INVERT_PASS = (1 << 1),
+ GP_OFFSET_INVERT_VGROUP = (1 << 2),
+ GP_OFFSET_INVERT_LAYERPASS = (1 << 3),
+} 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 */
+ int layer_pass; /* custom index for passes */
+ char pad_[4];
+} 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),
+ GP_SMOOTH_INVERT_LAYERPASS = (1 << 7),
+} eSmoothGpencil_Flag;
+
+typedef struct ArmatureGpencilModifierData {
+ GpencilModifierData modifier;
+ short deformflag, multi; /* deformflag replaces armature->deformflag */
+ int pad2;
+ struct Object *object;
+ float *prevCos; /* stored input of previous modifier, for vertexgroup blending */
+ char vgname[64]; /* MAX_VGROUP_NAME */
+
+} ArmatureGpencilModifierData;
+
+#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 ed2f4d69392..2c59dd899a9 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -34,8 +34,19 @@
#include "DNA_ID.h"
#include "DNA_brush_types.h"
+struct ARegion;
struct AnimData;
struct CurveMapping;
+struct GHash;
+struct MDeformVert;
+
+#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 */
@@ -57,56 +71,28 @@ typedef enum eGPDspoint_Flag {
/* stroke point is tagged (for some editing operation) */
GP_SPOINT_TAG = (1 << 1),
+ /* stroke point is temp tagged (for some editing operation) */
+ GP_SPOINT_TEMP_TAG = (1 << 2),
} eGPSPoint_Flag;
+/* ***************************************** */
+/* GP Fill - Triangle Tessellation 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 */
+ /* indices for tessellated 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 {
@@ -128,10 +114,8 @@ typedef enum eGPDpalettecolor_Flag {
PC_COLOR_LOCKED = (1 << 2),
/* do onion skinning */
PC_COLOR_ONIONSKIN = (1 << 3),
- /* "volumetric" strokes (i.e. GLU Quadric discs in 3D) */
- PC_COLOR_VOLUMETRIC = (1 << 4),
- /* Use High quality fill */
- PC_COLOR_HQ_FILL = (1 << 5)
+ /* "volumetric" strokes */
+ PC_COLOR_VOLUMETRIC = (1 << 4)
} eGPDpalettecolor_Flag;
/* palette of colors */
@@ -152,6 +136,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 +167,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 +191,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 +219,8 @@ typedef struct bGPDframe {
short flag; /* temp settings */
short key_type; /* keyframe type (eBezTriple_KeyframeType) */
+
+ bGPDframe_Runtime runtime;
} bGPDframe;
/* bGPDframe->flag */
@@ -220,6 +231,18 @@ typedef enum eGPDframe_Flag {
GP_FRAME_SELECT = (1 << 1)
} eGPDframe_Flag;
+/* ***************************************** */
+/* GP Layer */
+
+/* Runtime temp data for bGPDlayer */
+typedef struct bGPDlayer_Runtime {
+ struct bGPDframe *derived_array;/* runtime data created by modifiers */
+ int icon_id; /* id for dynamic icon used to show annotation color preview for layer */
+ int batch_index; /* batch used for dupli instances */
+ int len_derived; /* len of the derived array */
+ char pad_[4];
+} bGPDlayer_Runtime;
+
/* Grease-Pencil Annotations - 'Layer' */
typedef struct bGPDlayer {
struct bGPDlayer *next, *prev;
@@ -228,27 +251,28 @@ 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) */
+ short pass_index; /* used to filter groups of layers in modifiers */
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 */
+ char viewlayername[64]; /* Name of the layer used to filter render output */
+
+ bGPDlayer_Runtime runtime;
} bGPDlayer;
/* bGPDlayer->flag */
@@ -261,50 +285,102 @@ 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 (i.e. GLU Quadric discs in 3D) */
+ /* "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 {
+ struct ARegion *ar; /* last region where drawing was originated */
+ 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;
+
+/* grid configuration */
+typedef struct bGPgrid {
+ float color[3];
+ float scale[2];
+ float offset[2];
+ char _pad1[4];
+
+ int lines;
+ int axis;
+} bGPgrid;
+
/* 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 */
- char pad[6]; /* padding for compiler alignment error */
- short sflag; /* settings for palette color */
+ 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 */
- /* saved palettes */
- ListBase palettes;
+ /* 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 */
+
+ float zdepth_offset; /* offset for drawing over surfaces to keep strokes on top */
+ struct Material **mat; /* materials array */
+ short totcol; /* total materials */
+
+ /* stats */
+ short totlayer;
+ short totframe;
+ char pad_2[6];
+ int totstroke;
+ int totpoint;
+ char pad_3[4];
+ bGPgrid grid;
+
+ bGPdata_Runtime runtime;
} bGPdata;
/* bGPdata->flag */
@@ -313,8 +389,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),
@@ -338,10 +418,100 @@ 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),
+
+ /* Force fill recalc if use deformation modifiers.
+ * this is required if the stroke is deformed and the triangulation data is
+ * not valid.
+ */
+ GP_DATA_STROKE_FORCE_RECALC = (1 << 17),
+ /* Special mode drawing polygons */
+ GP_DATA_STROKE_POLYGON = (1 << 18),
+ /* Use adaptative UV scales */
+ GP_DATA_UV_ADAPTATIVE = (1 << 19),
} 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;
+
+/* gpencil_grid_axis */
+enum {
+ GP_GRID_AXIS_LOCK = (1 << 0),
+ GP_GRID_AXIS_X = (1 << 1),
+ GP_GRID_AXIS_Y = (1 << 2),
+ GP_GRID_AXIS_Z = (1 << 3),
+};
+
+/* ***************************************** */
+/* 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_EDIT_MODE(gpd) \
+ ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE))
+#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_gpu_types.h b/source/blender/makesdna/DNA_gpu_types.h
index 967cb7284dc..be34309572f 100644
--- a/source/blender/makesdna/DNA_gpu_types.h
+++ b/source/blender/makesdna/DNA_gpu_types.h
@@ -38,6 +38,8 @@ typedef struct GPUDOFSettings {
float fstop;
float focal_length;
float sensor;
+ float rotation;
+ float ratio;
int num_blades;
int high_quality;
} GPUDOFSettings;
diff --git a/source/blender/makesdna/DNA_group_types.h b/source/blender/makesdna/DNA_group_types.h
deleted file mode 100644
index ae565427365..00000000000
--- a/source/blender/makesdna/DNA_group_types.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * ***** 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) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): mar-2001 nzc
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file DNA_group_types.h
- * \ingroup DNA
- *
- * \brief Object groups, one object can be in many groups at once.
- */
-
-#ifndef __DNA_GROUP_TYPES_H__
-#define __DNA_GROUP_TYPES_H__
-
-#include "DNA_listBase.h"
-#include "DNA_ID.h"
-
-struct Object;
-
-typedef struct GroupObject {
- struct GroupObject *next, *prev;
- struct Object *ob;
- void *lampren; /* used while render */
- short recalc; /* copy of ob->recalc, used to set animated groups OK */
- char pad[6];
-} GroupObject;
-
-
-typedef struct Group {
- ID id;
-
- ListBase gobject; /* GroupObject */
-
- struct PreviewImage *preview;
-
- /* Bad design, since layers stored in the scenes 'Base'
- * the objects that show in the group can change depending
- * on the last used scene */
- unsigned int layer;
- float dupli_ofs[3];
-} Group;
-
-#endif /* __DNA_GROUP_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h
index 760e9b5461e..a7ec121efda 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -51,7 +51,7 @@ typedef struct ImageUser {
int framenr; /* movies, sequences: current to display */
int frames; /* total amount of frames to use */
int offset, sfra; /* offset within movie, start frame in global time */
- char fie_ima, cycl; /* fields/image in movie, cyclic flag */
+ char _pad, cycl; /* cyclic flag */
char ok;
char multiview_eye; /* multiview current eye - for internal use of drawing routines */
@@ -80,7 +80,9 @@ typedef struct ImagePackedFile {
} ImagePackedFile;
typedef struct RenderSlot {
+ struct RenderSlot *next, *prev;
char name[64]; /* 64 = MAX_NAME */
+ struct RenderResult *render;
} RenderSlot;
/* iuser->flag */
@@ -108,7 +110,7 @@ typedef struct Image {
ListBase anims;
struct RenderResult *rr;
- struct RenderResult *renders[8]; /* IMA_MAX_RENDER_SLOT */
+ ListBase renderslots;
short render_slot, last_render_slot;
int flag;
@@ -116,23 +118,17 @@ typedef struct Image {
int lastframe;
/* texture page */
- short tpageflag, totbind;
- short xrep, yrep;
- short twsta, twend;
- unsigned int bindcode[2]; /* only for current image... 2 = TEXTARGET_COUNT */
- char pad1[4];
- unsigned int *repbind; /* for repeat of parts of images */
+ short tpageflag;
+ short pad2;
+ unsigned int pad3;
struct PackedFile *packedfile DNA_DEPRECATED; /* deprecated */
struct ListBase packedfiles;
struct PreviewImage *preview;
- /* game engine tile animation */
- float lastupdate;
int lastused;
- short animspeed;
-
short ok;
+ short pad4[3];
/* for generated images */
int gen_x, gen_y;
@@ -154,8 +150,6 @@ typedef struct Image {
char views_format;
ListBase views; /* ImageView */
struct Stereo3dFormat *stereo3d_format;
-
- RenderSlot render_slots[8]; /* 8 = IMA_MAX_RENDER_SLOT */
} Image;
@@ -163,12 +157,12 @@ typedef struct Image {
/* Image.flag */
enum {
- IMA_FIELDS = (1 << 0),
- IMA_STD_FIELD = (1 << 1),
+ // IMA_FIELDS = (1 << 0),
+ // IMA_STD_FIELD = (1 << 1),
#ifdef DNA_DEPRECATED
IMA_DO_PREMUL = (1 << 2), /* deprecated, should not be used */
#endif
- IMA_REFLECT = (1 << 4),
+ //IMA_REFLECT = (1 << 4), /* deprecated */
IMA_NOCOLLECT = (1 << 5),
//IMA_DONE_TAG = (1 << 6), // UNUSED
IMA_OLD_PREMUL = (1 << 7),
@@ -184,12 +178,12 @@ enum {
};
/* Image.tpageflag */
-#define IMA_TILES 1
-#define IMA_TWINANIM 2
-#define IMA_COLCYCLE 4 /* Depreciated */
+//#define IMA_TILES 1 /* Deprecated */
+//#define IMA_TWINANIM 2 /* Deprecated */
+#define IMA_COLCYCLE 4 /* Deprecated */
#define IMA_MIPMAP_COMPLETE 8 /* all mipmap levels in OpenGL texture set? */
-#define IMA_CLAMP_U 16
-#define IMA_CLAMP_V 32
+//#define IMA_CLAMP_U 16 /* Deprecated */
+//#define IMA_CLAMP_V 32 /* Deprecated */
#define IMA_TPAGE_REFRESH 64
#define IMA_GLBIND_IS_DATA 128 /* opengl image texture bound as non-color data */
@@ -197,7 +191,6 @@ enum {
/* render */
#define IMA_MAX_RENDER_TEXT 512
-#define IMA_MAX_RENDER_SLOT 8
/* gen_flag */
#define IMA_GEN_FLOAT 1
diff --git a/source/blender/makesdna/DNA_key_types.h b/source/blender/makesdna/DNA_key_types.h
index 2b097092bc4..fa58f8f8abd 100644
--- a/source/blender/makesdna/DNA_key_types.h
+++ b/source/blender/makesdna/DNA_key_types.h
@@ -135,4 +135,15 @@ enum {
KEYBLOCK_LOCKED = (1 << 2)
};
+#define KEYELEM_FLOAT_LEN_COORD 3
+
+/* Curve key data layout constants */
+#define KEYELEM_ELEM_SIZE_CURVE 3
+
+#define KEYELEM_ELEM_LEN_BPOINT 2
+#define KEYELEM_FLOAT_LEN_BPOINT (KEYELEM_ELEM_LEN_BPOINT * KEYELEM_ELEM_SIZE_CURVE)
+
+#define KEYELEM_ELEM_LEN_BEZTRIPLE 4
+#define KEYELEM_FLOAT_LEN_BEZTRIPLE (KEYELEM_ELEM_LEN_BEZTRIPLE * KEYELEM_ELEM_SIZE_CURVE)
+
#endif /* __DNA_KEY_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_lamp_types.h b/source/blender/makesdna/DNA_lamp_types.h
index ca1a07fbcae..ff649f3ffe3 100644
--- a/source/blender/makesdna/DNA_lamp_types.h
+++ b/source/blender/makesdna/DNA_lamp_types.h
@@ -52,13 +52,10 @@ typedef struct Lamp {
short type, flag;
int mode;
- short colormodel, totex;
float r, g, b, k;
float shdwr, shdwg, shdwb, shdwpad;
float energy, dist, spotsize, spotblend;
- float haint;
-
float att1, att2; /* Quad1 and Quad2 attenuation */
float coeff_const, coeff_lin, coeff_quad, coeff_pad;
@@ -67,45 +64,30 @@ typedef struct Lamp {
short pad2;
float clipsta, clipend;
- float bias, soft, compressthresh, bleedbias, pad5;
+ float bias, soft, bleedbias, bleedexp;
short bufsize, samp, buffers, filtertype;
char bufflag, buftype;
- short ray_samp, ray_sampy, ray_sampz;
- short ray_samp_type;
short area_shape;
float area_size, area_sizey, area_sizez;
- float adapt_thresh;
- short ray_samp_method;
- short shadowmap_type;
/* texact is for buttons */
short texact, shadhalostep;
- /* sun/sky */
- short sun_effect_type;
- short skyblendtype;
- float horizon_brightness;
- float spread;
- float sun_brightness;
- float sun_size;
- float backscattered_light;
- float sun_intensity;
- float atm_turbidity;
- float atm_inscattering_factor;
- float atm_extinction_factor;
- float atm_distance_factor;
- float skyblendfac;
- float sky_exposure;
- float shadow_frustum_size; /* BGE Only */
- short sky_colorspace;
- char pad4[2];
-
struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
- struct MTex *mtex[18]; /* MAX_MTEX */
short pr_texture, use_nodes;
char pad6[4];
+ /* Eevee */
+ float cascade_max_dist;
+ float cascade_exponent;
+ float cascade_fade;
+ int cascade_count;
+
+ float contact_dist, contact_bias, contact_spread, contact_thickness;
+
+ float spec_fac, pad;
+
/* preview */
struct PreviewImage *preview;
@@ -130,36 +112,28 @@ typedef struct Lamp {
#define LA_AREA 4
/* mode */
-#define LA_SHAD_BUF (1 << 0)
-#define LA_HALO (1 << 1)
-#define LA_LAYER (1 << 2)
-#define LA_QUAD (1 << 3) /* no longer used */
-#define LA_NEG (1 << 4)
-#define LA_ONLYSHADOW (1 << 5)
-#define LA_SPHERE (1 << 6)
+#define LA_SHADOW (1 << 0)
+/* #define LA_HALO (1 << 1) */ /* not used anymore */
+/* #define LA_LAYER (1 << 2) */ /* not used anymore */
+/* #define LA_QUAD (1 << 3) */ /* not used anymore */
+/* #define LA_NEG (1 << 4) */ /* not used anymore */
+/* #define LA_ONLYSHADOW(1 << 5) */ /* not used anymore */
+/* #define LA_SPHERE (1 << 6) */ /* not used anymore */
#define LA_SQUARE (1 << 7)
-#define LA_TEXTURE (1 << 8)
-#define LA_OSATEX (1 << 9)
+/* #define LA_TEXTURE (1 << 8) */ /* not used anymore */
+/* #define LA_OSATEX (1 << 9) */ /* not used anymore */
/* #define LA_DEEP_SHADOW (1 << 10) */ /* not used anywhere */
-#define LA_NO_DIFF (1 << 11)
-#define LA_NO_SPEC (1 << 12)
-#define LA_SHAD_RAY (1 << 13)
+/* #define LA_NO_DIFF (1 << 11) */ /* not used anywhere */
+/* #define LA_NO_SPEC (1 << 12) */ /* not used anywhere */
+/* #define LA_SHAD_RAY (1 << 13) */ /* not used anywhere - cleaned */
/* yafray: lamp shadowbuffer flag, softlight */
/* Since it is used with LOCAL lamp, can't use LA_SHAD */
-/* #define LA_YF_SOFT (1 << 14) */ /* no longer used */
-#define LA_LAYER_SHADOW (1 << 15)
-#define LA_SHAD_TEX (1 << 16)
+/* #define LA_YF_SOFT (1 << 14) */ /* not used anymore */
+/* #define LA_LAYER_SHADOW (1 << 15) */ /* not used anymore */
+/* #define LA_SHAD_TEX (1 << 16) */ /* not used anymore */
#define LA_SHOW_CONE (1 << 17)
-#define LA_SHOW_SHADOW_BOX (1 << 18)
-
-/* layer_shadow */
-#define LA_LAYER_SHADOW_BOTH 0
-#define LA_LAYER_SHADOW_CAST 1
-#define LA_LAYER_SHADOW_RECEIVE 2
-
-/* sun effect type*/
-#define LA_SUN_EFFECT_SKY 1
-#define LA_SUN_EFFECT_AP 2
+/* #define LA_SHOW_SHADOW_BOX (1 << 18) */
+#define LA_SHAD_CONTACT (1 << 19)
/* falloff_type */
#define LA_FALLOFF_CONSTANT 0
@@ -169,46 +143,12 @@ typedef struct Lamp {
#define LA_FALLOFF_SLIDERS 4
#define LA_FALLOFF_INVCOEFFICIENTS 5
-
-/* buftype, no flag */
-#define LA_SHADBUF_REGULAR 0
-#define LA_SHADBUF_IRREGULAR 1
-#define LA_SHADBUF_HALFWAY 2
-#define LA_SHADBUF_DEEP 3
-
-/* bufflag, auto clipping */
-#define LA_SHADBUF_AUTO_START 1
-#define LA_SHADBUF_AUTO_END 2
-
-/* filtertype */
-#define LA_SHADBUF_BOX 0
-#define LA_SHADBUF_TENT 1
-#define LA_SHADBUF_GAUSS 2
-
/* area shape */
#define LA_AREA_SQUARE 0
#define LA_AREA_RECT 1
#define LA_AREA_CUBE 2
#define LA_AREA_BOX 3
-
-/* ray_samp_method */
-#define LA_SAMP_CONSTANT 0
-#define LA_SAMP_HALTON 1
-#define LA_SAMP_HAMMERSLEY 2
-
-
-/* ray_samp_type */
-// #define LA_SAMP_ROUND 1 // UNUSED
-#define LA_SAMP_UMBRA 2
-#define LA_SAMP_DITHER 4
-#define LA_SAMP_JITTER 8
-
-/* mapto */
-#define LAMAP_COL 1
-#define LAMAP_SHAD 2
-
-/* shadowmap_type */
-#define LA_SHADMAP_SIMPLE 0
-#define LA_SHADMAP_VARIANCE 1
+#define LA_AREA_DISK 4
+#define LA_AREA_ELLIPSE 5
#endif /* __DNA_LAMP_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_lattice_types.h b/source/blender/makesdna/DNA_lattice_types.h
index 8fb0d58f1db..71d6b3bbb0e 100644
--- a/source/blender/makesdna/DNA_lattice_types.h
+++ b/source/blender/makesdna/DNA_lattice_types.h
@@ -69,6 +69,7 @@ typedef struct Lattice {
char vgroup[64]; /* multiply the influence, MAX_VGROUP_NAME */
struct EditLatt *editlatt;
+ void *batch_cache;
} Lattice;
/* ***************** LATTICE ********************* */
diff --git a/source/blender/makesdna/DNA_layer_types.h b/source/blender/makesdna/DNA_layer_types.h
new file mode 100644
index 00000000000..3dcd31fbd7b
--- /dev/null
+++ b/source/blender/makesdna/DNA_layer_types.h
@@ -0,0 +1,162 @@
+/*
+ * ***** 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.
+ *
+ * Contributor(s): Dalai Felinto
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file DNA_layer_types.h
+ * \ingroup DNA
+ */
+
+#ifndef __DNA_LAYER_TYPES_H__
+#define __DNA_LAYER_TYPES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "DNA_freestyle_types.h"
+#include "DNA_listBase.h"
+
+typedef struct Base {
+ struct Base *next, *prev;
+ short flag;
+ short pad;
+ short sx, sy;
+ struct Object *object;
+ unsigned int lay DNA_DEPRECATED;
+ int flag_legacy;
+} Base;
+
+typedef struct ViewLayerEngineData {
+ struct ViewLayerEngineData *next, *prev;
+ struct DrawEngineType *engine_type;
+ void *storage;
+ void (*free)(void *storage);
+} ViewLayerEngineData;
+
+typedef struct LayerCollection {
+ struct LayerCollection *next, *prev;
+ struct Collection *collection;
+ struct SceneCollection *scene_collection DNA_DEPRECATED;
+ short flag;
+ short runtime_flag;
+ short pad[2];
+ ListBase layer_collections; /* synced with collection->children */
+} LayerCollection;
+
+typedef struct ViewLayer {
+ struct ViewLayer *next, *prev;
+ char name[64]; /* MAX_NAME */
+ short flag;
+ short runtime_flag;
+ short pad[2];
+ ListBase object_bases; /* ObjectBase */
+ struct SceneStats *stats; /* default allocated now */
+ struct Base *basact;
+ ListBase layer_collections; /* LayerCollection */
+ LayerCollection *active_collection;
+
+ /* Old SceneRenderLayer data. */
+ int layflag;
+ int passflag; /* pass_xor has to be after passflag */
+ int pass_xor;
+ float pass_alpha_threshold;
+
+ struct IDProperty *id_properties; /* Equivalent to datablocks ID properties. */
+
+ struct FreestyleConfig freestyle_config;
+
+ /* Runtime data */
+ ListBase drawdata; /* ViewLayerEngineData */
+ struct Base **object_bases_array;
+ struct GHash *object_bases_hash;
+} ViewLayer;
+
+/* Base->flag */
+enum {
+ /* User controlled flags. */
+ BASE_SELECTED = (1 << 0), /* Object is selected. */
+ BASE_HIDDEN = (1 << 8), /* Object is hidden for editing. */
+
+ /* Runtime evaluated flags. */
+ BASE_VISIBLE = (1 << 1), /* Object is enabled and visible. */
+ BASE_SELECTABLE = (1 << 2), /* Object can be selected. */
+ BASE_FROMDUPLI = (1 << 3), /* Object comes from duplicator. */
+ /* BASE_DEPRECATED = (1 << 4), */
+ BASE_FROM_SET = (1 << 5), /* Object comes from set. */
+ 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 */
+enum {
+ /* LAYER_COLLECTION_DEPRECATED0 = (1 << 0), */
+ /* LAYER_COLLECTION_DEPRECATED1 = (1 << 1), */
+ /* 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 */
+enum {
+ LAYER_COLLECTION_HAS_OBJECTS = (1 << 0),
+ LAYER_COLLECTION_HAS_VISIBLE_OBJECTS = (1 << 1),
+ LAYER_COLLECTION_HAS_ENABLED_OBJECTS = (1 << 2),
+};
+
+/* ViewLayer->flag */
+enum {
+ VIEW_LAYER_RENDER = (1 << 0),
+ /* VIEW_LAYER_DEPRECATED = (1 << 1), */
+ VIEW_LAYER_FREESTYLE = (1 << 2),
+};
+
+/* ViewLayer->runtime_flag */
+enum {
+ VIEW_LAYER_HAS_HIDE = (1 << 0),
+};
+
+/****************************** Deprecated ******************************/
+
+/* Compatibility with collections saved in early 2.8 versions,
+ * used in file reading and versioning code. */
+#define USE_COLLECTION_COMPAT_28
+
+typedef struct SceneCollection {
+ struct SceneCollection *next, *prev;
+ char name[64]; /* MAX_NAME */
+ int active_object_index; /* for UI */
+ short flag;
+ char type;
+ char pad;
+ ListBase objects; /* (Object *)LinkData->data */
+ ListBase scene_collections; /* nested collections */
+} SceneCollection;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __DNA_LAYER_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_lightprobe_types.h b/source/blender/makesdna/DNA_lightprobe_types.h
new file mode 100644
index 00000000000..490e2574a33
--- /dev/null
+++ b/source/blender/makesdna/DNA_lightprobe_types.h
@@ -0,0 +1,184 @@
+/*
+ * ***** 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.
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ *
+ */
+
+/** \file DNA_lightprobe_types.h
+ * \ingroup DNA
+ */
+
+#ifndef __DNA_LIGHTPROBE_TYPES_H__
+#define __DNA_LIGHTPROBE_TYPES_H__
+
+#include "DNA_defs.h"
+#include "DNA_listBase.h"
+#include "DNA_ID.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct Object;
+struct AnimData;
+
+typedef struct LightProbe {
+ ID id;
+ struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
+
+ char type; /* For realtime probe objects */
+ char flag; /* General purpose flags for probes */
+ char attenuation_type; /* Attenuation type */
+ char parallax_type; /* Parallax type */
+
+ float distinf; /* Influence Radius */
+ float distpar; /* Parallax Radius */
+ float falloff; /* Influence falloff */
+
+ float clipsta, clipend;
+
+ float vis_bias, vis_bleedbias; /* VSM visibility biases */
+ float vis_blur;
+
+ float intensity; /* Intensity multiplier */
+
+ int grid_resolution_x; /* Irradiance grid resolution */
+ int grid_resolution_y;
+ int grid_resolution_z;
+ int pad1;
+
+ struct Object *parallax_ob; /* Object to use as a parallax origin */
+ struct Image *image; /* Image to use on as lighting data */
+ struct Collection *visibility_grp; /* Object visibility group, inclusive or exclusive */
+
+ /* Runtime display data */
+ float distfalloff, distgridinf;
+ float pad[2];
+} LightProbe;
+
+/* Probe->type */
+enum {
+ LIGHTPROBE_TYPE_CUBE = 0,
+ LIGHTPROBE_TYPE_PLANAR = 1,
+ LIGHTPROBE_TYPE_GRID = 2,
+};
+
+/* Probe->flag */
+enum {
+ LIGHTPROBE_FLAG_CUSTOM_PARALLAX = (1 << 0),
+ LIGHTPROBE_FLAG_SHOW_INFLUENCE = (1 << 1),
+ LIGHTPROBE_FLAG_SHOW_PARALLAX = (1 << 2),
+ LIGHTPROBE_FLAG_SHOW_CLIP_DIST = (1 << 3),
+ LIGHTPROBE_FLAG_SHOW_DATA = (1 << 4),
+ LIGHTPROBE_FLAG_INVERT_GROUP = (1 << 5),
+};
+
+/* Probe->display */
+enum {
+ LIGHTPROBE_DISP_WIRE = 0,
+ LIGHTPROBE_DISP_SHADED = 1,
+ LIGHTPROBE_DISP_DIFFUSE = 2,
+ LIGHTPROBE_DISP_REFLECTIVE = 3,
+};
+
+/* Probe->parallax && Probe->attenuation_type*/
+enum {
+ LIGHTPROBE_SHAPE_ELIPSOID = 0,
+ LIGHTPROBE_SHAPE_BOX = 1,
+};
+
+/* ------- Eevee LightProbes ------- */
+/* Needs to be there because written to file
+ * with the lightcache. */
+
+typedef struct LightProbeCache {
+ float position[3], parallax_type;
+ float attenuation_fac;
+ float attenuation_type;
+ float pad3[2];
+ float attenuationmat[4][4];
+ float parallaxmat[4][4];
+} LightProbeCache;
+
+typedef struct LightGridCache {
+ float mat[4][4];
+ int resolution[3], offset; /* offset to the first irradiance sample in the pool. */
+ float corner[3], attenuation_scale;
+ float increment_x[3], attenuation_bias; /* world space vector between 2 opposite cells */
+ float increment_y[3], level_bias;
+ float increment_z[3], pad4;
+ float visibility_bias, visibility_bleed, visibility_range, pad5;
+} LightGridCache;
+
+/* ------ Eevee Lightcache ------- */
+
+typedef struct LightCacheTexture {
+ struct GPUTexture *tex;
+ /* Copy of GPU datas to create GPUTextures on file read. */
+ char *data;
+ int tex_size[3];
+ char data_type;
+ char components;
+ char pad[2];
+} LightCacheTexture;
+
+typedef struct LightCache {
+ int flag;
+ /* only a single cache for now */
+ int cube_len, grid_len; /* Number of probes to use for rendering. */
+ int mips_len; /* Number of mipmap level to use. */
+ int vis_res, ref_res; /* Size of a visibility/reflection sample. */
+ int pad[2];
+ /* In the future, we could create a bigger texture containing
+ * multiple caches (for animation) and interpolate between the
+ * caches overtime to another texture. */
+ LightCacheTexture grid_tx;
+ LightCacheTexture cube_tx; /* Contains data for mipmap level 0. */
+ LightCacheTexture *cube_mips; /* Does not contains valid GPUTexture, only data. */
+ /* All lightprobes data contained in the cache. */
+ LightProbeCache *cube_data;
+ LightGridCache *grid_data;
+} LightCache;
+
+/* LightCache->flag */
+enum {
+ LIGHTCACHE_BAKED = (1 << 0),
+ LIGHTCACHE_BAKING = (1 << 1),
+ LIGHTCACHE_CUBE_READY = (1 << 2),
+ LIGHTCACHE_GRID_READY = (1 << 3),
+ /* Update tagging */
+ LIGHTCACHE_UPDATE_CUBE = (1 << 4),
+ LIGHTCACHE_UPDATE_GRID = (1 << 5),
+ LIGHTCACHE_UPDATE_WORLD = (1 << 6),
+ LIGHTCACHE_UPDATE_AUTO = (1 << 7),
+};
+
+/* EEVEE_LightCacheTexture->data_type */
+enum {
+ LIGHTCACHETEX_BYTE = (1 << 0),
+ LIGHTCACHETEX_FLOAT = (1 << 1),
+ LIGHTCACHETEX_UINT = (1 << 2),
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __DNA_LIGHTPROBE_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index dfe7b441c71..9d4da91aaed 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -40,198 +40,130 @@
#define MAX_MTEX 18
#endif
-struct MTex;
struct Image;
-struct ColorBand;
-struct Group;
struct bNodeTree;
struct AnimData;
struct Ipo;
/* WATCH IT: change type? also make changes in ipo.h */
-typedef struct VolumeSettings {
- float density;
- float emission;
- float scattering;
- float reflection;
-
- float emission_col[3];
- float transmission_col[3];
- float reflection_col[3];
-
- float density_scale;
- float depth_cutoff;
- float asymmetry;
-
- short stepsize_type;
- short shadeflag;
- short shade_type;
- short precache_resolution;
-
- float stepsize;
- float ms_diff;
- float ms_intensity;
- float ms_spread;
-} VolumeSettings;
-
-/* Game Engine Options (old Texface mode, transp and flag) */
-typedef struct GameSettings {
- int flag;
- int alpha_blend;
- int face_orientation;
- int pad1;
-} GameSettings;
-
typedef struct TexPaintSlot {
struct Image *ima; /* image to be painted on */
char *uvname; /* customdata index for uv layer, MAX_NAME*/
- int index; /* index for mtex slot in material for blender internal */
+ int valid; /* do we have a valid image and UV map */
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) */
- short material_type, flag;
- /* note, keep this below synced with render_types.h */
+ short flag, pad1[7];
+
+ /* Colors from Blender Internal that we are still using. */
float r, g, b;
float specr, specg, specb;
- float mirr, mirg, mirb;
- float ambr, ambb, ambg;
- float amb, emit, ang, spectra, ray_mirror;
- float alpha, ref, spec, zoffs, add;
- float translucency;
- /* end synced with render_types.h */
-
- struct VolumeSettings vol;
- struct GameSettings game;
-
- float fresnel_mir, fresnel_mir_i;
- float fresnel_tra, fresnel_tra_i;
- float filter; /* filter added, for raytrace transparency and transmissivity */
- float tx_limit, tx_falloff;
- short ray_depth, ray_depth_tra;
- short har;
- char seed1, seed2;
-
- float gloss_mir, gloss_tra;
- short samp_gloss_mir, samp_gloss_tra;
- float adapt_thresh_mir, adapt_thresh_tra;
- float aniso_gloss_mir;
- float dist_mir;
- short fadeto_mir;
- short shade_flag; /* like Cubic interpolation */
-
- int mode, mode_l; /* mode_l is the or-ed result of all layer modes */
- int mode2, mode2_l; /* additional mode flags */
- short flarec, starc, linec, ringc;
- float hasize, flaresize, subsize, flareboost;
- float strand_sta, strand_end, strand_ease, strand_surfnor;
- float strand_min, strand_widthfade;
- char strand_uvname[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
-
- float sbias; /* shadow bias to prevent terminator prob */
- float lbias; /* factor to multiply lampbias with (0.0 = no mult) */
- float shad_alpha; /* in use for irregular shadowbuffer */
- int septex;
-
- /* for buttons and render*/
- char rgbsel, texact, pr_type, use_nodes;
- short pr_lamp, pr_texture, ml_flag; /* ml_flag is for disable base material */
-
- /* mapping */
- char mapflag, pad;
-
- /* shaders */
- short diff_shader, spec_shader;
- float roughness, refrac;
- /* XXX param[4] needs review and improvement (shader system as whole anyway)
- * This is nasty reused variable for different goals and not easy to RNAify nicely. -jesterKing */
- float param[4]; /* size, smooth, size, smooth, for toonshader, 0 (fac) and 1 (fresnel) also for fresnel shader */
- float rms;
- float darkness;
-
- /* runtime - OR'd from 'mtex' */
- short texco, mapto;
-
- /* ramp colors */
- struct ColorBand *ramp_col;
- struct ColorBand *ramp_spec;
- char rampin_col, rampin_spec;
- char rampblend_col, rampblend_spec;
- short ramp_show, pad3;
- float rampfac_col, rampfac_spec;
-
- struct MTex *mtex[18]; /* MAX_MTEX */
- struct bNodeTree *nodetree;
- struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
- struct Group *group; /* light group */
- struct PreviewImage *preview;
+ float alpha DNA_DEPRECATED;
+ float ray_mirror DNA_DEPRECATED;
+ float spec;
+ float gloss_mir DNA_DEPRECATED; /* renamed and inversed to roughness */
+ float roughness;
+ float metallic;
+ float pad4[2];
- /* dynamic properties */
- float friction, fh, reflect;
- float fhdist, xyfrict;
- short dynamode, pad2;
+ /* Ror buttons and render. */
+ char pr_type, use_nodes;
+ short pr_lamp, pr_texture;
- /* subsurface scattering */
- float sss_radius[3], sss_col[3];
- float sss_error, sss_scale, sss_ior;
- float sss_colfac, sss_texfac;
- float sss_front, sss_back;
- short sss_flag, sss_preset;
+ /* Index for render passes. */
+ short index;
- int mapto_textured; /* render-time cache to optimize texture lookups */
- short shadowonly_flag; /* "shadowsonly" type */
- short index; /* custom index for render passes */
+ struct bNodeTree *nodetree;
+ struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
+ struct PreviewImage *preview;
- /* Freestyle line settings */
+ /* Freestyle line settings. */
float line_col[4];
short line_priority;
short vcol_alpha;
- /* texture painting */
+ /* Texture painting slots. */
short paint_active_slot;
short paint_clone_slot;
short tot_slots;
- short pad4[3];
+ short pad2[3];
- /* multiple tangent (Normal Map node) */
- char nmap_tangent_names[9][64]; /* [MAX_MTFACE+1][MAX_NAME]; +1 for empty name */
- int nmap_tangent_names_count, pad5;
-
- struct TexPaintSlot *texpaintslot; /* cached slot for painting. Make sure to recalculate before use
- * with refresh_texpaint_image_cache */
- ListBase gpumaterial; /* runtime */
-} Material;
+ /* Transparency. */
+ float alpha_threshold;
+ float refract_depth;
+ char blend_method;
+ char blend_shadow;
+ char blend_flag;
+ char pad3[5];
+ /* Cached slots for texture painting, must be refreshed in
+ * refresh_texpaint_image_cache before using. */
+ struct TexPaintSlot *texpaintslot;
-/* **************** GAME PROPERTIES ********************* */
-// Blend Transparency Options - alpha_blend /* match GPU_material::GPUBlendMode */
-#define GEMAT_SOLID 0 /* GPU_BLEND_SOLID */
-#define GEMAT_ADD 1 /* GPU_BLEND_ADD */
-#define GEMAT_ALPHA 2 /* GPU_BLEND_ALPHA */
-#define GEMAT_CLIP 4 /* GPU_BLEND_CLIP */
-#define GEMAT_ALPHA_SORT 8 /* GPU_BLEND_ALPHA_SORT */
-#define GEMAT_ALPHA_TO_COVERAGE 16 /* GPU_BLEND_ALPHA_TO_COVERAGE */
-
-// Game Options - flag
-#define GEMAT_BACKCULL 16 /* KX_BACKCULL */
-#define GEMAT_SHADED 32 /* KX_LIGHT */
-#define GEMAT_TEXT 64 /* RAS_RENDER_3DPOLYGON_TEXT */
-#define GEMAT_NOPHYSICS 128
-#define GEMAT_INVISIBLE 256
-
-// Face Orientation Options - face_orientation
-#define GEMAT_NORMAL 0
-#define GEMAT_HALO 512 /* BILLBOARD_SCREENALIGNED */
-#define GEMAT_BILLBOARD 1024 /* BILLBOARD_AXISALIGNED */
-#define GEMAT_SHADOW 2048 /* SHADOW */
-
-// Use Textures - not defined directly in the UI
-#define GEMAT_TEX 4096 /* KX_TEX */
+ /* Runtime cache for GLSL materials. */
+ ListBase gpumaterial;
+ /* grease pencil color */
+ struct MaterialGPencilStyle *gp_style;
+} Material;
/* **************** MATERIAL ********************* */
@@ -241,12 +173,6 @@ typedef struct Material {
* -1 because for active material we store the index + 1 */
#define MAXMAT (32767-1)
-/* material_type */
-#define MA_TYPE_SURFACE 0
-#define MA_TYPE_HALO 1
-#define MA_TYPE_VOLUME 2
-#define MA_TYPE_WIRE 3
-
/* flag */
/* for render */
#define MA_IS_USED 1
@@ -258,101 +184,7 @@ typedef struct Material {
*/
#define MA_DS_SHOW_TEXS 4
-/* mode (is int) */
-#define MA_TRACEBLE 1
-#define MA_SHADOW 2
-#define MA_SHLESS 4
-#define MA_WIRE 8 /* deprecated */
-#define MA_VERTEXCOL 16
-#define MA_HALO_SOFT 16
-#define MA_HALO 32 /* deprecated */
-#define MA_ZTRANSP 64
-#define MA_VERTEXCOLP 128
-#define MA_ZINV 256
-#define MA_HALO_RINGS 256
-#define MA_ENV 512
-#define MA_HALO_LINES 512
-#define MA_ONLYSHADOW 1024
-#define MA_HALO_XALPHA 1024
-#define MA_STAR 0x800
-#define MA_FACETEXTURE 0x800
-#define MA_HALOTEX 0x1000
-#define MA_HALOPUNO 0x2000
-#define MA_ONLYCAST 0x2000
-#define MA_NOMIST 0x4000
-#define MA_HALO_SHADE 0x4000
-#define MA_HALO_FLARE 0x8000
-#define MA_TRANSP 0x10000
-#define MA_RAYTRANSP 0x20000
-#define MA_RAYMIRROR 0x40000
-#define MA_SHADOW_TRA 0x80000
-#define MA_RAMP_COL 0x100000
-#define MA_RAMP_SPEC 0x200000
-#define MA_RAYBIAS 0x400000
-#define MA_FULL_OSA 0x800000
-#define MA_TANGENT_STR 0x1000000
-#define MA_SHADBUF 0x2000000
- /* note; we drop MA_TANGENT_STR later to become tangent_u */
-#define MA_TANGENT_V 0x4000000
-/* qdn: a bit clumsy this, tangents needed for normal maps separated from shading */
-#define MA_NORMAP_TANG 0x8000000
-#define MA_GROUP_NOLAY 0x10000000
-#define MA_FACETEXTURE_ALPHA 0x20000000
-#define MA_STR_B_UNITS 0x40000000
-#define MA_STR_SURFDIFF 0x80000000
-
-#define MA_MODE_MASK 0x6fffffff /* all valid mode bits */
-#define MA_MODE_PIPELINE (MA_TRANSP | MA_ZTRANSP | MA_RAYTRANSP \
- | MA_TRACEBLE | MA_FULL_OSA | MA_ENV | MA_ZINV \
- | MA_ONLYCAST | MA_SHADBUF)
-
-/* mode2 (is int) */
-#define MA_CASTSHADOW (1 << 0)
-#define MA_MODE2_PIPELINE (MA_CASTSHADOW)
-#define MA_TANGENT_CONCRETE (1 << 1)
-
-/* mapflag */
-#define MA_MAPFLAG_UVPROJECT (1 << 0)
-
-/* ray mirror fadeout */
-#define MA_RAYMIR_FADETOSKY 0
-#define MA_RAYMIR_FADETOMAT 1
-
-/* shadowonly_flag */
-#define MA_SO_OLD 0
-#define MA_SO_SHADOW 1
-#define MA_SO_SHADED 2
-
-/* shade_flag */
-#define MA_CUBIC 1
-#define MA_OBCOLOR 2
-#define MA_APPROX_OCCLUSION 4
-#define MA_GROUP_LOCAL 8
-
-/* diff_shader */
-#define MA_DIFF_LAMBERT 0
-#define MA_DIFF_ORENNAYAR 1
-#define MA_DIFF_TOON 2
-#define MA_DIFF_MINNAERT 3
-#define MA_DIFF_FRESNEL 4
-
-/* spec_shader */
-#define MA_SPEC_COOKTORR 0
-#define MA_SPEC_PHONG 1
-#define MA_SPEC_BLINN 2
-#define MA_SPEC_TOON 3
-#define MA_SPEC_WARDISO 4
-
-/* dynamode */
-// #define MA_DRAW_DYNABUTS 1 /* deprecated */
-#define MA_FH_NOR 2
-
/* ramps */
-#define MA_RAMP_IN_SHADER 0
-#define MA_RAMP_IN_ENERGY 1
-#define MA_RAMP_IN_NOR 2
-#define MA_RAMP_IN_RESULT 3
-
#define MA_RAMP_BLEND 0
#define MA_RAMP_ADD 1
#define MA_RAMP_MULT 2
@@ -394,38 +226,7 @@ typedef struct Material {
/* mapto */
#define MAP_COL 1
-#define MAP_NORM 2
-#define MAP_COLSPEC 4
-#define MAP_COLMIR 8
-#define MAP_VARS (0xFFF0)
-#define MAP_REF 16
-#define MAP_SPEC 32
-#define MAP_EMIT 64
#define MAP_ALPHA 128
-#define MAP_HAR 256
-#define MAP_RAYMIRR 512
-#define MAP_TRANSLU 1024
-#define MAP_AMB 2048
-#define MAP_DISPLACE 4096
-#define MAP_WARP 8192
-// #define MAP_LAYER 16384 /* unused */
-
-/* volume mapto - reuse definitions for now - a bit naughty! */
-#define MAP_DENSITY 128
-#define MAP_EMISSION 64
-#define MAP_EMISSION_COL 1
-#define MAP_SCATTERING 16
-#define MAP_TRANSMISSION_COL 8
-#define MAP_REFLECTION_COL 4
-#define MAP_REFLECTION 32
-
-
-/* mapto for halo */
-//#define MAP_HA_COL 1
-//#define MAP_HA_ALPHA 128
-//#define MAP_HA_HAR 256
-//#define MAP_HA_SIZE 2
-//#define MAP_HA_ADD 64
/* pmapto */
/* init */
@@ -458,23 +259,50 @@ typedef struct Material {
#define MA_HAIR 10
#define MA_ATMOS 11
-/* sss_flag */
-#define MA_DIFF_SSS 1
-
-/* vol_stepsize_type */
-#define MA_VOL_STEP_RANDOMIZED 0
-#define MA_VOL_STEP_CONSTANT 1
-#define MA_VOL_STEP_ADAPTIVE 2
-
-/* vol_shadeflag */
-#define MA_VOL_RECV_EXT_SHADOW 1
-#define MA_VOL_PRECACHESHADING 8
-
-/* vol_shading_type */
-#define MA_VOL_SHADE_SHADELESS 0
-#define MA_VOL_SHADE_SHADOWED 2
-#define MA_VOL_SHADE_SHADED 1
-#define MA_VOL_SHADE_MULTIPLE 3
-#define MA_VOL_SHADE_SHADEDPLUSMULTIPLE 4
+/* blend_method */
+enum {
+ MA_BM_SOLID,
+ MA_BM_ADD,
+ MA_BM_MULTIPLY,
+ MA_BM_CLIP,
+ MA_BM_HASHED,
+ MA_BM_BLEND,
+};
+
+/* blend_flag */
+enum {
+ MA_BL_HIDE_BACKSIDE = (1 << 0),
+ MA_BL_SS_REFRACTION = (1 << 1),
+ MA_BL_SS_SUBSURFACE = (1 << 2), /* DEPRECATED */
+ MA_BL_TRANSLUCENCY = (1 << 3),
+};
+
+/* blend_shadow */
+enum {
+ MA_BS_NONE = 0,
+ MA_BS_SOLID,
+ MA_BS_CLIP,
+ 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_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index a667d0e578d..c591b57002a 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -39,11 +39,13 @@
struct AnimData;
struct Ipo;
struct Key;
+struct LinkNode;
struct MCol;
struct MEdge;
struct MFace;
struct MLoop;
struct MLoopCol;
+struct MLoopTri;
struct MLoopUV;
struct MPoly;
struct MTexPoly;
@@ -51,6 +53,62 @@ struct MVert;
struct Material;
struct Mesh;
struct Multires;
+struct SubdivCCG;
+
+#
+#
+typedef struct EditMeshData {
+ /** when set, \a vertexNos, polyNos are lazy initialized */
+ const float (*vertexCos)[3];
+
+ /** lazy initialize (when \a vertexCos is set) */
+ float const (*vertexNos)[3];
+ float const (*polyNos)[3];
+ /** also lazy init but dont depend on \a vertexCos */
+ const float (*polyCos)[3];
+} EditMeshData;
+
+
+/**
+ * \warning Typical access is done via #BKE_mesh_runtime_looptri_ensure, #BKE_mesh_runtime_looptri_len.
+ */
+struct MLoopTri_Store {
+ /* WARNING! swapping between array (ready-to-be-used data) and array_wip (where data is actually computed)
+ * shall always be protected by same lock as one used for looptris computing. */
+ struct MLoopTri *array, *array_wip;
+ int len;
+ int len_alloc;
+};
+
+/* not saved in file! */
+typedef struct Mesh_Runtime {
+ struct EditMeshData *edit_data;
+ void *batch_cache;
+
+ struct SubdivCCG *subdiv_ccg;
+ void *pad1;
+ int subdiv_ccg_tot_level;
+ int pad2;
+
+ int64_t cd_dirty_vert;
+ int64_t cd_dirty_edge;
+ int64_t cd_dirty_loop;
+ int64_t cd_dirty_poly;
+
+ struct MLoopTri_Store looptris;
+
+ /** 'BVHCache', for 'BKE_bvhutil.c' */
+ struct LinkNode *bvh_cache;
+
+ /** Set by modifier stack if only deformed from original. */
+ char deformed_only;
+ /**
+ * Copied from edit-mesh (hint, draw with editmesh data).
+ * In the future we may leave the mesh-data empty
+ * since its not needed if we can use edit-mesh data. */
+ char is_original;
+ char padding[6];
+} Mesh_Runtime;
typedef struct Mesh {
ID id;
@@ -66,7 +124,6 @@ typedef struct Mesh {
/* BMESH ONLY */
/*new face structures*/
struct MPoly *mpoly;
- struct MTexPoly *mtpoly;
struct MLoop *mloop;
struct MLoopUV *mloopuv;
struct MLoopCol *mloopcol;
@@ -127,6 +184,8 @@ typedef struct Mesh {
short totcol;
struct Multires *mr DNA_DEPRECATED; /* deprecated multiresolution modeling data, only keep for loading old files */
+
+ Mesh_Runtime runtime;
} Mesh;
/* deprecated by MTFace, only here for file reading */
@@ -188,6 +247,7 @@ enum {
ME_CDFLAG_EDGE_CREASE = 1 << 2,
};
+#if 0 /* Was moved to overlay options for 2.8 */
/* me->drawflag, short */
enum {
ME_DRAWEDGES = 1 << 0,
@@ -196,7 +256,7 @@ enum {
ME_DRAW_VNORMALS = 1 << 3,
ME_DRAWEIGHT = 1 << 4,
- /* ME_HIDDENEDGES = 1 << 5, */ /* DEPRECATED */
+ ME_DRAW_FACE_DOT = 1 << 5,
ME_DRAWCREASES = 1 << 6,
ME_DRAWSEAMS = 1 << 7,
@@ -220,6 +280,7 @@ enum {
/* draw loop normals */
ME_DRAW_LNORMALS = 1 << 18,
};
+#endif
/* Subsurf Type */
enum {
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index d1c137492de..636377ffd36 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -95,7 +95,7 @@ typedef struct MLoop {
* There is no attempt to maintain this data's validity over time, any changes to the underlying mesh
* invalidate the #MLoopTri array, which will need to be re-calculated.
*
- * Users normally access this via #DerivedMesh.getLoopTriArray.
+ * Users normally access this via #BKE_mesh_runtime_looptri_ensure.
* In rare cases its calculated directly, with #BKE_mesh_recalc_looptri.
*
* Typical usage includes:
@@ -164,8 +164,8 @@ typedef struct MLoop {
* MEdge *ed = &medge[mloop[lt->tri[j]].e];
* unsigned int tri_edge[2] = {mloop[lt->tri[j]].v, mloop[lt->tri[j_next]].v};
*
- * if (((ed->v1 == tri_edge[0]) && (ed->v1 == tri_edge[1])) ||
- * ((ed->v1 == tri_edge[1]) && (ed->v1 == tri_edge[0])))
+ * if (((ed->v1 == tri_edge[0]) && (ed->v2 == tri_edge[1])) ||
+ * ((ed->v1 == tri_edge[1]) && (ed->v2 == tri_edge[0])))
* {
* printf("real edge found %u %u\n", tri_edge[0], tri_edge[1]);
* }
@@ -174,8 +174,6 @@ typedef struct MLoop {
*
* \note A #MLoopTri may be in the middle of an ngon and not reference **any** edges.
*/
-#
-#
typedef struct MLoopTri {
unsigned int tri[3];
unsigned int poly;
@@ -186,22 +184,9 @@ typedef struct MVertTri {
unsigned int tri[3];
} MVertTri;
-
-typedef struct MTexPoly {
- struct Image *tpage;
- char flag, transp;
- short mode, tile, pad;
-} MTexPoly;
-
-/* can copy from/to MTexPoly/MTFace */
-#define ME_MTEXFACE_CPY(dst, src) \
-{ \
- (dst)->tpage = (src)->tpage; \
- (dst)->flag = (src)->flag; \
- (dst)->transp = (src)->transp; \
- (dst)->mode = (src)->mode; \
- (dst)->tile = (src)->tile; \
-} (void)0
+//typedef struct MTexPoly {
+// void *pad;
+//} MTexPoly;
typedef struct MLoopUV {
float uv[2];
@@ -256,9 +241,6 @@ typedef struct MSelect {
/*tessellation uv face data*/
typedef struct MTFace {
float uv[4][2];
- struct Image *tpage;
- char flag, transp;
- short mode, tile, unwrap;
} MTFace;
/*Custom Data Properties*/
@@ -463,58 +445,4 @@ enum {
ME_FSEL = 2,
};
-/* mtface->flag */
-enum {
- // TF_SELECT = (1 << 0), /* use MFace hide flag (after 2.43), should be able to reuse after 2.44 */
- // TF_ACTIVE = (1 << 1), /* deprecated! */
- TF_SEL1 = (1 << 2),
- TF_SEL2 = (1 << 3),
- TF_SEL3 = (1 << 4),
- TF_SEL4 = (1 << 5),
-};
-
-/* mtface->mode */
-enum {
- TF_DYNAMIC = (1 << 0),
- TF_ALPHASORT = (1 << 1),
- TF_TEX = (1 << 2),
- TF_SHAREDVERT = (1 << 3),
- TF_LIGHT = (1 << 4),
-
- TF_CONVERTED = (1 << 5), /* tface converted to material */
-
- TF_SHAREDCOL = (1 << 6),
- // TF_TILES = (1 << 7), /* deprecated */
- TF_BILLBOARD = (1 << 8),
- TF_TWOSIDE = (1 << 9),
- TF_INVISIBLE = (1 << 10),
-
- TF_OBCOL = (1 << 11),
- TF_BILLBOARD2 = (1 << 12), /* with Z axis constraint */
- TF_SHADOW = (1 << 13),
- TF_BMFONT = (1 << 14),
-};
-
-/* mtface->transp, values 1-4 are used as flags in the GL, WARNING, TF_SUB cant work with this */
-enum {
- TF_SOLID = 0,
- TF_ADD = (1 << 0),
- TF_ALPHA = (1 << 1),
- TF_CLIP = (1 << 2), /* clipmap alpha/binary alpha all or nothing! */
-
- TF_SUB = 3, /* sub is not available in the user interface anymore */
-};
-
-/* mtface->unwrap */
-enum {
- TF_DEPRECATED1 = (1 << 0),
- TF_DEPRECATED2 = (1 << 1),
- TF_DEPRECATED3 = (1 << 2),
- TF_DEPRECATED4 = (1 << 3),
- TF_PIN1 = (1 << 4),
- TF_PIN2 = (1 << 5),
- TF_PIN3 = (1 << 6),
- TF_PIN4 = (1 << 7),
-};
-
#endif /* __DNA_MESHDATA_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_meta_types.h b/source/blender/makesdna/DNA_meta_types.h
index aa926623e34..c312d45567f 100644
--- a/source/blender/makesdna/DNA_meta_types.h
+++ b/source/blender/makesdna/DNA_meta_types.h
@@ -59,7 +59,6 @@ typedef struct MetaElem {
float len; /* old, only used for backwards compat. use dimensions now */
float *mat, *imat; /* matrix and inverted matrix */
-
} MetaElem;
typedef struct MetaBall {
@@ -93,6 +92,8 @@ typedef struct MetaBall {
/* used in editmode */
/*ListBase edit_elems;*/
MetaElem *lastelem;
+
+ void *batch_cache;
} MetaBall;
/* **************** METABALL ********************* */
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 2adf4a02d22..6f8793bf0f7 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -32,6 +32,9 @@
* (ONLY ADD NEW ITEMS AT THE END)
*/
+struct Mesh;
+struct Scene;
+
typedef enum ModifierType {
eModifierType_None = 0,
eModifierType_Subsurf = 1,
@@ -87,6 +90,7 @@ typedef enum ModifierType {
eModifierType_CorrectiveSmooth = 51,
eModifierType_MeshSequenceCache = 52,
eModifierType_SurfaceDeform = 53,
+ eModifierType_WeightedNormal = 54,
NUM_MODIFIER_TYPES
} ModifierType;
@@ -105,21 +109,20 @@ typedef struct ModifierData {
struct ModifierData *next, *prev;
int type, mode;
- int stackindex, pad;
+ int stackindex;
+ short flag;
+ short pad;
char name[64]; /* MAX_NAME */
- /* XXX for timing info set by caller... solve later? (ton) */
- struct Scene *scene;
-
char *error;
} ModifierData;
typedef enum {
- eSubsurfModifierFlag_Incremental = (1 << 0),
- eSubsurfModifierFlag_DebugIncr = (1 << 1),
- eSubsurfModifierFlag_ControlEdges = (1 << 2),
- eSubsurfModifierFlag_SubsurfUv = (1 << 3),
-} SubsurfModifierFlag;
+ /* This modifier has been inserted in local override, and hence can be fully edited. */
+ eModifierFlag_StaticOverride_Local = (1 << 0),
+ /* This modifier does not own its caches, but instead shares them with another modifier. */
+ eModifierFlag_SharedCaches = (1 << 1),
+} ModifierFlag;
/* not a real modifier */
typedef struct MappingInfoModifierData {
@@ -132,11 +135,35 @@ typedef struct MappingInfoModifierData {
int texmapping;
} MappingInfoModifierData;
+typedef enum {
+ eSubsurfModifierFlag_Incremental = (1 << 0),
+ eSubsurfModifierFlag_DebugIncr = (1 << 1),
+ eSubsurfModifierFlag_ControlEdges = (1 << 2),
+ /* DEPRECATED, ONLY USED FOR DO-VERSIONS */
+ eSubsurfModifierFlag_SubsurfUv_DEPRECATED = (1 << 3),
+} SubsurfModifierFlag;
+
+typedef enum {
+ SUBSURF_TYPE_CATMULL_CLARK = 0,
+ SUBSURF_TYPE_SIMPLE = 1,
+} eSubsurfModifierType;
+
+typedef enum {
+ SUBSURF_UV_SMOOTH_NONE = 0,
+ SUBSURF_UV_SMOOTH_PRESERVE_CORNERS = 1,
+ SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_AND_JUNCTIONS = 2,
+ SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE = 3,
+ SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES = 4,
+ SUBSURF_UV_SMOOTH_ALL = 5,
+} eSubsurfUVSmooth;
+
typedef struct SubsurfModifierData {
ModifierData modifier;
short subdivType, levels, renderLevels, flags;
- short use_opensubdiv, pad[3];
+ short uv_smooth;
+ short quality;
+ short pad[2];
void *emCache, *mCache;
} SubsurfModifierData;
@@ -309,6 +336,10 @@ enum {
MOD_EDGESPLIT_FROMFLAG = (1 << 2),
};
+typedef struct BevelModNorEditData {
+ struct GHash *faceHash;
+} BevelModNorEditData;
+
typedef struct BevelModifierData {
ModifierData modifier;
@@ -319,13 +350,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 */
@@ -346,6 +380,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) */
@@ -356,6 +391,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;
@@ -420,8 +469,7 @@ typedef struct UVProjectModifierData {
/* the objects which do the projecting */
struct Object *projectors[10]; /* MOD_UVPROJECT_MAXPROJECTORS */
- struct Image *image; /* the image to project */
- int flags;
+ int pad2;
int num_projectors;
float aspectx, aspecty;
float scalex, scaley;
@@ -600,12 +648,15 @@ typedef struct SoftbodyModifierData {
typedef struct ClothModifierData {
ModifierData modifier;
- struct Scene *scene; /* the context, time etc is here */
struct Cloth *clothObject; /* The internal data structure for cloth. */
struct ClothSimSettings *sim_parms; /* definition is in DNA_cloth_types.h */
struct ClothCollSettings *coll_parms; /* definition is in DNA_cloth_types.h */
+
+ /* PointCache can be shared with other instances of ClothModifierData.
+ * Inspect (modifier.flag & eModifierFlag_SharedCaches) to find out. */
struct PointCache *point_cache; /* definition is in DNA_object_force_types.h */
struct ListBase ptcaches;
+
/* XXX nasty hack, remove once hair can be separated from cloth modifier data */
struct ClothHairData *hairdata;
/* grid geometry values of hair continuum */
@@ -644,7 +695,7 @@ typedef struct SurfaceModifierData {
struct MVert *x; /* old position */
struct MVert *v; /* velocity */
- struct DerivedMesh *dm;
+ struct Mesh *mesh;
struct BVHTreeFromMesh *bvhtree; /* bounding volume hierarchy of the mesh faces */
@@ -713,7 +764,7 @@ typedef struct MeshDeformModifierData {
float *bindcos; /* deprecated storage of cage coords */
/* runtime */
- void (*bindfunc)(struct Scene *scene, struct MeshDeformModifierData *mmd, struct DerivedMesh *cagedm,
+ void (*bindfunc)(struct Scene *scene, struct MeshDeformModifierData *mmd, struct Mesh *cagemesh,
float *vertexcos, int totvert, float cagemat[4][4]);
} MeshDeformModifierData;
@@ -731,8 +782,8 @@ typedef struct ParticleSystemModifierData {
ModifierData modifier;
struct ParticleSystem *psys;
- struct DerivedMesh *dm_final; /* Final DM - its topology may differ from orig mesh. */
- struct DerivedMesh *dm_deformed; /* Deformed-onle DM - its topology is same as orig mesh one. */
+ struct Mesh *mesh_final; /* Final Mesh - its topology may differ from orig mesh. */
+ struct Mesh *mesh_original; /* Original mesh that particles are attached to. */
int totdmvert, totdmedge, totdmface;
short flag, pad;
} ParticleSystemModifierData;
@@ -794,18 +845,21 @@ typedef struct MultiresModifierData {
char lvl, sculptlvl, renderlvl, totlvl;
char simple, flags, pad[2];
+ short quality;
+ short uv_smooth;
+ short pad2[2];
} MultiresModifierData;
typedef enum {
eMultiresModifierFlag_ControlEdges = (1 << 0),
- eMultiresModifierFlag_PlainUv = (1 << 1),
+ /* DEPRECATED, only used for versioning. */
+ eMultiresModifierFlag_PlainUv_DEPRECATED = (1 << 1),
} MultiresModifierFlag;
typedef struct FluidsimModifierData {
ModifierData modifier;
struct FluidsimSettings *fss; /* definition is in DNA_object_fluidsim_types.h */
- struct PointCache *point_cache; /* definition is in DNA_object_force_types.h */
} FluidsimModifierData;
typedef struct ShrinkwrapModifierData {
@@ -817,7 +871,7 @@ typedef struct ShrinkwrapModifierData {
float keepDist; /* distance offset to keep from mesh/projection point */
short shrinkType; /* shrink type projection */
char shrinkOpts; /* shrink options */
- char pad1;
+ char shrinkMode; /* shrink to surface mode */
float projLimit; /* limit the projection ray cast */
char projAxis; /* axis to project over */
@@ -836,6 +890,20 @@ enum {
MOD_SHRINKWRAP_NEAREST_VERTEX = 2,
};
+/* Shrinkwrap->shrinkMode */
+enum {
+ /* Move vertex to the surface of the target object (keepDist towards original position) */
+ MOD_SHRINKWRAP_ON_SURFACE = 0,
+ /* Move the vertex inside the target object; don't change if already inside */
+ MOD_SHRINKWRAP_INSIDE = 1,
+ /* Move the vertex outside the target object; don't change if already outside */
+ MOD_SHRINKWRAP_OUTSIDE = 2,
+ /* Move vertex to the surface of the target object, with keepDist towards the outside */
+ MOD_SHRINKWRAP_OUTSIDE_SURFACE = 3,
+ /* Move vertex to the surface of the target object, with keepDist along the normal */
+ MOD_SHRINKWRAP_ABOVE_SURFACE = 4,
+};
+
/* Shrinkwrap->shrinkOpts */
enum {
/* allow shrinkwrap to move the vertex in the positive direction of axis */
@@ -848,11 +916,16 @@ enum {
/* ignore vertex moves if a vertex ends projected on a back face of the target */
MOD_SHRINKWRAP_CULL_TARGET_BACKFACE = (1 << 4),
+#ifdef DNA_DEPRECATED_ALLOW
MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE = (1 << 5), /* distance is measure to the front face of the target */
+#endif
MOD_SHRINKWRAP_INVERT_VGROUP = (1 << 6),
+ MOD_SHRINKWRAP_INVERT_CULL_TARGET = (1 << 7),
};
+#define MOD_SHRINKWRAP_CULL_TARGET_MASK (MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE | MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)
+
/* Shrinkwrap->projAxis */
enum {
MOD_SHRINKWRAP_PROJECT_OVER_NORMAL = 0, /* projection over normal is used if no axis is selected */
@@ -988,7 +1061,7 @@ typedef struct OceanModifierData {
char geometry_mode;
char flag;
- char refresh;
+ char pad2;
short repeat_x;
short repeat_y;
@@ -1008,13 +1081,6 @@ enum {
MOD_OCEAN_GEOM_SIM_ONLY = 2,
};
-enum {
- MOD_OCEAN_REFRESH_RESET = (1 << 0),
- /* MOD_OCEAN_REFRESH_SIM = (1 << 1), */
- /* MOD_OCEAN_REFRESH_ADD = (1 << 2), */
- MOD_OCEAN_REFRESH_CLEAR_CACHE = (1 << 3),
- /* MOD_OCEAN_REFRESH_TOPOLOGY = (1 << 4), */
-};
enum {
MOD_OCEAN_GENERATE_FOAM = (1 << 0),
@@ -1608,6 +1674,7 @@ typedef struct SDefVert {
typedef struct SurfaceDeformModifierData {
ModifierData modifier;
+ struct Depsgraph *depsgraph;
struct Object *target; /* bind target object */
SDefVert *verts; /* vertex bind data */
float falloff;
@@ -1618,7 +1685,9 @@ typedef struct SurfaceDeformModifierData {
/* Surface Deform modifier flags */
enum {
+ /* This indicates "do bind on next modifier evaluation" as well as "is bound". */
MOD_SDEF_BIND = (1 << 0),
+
MOD_SDEF_USES_LOOPTRI = (1 << 1),
MOD_SDEF_HAS_CONCAVE = (1 << 2),
};
@@ -1630,6 +1699,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 91dc58ed1d4..832002d63ee 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -221,8 +221,11 @@ typedef struct bNode {
* and replacing all uses with per-instance data.
*/
short preview_xsize, preview_ysize; /* reserved size of the preview rect */
- int pad2;
+ short pad2[2];
struct uiBlock *block; /* runtime during drawing */
+
+ float ssr_id; /* XXX: eevee only, id of screen space reflection layer, needs to be a float to feed GPU_uniform. */
+ float sss_id; /* XXX: eevee only, id of screen subsurface scatter layer, needs to be a float to feed GPU_uniform. */
} bNode;
/* node->flag */
@@ -650,11 +653,6 @@ typedef struct NodeTwoFloats {
float x, y;
} NodeTwoFloats;
-typedef struct NodeGeometry {
- char uvname[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
- char colname[64];
-} NodeGeometry;
-
typedef struct NodeVertexCol {
char name[64];
} NodeVertexCol;
@@ -1125,39 +1123,6 @@ enum {
#define CMP_NODE_MASK_MBLUR_SAMPLES_MAX 64
-/* geometry output socket defines */
-#define GEOM_OUT_GLOB 0
-#define GEOM_OUT_LOCAL 1
-#define GEOM_OUT_VIEW 2
-#define GEOM_OUT_ORCO 3
-#define GEOM_OUT_UV 4
-#define GEOM_OUT_NORMAL 5
-#define GEOM_OUT_VCOL 6
-#define GEOM_OUT_VCOL_ALPHA 7
-#define GEOM_OUT_FRONTBACK 8
-
-/* material input socket defines */
-#define MAT_IN_COLOR 0
-#define MAT_IN_SPEC 1
-#define MAT_IN_REFL 2
-#define MAT_IN_NORMAL 3
-#define MAT_IN_MIR 4
-#define MAT_IN_AMB 5
-#define MAT_IN_EMIT 6
-#define MAT_IN_SPECTRA 7
-#define MAT_IN_RAY_MIRROR 8
-#define MAT_IN_ALPHA 9
-#define MAT_IN_TRANSLUCENCY 10
-#define NUM_MAT_IN 11 /* for array size */
-
-/* material output socket defines */
-#define MAT_OUT_COLOR 0
-#define MAT_OUT_ALPHA 1
-#define MAT_OUT_NORMAL 2
-#define MAT_OUT_DIFFUSE 3
-#define MAT_OUT_SPEC 4
-#define MAT_OUT_AO 5
-
/* image */
#define CMP_NODE_IMAGE_USE_STRAIGHT_OUTPUT 1
@@ -1200,4 +1165,12 @@ enum {
SHD_POINTDENSITY_COLOR_VERTNOR = 2,
};
+/* Output shader node */
+
+typedef enum NodeShaderOutputTarget {
+ SHD_OUTPUT_ALL = 0,
+ SHD_OUTPUT_EEVEE = 1,
+ SHD_OUTPUT_CYCLES = 2,
+} NodeShaderOutputTarget;
+
#endif
diff --git a/source/blender/makesdna/DNA_object_enums.h b/source/blender/makesdna/DNA_object_enums.h
index 58f9e29297f..8a7016ccd13 100644
--- a/source/blender/makesdna/DNA_object_enums.h
+++ b/source/blender/makesdna/DNA_object_enums.h
@@ -37,13 +37,22 @@ 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. */
#define OB_MODE_ALL_PAINT (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)
+#define OB_MODE_ALL_PAINT_GPENCIL (OB_MODE_GPENCIL_PAINT | OB_MODE_GPENCIL_SCULPT | OB_MODE_GPENCIL_WEIGHT)
+
/* Any mode that uses Object.sculpt. */
#define OB_MODE_ALL_SCULPT (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)
+/* Any mode that has data we need to free when switching modes, see: #ED_object_mode_generic_exit */
+#define OB_MODE_ALL_MODE_DATA \
+ (OB_MODE_EDIT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_SCULPT | OB_MODE_POSE)
+
#endif /* __DNA_OBJECT_ENUMS_H__ */
diff --git a/source/blender/makesdna/DNA_object_force_types.h b/source/blender/makesdna/DNA_object_force_types.h
index c90a626784a..6e42284f1a4 100644
--- a/source/blender/makesdna/DNA_object_force_types.h
+++ b/source/blender/makesdna/DNA_object_force_types.h
@@ -37,6 +37,7 @@ extern "C" {
#endif
#include "DNA_listBase.h"
+#include "DNA_defs.h"
/* pd->forcefield: Effector Fields types */
typedef enum ePFieldType {
@@ -112,11 +113,20 @@ typedef struct PartDeflect {
float f_noise; /* noise of force */
int seed; /* noise random seed */
+ /* Display Size */
+ float drawvec1[4]; /* Runtime only : start of the curve or draw scale */
+ float drawvec2[4]; /* Runtime only : end of the curve */
+ float drawvec_falloff_min[3], pad1; /* Runtime only */
+ float drawvec_falloff_max[3], pad2; /* Runtime only */
+
struct Object *f_source; /* force source object */
+
+ float pdef_cfrict; /* Friction of cloth collisions. */
+ float pad;
} PartDeflect;
typedef struct EffectorWeights {
- struct Group *group; /* only use effectors from this group of objects */
+ struct Collection *group; /* only use effectors from this group of objects */
float weight[14]; /* effector type specific weights */
float global_gravity;
@@ -212,58 +222,14 @@ typedef struct SBVertex {
float vec[4];
} SBVertex;
-typedef struct BulletSoftBody {
- int flag; /* various boolean options */
- float linStiff; /* linear stiffness 0..1 */
- float angStiff; /* angular stiffness 0..1 */
- float volume; /* volume preservation 0..1 */
-
- int viterations; /* Velocities solver iterations */
- int piterations; /* Positions solver iterations */
- int diterations; /* Drift solver iterations */
- int citerations; /* Cluster solver iterations */
-
- float kSRHR_CL; /* Soft vs rigid hardness [0,1] (cluster only) */
- float kSKHR_CL; /* Soft vs kinetic hardness [0,1] (cluster only) */
- float kSSHR_CL; /* Soft vs soft hardness [0,1] (cluster only) */
- float kSR_SPLT_CL; /* Soft vs rigid impulse split [0,1] (cluster only) */
-
- float kSK_SPLT_CL; /* Soft vs rigid impulse split [0,1] (cluster only) */
- float kSS_SPLT_CL; /* Soft vs rigid impulse split [0,1] (cluster only) */
- float kVCF; /* Velocities correction factor (Baumgarte) */
- float kDP; /* Damping coefficient [0,1] */
-
- float kDG; /* Drag coefficient [0,+inf] */
- float kLF; /* Lift coefficient [0,+inf] */
- float kPR; /* Pressure coefficient [-inf,+inf] */
- float kVC; /* Volume conversation coefficient [0,+inf] */
-
- float kDF; /* Dynamic friction coefficient [0,1] */
- float kMT; /* Pose matching coefficient [0,1] */
- float kCHR; /* Rigid contacts hardness [0,1] */
- float kKHR; /* Kinetic contacts hardness [0,1] */
-
- float kSHR; /* Soft contacts hardness [0,1] */
- float kAHR; /* Anchors hardness [0,1] */
- int collisionflags; /* Vertex/Face or Signed Distance Field(SDF) or Clusters, Soft versus Soft or Rigid */
- int numclusteriterations; /* number of iterations to refine collision clusters*/
- float welding; /* welding limit to remove duplicate/nearby vertices, 0.0..0.01 */
- float margin; /* margin specific to softbody */
-} BulletSoftBody;
-
-/* BulletSoftBody.flag */
-#define OB_BSB_SHAPE_MATCHING 2
-// #define OB_BSB_UNUSED 4
-#define OB_BSB_BENDING_CONSTRAINTS 8
-#define OB_BSB_AERO_VPOINT 16 /* aero model, Vertex normals are oriented toward velocity*/
-// #define OB_BSB_AERO_VTWOSIDE 32 /* aero model, Vertex normals are flipped to match velocity */
-
-/* BulletSoftBody.collisionflags */
-#define OB_BSB_COL_SDF_RS 2 /* SDF based rigid vs soft */
-#define OB_BSB_COL_CL_RS 4 /* Cluster based rigid vs soft */
-#define OB_BSB_COL_CL_SS 8 /* Cluster based soft vs soft */
-#define OB_BSB_COL_VF_SS 16 /* Vertex/Face based soft vs soft */
-
+/* Container for data that is shared among CoW copies.
+ *
+ * This is placed in a separate struct so that values can be changed
+ * without having to update all CoW copies. */
+typedef struct SoftBody_Shared {
+ struct PointCache *pointcache;
+ struct ListBase ptcaches;
+} SoftBody_Shared;
typedef struct SoftBody {
/* dynamic data */
@@ -336,10 +302,11 @@ typedef struct SoftBody {
float shearstiff;
float inpush;
- struct PointCache *pointcache;
- struct ListBase ptcaches;
+ struct SoftBody_Shared *shared;
+ struct PointCache *pointcache DNA_DEPRECATED; /* Moved to SoftBody_Shared */
+ struct ListBase ptcaches DNA_DEPRECATED; /* Moved to SoftBody_Shared */
- struct Group *collision_group;
+ struct Collection *collision_group;
struct EffectorWeights *effector_weights;
/* reverse esimated obmatrix .. no need to store in blend file .. how ever who cares */
@@ -373,6 +340,8 @@ typedef struct SoftBody {
#define PFIELD_GUIDE_PATH_WEIGHT (1<<16) /* apply curve weights */
#define PFIELD_SMOKE_DENSITY (1<<17) /* multiply smoke force by density */
#define PFIELD_GRAVITATION (1<<18) /* used for (simple) force */
+#define PFIELD_CLOTH_USE_CULLING (1<<19) /* Enable cloth collision side detection based on normal. */
+#define PFIELD_CLOTH_USE_NORMAL (1<<20) /* Replace collision direction with collider normal. */
/* pd->falloff */
#define PFIELD_FALL_SPHERE 0
@@ -384,6 +353,7 @@ typedef struct SoftBody {
#define PFIELD_SHAPE_PLANE 1
#define PFIELD_SHAPE_SURFACE 2
#define PFIELD_SHAPE_POINTS 3
+#define PFIELD_SHAPE_LINE 4
/* pd->tex_mode */
#define PFIELD_TEX_RGB 0
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index a9b43a5a957..d19c29574b6 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -58,7 +58,7 @@ struct DerivedMesh;
struct SculptSession;
struct bGPdata;
struct RigidBodyOb;
-
+struct GpencilBatchCache;
/* Vertex Groups - Name Info */
typedef struct bDeformGroup {
@@ -67,6 +67,15 @@ typedef struct bDeformGroup {
/* need this flag for locking weights */
char flag, pad[7];
} bDeformGroup;
+
+/* Face Maps*/
+typedef struct bFaceMap {
+ struct bFaceMap *next, *prev;
+ char name[64]; /* MAX_VGROUP_NAME */
+ char flag;
+ char pad[7];
+} bFaceMap;
+
#define MAX_VGROUP_NAME 64
/* bDeformGroup->flag */
@@ -114,9 +123,38 @@ typedef struct LodLevel {
int obhysteresis;
} LodLevel;
+typedef struct ObjectDisplay {
+ int flag;
+} ObjectDisplay;
+
+/* Not saved in file! */
+typedef struct Object_Runtime {
+ /* Original mesh pointer, before object->data was changed to point
+ * to mesh_eval.
+ * Is assigned by dependency graph's copy-on-write evaluation.
+ */
+ struct Mesh *mesh_orig;
+ /* Mesh structure created during object evaluation.
+ * It has all modifiers applied.
+ */
+ struct Mesh *mesh_eval;
+ /* Mesh structure created during object evaluation.
+ * 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;
+
+ /* Runtime grease pencil drawing data */
+ struct GpencilBatchCache *gpencil_cache;
+} Object_Runtime;
+
typedef struct Object {
ID id;
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
+ struct DrawDataList drawdata; /* runtime (must be immediately after id for utilities to use it). */
struct SculptSession *sculpt;
@@ -145,9 +183,12 @@ 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; /* Keep track of what mode to return to after toggling a mode */
+ int restore_mode;
/* materials */
struct Material **mat; /* material slots */
@@ -178,7 +219,7 @@ typedef struct Object {
*/
float imat_ren[4][4];
- unsigned int lay; /* copy of Base's layer in the scene */
+ unsigned int lay DNA_DEPRECATED; /* copy of Base's layer in the scene */
short flag; /* copy of Base */
short colbits DNA_DEPRECATED; /* deprecated, use 'matbits' */
@@ -186,47 +227,18 @@ typedef struct Object {
short transflag, protectflag; /* transformation settings and transform locks */
short trackflag, upflag;
short nlaflag; /* used for DopeSheet filtering settings (expanded/collapsed) */
- short scaflag; /* ui state for game logic */
- char scavisflag; /* more display settings for game logic */
- char depsflag;
+ short pad[2];
/* did last modifier stack generation need mapping support? */
char lastNeedMapping; /* bool */
- char pad;
+ char duplicator_visibility_flag;
/* dupli-frame settings */
int dupon, dupoff, dupsta, dupend;
- /* during realtime */
-
- /* note that inertia is only called inertia for historical reasons
- * and is not changed to avoid DNA surgery. It actually reflects the
- * Size value in the GameButtons (= radius) */
-
- float mass, damping, inertia;
- /* The form factor k is introduced to give the user more control
- * and to fix incompatibility problems.
- * For rotational symmetric objects, the inertia value can be
- * expressed as: Theta = k * m * r^2
- * where m = Mass, r = Radius
- * For a Sphere, the form factor is by default = 0.4
- */
-
- float formfactor;
- float rdamping;
- float margin;
- float max_vel; /* clamp the maximum velocity 0.0 is disabled */
- float min_vel; /* clamp the minimum velocity 0.0 is disabled */
- float max_angvel; /* clamp the maximum angular velocity, 0.0 is disabled */
- float min_angvel; /* clamp the minimum angular velocity, 0.0 is disabled */
- float obstacleRad;
-
- /* "Character" physics properties */
- float step_height;
- float jump_speed;
- float fall_speed;
- unsigned char max_jumps;
- char pad2[3];
+ /* Depsgraph */
+ short base_flag; /* used by depsgraph, flushed from base */
+ short pad8;
/** Collision mask settings */
unsigned short col_group, col_mask;
@@ -242,66 +254,63 @@ typedef struct Object {
float empty_drawsize;
float dupfacesca; /* dupliface scale */
- ListBase prop; /* game logic property list (not to be confused with IDProperties) */
- ListBase sensors; /* game logic sensors */
- ListBase controllers; /* game logic controllers */
- ListBase actuators; /* game logic actuators */
-
float sf; /* sf is time-offset */
short index; /* custom index, for renderpasses */
unsigned short actdef; /* current deformation group, note: index starts at 1 */
+ unsigned short actfmap; /* current face map, note: index starts at 1 */
+ unsigned char pad5[6];
float col[4]; /* object color */
- int gameflag;
- int gameflag2;
-
char restrictflag; /* for restricting view, select, render etc. accessible in outliner */
- char recalc; /* dependency flag */
+ char pad3;
short softflag; /* softbody settings */
- float anisotropicFriction[3];
+ int pad2;
ListBase constraints; /* object constraints */
ListBase nlastrips DNA_DEPRECATED; // XXX deprecated... old animation system
ListBase hooks DNA_DEPRECATED; // XXX deprecated... old animation system
ListBase particlesystem; /* particle systems */
- struct BulletSoftBody *bsoft; /* settings for game engine bullet soft body */
struct PartDeflect *pd; /* particle deflector/attractor/collision data */
struct SoftBody *soft; /* if exists, saved in file */
- struct Group *dup_group; /* object duplicator for group */
+ struct Collection *dup_group; /* object duplicator for group */
+ void *pad10;
- char body_type; /* for now used to temporarily holds the type of collision object */
+ char pad4;
char shapeflag; /* flag for pinning */
short shapenr; /* current shape key for menu or pinned */
float smoothresh; /* smoothresh is phong interpolation ray_shadow correction in render */
struct FluidsimSettings *fluidsimSettings; /* if fluidsim enabled, store additional settings */
- /* Runtime valuated curve-specific data, not stored in the file */
- struct CurveCache *curve_cache;
-
struct DerivedMesh *derivedDeform, *derivedFinal;
+ void *pad7;
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 */
- unsigned int state; /* bit masks of game controllers that are active */
- unsigned int init_state; /* bit masks of initial state as recorded by the users */
- ListBase gpulamp; /* runtime, for glsl lamp display only */
ListBase pc_ids;
- ListBase *duplilist; /* for temporary dupli list storage, only for use by RNA API */
struct RigidBodyOb *rigidbody_object; /* settings for Bullet rigid body */
struct RigidBodyCon *rigidbody_constraint; /* settings for Bullet constraint */
float ima_ofs[2]; /* offset for image empties */
- ImageUser *iuser; /* must be non-null when oject is an empty image */
- void *pad3;
+ ImageUser *iuser; /* must be non-null when object is an empty image */
ListBase lodlevels; /* contains data for levels of detail */
LodLevel *currentlod;
struct PreviewImage *preview;
+
+ int pad6;
+ int select_color;
+
+ /* Runtime evaluation data. */
+ Object_Runtime runtime;
+
+ /* Object Display */
+ struct ObjectDisplay display;
+ int pad9;
} Object;
/* Warning, this is not used anymore because hooks are now modifiers */
@@ -322,26 +331,6 @@ typedef struct ObHook {
float force;
} ObHook;
-/* runtime only, but include here for rna access */
-typedef struct DupliObject {
- struct DupliObject *next, *prev;
- struct Object *ob;
- float mat[4][4];
- float orco[3], uv[2];
-
- short type; /* from Object.transflag */
- char no_draw, animated;
-
- /* persistent identifier for a dupli object, for inter-frame matching of
- * objects with motion blur, or inter-update matching for syncing */
- int persistent_id[16]; /* 2*MAX_DUPLI_RECUR */
-
- /* particle this dupli was generated from */
- struct ParticleSystem *particle_system;
- unsigned int random_id;
- unsigned int pad;
-} DupliObject;
-
/* **************** OBJECT ********************* */
/* used many places... should be specialized */
@@ -360,19 +349,29 @@ enum {
OB_CAMERA = 11,
OB_SPEAKER = 12,
+ OB_LIGHTPROBE = 13,
/* OB_WAVE = 21, */
OB_LATTICE = 22,
/* 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,
+};
+
+/* ObjectDisplay.flag */
+enum {
+ OB_SHOW_SHADOW = (1 << 0),
};
/* 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) \
@@ -384,10 +383,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_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_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 {
@@ -416,7 +415,7 @@ enum {
OB_DUPLIROT = 1 << 5,
OB_DUPLINOSPEED = 1 << 6,
OB_DUPLICALCDERIVED = 1 << 7, /* runtime, calculate derivedmesh for dupli before it's used */
- OB_DUPLIGROUP = 1 << 8,
+ OB_DUPLICOLLECTION = 1 << 8,
OB_DUPLIFACES = 1 << 9,
OB_DUPLIFACES_SCALE = 1 << 10,
OB_DUPLIPARTS = 1 << 11,
@@ -424,7 +423,7 @@ enum {
OB_NO_CONSTRAINTS = 1 << 13, /* runtime constraints disable */
OB_NO_PSYS_UPDATE = 1 << 14, /* hack to work around particle issue */
- OB_DUPLI = OB_DUPLIFRAMES | OB_DUPLIVERTS | OB_DUPLIGROUP | OB_DUPLIFACES | OB_DUPLIPARTS,
+ OB_DUPLI = OB_DUPLIFRAMES | OB_DUPLIVERTS | OB_DUPLICOLLECTION | OB_DUPLIFACES | OB_DUPLIPARTS,
};
/* (short) trackflag / upflag */
@@ -437,8 +436,6 @@ enum {
OB_NEGZ = 5,
};
-/* gameflag in game.h */
-
/* dt: no flags */
enum {
OB_BOUNDBOX = 1,
@@ -447,8 +444,6 @@ enum {
OB_MATERIAL = 4,
OB_TEXTURE = 5,
OB_RENDER = 6,
-
- OB_PAINT = 100, /* temporary used in draw code */
};
/* dtx: flags (short) */
@@ -479,6 +474,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,
@@ -519,16 +521,10 @@ enum {
#define BA_TRANSFORM_CHILD (1 << 8) /* child of a transformed object */
#define BA_TRANSFORM_PARENT (1 << 13) /* parent of a transformed object */
-
-/* an initial attempt as making selection more specific! */
-#define BA_DESELECT 0
-#define BA_SELECT 1
-
-
#define OB_FROMDUPLI (1 << 9)
#define OB_DONE (1 << 10) /* unknown state, clear before use */
/* #define OB_RADIO (1 << 11) */ /* deprecated */
-#define OB_FROMGROUP (1 << 12)
+/* #define OB_FROMGROUP (1 << 12) */ /* deprecated */
/* WARNING - when adding flags check on PSYS_RECALC */
/* ob->recalc (flag bits!) */
@@ -547,90 +543,6 @@ enum {
/* collision masks */
#define OB_MAX_COL_MASKS 16
-/* ob->gameflag */
-enum {
- OB_DYNAMIC = 1 << 0,
- OB_CHILD = 1 << 1,
- OB_ACTOR = 1 << 2,
- OB_INERTIA_LOCK_X = 1 << 3,
- OB_INERTIA_LOCK_Y = 1 << 4,
- OB_INERTIA_LOCK_Z = 1 << 5,
- OB_DO_FH = 1 << 6,
- OB_ROT_FH = 1 << 7,
- OB_ANISOTROPIC_FRICTION = 1 << 8,
- OB_GHOST = 1 << 9,
- OB_RIGID_BODY = 1 << 10,
- OB_BOUNDS = 1 << 11,
-
- OB_COLLISION_RESPONSE = 1 << 12,
- OB_SECTOR = 1 << 13,
- OB_PROP = 1 << 14,
- OB_MAINACTOR = 1 << 15,
-
- OB_COLLISION = 1 << 16,
- OB_SOFT_BODY = 1 << 17,
- OB_OCCLUDER = 1 << 18,
- OB_SENSOR = 1 << 19,
- OB_NAVMESH = 1 << 20,
- OB_HASOBSTACLE = 1 << 21,
- OB_CHARACTER = 1 << 22,
-
- OB_RECORD_ANIMATION = 1 << 23,
-};
-
-/* ob->gameflag2 */
-enum {
- OB_NEVER_DO_ACTIVITY_CULLING = 1 << 0,
- OB_LOCK_RIGID_BODY_X_AXIS = 1 << 2,
- OB_LOCK_RIGID_BODY_Y_AXIS = 1 << 3,
- OB_LOCK_RIGID_BODY_Z_AXIS = 1 << 4,
- OB_LOCK_RIGID_BODY_X_ROT_AXIS = 1 << 5,
- OB_LOCK_RIGID_BODY_Y_ROT_AXIS = 1 << 6,
- OB_LOCK_RIGID_BODY_Z_ROT_AXIS = 1 << 7,
-
-/* OB_LIFE = OB_PROP | OB_DYNAMIC | OB_ACTOR | OB_MAINACTOR | OB_CHILD, */
-};
-
-/* ob->body_type */
-enum {
- OB_BODY_TYPE_NO_COLLISION = 0,
- OB_BODY_TYPE_STATIC = 1,
- OB_BODY_TYPE_DYNAMIC = 2,
- OB_BODY_TYPE_RIGID = 3,
- OB_BODY_TYPE_SOFT = 4,
- OB_BODY_TYPE_OCCLUDER = 5,
- OB_BODY_TYPE_SENSOR = 6,
- OB_BODY_TYPE_NAVMESH = 7,
- OB_BODY_TYPE_CHARACTER = 8,
-};
-
-/* ob->depsflag */
-enum {
- OB_DEPS_EXTRA_OB_RECALC = 1 << 0,
- OB_DEPS_EXTRA_DATA_RECALC = 1 << 1,
-};
-
-/* ob->scavisflag */
-enum {
- OB_VIS_SENS = 1 << 0,
- OB_VIS_CONT = 1 << 1,
- OB_VIS_ACT = 1 << 2,
-};
-
-/* ob->scaflag */
-enum {
- OB_SHOWSENS = 1 << 6,
- OB_SHOWACT = 1 << 7,
- OB_ADDSENS = 1 << 8,
- OB_ADDCONT = 1 << 9,
- OB_ADDACT = 1 << 10,
- OB_SHOWCONT = 1 << 11,
- OB_ALLSTATE = 1 << 12,
- OB_INITSTBIT = 1 << 13,
- OB_DEBUGSTATE = 1 << 14,
- OB_SHOWSTATE = 1 << 15,
-};
-
/* ob->restrictflag */
enum {
OB_RESTRICT_VIEW = 1 << 0,
@@ -678,6 +590,12 @@ enum {
OB_LOCK_ROT4D = 1 << 10,
};
+/* ob->duplicator_visibility_flag */
+enum {
+ OB_DUPLI_FLAG_VIEWPORT = 1 << 0,
+ OB_DUPLI_FLAG_RENDER = 1 << 1,
+};
+
#define MAX_DUPLI_RECUR 8
#ifdef __cplusplus
diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h
index ed78e302022..75d0ce493f5 100644
--- a/source/blender/makesdna/DNA_outliner_types.h
+++ b/source/blender/makesdna/DNA_outliner_types.h
@@ -38,6 +38,9 @@ struct ID;
typedef struct TreeStoreElem {
short type, nr, flag, used;
+
+ /* XXX We actually also store non-ID data in this pointer for identifying
+ * the TreeStoreElem for a TreeElement when rebuilding the tree. Ugly! */
struct ID *id;
} TreeStoreElem;
@@ -50,11 +53,18 @@ typedef struct TreeStore {
} TreeStore;
/* TreeStoreElem->flag */
-#define TSE_CLOSED 1
-#define TSE_SELECTED 2
-#define TSE_TEXTBUT 4
-#define TSE_CHILDSEARCH 8
-#define TSE_SEARCHMATCH 16
+enum {
+ TSE_CLOSED = (1 << 0),
+ TSE_SELECTED = (1 << 1),
+ TSE_TEXTBUT = (1 << 2),
+ 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 */
#define TSE_NLA 1 /* NO ID */
@@ -78,7 +88,7 @@ typedef struct TreeStore {
#define TSE_PROXY 18
#define TSE_R_LAYER_BASE 19
#define TSE_R_LAYER 20
-#define TSE_R_PASS 21
+/* #define TSE_R_PASS 21 */ /* UNUSED */
#define TSE_LINKED_MAT 22
/* NOTE, is used for light group */
#define TSE_LINKED_LAMP 23
@@ -96,6 +106,10 @@ typedef struct TreeStore {
#define TSE_KEYMAP_ITEM 35 /* NO ID */
#define TSE_ID_BASE 36 /* NO ID */
#define TSE_GP_LAYER 37 /* NO ID */
+#define TSE_LAYER_COLLECTION 38
+#define TSE_SCENE_COLLECTION_BASE 39
+#define TSE_VIEW_COLLECTION_BASE 40
+#define TSE_SCENE_OBJECTS_BASE 41
/* Check whether given TreeStoreElem should have a real ID in its ->id member. */
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index 26a99f49d86..037e9b9c499 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -160,14 +160,15 @@ typedef struct ParticleSettings {
struct SPHFluidSettings *fluid;
struct EffectorWeights *effector_weights;
- struct Group *collision_group;
+ struct Collection *collision_group;
int flag, rt;
short type, from, distr, texact;
/* physics modes */
short phystype, rotmode, avemode, reactevent;
- int draw, pad1;
- short draw_as, draw_size, childtype, pad2;
+ int draw;
+ float draw_size;
+ short draw_as, pad1, childtype, pad2;
short ren_as, subframes, draw_col;
/* number of path segments, power of 2 except */
short draw_step, ren_step;
@@ -187,11 +188,6 @@ typedef struct ParticleSettings {
/* draw color */
float color_vec_max;
- /* simplification */
- short simplify_flag, simplify_refsize;
- float simplify_rate, simplify_transition;
- float simplify_viewport;
-
/* time and emission */
float sta, end, lifetime, randlife;
float timetweak, courant_target;
@@ -248,9 +244,9 @@ typedef struct ParticleSettings {
struct MTex *mtex[18]; /* MAX_MTEX */
- struct Group *dup_group;
+ struct Collection *dup_group;
struct ListBase dupliweights;
- struct Group *eff_group DNA_DEPRECATED; // deprecated
+ struct Collection *eff_group DNA_DEPRECATED; // deprecated
struct Object *dup_ob;
struct Object *bb_ob;
struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
@@ -259,10 +255,18 @@ typedef struct ParticleSettings {
/* modified dm support */
short use_modifier_stack;
- short pad5[3];
+ short pad5;
+
+ /* hair shape */
+ short shape_flag;
+ short pad6;
+
+ float twist, pad8;
+
+ /* hair thickness shape */
+ float shape;
+ float rad_root, rad_tip, rad_scale;
- float twist;
- float pad6;
struct CurveMapping *twistcurve;
void *pad7;
} ParticleSettings;
@@ -286,7 +290,7 @@ typedef struct ParticleSystem {
ListBase pathcachebufs, childcachebufs; /* buffers for the above */
struct ClothModifierData *clmd; /* cloth simulation for hair */
- struct DerivedMesh *hair_in_dm, *hair_out_dm; /* input/output for cloth simulation */
+ struct Mesh *hair_in_mesh, *hair_out_mesh; /* input/output for cloth simulation */
struct Object *target_ob;
@@ -310,9 +314,6 @@ typedef struct ParticleSystem {
short vgroup[13], vg_neg, rt3; /* vertex groups, 0==disable, 1==starting index */
char pad[6];
- /* temporary storage during render */
- struct ParticleRenderData *renderdata;
-
/* point cache */
struct PointCache *pointcache;
struct ListBase ptcaches;
@@ -329,6 +330,17 @@ typedef struct ParticleSystem {
float dt_frac; /* current time step, as a fraction of a frame */
float lattice_strength; /* influence of the lattice modifier */
+
+ void *batch_cache;
+
+ /* Set by dependency graph's copy-on-write, allows to quickly go
+ * from evaluated particle system to original one.
+ *
+ * Original system will have this set to NULL.
+ *
+ * Use psys_orig_get() function to access,
+ */
+ struct ParticleSystem *orig_psys;
} ParticleSystem;
typedef enum eParticleDrawFlag {
@@ -443,6 +455,11 @@ typedef enum eParticleChildFlag {
PART_CHILD_USE_TWIST_CURVE = (1<<3),
} eParticleChildFlag;
+/* part->shape_flag */
+typedef enum eParticleShapeFlag {
+ PART_SHAPE_CLOSE_TIP = (1<<0),
+} eParticleShapeFlag;
+
/* part->draw_col */
#define PART_DRAW_COL_NONE 0
#define PART_DRAW_COL_MAT 1
diff --git a/source/blender/makesdna/DNA_property_types.h b/source/blender/makesdna/DNA_property_types.h
deleted file mode 100644
index 82568e93f54..00000000000
--- a/source/blender/makesdna/DNA_property_types.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * ***** 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) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file DNA_property_types.h
- * \ingroup DNA
- * \since mar-2001
- * \author nzc
- * \attention Renderrecipe and scene decription. The fact that there is a
- * hierarchy here is a bit strange, and not desirable.
- *
- * #bProperty type is specifically for use by Objects game-logic.
- */
-
-#ifndef __DNA_PROPERTY_TYPES_H__
-#define __DNA_PROPERTY_TYPES_H__
-
-/* ********************* PROPERTY ************************ */
-
-typedef struct bProperty {
- struct bProperty *next, *prev;
- char name[64]; /* MAX_NAME */
- short type, flag;
- int data; /* data should be 4 bytes to store int,float stuff */
- void *poin; /* references data unless its a string which is malloc'd */
-
-} bProperty;
-
-/* property->type XXX Game Property, not RNA */
-#define GPROP_BOOL 0
-#define GPROP_INT 1
-#define GPROP_FLOAT 2
-#define GPROP_STRING 3
-// #define GPROP_VECTOR 4 // UNUSED
-#define GPROP_TIME 5
-
-/* property->flag */
-#define PROP_DEBUG 1
-
-#define MAX_PROPSTRING 128
-
-#endif /* __DNA_PROPERTY_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_rigidbody_types.h b/source/blender/makesdna/DNA_rigidbody_types.h
index dbfd3921b8b..1482667d8b8 100644
--- a/source/blender/makesdna/DNA_rigidbody_types.h
+++ b/source/blender/makesdna/DNA_rigidbody_types.h
@@ -35,13 +35,23 @@
#include "DNA_listBase.h"
-struct Group;
+struct Collection;
struct EffectorWeights;
/* ******************************** */
/* RigidBody World */
+/* Container for data shared by original and evaluated copies of RigidBodyWorld */
+typedef struct RigidBodyWorld_Shared {
+ /* cache */
+ struct PointCache *pointcache;
+ struct ListBase ptcaches;
+
+ /* References to Physics Sim objects. Exist at runtime only ---------------------- */
+ void *physics_world; /* Physics sim world (i.e. btDiscreteDynamicsWorld) */
+} RigidBodyWorld_Shared;
+
/* RigidBodyWorld (rbw)
*
* Represents a "simulation scene" existing within the parent scene.
@@ -50,17 +60,17 @@ typedef struct RigidBodyWorld {
/* Sim World Settings ------------------------------------------------------------- */
struct EffectorWeights *effector_weights; /* effectors info */
- struct Group *group; /* Group containing objects to use for Rigid Bodies */
+ struct Collection *group; /* Group containing objects to use for Rigid Bodies */
struct Object **objects; /* Array to access group objects by index, only used at runtime */
- struct Group *constraints; /* Group containing objects to use for Rigid Body Constraints*/
+ struct Collection *constraints; /* Group containing objects to use for Rigid Body Constraints*/
int pad;
float ltime; /* last frame world was evaluated for (internal) */
- /* cache */
- struct PointCache *pointcache;
- struct ListBase ptcaches;
+ struct RigidBodyWorld_Shared *shared; /* This pointer is shared between all evaluated copies */
+ struct PointCache *pointcache DNA_DEPRECATED; /* Moved to shared->pointcache */
+ struct ListBase ptcaches DNA_DEPRECATED; /* Moved to shared->ptcaches */
int numbodies; /* number of objects in rigid body group */
short steps_per_second; /* number of simulation steps thaken per second */
@@ -68,9 +78,6 @@ typedef struct RigidBodyWorld {
int flag; /* (eRigidBodyWorld_Flag) settings for this RigidBodyWorld */
float time_scale; /* used to speed up or slow down the simulation */
-
- /* References to Physics Sim objects. Exist at runtime only ---------------------- */
- void *physics_world; /* Physics sim world (i.e. btDiscreteDynamicsWorld) */
} RigidBodyWorld;
/* Flags for RigidBodyWorld */
@@ -86,6 +93,18 @@ typedef enum eRigidBodyWorld_Flag {
/* ******************************** */
/* RigidBody Object */
+/* Container for data that is shared among CoW copies.
+ *
+ * This is placed in a separate struct so that, for example, the physics_shape
+ * pointer can be replaced without having to update all CoW copies. */
+#
+#
+typedef struct RigidBodyOb_Shared {
+ /* References to Physics Sim objects. Exist at runtime only */
+ void *physics_object; /* Physics object representation (i.e. btRigidBody) */
+ void *physics_shape; /* Collision shape used by physics sim (i.e. btCollisionShape) */
+} RigidBodyOb_Shared;
+
/* RigidBodyObject (rbo)
*
* Represents an object participating in a RigidBody sim.
@@ -93,10 +112,6 @@ typedef enum eRigidBodyWorld_Flag {
* participating in a sim.
*/
typedef struct RigidBodyOb {
- /* References to Physics Sim objects. Exist at runtime only */
- void *physics_object; /* Physics object representation (i.e. btRigidBody) */
- void *physics_shape; /* Collision shape used by physics sim (i.e. btCollisionShape) */
-
/* General Settings for this RigidBodyOb */
short type; /* (eRigidBodyOb_Type) role of RigidBody in sim */
short shape; /* (eRigidBody_Shape) collision shape to use */
@@ -123,6 +138,8 @@ typedef struct RigidBodyOb {
float orn[4]; /* rigid body orientation */
float pos[3]; /* rigid body position */
float pad1;
+
+ struct RigidBodyOb_Shared *shared; /* This pointer is shared between all evaluated copies */
} RigidBodyOb;
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index c7bba869ef4..9045fb4353d 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -47,7 +47,11 @@ extern "C" {
#include "DNA_ID.h"
#include "DNA_freestyle_types.h"
#include "DNA_gpu_types.h"
+#include "DNA_collection_types.h"
+#include "DNA_layer_types.h"
+#include "DNA_material_types.h"
#include "DNA_userdef_types.h"
+#include "DNA_view3d_types.h"
struct CurveMapping;
struct Object;
@@ -55,29 +59,20 @@ struct Brush;
struct World;
struct Scene;
struct Image;
-struct Group;
+struct Collection;
struct Text;
struct bNodeTree;
struct AnimData;
struct Editing;
struct SceneStats;
struct bGPdata;
-struct bGPDbrush;
struct MovieClip;
struct ColorSpace;
+struct SceneCollection;
/* ************************************************************* */
/* Scene Data */
-/* Base - Wrapper for referencing Objects in a Scene */
-typedef struct Base {
- struct Base *next, *prev;
- unsigned int lay, selcol;
- int flag;
- short sx, sy;
- struct Object *object;
-} Base;
-
/* ************************************************************* */
/* Output Format Data */
@@ -197,27 +192,25 @@ typedef struct AudioData {
typedef struct SceneRenderLayer {
struct SceneRenderLayer *next, *prev;
- char name[64]; /* MAX_NAME */
+ char name[64] DNA_DEPRECATED; /* MAX_NAME */
- struct Material *mat_override;
- struct Group *light_override;
+ struct Material *mat_override DNA_DEPRECATED; /* Converted to ViewLayer override. */
- unsigned int lay; /* Scene.lay itself has priority over this */
- unsigned int lay_zmask; /* has to be after lay, this is for Z-masking */
- unsigned int lay_exclude; /* not used by internal, exclude */
- int layflag;
+ unsigned int lay DNA_DEPRECATED; /* Converted to LayerCollection cycles camera visibility override. */
+ unsigned int lay_zmask DNA_DEPRECATED; /* Converted to LayerCollection cycles holdout override. */
+ unsigned int lay_exclude DNA_DEPRECATED;
+ int layflag DNA_DEPRECATED; /* Converted to ViewLayer layflag and flag. */
/* pass_xor has to be after passflag */
- /* note, this is treestore element 'nr' in outliner, short still... */
- int passflag;
- int pass_xor;
+ int passflag DNA_DEPRECATED; /* pass_xor has to be after passflag */
+ int pass_xor DNA_DEPRECATED; /* Converted to ViewLayer passflag and flag. */
- int samples;
- float pass_alpha_threshold;
+ int samples DNA_DEPRECATED; /* Converted to ViewLayer override. */
+ float pass_alpha_threshold DNA_DEPRECATED; /* Converted to ViewLayer pass_alpha_threshold. */
- IDProperty *prop;
+ IDProperty *prop DNA_DEPRECATED; /* Converted to ViewLayer id_properties. */
- struct FreestyleConfig freestyleConfig;
+ struct FreestyleConfig freestyleConfig DNA_DEPRECATED; /* Converted to ViewLayer freestyleConfig. */
} SceneRenderLayer;
/* SceneRenderLayer.layflag */
@@ -447,7 +440,7 @@ typedef struct ImageFormatData {
#define R_IMF_IMTYPE_TIFF 22
#define R_IMF_IMTYPE_OPENEXR 23
#define R_IMF_IMTYPE_FFMPEG 24
-#define R_IMF_IMTYPE_FRAMESERVER 25
+/* #define R_IMF_IMTYPE_FRAMESERVER 25 */ /* frame server is nomore */
#define R_IMF_IMTYPE_CINEON 26
#define R_IMF_IMTYPE_DPX 27
#define R_IMF_IMTYPE_MULTILAYER 28
@@ -563,6 +556,12 @@ typedef enum eBakePassFilter {
#define R_BAKE_PASS_FILTER_ALL (~0)
+/* RenderEngineSettingsClay.options */
+typedef enum ClayFlagSettings {
+ CLAY_USE_AO = (1 << 0),
+ CLAY_USE_HSV = (1 << 1),
+} ClayFlagSettings;
+
/* *************************************************************** */
/* Render Data */
@@ -581,29 +580,14 @@ typedef struct RenderData {
float framelen, blurfac;
- /** For UR edge rendering: give the edges this color */
- float edgeR, edgeG, edgeB;
-
-
- /* standalone player */ // XXX deprecated since 2.5
- short fullscreen DNA_DEPRECATED, xplay DNA_DEPRECATED, yplay DNA_DEPRECATED;
- short freqplay DNA_DEPRECATED;
- /* standalone player */ // XXX deprecated since 2.5
- short depth DNA_DEPRECATED, attrib DNA_DEPRECATED;
-
-
int frame_step; /* frames to jump during render/playback */
short stereomode DNA_DEPRECATED; /* standalone player stereo settings */ // XXX deprecated since 2.5
short dimensionspreset; /* for the dimensions presets menu */
- short filtertype; /* filter is box, tent, gauss, mitch, etc */
-
short size; /* size in % */
- short maximsize DNA_DEPRECATED; /* max in Kb */
-
short pad6;
/* from buttons: */
@@ -617,15 +601,6 @@ typedef struct RenderData {
int ysch;
/**
- * The number of part to use in the x direction
- */
- short xparts DNA_DEPRECATED;
- /**
- * The number of part to use in the y direction
- */
- short yparts DNA_DEPRECATED;
-
- /**
* render tile dimensions
*/
int tilex, tiley;
@@ -650,22 +625,6 @@ typedef struct RenderData {
int mode;
/**
- * Flags for raytrace settings. Use bit-masking to access the settings.
- */
- int raytrace_options;
-
- /**
- * Raytrace acceleration structure
- */
- short raytrace_structure;
-
- short pad1;
-
- /* octree resolution */
- short ocres;
- short pad4;
-
- /**
* What to do with the sky/background. Picks sky/premul/key
* blending for the background
*/
@@ -676,7 +635,7 @@ typedef struct RenderData {
*/
short osa;
- short frs_sec, edgeint;
+ short frs_sec, pad[7];
/* safety, border and display rect */
@@ -684,11 +643,9 @@ typedef struct RenderData {
rcti disprect;
/* information on different layers to be rendered */
- ListBase layers;
- short actlay;
-
- /* number of mblur samples */
- short mblur_samples;
+ ListBase layers DNA_DEPRECATED; /* Converted to Scene->view_layers. */
+ short actlay DNA_DEPRECATED; /* Converted to Scene->active_layer. */
+ short pad1;
/**
* Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
@@ -705,18 +662,13 @@ typedef struct RenderData {
/* color management settings - color profiles, gamma correction, etc */
int color_mgt_flag;
- /** post-production settings. deprecated, but here for upwards compat (initialized to 1) */
- float postgamma, posthue, postsat;
-
/* Dither noise intensity */
float dither_intensity;
/* Bake Render options */
- short bake_osa, bake_filter, bake_mode, bake_flag;
- short bake_normal_space, bake_quad_split;
- float bake_maxdist, bake_biasdist;
- short bake_samples, bake_pad;
- float bake_user_scale, bake_pad1;
+ short bake_mode, bake_flag;
+ short bake_filter, bake_samples;
+ float bake_biasdist, bake_user_scale;
/* path to render output */
char pic[1024]; /* 1024 = FILE_MAX */
@@ -739,28 +691,12 @@ typedef struct RenderData {
char pad5[5];
/* render simplify */
- int simplify_flag;
short simplify_subsurf;
short simplify_subsurf_render;
- short simplify_shadowsamples, pad9;
+ short simplify_gpencil;
+ short pad10;
float simplify_particles;
float simplify_particles_render;
- float simplify_aosss;
-
- /* cineon */
- short cineonwhite DNA_DEPRECATED, cineonblack DNA_DEPRECATED; /*deprecated*/
- float cineongamma DNA_DEPRECATED; /*deprecated*/
-
- /* jpeg2000 */
- short jp2_preset DNA_DEPRECATED, jp2_depth DNA_DEPRECATED; /*deprecated*/
- int rpad3;
-
- /* Dome variables */ // XXX deprecated since 2.5
- short domeres DNA_DEPRECATED, domemode DNA_DEPRECATED; // XXX deprecated since 2.5
- short domeangle DNA_DEPRECATED, dometilt DNA_DEPRECATED; // XXX deprecated since 2.5
- float domeresbuf DNA_DEPRECATED; // XXX deprecated since 2.5
- float pad2;
- struct Text *dometext DNA_DEPRECATED; // XXX deprecated since 2.5
/* Freestyle line thickness options */
int line_thickness_mode;
@@ -768,6 +704,7 @@ typedef struct RenderData {
/* render engine */
char engine[32];
+ int pad2;
/* Cycles baking */
struct BakeData bake;
@@ -784,12 +721,21 @@ typedef struct RenderData {
ListBase views; /* SceneRenderView */
short actview;
short views_format;
- short pad8[2];
+
+ /* Hair Display */
+ short hair_type, hair_subdiv;
/* Motion blur shutter */
struct CurveMapping mblur_shutter_curve;
} RenderData;
+/* RenderData.hair_type */
+typedef enum eHairType {
+ SCE_HAIR_SHAPE_STRAND = 0,
+ SCE_HAIR_SHAPE_STRIP = 1,
+} eHairType;
+
+
/* *************************************************************** */
/* Render Conversion/Simplfication Settings */
@@ -807,180 +753,6 @@ typedef struct RenderProfile {
} RenderProfile;
-/* *************************************************************** */
-/* Game Engine - Dome */
-
-typedef struct GameDome {
- short res, mode;
- short angle, tilt;
- float resbuf, pad2;
- struct Text *warptext;
-} GameDome;
-
-/* GameDome.mode */
-#define DOME_FISHEYE 1
-#define DOME_TRUNCATED_FRONT 2
-#define DOME_TRUNCATED_REAR 3
-#define DOME_ENVMAP 4
-#define DOME_PANORAM_SPH 5
-#define DOME_NUM_MODES 6
-
-/* *************************************************************** */
-/* Game Engine */
-
-typedef struct GameFraming {
- float col[3];
- char type, pad1, pad2, pad3;
-} GameFraming;
-
-/* GameFraming.type */
-#define SCE_GAMEFRAMING_BARS 0
-#define SCE_GAMEFRAMING_EXTEND 1
-#define SCE_GAMEFRAMING_SCALE 2
-
-typedef struct RecastData {
- float cellsize;
- float cellheight;
- float agentmaxslope;
- float agentmaxclimb;
- float agentheight;
- float agentradius;
- float edgemaxlen;
- float edgemaxerror;
- float regionminsize;
- float regionmergesize;
- int vertsperpoly;
- float detailsampledist;
- float detailsamplemaxerror;
- char partitioning;
- char pad1;
- short pad2;
-} RecastData;
-
-/* RecastData.partitioning */
-#define RC_PARTITION_WATERSHED 0
-#define RC_PARTITION_MONOTONE 1
-#define RC_PARTITION_LAYERS 2
-
-typedef struct GameData {
-
- /* standalone player */
- struct GameFraming framing;
- short playerflag, xplay, yplay, freqplay;
- short depth, attrib, rt1, rt2;
- short aasamples, pad4[3];
-
- /* stereo/dome mode */
- struct GameDome dome;
- short stereoflag, stereomode;
- float eyeseparation;
- RecastData recastData;
-
-
- /* physics (it was in world)*/
- float gravity; /*Gravitation constant for the game world*/
-
- /*
- * Radius of the activity bubble, in Manhattan length. Objects
- * outside the box are activity-culled. */
- float activityBoxRadius;
-
- /*
- * bit 3: (gameengine): Activity culling is enabled.
- * bit 5: (gameengine) : enable Bullet DBVT tree for view frustum culling
- */
- int flag;
- short mode, matmode;
- short occlusionRes; /* resolution of occlusion Z buffer in pixel */
- short physicsEngine;
- short exitkey;
- short vsync; /* Controls vsync: off, on, or adaptive (if supported) */
- short ticrate, maxlogicstep, physubstep, maxphystep;
- short obstacleSimulation;
- short raster_storage;
- float levelHeight;
- float deactivationtime, lineardeactthreshold, angulardeactthreshold;
-
- /* Scene LoD */
- short lodflag, pad2;
- int scehysteresis, pad5;
-
-} GameData;
-
-/* GameData.stereoflag */
-#define STEREO_NOSTEREO 1
-#define STEREO_ENABLED 2
-#define STEREO_DOME 3
-
-/* GameData.stereomode */
-//#define STEREO_NOSTEREO 1
-#define STEREO_QUADBUFFERED 2
-#define STEREO_ABOVEBELOW 3
-#define STEREO_INTERLACED 4
-#define STEREO_ANAGLYPH 5
-#define STEREO_SIDEBYSIDE 6
-#define STEREO_VINTERLACE 7
-//#define STEREO_DOME 8
-#define STEREO_3DTVTOPBOTTOM 9
-
-/* GameData.physicsEngine */
-#define WOPHY_NONE 0
-#define WOPHY_BULLET 5
-
-/* obstacleSimulation */
-#define OBSTSIMULATION_NONE 0
-#define OBSTSIMULATION_TOI_rays 1
-#define OBSTSIMULATION_TOI_cells 2
-
-/* GameData.raster_storage */
-#define RAS_STORE_AUTO 0
-/* #define RAS_STORE_IMMEDIATE 1 */ /* DEPRECATED */
-#define RAS_STORE_VA 2
-#define RAS_STORE_VBO 3
-
-/* GameData.vsync */
-#define VSYNC_ON 0
-#define VSYNC_OFF 1
-#define VSYNC_ADAPTIVE 2
-
-/* GameData.flag */
-#define GAME_RESTRICT_ANIM_UPDATES (1 << 0)
-#define GAME_ENABLE_ALL_FRAMES (1 << 1)
-#define GAME_SHOW_DEBUG_PROPS (1 << 2)
-#define GAME_SHOW_FRAMERATE (1 << 3)
-#define GAME_SHOW_PHYSICS (1 << 4)
-#define GAME_DISPLAY_LISTS (1 << 5)
-#define GAME_GLSL_NO_LIGHTS (1 << 6)
-#define GAME_GLSL_NO_SHADERS (1 << 7)
-#define GAME_GLSL_NO_SHADOWS (1 << 8)
-#define GAME_GLSL_NO_RAMPS (1 << 9)
-#define GAME_GLSL_NO_NODES (1 << 10)
-#define GAME_GLSL_NO_EXTRA_TEX (1 << 11)
-#define GAME_IGNORE_DEPRECATION_WARNINGS (1 << 12)
-#define GAME_ENABLE_ANIMATION_RECORD (1 << 13)
-#define GAME_SHOW_MOUSE (1 << 14)
-#define GAME_GLSL_NO_COLOR_MANAGEMENT (1 << 15)
-#define GAME_SHOW_OBSTACLE_SIMULATION (1 << 16)
-#define GAME_NO_MATERIAL_CACHING (1 << 17)
-#define GAME_GLSL_NO_ENV_LIGHTING (1 << 18)
-/* Note: GameData.flag is now an int (max 32 flags). A short could only take 16 flags */
-
-/* GameData.playerflag */
-#define GAME_PLAYER_FULLSCREEN (1 << 0)
-#define GAME_PLAYER_DESKTOP_RESOLUTION (1 << 1)
-
-/* GameData.matmode */
-enum {
-#ifdef DNA_DEPRECATED
- GAME_MAT_TEXFACE = 0, /* deprecated */
-#endif
- GAME_MAT_MULTITEX = 1,
- GAME_MAT_GLSL = 2,
-};
-
-/* GameData.lodflag */
-#define SCE_LOD_USE_HYST (1 << 0)
-
/* UV Paint */
/* ToolSettings.uv_sculpt_settings */
#define UV_SCULPT_LOCK_BORDERS 1
@@ -1141,6 +913,11 @@ typedef struct UvSculpt {
Paint paint;
} UvSculpt;
+/* grease pencil drawing brushes */
+typedef struct GpPaint {
+ Paint paint;
+} GpPaint;
+
/* ------------------------------------------- */
/* Vertex Paint */
@@ -1165,15 +942,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
@@ -1192,6 +972,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 */
@@ -1204,21 +986,35 @@ typedef enum eGP_EditBrush_Flag {
/* strength of brush falls off with distance from cursor */
GP_EDITBRUSH_FLAG_USE_FALLOFF = (1 << 2),
+ /* XXX: currently unused. */
/* 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),
+ /* adjust radius using pen pressure */
+ GP_EDITBRUSH_FLAG_PRESSURE_RADIUS = (1 << 6),
} 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 */
@@ -1231,6 +1027,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;
@@ -1276,17 +1078,6 @@ typedef enum eGP_Interpolate_Type {
GP_IPO_SINE = 12,
} eGP_Interpolate_Type;
-
-/* *************************************************************** */
-/* Transform Orientations */
-
-typedef struct TransformOrientation {
- struct TransformOrientation *next, *prev;
- char name[64]; /* MAX_NAME */
- float mat[3][3];
- int pad;
-} TransformOrientation;
-
/* *************************************************************** */
/* Unified Paint Settings
*/
@@ -1460,14 +1251,15 @@ 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 */
float vgroup_weight;
float doublimit; /* remove doubles limit */
- float normalsize; /* size of normals */
- short automerge;
+ char automerge;
+ char object_flag;
/* Selection Mode for Mesh */
short selectmode;
@@ -1485,23 +1277,25 @@ typedef struct ToolSettings {
/* 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 */
+ /* Annotations */
+ char annotate_v3d_align; /* stroke placement settings - 3D View */
+
+ short annotate_thickness; /* default stroke thickness for annotation strokes */
+ short gpencil_selectmode; /* stroke selection mode */
+
/* Grease Pencil Sculpt */
struct GP_BrushEdit_Settings gp_sculpt;
/* 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 */
@@ -1520,42 +1314,20 @@ typedef struct ToolSettings {
/* Multires */
char multires_subdiv_type;
- /* Skeleton generation */
- short skgen_resolution;
- float skgen_threshold_internal;
- float skgen_threshold_external;
- float skgen_length_ratio;
- float skgen_length_limit;
- float skgen_angle_limit;
- float skgen_correlation_limit;
- float skgen_symmetry_limit;
- float skgen_retarget_angle_weight;
- float skgen_retarget_length_weight;
- float skgen_retarget_distance_weight;
- short skgen_options;
- char skgen_postpro;
- char skgen_postpro_passes;
- char skgen_subdivisions[3];
- char skgen_multi_level;
-
- /* Skeleton Sketching */
- struct Object *skgen_template;
- char bone_sketching;
- char bone_sketching_convert;
- char skgen_subdivision_number;
- char skgen_retarget_options;
- char skgen_retarget_roll;
- char skgen_side_string[8];
- char skgen_num_string[8];
-
/* Alt+RMB option */
char edge_mode;
char edge_mode_live_unwrap;
+ /* SCE_MPR_LOC/SCAL */
+ char gizmo_flag;
+
/* Transform */
+ char transform_pivot_point;
+ char transform_flag;
char snap_mode, snap_node_mode;
char snap_uv_mode;
- short snap_flag, snap_target;
+ char snap_flag;
+ char snap_target;
short proportional, prop_mode;
char proportional_objects; /* proportional edit, object mode */
char proportional_mask; /* proportional edit, mask editing */
@@ -1570,10 +1342,11 @@ typedef struct ToolSettings {
char vgroupsubset; /* subset selection filter in wpaint */
/* UV painting */
- int use_uv_sculpt;
- int uv_sculpt_settings;
- int uv_sculpt_tool;
- int uv_relax_method;
+ char _pad2[2];
+ char use_uv_sculpt;
+ char uv_sculpt_settings;
+ char uv_sculpt_tool;
+ char uv_relax_method;
/* XXX: these sculpt_paint_* fields are deprecated, use the
* unified_paint_settings field instead! */
short sculpt_paint_settings DNA_DEPRECATED; short pad5;
@@ -1587,6 +1360,10 @@ typedef struct ToolSettings {
struct CurvePaintSettings curve_paint_settings;
struct MeshStatVis statvis;
+
+ /* Normal Editing */
+ float normal_vector[3];
+ int face_strength;
} ToolSettings;
/* *************************************************************** */
@@ -1610,6 +1387,12 @@ typedef struct UnitSettings {
char system; /* imperial, metric etc */
char system_rotation; /* not implemented as a proper unit system yet */
short flag;
+
+ char length_unit;
+ char mass_unit;
+ char time_unit;
+
+ char pad[5];
} UnitSettings;
/* ------------------------------------------- */
@@ -1635,6 +1418,75 @@ typedef struct DisplaySafeAreas {
float action_center[2];
} DisplaySafeAreas;
+/* ------------------------------------------- */
+/* Scene Display - used for store scene specific display settings for the 3d view */
+typedef struct SceneDisplay {
+ float light_direction[3]; /* light direction for shadows/highlight */
+ float shadow_shift;
+
+ /* Settings for Cavity Shader */
+ float matcap_ssao_distance;
+ float matcap_ssao_attenuation;
+ int matcap_ssao_samples;
+ int pad;
+
+ /* OpenGL render engine settings. */
+ View3DShading shading;
+} SceneDisplay;
+
+typedef struct SceneEEVEE {
+ int flag;
+ int gi_diffuse_bounces;
+ int gi_cubemap_resolution;
+ int gi_visibility_resolution;
+
+ float gi_cubemap_draw_size;
+ float gi_irradiance_draw_size;
+
+ int taa_samples;
+ int taa_render_samples;
+ int sss_samples;
+ float sss_jitter_threshold;
+
+ float ssr_quality;
+ float ssr_max_roughness;
+ float ssr_thickness;
+ float ssr_border_fade;
+ float ssr_firefly_fac;
+
+ float volumetric_start;
+ float volumetric_end;
+ int volumetric_tile_size;
+ int volumetric_samples;
+ float volumetric_sample_distribution;
+ float volumetric_light_clamp;
+ int volumetric_shadow_samples;
+
+ float gtao_distance;
+ float gtao_factor;
+ float gtao_quality;
+
+ float bokeh_max_size;
+ float bokeh_threshold;
+
+ float bloom_color[3];
+ float bloom_threshold;
+ float bloom_knee;
+ float bloom_intensity;
+ float bloom_radius;
+ float bloom_clamp;
+
+ int motion_blur_samples;
+ float motion_blur_shutter;
+
+ int shadow_method;
+ int shadow_cube_size;
+ int shadow_cascade_size;
+
+ struct LightCache *light_cache;
+ char light_cache_info[64];
+} SceneEEVEE;
+
/* *************************************************************** */
/* Scene ID-Block */
@@ -1647,16 +1499,15 @@ typedef struct Scene {
struct Scene *set;
- ListBase base;
- struct Base *basact; /* active base */
- struct Object *obedit; /* name replaces old G.obedit */
+ ListBase base DNA_DEPRECATED;
+ struct Base *basact DNA_DEPRECATED; /* active base */
+ void *_pad1;
- float cursor[3]; /* 3d cursor location */
- char _pad[4];
+ View3DCursor cursor; /* 3d cursor location */
- unsigned int lay; /* bitflags for layer visibility */
- int layact; /* active layer */
- unsigned int lay_updated; /* runtime flag, has layer ever been updated since load? */
+ unsigned int lay DNA_DEPRECATED; /* bitflags for layer visibility */
+ int layact DNA_DEPRECATED; /* active layer */
+ unsigned int pad1;
short flag; /* various settings */
@@ -1668,7 +1519,7 @@ typedef struct Scene {
struct Editing *ed; /* sequence editor data is allocated here */
struct ToolSettings *toolsettings; /* default allocated now */
- struct SceneStats *stats; /* default allocated now */
+ void *pad2;
struct DisplaySafeAreas safe_areas;
/* migrate or replace? depends on some internal things... */
@@ -1679,6 +1530,9 @@ typedef struct Scene {
ListBase markers;
ListBase transform_spaces;
+ int orientation_index_custom;
+ int orientation_type;
+
void *sound_scene;
void *playback_handle;
void *sound_scrub_handle;
@@ -1687,24 +1541,17 @@ typedef struct Scene {
void *fps_info; /* (runtime) info/cache used for presenting playback framerate info to the user */
/* none of the dependency graph vars is mean to be saved */
- struct Depsgraph *depsgraph;
- void *pad1;
- struct DagForest *theDag;
- short dagflags;
- short pad3;
+ struct GHash *depsgraph_hash;
+ int pad7;
/* User-Defined KeyingSets */
int active_keyingset; /* index of the active KeyingSet. first KeyingSet has index 1, 'none' active is 0, 'add new' is -1 */
ListBase keyingsets; /* KeyingSets for this scene */
- /* Game Settings */
- struct GameFraming framing DNA_DEPRECATED; // XXX deprecated since 2.5
- struct GameData gm;
-
/* Units */
struct UnitSettings unit;
- /* Grease Pencil */
+ /* Grease Pencil - Annotations */
struct bGPdata *gpd;
/* Movie Tracking */
@@ -1716,6 +1563,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;
@@ -1725,6 +1573,16 @@ typedef struct Scene {
struct RigidBodyWorld *rigidbody_world;
struct PreviewImage *preview;
+
+ ListBase view_layers;
+ /* Not an actual datablock, but memory owned by scene. */
+ Collection *master_collection;
+ struct SceneCollection *collection DNA_DEPRECATED;
+
+ IDProperty *layer_properties; /* settings to be override by workspaces */
+
+ struct SceneDisplay display;
+ struct SceneEEVEE eevee;
} Scene;
/* **************** RENDERDATA ********************* */
@@ -1738,25 +1596,25 @@ typedef struct Scene {
/* RenderData.mode */
#define R_OSA 0x0001
-#define R_SHADOW 0x0002
-#define R_GAMMA 0x0004
-#define R_ORTHO 0x0008
-#define R_ENVMAP 0x0010
-#define R_EDGE 0x0020
-#define R_FIELDS 0x0040
-#define R_FIELDSTILL 0x0080
-/*#define R_RADIO 0x0100 */ /* deprecated */
+/* #define R_SHADOW 0x0002 */
+/* #define R_GAMMA 0x0004 */
+/* #define R_ORTHO 0x0008 */
+/* #define R_ENVMAP 0x0010 */
+/* #define R_EDGE 0x0020 */
+/* #define R_FIELDS 0x0040 */
+/*#define R_FIELDSTILL 0x0080 */
+/*#define R_RADIO 0x0100 */ /* deprecated */
#define R_BORDER 0x0200
-#define R_PANORAMA 0x0400 /* deprecated as scene option, still used in renderer */
+#define R_PANORAMA 0x0400 /* deprecated */
#define R_CROP 0x0800
/* Disable camera switching: runtime (DURIAN_CAMERA_SWITCH) */
#define R_NO_CAMERA_SWITCH 0x1000
-#define R_ODDFIELD 0x2000
+/* #define R_ODDFIELD 0x2000 */
#define R_MBLUR 0x4000
/* unified was here */
-#define R_RAYTRACE 0x10000
+/* #define R_RAYTRACE 0x10000 */
/* R_GAUSS is obsolete, but used to retrieve setting from old files */
-#define R_GAUSS 0x20000
+/* #define R_GAUSS 0x20000 */
/* fbuf obsolete... */
/*#define R_FBUF 0x40000*/
/* threads obsolete... is there for old files, now use for autodetect threads */
@@ -1764,14 +1622,14 @@ typedef struct Scene {
/* Use the same flag for autothreads */
#define R_FIXED_THREADS 0x80000
-#define R_SPEED 0x100000
-#define R_SSS 0x200000
+/* #define R_SPEED 0x100000 */
+/* #define R_SSS 0x200000 */
#define R_NO_OVERWRITE 0x400000 /* skip existing files */
#define R_TOUCH 0x800000 /* touch files before rendering */
#define R_SIMPLIFY 0x1000000
#define R_EDGE_FRS 0x2000000 /* R_EDGE reserved for Freestyle */
#define R_PERSISTENT_DATA 0x4000000 /* keep data around for re-render */
-#define R_USE_WS_SHADING 0x8000000 /* use world space interpretation of lighting data */
+/* #define R_USE_WS_SHADING 0x8000000 */ /* use world space interpretation of lighting data */
/* RenderData.seq_flag */
enum {
@@ -1788,7 +1646,7 @@ enum {
#define R_OUTPUT_NONE 3
/*#define R_OUTPUT_FORKED 4*/
-/* RenderData.filtertype */
+/* RenderData.filtertype (used for nodes) */
#define R_FILTER_BOX 0
#define R_FILTER_TENT 1
#define R_FILTER_QUAD 2
@@ -1796,19 +1654,7 @@ enum {
#define R_FILTER_CATROM 4
#define R_FILTER_GAUSS 5
#define R_FILTER_MITCH 6
-#define R_FILTER_FAST_GAUSS 7 /* note, this is only used for nodes at the moment */
-
-/* RenderData.raytrace_structure */
-#define R_RAYSTRUCTURE_AUTO 0
-#define R_RAYSTRUCTURE_OCTREE 1
-#define R_RAYSTRUCTURE_BLIBVH 2 /* removed */
-#define R_RAYSTRUCTURE_VBVH 3
-#define R_RAYSTRUCTURE_SIMD_SVBVH 4 /* needs SIMD */
-#define R_RAYSTRUCTURE_SIMD_QBVH 5 /* needs SIMD */
-
-/* RenderData.raytrace_options */
-#define R_RAYTRACE_USE_LOCAL_COORDS 0x0001
-#define R_RAYTRACE_USE_INSTANCES 0x0002
+#define R_FILTER_FAST_GAUSS 7
/* RenderData.scemode (int now) */
#define R_DOSEQ 0x0001
@@ -1820,18 +1666,18 @@ enum {
#define R_MATNODE_PREVIEW 0x0020
#define R_DOCOMP 0x0040
#define R_COMP_CROP 0x0080
-#define R_FREE_IMAGE 0x0100
+/* #define R_FREE_IMAGE 0x0100 */
#define R_SINGLE_LAYER 0x0200
#define R_EXR_TILE_FILE 0x0400
/* #define R_COMP_FREE 0x0800 */
#define R_NO_IMAGE_LOAD 0x1000
-#define R_NO_TEX 0x2000
+/* #define R_NO_TEX 0x2000 */
#define R_NO_FRAME_UPDATE 0x4000
#define R_FULL_SAMPLE 0x8000
/* #define R_DEPRECATED 0x10000 */
/* #define R_RECURS_PROTECTION 0x20000 */
#define R_TEXNODE_PREVIEW 0x40000
-#define R_VIEWPORT_PREVIEW 0x80000
+/* #define R_VIEWPORT_PREVIEW 0x80000 */
#define R_EXR_CACHE_FILE 0x100000
#define R_MULTIVIEW 0x200000
@@ -1888,12 +1734,12 @@ enum {
/* bake_mode: same as RE_BAKE_xxx defines */
/* RenderData.bake_flag */
#define R_BAKE_CLEAR 1
-#define R_BAKE_OSA 2
+/* #define R_BAKE_OSA 2 */ /* deprecated */
#define R_BAKE_TO_ACTIVE 4
-#define R_BAKE_NORMALIZE 8
+/* #define R_BAKE_NORMALIZE 8 */ /* deprecated */
#define R_BAKE_MULTIRES 16
#define R_BAKE_LORES_MESH 32
-#define R_BAKE_VCOL 64
+/* #define R_BAKE_VCOL 64 */ /* deprecated */
#define R_BAKE_USERSCALE 128
#define R_BAKE_CAGE 256
#define R_BAKE_SPLIT_MAT 512
@@ -1905,9 +1751,6 @@ enum {
#define R_BAKE_SPACE_OBJECT 2
#define R_BAKE_SPACE_TANGENT 3
-/* RenderData.simplify_flag */
-#define R_SIMPLE_NO_TRIANGULATE 1
-
/* RenderData.line_thickness_mode */
#define R_LINE_THICKNESS_ABSOLUTE 1
#define R_LINE_THICKNESS_RELATIVE 2
@@ -1915,8 +1758,8 @@ enum {
/* sequencer seq_prev_type seq_rend_type */
/* RenderData.engine (scene.c) */
-extern const char *RE_engine_id_BLENDER_RENDER;
-extern const char *RE_engine_id_BLENDER_GAME;
+extern const char *RE_engine_id_BLENDER_EEVEE;
+extern const char *RE_engine_id_BLENDER_OPENGL;
extern const char *RE_engine_id_CYCLES;
/* **************** SCENE ********************* */
@@ -1935,39 +1778,39 @@ extern const char *RE_engine_id_CYCLES;
#define MINAFRAME -1048574
#define MINAFRAMEF -1048574.0f
-/* depricate this! */
-#define TESTBASE(v3d, base) ( \
- ((base)->flag & SELECT) && \
- ((base)->lay & v3d->lay) && \
- (((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
-#define TESTBASELIB(v3d, base) ( \
- ((base)->flag & SELECT) && \
- ((base)->lay & v3d->lay) && \
+/* deprecate this! */
+#define TESTBASE(base) ( \
+ (((base)->flag & BASE_SELECTED) != 0) && \
+ (((base)->flag & BASE_VISIBLE) != 0))
+#define TESTBASELIB(base) ( \
+ (((base)->flag & BASE_SELECTED) != 0) && \
((base)->object->id.lib == NULL) && \
- (((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
-#define TESTBASELIB_BGMODE(v3d, scene, base) ( \
- ((base)->flag & SELECT) && \
- ((base)->lay & (v3d ? v3d->lay : scene->lay)) && \
+ (((base)->flag & BASE_VISIBLE) != 0))
+#define TESTBASELIB_BGMODE(base) ( \
+ (((base)->flag & BASE_SELECTED) != 0) && \
((base)->object->id.lib == NULL) && \
- (((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
-#define BASE_EDITABLE_BGMODE(v3d, scene, base) ( \
- ((base)->lay & (v3d ? v3d->lay : scene->lay)) && \
+ (((base)->flag & BASE_VISIBLE) != 0))
+#define BASE_EDITABLE_BGMODE(base) ( \
((base)->object->id.lib == NULL) && \
- (((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
-#define BASE_SELECTABLE(v3d, base) ( \
- (base->lay & v3d->lay) && \
- (base->object->restrictflag & (OB_RESTRICT_SELECT | OB_RESTRICT_VIEW)) == 0)
-#define BASE_VISIBLE(v3d, base) ( \
- (base->lay & v3d->lay) && \
- (base->object->restrictflag & OB_RESTRICT_VIEW) == 0)
-#define BASE_VISIBLE_BGMODE(v3d, scene, base) ( \
- (base->lay & (v3d ? v3d->lay : scene->lay)) && \
- (base->object->restrictflag & OB_RESTRICT_VIEW) == 0)
-
-#define FIRSTBASE scene->base.first
-#define LASTBASE scene->base.last
-#define BASACT (scene->basact)
-#define OBACT (BASACT ? BASACT->object: NULL)
+ (((base)->flag & BASE_VISIBLE) != 0))
+#define BASE_SELECTABLE(base) \
+ (((base)->flag & BASE_SELECTABLE) != 0)
+#define BASE_VISIBLE(base) ( \
+ ((base)->flag & BASE_VISIBLE) != 0)
+
+#define FIRSTBASE(_view_layer) ((_view_layer)->object_bases.first)
+#define LASTBASE(_view_layer) ((_view_layer)->object_bases.last)
+#define BASACT(_view_layer) ((_view_layer)->basact)
+#define OBACT(_view_layer) (BASACT(_view_layer) ? BASACT(_view_layer)->object: NULL)
+
+#define OBEDIT_FROM_WORKSPACE(workspace, _view_layer) \
+ (((workspace)->object_mode & OD_MODE_EDIT) ? OBACT(_view_layer) : NULL)
+#define OBEDIT_FROM_OBACT(ob) \
+ ((ob) ? (((ob)->mode & OB_MODE_EDIT) ? ob : NULL) : NULL)
+#define OBPOSE_FROM_OBACT(ob) \
+ ((ob) ? (((ob)->mode & OB_MODE_POSE) ? ob : NULL) : NULL)
+#define OBEDIT_FROM_VIEW_LAYER(view_layer) \
+ OBEDIT_FROM_OBACT(OBACT(view_layer))
#define V3D_CAMERA_LOCAL(v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : NULL)
#define V3D_CAMERA_SCENE(scene, v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : (scene)->camera)
@@ -1985,6 +1828,16 @@ extern const char *RE_engine_id_CYCLES;
/* Base.flag is in DNA_object_types.h */
+/* ToolSettings.transform_flag */
+enum {
+ SCE_XFORM_AXIS_ALIGN = (1 << 0),
+};
+
+/* ToolSettings.object_flag */
+enum {
+ SCE_OBJECT_MODE_LOCK = (1 << 0),
+};
+
/* ToolSettings.snap_flag */
#define SCE_SNAP 1
#define SCE_SNAP_ROTATE 2
@@ -1998,16 +1851,18 @@ extern const char *RE_engine_id_CYCLES;
#define SCE_SNAP_TARGET_CENTER 1
#define SCE_SNAP_TARGET_MEDIAN 2
#define SCE_SNAP_TARGET_ACTIVE 3
+
/* ToolSettings.snap_mode */
-#define SCE_SNAP_MODE_INCREMENT 0
-#define SCE_SNAP_MODE_VERTEX 1
-#define SCE_SNAP_MODE_EDGE 2
-#define SCE_SNAP_MODE_FACE 3
-#define SCE_SNAP_MODE_VOLUME 4
-#define SCE_SNAP_MODE_NODE_X 5
-#define SCE_SNAP_MODE_NODE_Y 6
-#define SCE_SNAP_MODE_NODE_XY 7
-#define SCE_SNAP_MODE_GRID 8
+#define SCE_SNAP_MODE_VERTEX (1 << 0)
+#define SCE_SNAP_MODE_EDGE (1 << 1)
+#define SCE_SNAP_MODE_FACE (1 << 2)
+#define SCE_SNAP_MODE_VOLUME (1 << 3)
+#define SCE_SNAP_MODE_INCREMENT (1 << 4)
+
+/* ToolSettings.snap_node_mode */
+#define SCE_SNAP_MODE_GRID (1 << 5)
+#define SCE_SNAP_MODE_NODE_X (1 << 6)
+#define SCE_SNAP_MODE_NODE_Y (1 << 7)
/* ToolSettings.selectmode */
#define SCE_SELECT_VERTEX 1 /* for mesh */
@@ -2050,6 +1905,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 {
@@ -2151,6 +2013,7 @@ typedef enum eSculptFlags {
/* If set, dynamic-topology detail size will be constant in object space */
SCULPT_DYNTOPO_DETAIL_CONSTANT = (1 << 13),
SCULPT_DYNTOPO_DETAIL_BRUSH = (1 << 14),
+ SCULPT_DYNTOPO_DETAIL_MANUAL = (1 << 16),
/* Don't display mask in viewport, but still use it for strokes. */
SCULPT_HIDE_MASK = (1 << 15),
@@ -2206,21 +2069,40 @@ typedef enum eImagePaintMode {
#define EDGE_MODE_TAG_BEVEL 4
#define EDGE_MODE_TAG_FREESTYLE 5
+/* ToolSettings.gizmo_flag */
+enum {
+ SCE_GIZMO_SHOW_TRANSLATE = (1 << 0),
+ SCE_GIZMO_SHOW_ROTATE = (1 << 1),
+ SCE_GIZMO_SHOW_SCALE = (1 << 2),
+};
+
/* 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),
+ /* Generate wheight data for new strokes */
+ GP_TOOL_FLAG_CREATE_WEIGHTS = (1 << 4),
} 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 {
@@ -2236,8 +2118,15 @@ typedef enum eGPencil_Placement_Flags {
/* "Use Endpoints" */
GP_PROJECT_DEPTH_STROKE_ENDPOINTS = (1 << 4),
+ GP_PROJECT_CURSOR = (1 << 5),
} eGPencil_Placement_Flags;
+/* ToolSettings.gpencil_selectmode */
+typedef enum eGPencil_Selectmode_types {
+ GP_SELECTMODE_POINT = 0,
+ GP_SELECTMODE_STROKE = 1
+} eGPencil_Selectmode_types;
+
/* ToolSettings.particle flag */
#define PE_KEEP_LENGTHS 1
#define PE_LOCK_FIRST 2
@@ -2266,57 +2155,12 @@ typedef enum eGPencil_Placement_Flags {
#define PE_TYPE_SOFTBODY 1
#define PE_TYPE_CLOTH 2
-/* ToolSettings.skgen_options */
-#define SKGEN_FILTER_INTERNAL (1 << 0)
-#define SKGEN_FILTER_EXTERNAL (1 << 1)
-#define SKGEN_SYMMETRY (1 << 2)
-#define SKGEN_CUT_LENGTH (1 << 3)
-#define SKGEN_CUT_ANGLE (1 << 4)
-#define SKGEN_CUT_CORRELATION (1 << 5)
-#define SKGEN_HARMONIC (1 << 6)
-#define SKGEN_STICK_TO_EMBEDDING (1 << 7)
-#define SKGEN_ADAPTIVE_DISTANCE (1 << 8)
-#define SKGEN_FILTER_SMART (1 << 9)
-#define SKGEN_DISP_LENGTH (1 << 10)
-#define SKGEN_DISP_WEIGHT (1 << 11)
-#define SKGEN_DISP_ORIG (1 << 12)
-#define SKGEN_DISP_EMBED (1 << 13)
-#define SKGEN_DISP_INDEX (1 << 14)
-
-#define SKGEN_SUB_LENGTH 0
-#define SKGEN_SUB_ANGLE 1
-#define SKGEN_SUB_CORRELATION 2
-#define SKGEN_SUB_TOTAL 3
-
-/* ToolSettings.skgen_postpro */
-#define SKGEN_SMOOTH 0
-#define SKGEN_AVERAGE 1
-#define SKGEN_SHARPEN 2
-
-/* ToolSettings.bone_sketching */
-#define BONE_SKETCHING 1
-#define BONE_SKETCHING_QUICK 2
-#define BONE_SKETCHING_ADJUST 4
-
-/* ToolSettings.bone_sketching_convert */
-#define SK_CONVERT_CUT_FIXED 0
-#define SK_CONVERT_CUT_LENGTH 1
-#define SK_CONVERT_CUT_ADAPTATIVE 2
-#define SK_CONVERT_RETARGET 3
-
-/* ToolSettings.skgen_retarget_options */
-#define SK_RETARGET_AUTONAME 1
-
-/* ToolSettings.skgen_retarget_roll */
-#define SK_RETARGET_ROLL_NONE 0
-#define SK_RETARGET_ROLL_VIEW 1
-#define SK_RETARGET_ROLL_JOINT 2
-
/* PhysicsSettings.flag */
#define PHYS_GLOBAL_GRAVITY 1
/* UnitSettings */
+#define USER_UNIT_ADAPTIVE 0xFF
/* UnitSettings.system */
#define USER_UNIT_NONE 0
#define USER_UNIT_METRIC 1
@@ -2325,6 +2169,38 @@ typedef enum eGPencil_Placement_Flags {
#define USER_UNIT_OPT_SPLIT 1
#define USER_UNIT_ROT_RADIANS 2
+/* SceneEEVEE->flag */
+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), /* Unused */
+ SCE_EEVEE_GTAO_ENABLED = (1 << 4),
+ SCE_EEVEE_GTAO_BENT_NORMALS = (1 << 5),
+ SCE_EEVEE_GTAO_BOUNCE = (1 << 6),
+ SCE_EEVEE_DOF_ENABLED = (1 << 7),
+ SCE_EEVEE_BLOOM_ENABLED = (1 << 8),
+ SCE_EEVEE_MOTION_BLUR_ENABLED = (1 << 9),
+ SCE_EEVEE_SHADOW_HIGH_BITDEPTH = (1 << 10),
+ SCE_EEVEE_TAA_REPROJECTION = (1 << 11),
+ SCE_EEVEE_SSS_ENABLED = (1 << 12),
+ SCE_EEVEE_SSS_SEPARATE_ALBEDO = (1 << 13),
+ SCE_EEVEE_SSR_ENABLED = (1 << 14),
+ SCE_EEVEE_SSR_REFRACTION = (1 << 15),
+ SCE_EEVEE_SSR_HALF_RESOLUTION = (1 << 16),
+ SCE_EEVEE_SHOW_IRRADIANCE = (1 << 17),
+ SCE_EEVEE_SHOW_CUBEMAPS = (1 << 18),
+ SCE_EEVEE_GI_AUTOBAKE = (1 << 19),
+ SCE_EEVEE_SHADOW_SOFT = (1 << 20),
+};
+
+/* SceneEEVEE->shadow_method */
+enum {
+ SHADOW_ESM = 1,
+ SHADOW_VSM = 2,
+ SHADOW_METHOD_MAX = 3,
+};
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index bdcbf9cb856..50bf24e0b55 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -30,6 +30,7 @@
#ifndef __DNA_SCREEN_TYPES_H__
#define __DNA_SCREEN_TYPES_H__
+#include "DNA_defs.h"
#include "DNA_listBase.h"
#include "DNA_view2d_types.h"
#include "DNA_vec_types.h"
@@ -43,20 +44,29 @@ struct ARegionType;
struct PanelType;
struct Scene;
struct uiLayout;
+struct wmDrawBuffer;
struct wmTimer;
struct wmTooltipState;
+
+/* TODO Doing this is quite ugly :)
+ * Once the top-bar is merged bScreen should be refactored to use ScrAreaMap. */
+#define AREAMAP_FROM_SCREEN(screen) ((ScrAreaMap *)&(screen)->vertbase)
+
typedef struct bScreen {
ID id;
+ /* TODO Should become ScrAreaMap now.
+ * ** NOTE: KEEP ORDER IN SYNC WITH ScrAreaMap! (see AREAMAP_FROM_SCREEN macro above) ** */
ListBase vertbase; /* screens have vertices/edges to define areas */
ListBase edgebase;
ListBase areabase;
+
ListBase regionbase; /* screen level regions (menus), runtime only */
- struct Scene *scene;
- struct Scene *newscene; /* temporary when switching */
+ struct Scene *scene DNA_DEPRECATED;
+ short flag; /* general flags */
short winid; /* winid from WM, starts with 1 */
short redraws_flag; /* user-setting for which editors get redrawn during anim playback (used to be time->redraws) */
@@ -67,18 +77,18 @@ typedef struct bScreen {
char do_draw_gesture; /* notifier for gesture draw. */
char do_draw_paintcursor; /* notifier for paint cursor draw. */
char do_draw_drag; /* notifier for dragging draw. */
- char swap; /* indicator to survive swap-exchange systems */
char skip_handling; /* set to delay screen handling after switching back from maximized area */
char scrubbing; /* set when scrubbing to avoid some costly updates */
- char pad[6];
+ char pad[1];
- short mainwin; /* screensize subwindow, for screenedges and global menus */
- short subwinactive; /* active subwindow */
+ struct ARegion *active_region; /* active region that has mouse focus */
struct wmTimer *animtimer; /* if set, screen has timer handler added in window */
void *context; /* context callback */
struct wmTooltipState *tool_tip; /* runtime */
+
+ PreviewImage *preview;
} bScreen;
typedef struct ScrVert {
@@ -96,6 +106,14 @@ typedef struct ScrEdge {
int pad;
} ScrEdge;
+typedef struct ScrAreaMap {
+ /* ** NOTE: KEEP ORDER IN SYNC WITH LISTBASES IN bScreen! ** */
+
+ ListBase vertbase; /* ScrVert - screens have vertices/edges to define areas */
+ ListBase edgebase; /* ScrEdge */
+ ListBase areabase; /* ScrArea */
+} ScrAreaMap;
+
typedef struct Panel { /* the part from uiBlock that needs saved in file */
struct Panel *next, *prev;
@@ -104,7 +122,9 @@ typedef struct Panel { /* the part from uiBlock that needs saved in file */
char panelname[64], tabname[64]; /* defined as UI_MAX_NAME_STR */
char drawname[64]; /* panelname is identifier for restoring location */
- int ofsx, ofsy, sizex, sizey;
+ int ofsx, ofsy; /* offset within the region */
+ int sizex, sizey; /* panel size including children */
+ int blocksizex, blocksizey; /* panel size excluding children */
short labelofs, pad;
short flag, runtime_flag;
short control;
@@ -112,6 +132,7 @@ typedef struct Panel { /* the part from uiBlock that needs saved in file */
int sortorder; /* panels are aligned according to increasing sortorder */
struct Panel *paneltab; /* this panel is tabbed in *paneltab */
void *activedata; /* runtime for panel manipulation */
+ ListBase children; /* sub panels */
} Panel;
@@ -194,6 +215,13 @@ typedef struct uiList { /* some list UI data need to be saved in file
uiListDyn *dyn_data;
} uiList;
+typedef struct TransformOrientation {
+ struct TransformOrientation *next, *prev;
+ char name[64]; /* MAX_NAME */
+ float mat[3][3];
+ int pad;
+} TransformOrientation;
+
typedef struct uiPreview { /* some preview UI data need to be saved in file */
struct uiPreview *next, *prev;
@@ -202,6 +230,41 @@ typedef struct uiPreview { /* some preview UI data need to be saved in
short pad1[3];
} uiPreview;
+/* These two lines with # tell makesdna this struct can be excluded.
+ * Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
+#
+#
+typedef struct ScrGlobalAreaData {
+ /* Global areas have a non-dynamic size. That means, changing the window
+ * size doesn't affect their size at all. However, they can still be
+ * 'collapsed', by changing this value. Ignores DPI (ED_area_global_size_y
+ * and winx/winy don't) */
+ short cur_fixed_height;
+ /* For global areas, this is the min and max size they can use depending on
+ * if they are 'collapsed' or not. Value is set on area creation and not
+ * touched afterwards. */
+ short size_min, size_max;
+ short align; /* GlobalAreaAlign */
+
+ short flag; /* GlobalAreaFlag */
+ short pad;
+} ScrGlobalAreaData;
+
+enum GlobalAreaFlag {
+ GLOBAL_AREA_IS_HIDDEN = (1 << 0),
+};
+
+typedef enum GlobalAreaAlign {
+ GLOBAL_AREA_ALIGN_TOP,
+ GLOBAL_AREA_ALIGN_BOTTOM,
+} GlobalAreaAlign;
+
+typedef struct ScrArea_Runtime {
+ struct bToolRef *tool;
+ char is_tool_set;
+ char _pad0[7];
+} ScrArea_Runtime;
+
typedef struct ScrArea {
struct ScrArea *next, *prev;
@@ -210,11 +273,17 @@ typedef struct ScrArea {
rcti totrct; /* rect bound by v1 v2 v3 v4 */
- char spacetype, butspacetype; /* SPACE_..., butspacetype is button arg */
+ char spacetype; /* eSpace_Type (SPACE_FOO) */
+ /* Temporarily used while switching area type, otherwise this should be
+ * SPACE_EMPTY. Also, versioning uses it to nicely replace deprecated
+ * editors. It's been there for ages, name doesn't fit any more... */
+ char butspacetype; /* eSpace_Type (SPACE_FOO) */
+ short butspacetype_subtype;
+
short winx, winy; /* size */
- short headertype; /* OLD! 0=no header, 1= down, 2= up */
- short do_refresh; /* private, for spacetype refresh callback */
+ char headertype DNA_DEPRECATED;/* OLD! 0=no header, 1= down, 2= up */
+ char do_refresh; /* private, for spacetype refresh callback */
short flag;
short region_active_win; /* index of last used region of 'RGN_TYPE_WINDOW'
* runtime variable, updated by executing operators */
@@ -222,6 +291,9 @@ typedef struct ScrArea {
struct SpaceType *type; /* callbacks for this space type */
+ /* Non-NULL if this area is global. */
+ ScrGlobalAreaData *global;
+
/* A list of space links (editors) that were open in this area before. When
* changing the editor type, we try to reuse old editor data from this list.
* The first item is the active/visible one.
@@ -234,8 +306,16 @@ typedef struct ScrArea {
ListBase handlers; /* wmEventHandler */
ListBase actionzones; /* AZone */
+
+ ScrArea_Runtime runtime;
} ScrArea;
+
+typedef struct ARegion_Runtime {
+ /* Panel category to use between 'layout' and 'draw'. */
+ const char *category;
+} ARegion_Runtime;
+
typedef struct ARegion {
struct ARegion *next, *prev;
@@ -244,7 +324,7 @@ typedef struct ARegion {
rcti drawrct; /* runtime for partial redraw, same or smaller than winrct */
short winx, winy; /* size */
- short swinid;
+ short visible; /* region is currently visible on screen */
short regiontype; /* window, header, etc. identifier for drawing */
short alignment; /* how it should split */
short flag; /* hide, ... */
@@ -254,10 +334,9 @@ typedef struct ARegion {
short do_draw; /* private, cached notifier events */
short do_draw_overlay; /* private, cached notifier events */
- short swap; /* private, indicator to survive swap-exchange */
short overlap; /* private, set for indicate drawing overlapped */
short flagfullscreen; /* temporary copy of flag settings for clean fullscreen */
- short pad;
+ short pad1, pad2;
struct ARegionType *type; /* callbacks for this region type */
@@ -269,23 +348,26 @@ typedef struct ARegion {
ListBase handlers; /* wmEventHandler */
ListBase panels_category; /* Panel categories runtime */
+ struct wmGizmoMap *gizmo_map; /* gizmo-map of this region */
struct wmTimer *regiontimer; /* blend in/out */
+ struct wmDrawBuffer *draw_buffer;
char *headerstr; /* use this string to draw info */
void *regiondata; /* XXX 2.50, need spacedata equivalent? */
-} ARegion;
-/* swap */
-#define WIN_BACK_OK 1
-#define WIN_FRONT_OK 2
-// #define WIN_EQUAL 3 // UNUSED
+ ARegion_Runtime runtime;
+} ARegion;
/* area->flag */
enum {
HEADER_NO_PULLDOWN = (1 << 0),
// AREA_FLAG_DEPRECATED_1 = (1 << 1),
// AREA_FLAG_DEPRECATED_2 = (1 << 2),
- AREA_TEMP_INFO = (1 << 3),
+#ifdef DNA_DEPRECATED_ALLOW
+ AREA_TEMP_INFO = (1 << 3), /* versioned to make slot reusable */
+#endif
+ /* update size of regions within the area */
+ AREA_FLAG_REGION_SIZE_UPDATE = (1 << 3),
// AREA_FLAG_DEPRECATED_4 = (1 << 4),
// AREA_FLAG_DEPRECATED_5 = (1 << 5),
/* used to check if we should switch back to prevspace (of a different type) */
@@ -301,8 +383,11 @@ enum {
#define AREAMINX 32
#define HEADERY 26
-#define HEADERDOWN 1
-#define HEADERTOP 2
+/* screen->flag */
+enum {
+ SCREEN_COLLAPSE_TOPBAR = 1,
+ SCREEN_COLLAPSE_STATUSBAR = 2,
+};
/* screen->state */
enum {
@@ -320,6 +405,7 @@ enum {
/*PNL_TABBED = (1 << 3), */ /*UNUSED*/
PNL_OVERLAP = (1 << 4),
PNL_PIN = (1 << 5),
+ PNL_POPOVER = (1 << 6),
};
/* Panel->snap - for snapping to screen edges */
@@ -369,6 +455,7 @@ enum {
/* uiList filter orderby type */
enum {
UILST_FLT_SORT_ALPHA = 1 << 0,
+ UILST_FLT_FORCED_REVERSE = 1 << 1, /* Special flag to indicate reverse was set by external parameter */
UILST_FLT_SORT_REVERSE = 1u << 31 /* Special value, bitflag used to reverse order! */
};
@@ -385,10 +472,14 @@ enum {
RGN_TYPE_TOOLS = 5,
RGN_TYPE_TOOL_PROPS = 6,
RGN_TYPE_PREVIEW = 7,
+ RGN_TYPE_HUD = 8,
};
/* use for function args */
#define RGN_TYPE_ANY -1
+/* Region supports panel tabs (categories). */
+#define RGN_TYPE_HAS_CATEGORY_MASK (1 << RGN_TYPE_UI)
+
/* region alignment */
#define RGN_ALIGN_NONE 0
#define RGN_ALIGN_TOP 1
@@ -406,6 +497,10 @@ enum {
enum {
RGN_FLAG_HIDDEN = (1 << 0),
RGN_FLAG_TOO_SMALL = (1 << 1),
+ /* Force delayed reinit of region size data, so that region size is calculated
+ * just big enough to show all its content (if enough space is available).
+ * Note that only ED_region_header supports this right now. */
+ RGN_FLAG_DYNAMIC_SIZE = (1 << 2),
/* Region data is NULL'd on read, never written. */
RGN_FLAG_TEMP_REGIONDATA = (1 << 3),
};
@@ -415,4 +510,5 @@ enum {
#define RGN_DRAW_PARTIAL 2
#define RGN_DRAWING 4
#define RGN_DRAW_REFRESH_UI 8 /* re-create uiBlock's where possible */
+#define RGN_DRAW_NO_REBUILD 16
#endif
diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h
deleted file mode 100644
index 1fee490319f..00000000000
--- a/source/blender/makesdna/DNA_sensor_types.h
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * ***** 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) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file DNA_sensor_types.h
- * \ingroup DNA
- * \since mar-2001
- * \author nzc
- *
- * #bSensor type is specifically for use by Object logic-bricks in the game-engine.
- */
-
-#ifndef __DNA_SENSOR_TYPES_H__
-#define __DNA_SENSOR_TYPES_H__
-
-struct Object;
-struct Material;
-
-/* ****************** SENSORS ********************* */
-
-typedef struct bNearSensor {
- char name[64]; /* MAX_NAME */
- float dist, resetdist;
- int lastval, pad;
-} bNearSensor;
-
-/**
- * Defines the settings of a mouse sensor.
- */
-typedef struct bMouseSensor {
- /**
- * The type of key this sensor listens to.
- */
- short type;
- short flag;
- short pad1;
- short mode; /* flag to choose material or property */
- char propname[64];
- char matname[64];
-} bMouseSensor;
-
-/* DEPRECATED */
-typedef struct bTouchSensor {
- char name[64]; /* MAX_NAME */
- struct Material *ma;
- float dist, pad;
-} bTouchSensor;
-
-typedef struct bKeyboardSensor {
- short key, qual;
- short type, qual2;
- /**
- * Name of the target property
- */
- char targetName[64]; /* MAX_NAME */
- /**
- * Name of the toggle property
- */
- char toggleName[64]; /* MAX_NAME */
-} bKeyboardSensor;
-
-typedef struct bPropertySensor {
- int type;
- int pad;
- char name[64]; /* MAX_NAME */
- char value[64];
- char maxvalue[64];
-} bPropertySensor;
-
-typedef struct bActuatorSensor {
- int type;
- int pad;
- char name[64]; /* MAX_NAME */
-} bActuatorSensor;
-
-typedef struct bDelaySensor {
- short delay;
- short duration;
- short flag;
- short pad;
-} bDelaySensor;
-
-typedef struct bCollisionSensor {
- char name[64]; /* property name. MAX_NAME */
- char materialName[64]; /* material */
- // struct Material *ma; // XXX remove materialName
- short damptimer, damp;
- short mode; /* flag to choose material or property */
- short pad2;
-} bCollisionSensor;
-
-typedef struct bRadarSensor {
- char name[64]; /* MAX_NAME */
- float angle;
- float range;
- short flag, axis;
-} bRadarSensor;
-
-typedef struct bRandomSensor {
- char name[64]; /* MAX_NAME */
- int seed;
- int delay;
-} bRandomSensor;
-
-typedef struct bRaySensor {
- char name[64]; /* MAX_NAME */
- float range;
- char propname[64];
- char matname[64];
- //struct Material *ma; // XXX remove materialName
- short mode;
- short pad1;
- int axisflag;
-} bRaySensor;
-
-typedef struct bArmatureSensor {
- char posechannel[64]; /* MAX_NAME */
- char constraint[64]; /* MAX_NAME */
- int type;
- float value;
-} bArmatureSensor;
-
-typedef struct bMessageSensor {
- /**
- * (Possible future use) pointer to a single sender object
- */
- struct Object *fromObject;
-
- /**
- * Can be used to filter on subjects like this
- */
- char subject[64];
-
- /**
- * (Possible future use) body to filter on
- */
- char body[64];
-} bMessageSensor;
-
-typedef struct bSensor {
- struct bSensor *next, *prev;
- /* pulse and freq are the bool toggle and frame count for pulse mode */
- short type, otype, flag, pulse;
- short freq, totlinks, pad1, pad2; /* freq makes reference to skipped ticks between 2 active pulses */
- char name[64]; /* MAX_NAME */
- void *data;
-
- struct bController **links;
-
- struct Object *ob;
-
- /* just add here, to avoid align errors... */
- short invert; /* Whether or not to invert the output. */
- short level; /* Whether the sensor is level base (edge by default) */
- short tap;
- short pad;
-} bSensor;
-
-typedef struct bJoystickSensor {
- char name[64]; /* MAX_NAME */
- char type;
- char joyindex;
- short flag;
- short axis;
- short axis_single;
- int axisf;
- int button;
- int hat;
- int hatf;
- int precision;
-} bJoystickSensor;
-
-/* bMouseSensor->type: uses blender event defines */
-
-/* bMouseSensor->flag: only pulse for now */
-#define SENS_MOUSE_FOCUS_PULSE 1
-
-/* propertysensor->type */
-#define SENS_PROP_EQUAL 0
-#define SENS_PROP_NEQUAL 1
-#define SENS_PROP_INTERVAL 2
-#define SENS_PROP_CHANGED 3
-#define SENS_PROP_EXPRESSION 4
-#define SENS_PROP_LESSTHAN 5
-#define SENS_PROP_GREATERTHAN 6
-
-/* raysensor->axisflag */
-/* flip x and y to make y default!!! */
-#define SENS_RAY_X_AXIS 1
-#define SENS_RAY_Y_AXIS 0
-#define SENS_RAY_Z_AXIS 2
-#define SENS_RAY_NEG_X_AXIS 3
-#define SENS_RAY_NEG_Y_AXIS 4
-#define SENS_RAY_NEG_Z_AXIS 5
-//#define SENS_RAY_NEGATIVE_AXIS 1
-
-/* bRadarSensor->axis */
-#define SENS_RADAR_X_AXIS 0
-#define SENS_RADAR_Y_AXIS 1
-#define SENS_RADAR_Z_AXIS 2
-#define SENS_RADAR_NEG_X_AXIS 3
-#define SENS_RADAR_NEG_Y_AXIS 4
-#define SENS_RADAR_NEG_Z_AXIS 5
-
-/* bMessageSensor->type */
-#define SENS_MESG_MESG 0
-#define SENS_MESG_PROP 1
-
-/* bArmatureSensor->type */
-#define SENS_ARM_STATE_CHANGED 0
-#define SENS_ARM_LIN_ERROR_BELOW 1
-#define SENS_ARM_LIN_ERROR_ABOVE 2
-#define SENS_ARM_ROT_ERROR_BELOW 3
-#define SENS_ARM_ROT_ERROR_ABOVE 4
-/* update this when adding new type */
-#define SENS_ARM_MAXTYPE 4
-
-/* sensor->type */
-#define SENS_ALWAYS 0
-#define SENS_TOUCH 1 /* DEPRECATED */
-#define SENS_NEAR 2
-#define SENS_KEYBOARD 3
-#define SENS_PROPERTY 4
-#define SENS_MOUSE 5
-#define SENS_COLLISION 6
-#define SENS_RADAR 7
-#define SENS_RANDOM 8
-#define SENS_RAY 9
-#define SENS_MESSAGE 10
-#define SENS_JOYSTICK 11
-#define SENS_ACTUATOR 12
-#define SENS_DELAY 13
-#define SENS_ARMATURE 14
-/* sensor->flag */
-#define SENS_SHOW 1
-#define SENS_DEL 2
-#define SENS_NEW 4
-#define SENS_NOT 8
-#define SENS_VISIBLE 16
-#define SENS_PIN 32
-#define SENS_DEACTIVATE 64
-
-/* sensor->pulse */
-#define SENS_PULSE_CONT 0
-#define SENS_PULSE_REPEAT 1
-//#define SENS_PULSE_ONCE 2
-#define SENS_NEG_PULSE_MODE 4
-
-/* sensor->suppress */
-#define SENS_SUPPRESS_POSITIVE (1 << 0)
-#define SENS_SUPPRESS_NEGATIVE (1 << 1)
-
-/* collision, ray sensor modes: */
-/* A little bit fake: when property is active, the first bit is
- * reset. Bite me :) So we don't actually use it, so we comment it out
- * ... The reason for this is that we need to be backward compatible,
- * and have a proper default value for this thing.
- * */
-#define SENS_COLLISION_PROPERTY 0
-#define SENS_COLLISION_MATERIAL 1
-#define SENS_COLLISION_PULSE 2
-
-/* ray specific mode */
-/* X-Ray means that the ray will traverse objects that don't have the property/material */
-#define SENS_RAY_PROPERTY 0
-#define SENS_RAY_MATERIAL 1
-#define SENS_RAY_XRAY 2
-
-/* Some stuff for the mouse sensor Type: */
-#define BL_SENS_MOUSE_LEFT_BUTTON 1
-#define BL_SENS_MOUSE_MIDDLE_BUTTON 2
-#define BL_SENS_MOUSE_RIGHT_BUTTON 4
-#define BL_SENS_MOUSE_WHEEL_UP 5
-#define BL_SENS_MOUSE_WHEEL_DOWN 6
-#define BL_SENS_MOUSE_MOVEMENT 8
-#define BL_SENS_MOUSE_MOUSEOVER 16
-#define BL_SENS_MOUSE_MOUSEOVER_ANY 32
-
-/* Joystick sensor - sorted by axis types */
-#define SENS_JOY_ANY_EVENT 1
-
-#define SENS_JOY_BUTTON 0 /* axis type */
-
-#define SENS_JOY_AXIS 1 /* axis type */
-#define SENS_JOY_X_AXIS 0
-#define SENS_JOY_Y_AXIS 1
-#define SENS_JOY_NEG_X_AXIS 2
-#define SENS_JOY_NEG_Y_AXIS 3
-#define SENS_JOY_PRECISION 4
-
-#define SENS_JOY_HAT 2 /* axis type */
-#define SENS_JOY_HAT_DIR 0
-#define SENS_JOY_HAT_UP 1
-#define SENS_JOY_HAT_RIGHT 2
-#define SENS_JOY_HAT_DOWN 4
-#define SENS_JOY_HAT_LEFT 8
-
-#define SENS_JOY_HAT_UP_RIGHT SENS_JOY_HAT_UP | SENS_JOY_HAT_RIGHT
-#define SENS_JOY_HAT_DOWN_RIGHT SENS_JOY_HAT_DOWN | SENS_JOY_HAT_RIGHT
-#define SENS_JOY_HAT_UP_LEFT SENS_JOY_HAT_UP | SENS_JOY_HAT_LEFT
-#define SENS_JOY_HAT_DOWN_LEFT SENS_JOY_HAT_DOWN | SENS_JOY_HAT_LEFT
-
-
-#define SENS_JOY_AXIS_SINGLE 3 /* axis type */
-
-
-#define SENS_DELAY_REPEAT 1
-// should match JOYINDEX_MAX in SCA_JoystickDefines.h */
-#define SENS_JOY_MAXINDEX 8
-
-#endif /* __DNA_SENSOR_TYPES_H__ */
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..7c138f21887
--- /dev/null
+++ b/source/blender/makesdna/DNA_shader_fx_types.h
@@ -0,0 +1,244 @@
+/*
+ * ***** 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,
+ eShaderFxType_Shadow = 9,
+ eShaderFxType_Glow = 10,
+ 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 GlowShaderFxData {
+ ShaderFxData shaderfx;
+ float glow_color[3];
+ float select_color[3];
+ float threshold;
+ int flag; /* flags */
+ int mode;
+ int blur[2];
+ int samples;
+ ShaderFxData_Runtime runtime;
+} GlowShaderFxData;
+
+typedef enum GlowShaderFxModes {
+ eShaderFxGlowMode_Luminance = 0,
+ eShaderFxGlowMode_Color = 1,
+} GlowShaderFxModes;
+
+typedef enum eGlowShaderFx_Flag {
+ FX_GLOW_USE_ALPHA = (1 << 0),
+} eGlowShaderFx_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 ShadowShaderFxData {
+ ShaderFxData shaderfx;
+ struct Object *object;
+ int offset[2];
+ int flag; /* flags */
+ float shadow_rgba[4];
+ float amplitude;
+ float period;
+ float phase;
+ int orientation;
+ float scale[2];
+ float rotation;
+ int blur[2];
+ int samples;
+ char pad[4];
+ ShaderFxData_Runtime runtime;
+} ShadowShaderFxData;
+
+typedef enum eShadowShaderFx_Flag {
+ FX_SHADOW_USE_OBJECT = (1 << 0),
+ FX_SHADOW_USE_WAVE = (1 << 1),
+} eShadowShaderFx_Flag;
+
+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 ee7e080f39b..b8ac0de0090 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -129,14 +129,20 @@ typedef struct SmokeDomainSettings {
struct SmokeModifierData *smd; /* for fast RNA access */
struct FLUID_3D *fluid;
void *fluid_mutex;
- struct Group *fluid_group;
- struct Group *eff_group; // UNUSED
- struct Group *coll_group; // collision objects group
+ struct Collection *fluid_group;
+ struct Collection *eff_group; // UNUSED
+ struct Collection *coll_group; // collision objects group
struct WTURBULENCE *wt; // WTURBULENCE object, if active
struct GPUTexture *tex;
struct GPUTexture *tex_wt;
struct GPUTexture *tex_shadow;
struct GPUTexture *tex_flame;
+ struct GPUTexture *tex_flame_coba;
+ struct GPUTexture *tex_coba;
+ struct GPUTexture *tex_field;
+ struct GPUTexture *tex_velocity_x;
+ struct GPUTexture *tex_velocity_y;
+ struct GPUTexture *tex_velocity_z;
float *shadow;
/* simulation data */
@@ -247,7 +253,7 @@ typedef struct SmokeDomainSettings {
typedef struct SmokeFlowSettings {
struct SmokeModifierData *smd; /* for fast RNA access */
- struct DerivedMesh *dm;
+ struct Mesh *mesh;
struct ParticleSystem *psys;
struct Tex *noise_texture;
@@ -287,7 +293,7 @@ typedef struct SmokeFlowSettings {
/* collision objects (filled with smoke) */
typedef struct SmokeCollSettings {
struct SmokeModifierData *smd; /* for fast RNA access */
- struct DerivedMesh *dm;
+ struct Mesh *mesh;
float *verts_old;
int numverts;
short type; // static = 0, rigid = 1, dynamic = 2
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index e94364e8a65..5f91c8a07cb 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -67,6 +67,11 @@ struct MovieClipScopes;
struct Mask;
struct BLI_mempool;
+/* TODO 2.8: We don't write the global areas to files currently. Uncomment
+ * define to enable writing (should become the default in a bit). */
+//#define WITH_GLOBAL_AREA_WRITING
+
+
/* -------------------------------------------------------------------- */
/** \name SpaceLink (Base)
* \{ */
@@ -129,12 +134,14 @@ typedef struct SpaceButs {
View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
+ /* For different kinds of property editors (exposed in the space type selector). */
+ short space_subtype;
+
short mainb, mainbo, mainbuser; /* context tabs */
- short re_align, align; /* align for panels */
short preview; /* preview is signal to refresh */
- /* texture context selector (material, lamp, particles, world, other) */
- short texture_context, texture_context_prev;
- char flag, pad[7];
+ short pad[2];
+ char flag;
+ char collection_context;
void *path; /* runtime */
int pathflag, dataicon; /* runtime */
@@ -153,7 +160,7 @@ typedef struct SpaceButs {
#define CONTEXT_SHADING 3
#define CONTEXT_EDITING 4
// #define CONTEXT_SCRIPT 5
-#define CONTEXT_LOGIC 6
+// #define CONTEXT_LOGIC 6
/* SpaceButs.mainb old (deprecated) */
// #define BUTS_VIEW 0
@@ -164,7 +171,7 @@ typedef struct SpaceButs {
#define BUTS_WORLD 5
#define BUTS_RENDER 6
#define BUTS_EDIT 7
-#define BUTS_GAME 8
+// #define BUTS_GAME 8
#define BUTS_FPAINT 9
#define BUTS_RADIO 10
#define BUTS_SCRIPT 11
@@ -188,7 +195,9 @@ typedef enum eSpaceButtons_Context {
BCONTEXT_MODIFIER = 10,
BCONTEXT_CONSTRAINT = 11,
BCONTEXT_BONE_CONSTRAINT = 12,
- BCONTEXT_RENDER_LAYER = 13,
+ BCONTEXT_VIEW_LAYER = 13,
+ BCONTEXT_TOOL = 14,
+ BCONTEXT_SHADERFX = 15,
/* always as last... */
BCONTEXT_TOT
@@ -204,39 +213,6 @@ typedef enum eSpaceButtons_Flag {
SB_SHADING_CONTEXT = (1 << 4),
} eSpaceButtons_Flag;
-/* SpaceButs.texture_context */
-typedef enum eSpaceButtons_Texture_Context {
- SB_TEXC_MATERIAL = 0,
- SB_TEXC_WORLD = 1,
- SB_TEXC_LAMP = 2,
- SB_TEXC_PARTICLES = 3,
- SB_TEXC_OTHER = 4,
- SB_TEXC_LINESTYLE = 5,
-} eSpaceButtons_Texture_Context;
-
-/* SpaceButs.align */
-typedef enum eSpaceButtons_Align {
- BUT_FREE = 0,
- BUT_HORIZONTAL = 1,
- BUT_VERTICAL = 2,
- BUT_AUTO = 3,
-} eSpaceButtons_Align;
-
-/* SpaceButs.scaflag */
-#define BUTS_SENS_SEL 1
-#define BUTS_SENS_ACT 2
-#define BUTS_SENS_LINK 4
-#define BUTS_CONT_SEL 8
-#define BUTS_CONT_ACT 16
-#define BUTS_CONT_LINK 32
-#define BUTS_ACT_SEL 64
-#define BUTS_ACT_ACT 128
-#define BUTS_ACT_LINK 256
-#define BUTS_SENS_STATE 512
-#define BUTS_ACT_STATE 1024
-#define BUTS_CONT_INIT_STATE 2048
-
-
/** \} */
/* -------------------------------------------------------------------- */
@@ -269,6 +245,10 @@ typedef struct SpaceOops {
struct TreeStoreElem search_tse;
short flag, outlinevis, storeflag, search_flags;
+ int filter;
+ char filter_state;
+ char pad;
+ short filter_id_type;
/* pointers to treestore elements, grouped by (id, type, nr) in hashtable for faster searching */
void *treehash;
@@ -284,31 +264,81 @@ typedef enum eSpaceOutliner_Flag {
SO_SKIP_SORT_ALPHA = (1 << 4),
} eSpaceOutliner_Flag;
+/* SpaceOops.filter */
+typedef enum eSpaceOutliner_Filter {
+ SO_FILTER_SEARCH = (1 << 0), /* Run-time flag. */
+ /* SO_FILTER_ENABLE = (1 << 1), */ /* Deprecated */
+ SO_FILTER_NO_OBJECT = (1 << 2),
+ SO_FILTER_NO_OB_CONTENT = (1 << 3), /* Not only mesh, but modifiers, constraints, ... */
+ SO_FILTER_NO_CHILDREN = (1 << 4),
+
+ /* SO_FILTER_OB_TYPE = (1 << 5), */ /* Deprecated */
+ SO_FILTER_NO_OB_MESH = (1 << 6),
+ SO_FILTER_NO_OB_ARMATURE = (1 << 7),
+ SO_FILTER_NO_OB_EMPTY = (1 << 8),
+ SO_FILTER_NO_OB_LAMP = (1 << 9),
+ SO_FILTER_NO_OB_CAMERA = (1 << 10),
+ SO_FILTER_NO_OB_OTHERS = (1 << 11),
+
+ /* SO_FILTER_OB_STATE = (1 << 12), */ /* Deprecated */
+ SO_FILTER_OB_STATE_VISIBLE = (1 << 13), /* Not set via DNA. */
+ SO_FILTER_OB_STATE_SELECTED = (1 << 14), /* Not set via DNA. */
+ SO_FILTER_OB_STATE_ACTIVE = (1 << 15), /* Not set via DNA. */
+ SO_FILTER_NO_COLLECTION = (1 << 16),
+
+ SO_FILTER_ID_TYPE = (1 << 17),
+} eSpaceOutliner_Filter;
+
+#define SO_FILTER_OB_TYPE (SO_FILTER_NO_OB_MESH | \
+ SO_FILTER_NO_OB_ARMATURE | \
+ SO_FILTER_NO_OB_EMPTY | \
+ SO_FILTER_NO_OB_LAMP | \
+ SO_FILTER_NO_OB_CAMERA | \
+ SO_FILTER_NO_OB_OTHERS)
+
+#define SO_FILTER_OB_STATE (SO_FILTER_OB_STATE_VISIBLE | \
+ SO_FILTER_OB_STATE_SELECTED | \
+ SO_FILTER_OB_STATE_ACTIVE)
+
+#define SO_FILTER_ANY (SO_FILTER_NO_OB_CONTENT | \
+ SO_FILTER_NO_CHILDREN | \
+ SO_FILTER_OB_TYPE | \
+ SO_FILTER_OB_STATE | \
+ SO_FILTER_NO_COLLECTION)
+
+/* SpaceOops.filter_state */
+typedef enum eSpaceOutliner_StateFilter {
+ SO_FILTER_OB_ALL = 0,
+ SO_FILTER_OB_VISIBLE = 1,
+ SO_FILTER_OB_SELECTED = 2,
+ SO_FILTER_OB_ACTIVE = 3,
+} eSpaceOutliner_StateFilter;
+
/* SpaceOops.outlinevis */
typedef enum eSpaceOutliner_Mode {
- SO_ALL_SCENES = 0,
- SO_CUR_SCENE = 1,
- SO_VISIBLE = 2,
- SO_SELECTED = 3,
- SO_ACTIVE = 4,
- SO_SAME_TYPE = 5,
- SO_GROUPS = 6,
- SO_LIBRARIES = 7,
- /* SO_VERSE_SESSION = 8, */ /* deprecated! */
- /* SO_VERSE_MS = 9, */ /* deprecated! */
- SO_SEQUENCE = 10,
- SO_DATABLOCKS = 11,
- SO_USERDEF = 12,
- /* SO_KEYMAP = 13, */ /* deprecated! */
- SO_ID_ORPHANS = 14,
+ SO_SCENES = 0,
+ /* SO_CUR_SCENE = 1, */ /* deprecated! */
+ /* SO_VISIBLE = 2, */ /* deprecated! */
+ /* SO_SELECTED = 3, */ /* deprecated! */
+ /* SO_ACTIVE = 4, */ /* deprecated! */
+ /* SO_SAME_TYPE = 5, */ /* deprecated! */
+ /* SO_GROUPS = 6, */ /* deprecated! */
+ SO_LIBRARIES = 7,
+ /* SO_VERSE_SESSION = 8, */ /* deprecated! */
+ /* SO_VERSE_MS = 9, */ /* deprecated! */
+ SO_SEQUENCE = 10,
+ SO_DATA_API = 11,
+ /* SO_USERDEF = 12, */ /* deprecated! */
+ /* SO_KEYMAP = 13, */ /* deprecated! */
+ SO_ID_ORPHANS = 14,
+ SO_VIEW_LAYER = 15,
} eSpaceOutliner_Mode;
/* SpaceOops.storeflag */
typedef enum eSpaceOutliner_StoreFlag {
/* cleanup tree */
SO_TREESTORE_CLEANUP = (1 << 0),
- /* if set, it allows redraws. gets set for some allqueue events */
- SO_TREESTORE_REDRAW = (1 << 1),
+ /* SO_TREESTORE_REDRAW = (1 << 1), */ /* Deprecated */
/* rebuild the tree, similar to cleanup,
* but defer a call to BKE_outliner_treehash_rebuild_from_treestore instead */
SO_TREESTORE_REBUILD = (1 << 2),
@@ -443,43 +473,6 @@ typedef enum eSpaceNla_Flag {
/** \name Timeline
* \{ */
-/* Pointcache drawing data */
-# /* Only store the data array in the cache to avoid constant reallocation. */
-# /* No need to store when saved. */
-typedef struct SpaceTimeCache {
- struct SpaceTimeCache *next, *prev;
- float *array;
-} SpaceTimeCache;
-
-/* Timeline View */
-typedef struct SpaceTime {
- SpaceLink *next, *prev;
- ListBase regionbase; /* storage of regions for inactive spaces */
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
-
- View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
-
- ListBase caches;
-
- int cache_display;
- int flag;
-} SpaceTime;
-
-
-/* SpaceTime.flag */
-typedef enum eTimeline_Flag {
- /* show timing in frames instead of in seconds */
- TIME_DRAWFRAMES = (1 << 0),
- /* show time indicator box beside the frame number */
- TIME_CFRA_NUM = (1 << 1),
- /* only keyframes from active/selected channels get shown */
- TIME_ONLYACTSEL = (1 << 2),
-} eTimeline_Flag;
-
/* SpaceTime.redraws (now bScreen.redraws_flag) */
typedef enum eScreen_Redraws_Flag {
TIME_REGION = (1 << 0),
@@ -496,17 +489,6 @@ typedef enum eScreen_Redraws_Flag {
TIME_FOLLOW = (1 << 15),
} eScreen_Redraws_Flag;
-/* SpaceTime.cache */
-typedef enum eTimeline_Cache_Flag {
- TIME_CACHE_DISPLAY = (1 << 0),
- TIME_CACHE_SOFTBODY = (1 << 1),
- TIME_CACHE_PARTICLES = (1 << 2),
- TIME_CACHE_CLOTH = (1 << 3),
- TIME_CACHE_SMOKE = (1 << 4),
- TIME_CACHE_DYNAMICPAINT = (1 << 5),
- TIME_CACHE_RIGIDBODY = (1 << 6),
-} eTimeline_Cache_Flag;
-
/** \} */
/* -------------------------------------------------------------------- */
@@ -693,17 +675,6 @@ typedef struct SpaceFile {
short systemnr, system_bookmarknr;
} SpaceFile;
-/* FSMenuEntry's without paths indicate separators */
-typedef struct FSMenuEntry {
- struct FSMenuEntry *next;
-
- char *path;
- char name[256]; /* FILE_MAXFILE */
- short save;
- short valid;
- short pad[2];
-} FSMenuEntry;
-
/* FileSelectParams.display */
enum eFileDisplayType {
FILE_DEFAULTDISPLAY = 0,
@@ -753,7 +724,7 @@ typedef enum eFileSel_Params_Flag {
FILE_LINK = (1 << 2),
FILE_HIDE_DOT = (1 << 3),
FILE_AUTOSELECT = (1 << 4),
- FILE_ACTIVELAY = (1 << 5),
+ FILE_ACTIVE_COLLECTION = (1 << 5),
/* FILE_ATCURSOR = (1 << 6), */ /* deprecated */
FILE_DIRSEL_ONLY = (1 << 7),
FILE_FILTER = (1 << 8),
@@ -946,8 +917,7 @@ typedef struct SpaceImage {
char dt_uvstretch;
char around;
- /* Filter settings when editor shows other object's UVs. */
- int other_uv_filter;
+ int pad2;
int flag;
@@ -973,7 +943,8 @@ typedef enum eSpaceImage_UVDT_Stretch {
typedef enum eSpaceImage_Mode {
SI_MODE_VIEW = 0,
SI_MODE_PAINT = 1,
- SI_MODE_MASK = 2 /* note: mesh edit mode overrides mask */
+ SI_MODE_MASK = 2,
+ SI_MODE_UV = 3,
} eSpaceImage_Mode;
/* SpaceImage.sticky
@@ -988,7 +959,7 @@ typedef enum eSpaceImage_Sticky {
/* SpaceImage.flag */
typedef enum eSpaceImage_Flag {
/* SI_BE_SQUARE = (1 << 0), */ /* deprecated */
- SI_EDITTILE = (1 << 1), /* XXX - not used but should be? */
+/* SI_EDITTILE = (1 << 1), */ /* deprecated */
SI_CLIP_UV = (1 << 2),
/* SI_DRAWTOOL = (1 << 3), */ /* deprecated */
SI_NO_DRAWFACES = (1 << 4),
@@ -1017,7 +988,7 @@ typedef enum eSpaceImage_Flag {
SI_SMOOTH_UV = (1 << 20),
SI_DRAW_STRETCH = (1 << 21),
SI_SHOW_GPENCIL = (1 << 22),
- SI_DRAW_OTHER = (1 << 23),
+/* SI_DEPRECATED6 = (1 << 23), */ /* deprecated */
SI_COLOR_CORRECTION = (1 << 24),
@@ -1027,6 +998,8 @@ typedef enum eSpaceImage_Flag {
SI_SHOW_R = (1 << 27),
SI_SHOW_G = (1 << 28),
SI_SHOW_B = (1 << 29),
+
+ SI_NO_DRAWEDGES = (1 << 30),
} eSpaceImage_Flag;
/* SpaceImage.other_uv_filter */
@@ -1217,14 +1190,14 @@ typedef enum eSpaceNode_Flag {
SNODE_AUTO_RENDER = (1 << 5),
// SNODE_SHOW_HIGHLIGHT = (1 << 6), DNA_DEPRECATED
// SNODE_USE_HIDDEN_PREVIEW = (1 << 10), DNA_DEPRECATED December2013
- SNODE_NEW_SHADERS = (1 << 11),
+// SNODE_NEW_SHADERS = (1 << 11), DNA_DEPRECATED
SNODE_PIN = (1 << 12),
SNODE_SKIP_INSOFFSET = (1 << 13), /* automatically offset following nodes in a chain on insertion */
} eSpaceNode_Flag;
/* SpaceNode.texfrom */
typedef enum eSpaceNode_TexFrom {
- SNODE_TEX_OBJECT = 0,
+ /* SNODE_TEX_OBJECT = 0, */
SNODE_TEX_WORLD = 1,
SNODE_TEX_BRUSH = 2,
SNODE_TEX_LINESTYLE = 3,
@@ -1246,27 +1219,6 @@ enum {
/** \} */
/* -------------------------------------------------------------------- */
-/** \name Game Logic Editor
- * \{ */
-
-/* Logic Editor */
-typedef struct SpaceLogic {
- SpaceLink *next, *prev;
- ListBase regionbase; /* storage of regions for inactive spaces */
- char spacetype;
- char link_flag;
- char _pad0[6];
- /* End 'SpaceLink' header. */
-
- short flag, scaflag;
- int pad;
-
- struct bGPdata *gpd; /* grease-pencil data */
-} SpaceLogic;
-
-/** \} */
-
-/* -------------------------------------------------------------------- */
/** \name Console
* \{ */
@@ -1396,7 +1348,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),
@@ -1430,6 +1382,45 @@ typedef enum eSpaceClip_GPencil_Source {
SC_GPENCIL_SRC_TRACK = 1,
} eSpaceClip_GPencil_Source;
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Top Bar
+ * \{ */
+
+/* These two lines with # tell makesdna this struct can be excluded.
+ * Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
+#
+#
+typedef struct SpaceTopBar {
+ SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+} SpaceTopBar;
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Status Bar
+ * \{ */
+
+/* These two lines with # tell makesdna this struct can be excluded.
+ * Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
+#
+#
+typedef struct SpaceStatusBar {
+ SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
+ char spacetype;
+ char link_flag;
+ char _pad0[6];
+ /* End 'SpaceLink' header. */
+} SpaceStatusBar;
+
/** \} */
/* -------------------------------------------------------------------- */
@@ -1457,14 +1448,16 @@ typedef enum eSpace_Type {
SPACE_NLA = 13,
/* TODO: fully deprecate */
SPACE_SCRIPT = 14, /* Deprecated */
- SPACE_TIME = 15,
+ SPACE_TIME = 15, /* Deprecated */
SPACE_NODE = 16,
- SPACE_LOGIC = 17,
+ SPACE_LOGIC = 17, /* deprecated */
SPACE_CONSOLE = 18,
SPACE_USERPREF = 19,
SPACE_CLIP = 20,
+ SPACE_TOPBAR = 21,
+ SPACE_STATUSBAR = 22,
- SPACE_TYPE_LAST = SPACE_CLIP
+ SPACE_TYPE_LAST = SPACE_STATUSBAR
} eSpace_Type;
/* use for function args */
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index 3972cbd2a0e..42198e22c6b 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -45,13 +45,11 @@ extern "C" {
struct AnimData;
struct Ipo;
struct ColorBand;
-struct EnvMap;
struct Object;
struct Tex;
struct Image;
struct PreviewImage;
struct ImBuf;
-struct Ocean;
struct CurveMapping;
typedef struct MTex {
@@ -121,21 +119,6 @@ typedef struct ColorBand {
CBData data[32];
} ColorBand;
-typedef struct EnvMap {
- struct Object *object;
- struct Image *ima; /* type ENV_LOAD */
- struct ImBuf *cube[6]; /* these images are dynamic, not part of the main struct */
- float imat[4][4];
- float obimat[3][3];
- short type, stype;
- float clipsta, clipend;
- float viewscale; /* viewscale is for planar envmaps to zoom in or out */
- unsigned int notlay;
- short cuberes, depth;
- int ok, lastframe;
- short recalc, lastsize;
-} EnvMap;
-
typedef struct PointDensity {
short flag;
@@ -172,38 +155,6 @@ typedef struct PointDensity {
struct CurveMapping *falloff_curve; /* falloff density curve */
} PointDensity;
-typedef struct VoxelData {
- int resol[3];
- int interp_type;
- short file_format;
- short flag;
- short extend;
- short smoked_type;
- short hair_type;
- short data_type;
- int _pad;
-
- struct Object *object; /* for rendering smoke sims */
- float int_multiplier;
- int still_frame;
- char source_path[1024]; /* 1024 = FILE_MAX */
-
- /* temporary data */
- float *dataset;
- int cachedframe;
- int ok;
-
-} VoxelData;
-
-typedef struct OceanTex {
- struct Object *object;
- char oceanmod[64];
-
- int output;
- int pad;
-
-} OceanTex;
-
typedef struct Tex {
ID id;
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
@@ -241,7 +192,7 @@ typedef struct Tex {
short extend;
/* variables disabled, moved to struct iuser */
- short fie_ima;
+ short _pad0;
int len;
int frames, offset, sfra;
@@ -254,11 +205,7 @@ typedef struct Tex {
struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
struct Image *ima;
struct ColorBand *coba;
- struct EnvMap *env;
struct PreviewImage *preview;
- struct PointDensity *pd;
- struct VoxelData *vd;
- struct OceanTex *ot;
char use_nodes;
char pad[7];
@@ -316,13 +263,13 @@ typedef struct ColorMapping {
#define TEX_NOISE 7
#define TEX_IMAGE 8
//#define TEX_PLUGIN 9 /* Deprecated */
-#define TEX_ENVMAP 10
+//#define TEX_ENVMAP 10 /* Deprecated */
#define TEX_MUSGRAVE 11
#define TEX_VORONOI 12
#define TEX_DISTNOISE 13
-#define TEX_POINTDENSITY 14
-#define TEX_VOXELDATA 15
-#define TEX_OCEAN 16
+//#define TEX_POINTDENSITY 14 /* Deprecated */
+//#define TEX_VOXELDATA 15 /* Deprecated */
+//#define TEX_OCEAN 16 /* Deprecated */
/* musgrave stype */
#define TEX_MFRACTAL 0
@@ -372,7 +319,7 @@ typedef struct ColorMapping {
/* imaflag unused, only for version check */
#ifdef DNA_DEPRECATED_ALLOW
-#define TEX_FIELDS_ 8
+// #define TEX_FIELDS_ 8
#define TEX_ANIMCYCLIC_ 64
#define TEX_ANIM5_ 128
#define TEX_ANTIALI_ 256
@@ -549,22 +496,6 @@ enum {
COLBAND_HUE_CCW = 3,
};
-/* **************** EnvMap ********************* */
-
-/* type */
-#define ENV_CUBE 0
-#define ENV_PLANE 1
-#define ENV_SPHERE 2
-
-/* stype */
-#define ENV_STATIC 0
-#define ENV_ANIM 1
-#define ENV_LOAD 2
-
-/* ok */
-#define ENV_NORMAL 1
-#define ENV_OSA 2
-
/* **************** PointDensity ********************* */
/* source */
@@ -592,9 +523,9 @@ enum {
/* noise_influence */
#define TEX_PD_NOISE_STATIC 0
-#define TEX_PD_NOISE_VEL 1
-#define TEX_PD_NOISE_AGE 2
-#define TEX_PD_NOISE_TIME 3
+/* #define TEX_PD_NOISE_VEL 1 */ /* Deprecated */
+/* #define TEX_PD_NOISE_AGE 2 */ /* Deprecated */
+/* #define TEX_PD_NOISE_TIME 3 */ /* Deprecated */
/* color_source */
enum {
@@ -613,55 +544,6 @@ enum {
#define POINT_DATA_LIFE 2
#define POINT_DATA_COLOR 4
-/******************** Voxel Data *****************************/
-/* flag */
-#define TEX_VD_STILL 1
-
-/* interpolation */
-#define TEX_VD_NEARESTNEIGHBOR 0
-#define TEX_VD_LINEAR 1
-#define TEX_VD_QUADRATIC 2
-#define TEX_VD_TRICUBIC_CATROM 3
-#define TEX_VD_TRICUBIC_BSPLINE 4
-#define TEX_VD_TRICUBIC_SLOW 5
-
-/* file format */
-#define TEX_VD_BLENDERVOXEL 0
-#define TEX_VD_RAW_8BIT 1
-#define TEX_VD_RAW_16BIT 2
-#define TEX_VD_IMAGE_SEQUENCE 3
-#define TEX_VD_SMOKE 4
-#define TEX_VD_HAIR 5
-/* for voxels which use VoxelData->source_path */
-#define TEX_VD_IS_SOURCE_PATH(_format) (ELEM(_format, TEX_VD_BLENDERVOXEL, TEX_VD_RAW_8BIT, TEX_VD_RAW_16BIT))
-
-/* smoke data types */
-#define TEX_VD_SMOKEDENSITY 0
-#define TEX_VD_SMOKEHEAT 1
-#define TEX_VD_SMOKEVEL 2
-#define TEX_VD_SMOKEFLAME 3
-
-#define TEX_VD_HAIRDENSITY 0
-#define TEX_VD_HAIRVELOCITY 1
-#define TEX_VD_HAIRENERGY 2
-#define TEX_VD_HAIRRESTDENSITY 3
-
-/* data_type */
-#define TEX_VD_INTENSITY 0
-#define TEX_VD_RGBA_PREMUL 1
-
-/******************** Ocean *****************************/
-/* output */
-#define TEX_OCN_DISPLACEMENT 1
-#define TEX_OCN_FOAM 2
-#define TEX_OCN_JPLUS 3
-#define TEX_OCN_EMINUS 4
-#define TEX_OCN_EPLUS 5
-
-/* flag */
-#define TEX_OCN_GENERATE_NORMALS 1
-#define TEX_OCN_XZ 2
-
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index aea5f0fd87b..3fd6fff932b 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -48,6 +48,11 @@ struct ColorBand;
#define MAX_STYLE_NAME 64
+#define GPU_VIEWPORT_QUALITY_FXAA 0.10f
+#define GPU_VIEWPORT_QUALITY_TAA8 0.25f
+#define GPU_VIEWPORT_QUALITY_TAA16 0.6f
+#define GPU_VIEWPORT_QUALITY_TAA32 0.8f
+
/* default offered by Blender.
* uiFont.uifont_id */
typedef enum eUIFont_ID {
@@ -128,9 +133,10 @@ typedef struct uiWidgetColors {
char item[4];
char text[4];
char text_sel[4];
- short shaded;
+ char shaded;
+ char _pad0[7];
short shadetop, shadedown;
- char _pad0[2];
+ float roundness;
} uiWidgetColors;
typedef struct uiWidgetStateColors {
@@ -140,15 +146,16 @@ typedef struct uiWidgetStateColors {
char inner_key_sel[4];
char inner_driven[4];
char inner_driven_sel[4];
+ char inner_overridden[4];
+ char inner_overridden_sel[4];
float blend, pad;
} uiWidgetStateColors;
typedef struct uiPanelColors {
char header[4];
char back[4];
- short show_header;
- short show_back;
- int pad;
+ char sub_back[4];
+ char pad2[4];
} uiPanelColors;
typedef struct uiGradientColors {
@@ -160,9 +167,9 @@ typedef struct uiGradientColors {
typedef struct ThemeUI {
/* Interface Elements (buttons, menus, icons) */
- uiWidgetColors wcol_regular, wcol_tool, wcol_text;
+ uiWidgetColors wcol_regular, wcol_tool, wcol_toolbar_item, wcol_text;
uiWidgetColors wcol_radio, wcol_option, wcol_toggle;
- uiWidgetColors wcol_num, wcol_numslider;
+ uiWidgetColors wcol_num, wcol_numslider, wcol_tab;
uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item, wcol_tooltip;
uiWidgetColors wcol_box, wcol_scroll, wcol_progress, wcol_list_item, wcol_pie_menu;
@@ -176,13 +183,30 @@ typedef struct ThemeUI {
float menu_shadow_fac;
short menu_shadow_width;
- short pad[3];
+ char editor_outline[4];
+ short pad[1];
char iconfile[256]; // FILE_MAXFILE length
float icon_alpha;
+ float icon_saturation;
+ char _pad[4];
/* Axis Colors */
char xaxis[4], yaxis[4], zaxis[4];
+
+ /* Gizmo Colors. */
+ char gizmo_hi[4];
+ char gizmo_primary[4];
+ char gizmo_secondary[4];
+ char gizmo_a[4];
+ char gizmo_b[4];
+
+ /* Icon Colors. */
+ char icon_collection[4]; /* Collection items */
+ char icon_object[4]; /* Object items */
+ char icon_object_data[4]; /* Object data items */
+ char icon_modifier[4]; /* Modifier and constraint items */
+ char icon_shading[4]; /* Shading related items */
} ThemeUI;
/* try to put them all in one, if needed a special struct can be created as well
@@ -263,8 +287,8 @@ typedef struct ThemeSpace {
char handle_sel_free[4], handle_sel_auto[4], handle_sel_vect[4], handle_sel_align[4], handle_sel_auto_clamped[4];
char ds_channel[4], ds_subchannel[4]; /* dopesheet */
- char keytype_keyframe[4], keytype_extreme[4], keytype_breakdown[4], keytype_jitter[4]; /* keytypes */
- char keytype_keyframe_select[4], keytype_extreme_select[4], keytype_breakdown_select[4], keytype_jitter_select[4]; /* keytypes */
+ char keytype_keyframe[4], keytype_extreme[4], keytype_breakdown[4], keytype_jitter[4], keytype_movehold[4]; /* keytypes */
+ char keytype_keyframe_select[4], keytype_extreme_select[4], keytype_breakdown_select[4], keytype_jitter_select[4], keytype_movehold_select[4]; /* keytypes */
char keyborder[4], keyborder_select[4];
char console_output[4], console_input[4], console_info[4], console_error[4];
@@ -326,6 +350,8 @@ typedef struct ThemeSpace {
/* NLA */
char anim_active[4]; /* Active Action + Summary Channel */
char anim_non_active[4]; /* Active Action = NULL */
+ char anim_preview_range[4]; /* Preview range overlay */
+ char anim_pad[4];
char nla_tweaking[4]; /* NLA 'Tweaking' action/strip */
char nla_tweakdupli[4]; /* NLA - warning color for duplicate instances of tweaking strip */
@@ -387,10 +413,11 @@ typedef struct bTheme {
ThemeSpace toops;
ThemeSpace ttime;
ThemeSpace tnode;
- ThemeSpace tlogic;
ThemeSpace tuserpref;
ThemeSpace tconsole;
ThemeSpace tclip;
+ ThemeSpace ttopbar;
+ ThemeSpace tstatusbar;
/* 20 sets of bone colors for this theme */
ThemeWireColor tarm[20];
@@ -414,6 +441,51 @@ typedef struct bPathCompare {
char flag, pad[7];
} bPathCompare;
+typedef struct bUserMenu {
+ struct bUserMenu *next, *prev;
+ char space_type;
+ char _pad0[7];
+ char context[64];
+ /* bUserMenuItem */
+ ListBase items;
+} bUserMenu;
+
+/* May be part of bUserMenu or other list. */
+typedef struct bUserMenuItem {
+ struct bUserMenuItem *next, *prev;
+ char ui_name[64];
+ char type;
+ char _pad0[7];
+} bUserMenuItem;
+
+typedef struct bUserMenuItem_Op {
+ bUserMenuItem item;
+ char op_idname[64];
+ struct IDProperty *prop;
+ char opcontext;
+ char _pad0[7];
+} bUserMenuItem_Op;
+
+typedef struct bUserMenuItem_Menu {
+ bUserMenuItem item;
+ char mt_idname[64];
+} bUserMenuItem_Menu;
+
+typedef struct bUserMenuItem_Prop {
+ bUserMenuItem item;
+ char context_data_path[256];
+ char prop_id[64];
+ int prop_index;
+ char _pad0[4];
+} bUserMenuItem_Prop;
+
+enum {
+ USER_MENU_TYPE_SEP = 1,
+ USER_MENU_TYPE_OPERATOR = 2,
+ USER_MENU_TYPE_MENU = 3,
+ USER_MENU_TYPE_PROP = 4,
+};
+
typedef struct SolidLight {
int flag, pad;
float col[4], spec[4], vec[4];
@@ -456,7 +528,7 @@ typedef struct UserDef {
short versions;
short dbl_click_time;
- short gameflags;
+ short pad;
short wheellinescroll;
int uiflag; /* eUserpref_UI_Flag */
int uiflag2; /* eUserpref_UI_Flag2 */
@@ -472,12 +544,16 @@ typedef struct UserDef {
int audioformat;
int audiochannels;
+ float ui_scale; /* setting for UI scale */
+ int ui_line_width; /* setting for UI line width */
+ int dpi; /* runtime, full DPI divided by pixelsize */
+ float dpi_fac; /* runtime, multiplier to scale UI elements based on DPI */
+ float pixelsize; /* runtime, line width and point size based on DPI */
+ int virtual_pixel; /* deprecated, for forward compatibility */
+
int scrollback; /* console scrollback limit */
- int dpi; /* range 48-128? */
- float ui_scale; /* interface scale */
- int ui_line_width; /* interface line width */
char node_margin; /* node insert offset (aka auto-offset) margin, but might be useful for later stuff as well */
- char pad2;
+ char pad2[5];
short transopts; /* eUserpref_Translation_Flags */
short menuthreshold1, menuthreshold2;
@@ -491,24 +567,26 @@ typedef struct UserDef {
struct ListBase user_keymaps;
struct ListBase addons;
struct ListBase autoexec_paths;
+ struct ListBase user_menus; /* bUserMenu */
+
char keyconfigstr[64];
short undosteps;
short pad1;
int undomemory;
- int pad3;
+ float gpu_viewport_quality;
short gp_manhattendist, gp_euclideandist, gp_eraser;
short gp_settings; /* eGP_UserdefSettings */
short tb_leftmouse, tb_rightmouse;
struct SolidLight light[3];
- short tw_hotspot, tw_flag, tw_handlesize, tw_size;
+ short gizmo_flag, gizmo_size;
+ short pad6[3];
short textimeout, texcollectrate;
- short wmdrawmethod; /* eWM_DrawMethod */
short dragthreshold;
int memcachelimit;
int prefetchframes;
float pad_rot_angle; /* control the rotation step of the view when PAD2, PAD4, PAD6&PAD8 is use */
- short frameserverport;
+ short _pad0;
short obcenter_dia;
short rvisize; /* rotating view icon size */
short rvibright; /* rotating view icon brightness */
@@ -521,13 +599,13 @@ typedef struct UserDef {
char keyhandles_new; /* handle types for newly added keyframes */
char gpu_select_method;
char gpu_select_pick_deph;
- char pad4;
+ char pad0;
char view_frame_type; /* eZoomFrame_Mode */
int view_frame_keyframes; /* number of keyframes to zoom around current frame */
float view_frame_seconds; /* seconds to zoom around current frame */
- char _pad0[4];
+ char _pad1[4];
short widget_unit; /* private, defaults to 20 for 72 DPI setting */
short anisotropic_filter;
@@ -556,7 +634,7 @@ typedef struct UserDef {
float gpencil_new_layer_col[4]; /* default color for newly created Grease Pencil layers */
short tweak_threshold;
- char navigation_mode, pad;
+ char navigation_mode, pad10;
char author[80]; /* author name for file formats supporting it */
@@ -567,8 +645,6 @@ typedef struct UserDef {
int compute_device_id;
float fcu_inactive_alpha; /* opacity of inactive F-Curves in F-Curve Editor */
- float pixelsize; /* private, set by GHOST, to multiply DPI with */
- int virtual_pixel; /* virtual pixelsize mode */
short pie_interaction_type; /* if keeping a pie menu spawn button pressed after this time, it turns into
* a drag/release pie menu */
@@ -582,7 +658,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 */
@@ -598,15 +676,16 @@ typedef enum eUserPref_Section {
USER_SECTION_THEME = 4,
USER_SECTION_INPUT = 5,
USER_SECTION_ADDONS = 6,
+ USER_SECTION_LIGHT = 7,
} eUserPref_Section;
/* UserDef.flag */
typedef enum eUserPref_Flag {
USER_AUTOSAVE = (1 << 0),
- USER_FLAG_DEPRECATED_1 = (1 << 1), /* cleared */
+ USER_FLAG_NUMINPUT_ADVANCED = (1 << 1),
USER_FLAG_DEPRECATED_2 = (1 << 2), /* cleared */
USER_FLAG_DEPRECATED_3 = (1 << 3), /* cleared */
- USER_SCENEGLOBAL = (1 << 4),
+/* USER_SCENEGLOBAL = (1 << 4), deprecated */
USER_TRACKBALL = (1 << 5),
USER_FLAG_DEPRECATED_6 = (1 << 6), /* cleared */
USER_FLAG_DEPRECATED_7 = (1 << 7), /* cleared */
@@ -676,12 +755,12 @@ typedef enum eUserpref_UI_Flag {
USER_MENUOPENAUTO = (1 << 9),
USER_DEPTH_CURSOR = (1 << 10),
USER_AUTOPERSP = (1 << 11),
- USER_LOCKAROUND = (1 << 12),
+ /* USER_LOCKAROUND = (1 << 12), */ /* DEPRECATED */
USER_GLOBALUNDO = (1 << 13),
USER_ORBIT_SELECTION = (1 << 14),
USER_DEPTH_NAVIGATE = (1 << 15),
USER_HIDE_DOT = (1 << 16),
- USER_SHOW_ROTVIEWICON = (1 << 17),
+ USER_SHOW_GIZMO_AXIS = (1 << 17),
USER_SHOW_VIEWPORTNAME = (1 << 18),
USER_CAM_LOCK_NO_PARENT = (1 << 19),
USER_ZOOM_TO_MOUSEPOS = (1 << 20),
@@ -775,15 +854,6 @@ typedef enum eDupli_ID_Flags {
USER_DUP_PSYS = (1 << 11)
} eDupli_ID_Flags;
-/* UserDef.gameflags */
-typedef enum eOpenGL_RenderingOptions {
- USER_GL_RENDER_DEPRECATED_0 = (1 << 0),
- USER_GL_RENDER_DEPRECATED_1 = (1 << 1),
- USER_DISABLE_MIPMAP = (1 << 2),
- USER_GL_RENDER_DEPRECATED_3 = (1 << 3),
- USER_GL_RENDER_DEPRECATED_4 = (1 << 4),
-} eOpenGL_RenderingOptions;
-
/* selection method for opengl gpu_select_method */
typedef enum eOpenGL_SelectOptions {
USER_SELECT_AUTO = 0,
@@ -791,15 +861,12 @@ typedef enum eOpenGL_SelectOptions {
USER_SELECT_USE_SELECT_RENDERMODE = 2
} eOpenGL_SelectOptions;
-/* wm draw method.
- * UserDef.wmdrawmethod */
-typedef enum eWM_DrawMethod {
- USER_DRAW_TRIPLE = 0,
- USER_DRAW_OVERLAP = 1,
- USER_DRAW_FULL = 2,
- USER_DRAW_AUTOMATIC = 3,
- USER_DRAW_OVERLAP_FLIP = 4,
-} eWM_DrawMethod;
+/* max anti alias draw method UserDef.gpu_viewport_antialias */
+typedef enum eOpenGL_AntiAliasMethod {
+ USER_AA_NONE = 0,
+ USER_AA_FXAA = 1,
+ USER_AA_TAA8 = 2,
+} eOpenGL_AntiAliasMethod;
/* text draw options
* UserDef.text_render */
@@ -816,10 +883,14 @@ typedef enum eText_Draw_Options {
/* Grease Pencil Settings.
* UserDef.gp_settings */
typedef enum eGP_UserdefSettings {
- GP_PAINT_DOSMOOTH = (1 << 0),
- GP_PAINT_DOSIMPLIFY = (1 << 1),
+ GP_PAINT_DOSMOOTH = (1 << 0),
+ GP_PAINT_DOSIMPLIFY = (1 << 1),
} eGP_UserdefSettings;
+enum {
+ USER_GIZMO_DRAW = (1 << 0),
+};
+
/* Color Picker Types.
* UserDef.color_picker_type */
typedef enum eColorPicker_Types {
@@ -899,7 +970,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_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h
index 4132e17a249..e2d8d836368 100644
--- a/source/blender/makesdna/DNA_view2d_types.h
+++ b/source/blender/makesdna/DNA_view2d_types.h
@@ -64,6 +64,10 @@ typedef struct View2D {
int tab_num; /* number of tabs stored */
int tab_cur; /* current tab */
+ /* Usually set externally (as in, not in view2d files). */
+ char alpha_vert, alpha_hor; /* alpha of vertical and horizontal scrollbars (range is [0, 255]) */
+ short pad[3];
+
/* animated smooth view */
struct SmoothView2DStore *sms;
struct wmTimer *smooth_timer;
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 1b3eef0f3ec..fca1a79c775 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -44,11 +44,12 @@ struct bGPdata;
struct SmoothView3DStore;
struct wmTimer;
struct Material;
-struct GPUFX;
+struct GPUViewport;
#include "DNA_defs.h"
#include "DNA_listBase.h"
#include "DNA_image_types.h"
+#include "DNA_object_types.h"
#include "DNA_movieclip_types.h"
#include "DNA_gpu_types.h"
@@ -61,23 +62,6 @@ struct GPUFX;
# undef far
#endif
-/* Background Picture in 3D-View */
-typedef struct BGpic {
- struct BGpic *next, *prev;
-
- struct Image *ima;
- struct ImageUser iuser;
- struct MovieClip *clip;
- struct MovieClipUser cuser;
- float xof, yof, size, blend, rotation;
- short view;
- short flag;
- short source;
- char pad[6];
-} BGpic;
-
-/* ********************************* */
-
typedef struct RegionView3D {
float winmat[4][4]; /* GL_PROJECTION matrix */
@@ -106,8 +90,13 @@ typedef struct RegionView3D {
struct wmTimer *smooth_timer;
- /* transform widget matrix */
+ /* transform gizmo matrix */
float twmat[4][4];
+ /* min/max dot product on twmat xyz axis. */
+ float tw_axis_min[3], tw_axis_max[3];
+ float tw_axis_matrix[3][3];
+
+ float gridview DNA_DEPRECATED;
float viewquat[4]; /* view rotation, must be kept normalized */
float dist; /* distance from 'ofs' along -viewinv[2] vector, where result is negative as is 'ofs' */
@@ -125,7 +114,7 @@ typedef struct RegionView3D {
char pad[3];
float ofs_lock[2]; /* normalized offset for locked view: (-1, -1) bottom left, (1, 1) upper right */
- short twdrawflag;
+ short twdrawflag; /* XXX can easily get rid of this (Julian) */
short rflag;
@@ -133,17 +122,84 @@ typedef struct RegionView3D {
float lviewquat[4];
short lpersp, lview; /* lpersp can never be set to 'RV3D_CAMOB' */
- float gridview;
- float tw_idot[3]; /* manipulator runtime: (1 - dot) product with view vector (used to check view alignment) */
-
-
/* active rotation from NDOF or elsewhere */
float rot_angle;
float rot_axis[3];
-
- struct GPUFX *compositor;
} RegionView3D;
+typedef struct View3DCursor {
+ float location[3];
+ float rotation[4];
+ char _pad[4];
+} View3DCursor;
+
+/* 3D Viewport Shading settings */
+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;
+ short background_type;
+ short pad2[2];
+
+ char studio_light[256]; /* FILE_MAXFILE */
+ char matcap[256]; /* FILE_MAXFILE */
+
+ float shadow_intensity;
+ float single_color[3];
+
+ float studiolight_rot_z;
+ float studiolight_background;
+
+ float object_outline_color[3];
+ float xray_alpha;
+ float xray_alpha_wire;
+
+ float cavity_valley_factor;
+ float cavity_ridge_factor;
+
+ float background_color[3];
+
+} View3DShading;
+
+/* 3D Viewport Overlay settings */
+typedef struct View3DOverlay {
+ int flag;
+
+ /* Edit mode settings */
+ int edit_flag;
+ float normals_length;
+ float backwire_opacity;
+
+ /* Paint mode settings */
+ int paint_flag;
+
+ /* Weight paint mode settings */
+ int wpaint_flag;
+ char _pad2[4];
+
+ /* Alpha for texture, weight, vertex paint overlay */
+ float texture_paint_mode_opacity;
+ float vertex_paint_mode_opacity;
+ float weight_paint_mode_opacity;
+
+ /* Armature edit/pose mode settings */
+ int arm_flag;
+ float bone_select_alpha;
+
+ /* Other settings */
+ float wireframe_threshold;
+
+ /* grease pencil settings */
+ float gpencil_paper_opacity;
+ float gpencil_grid_opacity;
+ char _pad1[4];
+
+} View3DOverlay;
+
/* 3D ViewPort Struct */
typedef struct View3D {
struct SpaceLink *next, *prev;
@@ -160,8 +216,11 @@ typedef struct View3D {
char bundle_drawtype; /* display style for bundle */
char pad[3];
- unsigned int lay_prev; /* for active layer toggle */
- unsigned int lay_used; /* used while drawing */
+ unsigned int lay_prev DNA_DEPRECATED; /* for active layer toggle */
+ unsigned int lay_used DNA_DEPRECATED; /* used while drawing */
+
+ int object_type_exclude_viewport;
+ int object_type_exclude_select;
short persp DNA_DEPRECATED;
short view DNA_DEPRECATED;
@@ -169,29 +228,26 @@ typedef struct View3D {
struct Object *camera, *ob_centre;
rctf render_border;
- struct ListBase bgpicbase;
- struct BGpic *bgpic DNA_DEPRECATED; /* deprecated, use bgpicbase, only kept for do_versions(...) */
-
struct View3D *localvd; /* allocated backup of its self while in localview */
char ob_centre_bone[64]; /* optional string for armature bone to define center, MAXBONENAME */
- unsigned int lay;
- int layact;
+ unsigned int lay DNA_DEPRECATED;
+ int layact DNA_DEPRECATED;
- /**
- * The drawing mode for the 3d display. Set to OB_BOUNDBOX, OB_WIRE, OB_SOLID,
- * OB_TEXTURE, OB_MATERIAL or OB_RENDER */
- char drawtype;
- char ob_centre_cursor; /* optional bool for 3d cursor to define center */
- short scenelock, around;
+ short ob_centre_cursor; /* optional bool for 3d cursor to define center */
+ short scenelock;
+ short gp_flag;
short flag;
int flag2;
float lens, grid;
float near, far;
float ofs[3] DNA_DEPRECATED; /* XXX deprecated */
- float cursor[3];
+
+ View3DCursor cursor;
+
+ char _pad[4];
short matcap_icon; /* icon id */
@@ -199,36 +255,30 @@ typedef struct View3D {
short gridsubdiv; /* Number of subdivisions in the grid between each highlighted grid line */
char gridflag;
- /* transform widget info */
- char twtype, twmode, twflag;
+ /* transform gizmo info */
+ char _pad5[2], gizmo_flag;
- short _pad1;
-
- /* afterdraw, for xray & transparent */
- struct ListBase afterdraw_transp;
- struct ListBase afterdraw_xray;
- struct ListBase afterdraw_xraytransp;
+ short _pad2;
/* drawflags, denoting state */
- char zbuf, transp, xray;
+ char _pad3;
+ char transp, xray;
char multiview_eye; /* multiview current eye - for internal use */
- /* built-in shader effects (eGPUFXFlags) */
- 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 */
struct GPUFXSettings fx_settings;
void *properties_storage; /* Nkey panel stores stuff here (runtime only!) */
- /* Allocated per view, not library data (used by matcap). */
- struct Material *defmaterial;
/* XXX deprecated? */
struct bGPdata *gpd DNA_DEPRECATED; /* Grease-Pencil Data (annotation layers) */
- /* multiview - stereo 3d */
+ /* Stereoscopy settings */
short stereo3d_flag;
char stereo3d_camera;
char pad4;
@@ -236,12 +286,12 @@ typedef struct View3D {
float stereo3d_volume_alpha;
float stereo3d_convergence_alpha;
- /* Previous viewport draw type.
- * Runtime-only, set in the rendered viewport toggle operator.
- */
- short prev_drawtype;
- short pad1;
- float pad2;
+ /* Display settings */
+ short drawtype DNA_DEPRECATED;
+ short pad5[3];
+
+ View3DShading shading;
+ View3DOverlay overlay;
} View3D;
@@ -251,14 +301,14 @@ typedef struct View3D {
#define V3D_S3D_DISPVOLUME (1 << 2)
/* View3D->flag (short) */
-/*#define V3D_DISPIMAGE 1*/ /*UNUSED*/
-#define V3D_DISPBGPICS 2
+/*#define V3D_FLAG_DEPRECATED_1 (1 << 0) */ /*UNUSED */
+/*#define V3D_FLAG_DEPRECATED_2 (1 << 1) */ /* UNUSED */
#define V3D_HIDE_HELPLINES 4
#define V3D_INVALID_BACKBUF 8
-#define V3D_ALIGN 1024
+/* #define V3D_FLAG_DEPRECATED_10 (1 << 10) */ /* UNUSED */
#define V3D_SELECT_OUTLINE 2048
-#define V3D_ZBUF_SELECT 4096
+#define V3D_ZBUF_SELECT 4096 /* XXX: DNA deprecated */
#define V3D_GLOBAL_STATS 8192
#define V3D_DRAW_CENTERS 32768
@@ -271,7 +321,7 @@ typedef struct View3D {
#define RV3D_CLIPPING 4
#define RV3D_NAVIGATING 8
#define RV3D_GPULIGHT_UPDATE 16
-#define RV3D_IS_GAME_ENGINE 32 /* runtime flag, used to check if LoD's should be used */
+/*#define RV3D_IS_GAME_ENGINE 32 *//* UNUSED */
/**
* Disable zbuffer offset, skip calls to #ED_view3d_polygon_offset.
* Use when precise surface depth is needed and picking bias isn't, see T45434).
@@ -301,7 +351,7 @@ typedef struct View3D {
/* 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)
@@ -312,9 +362,112 @@ typedef struct View3D {
#define V3D_SOLID_MATCAP (1 << 12) /* user flag */
#define V3D_SHOW_SOLID_MATCAP (1 << 13) /* runtime flag */
#define V3D_OCCLUDE_WIRE (1 << 14)
-#define V3D_SHADELESS_TEX (1 << 15)
-#define V3D_SHOW_WORLD (1 << 16)
+#define V3D_SHOW_MODE_SHADE_OVERRIDE (1 << 15) /* XXX: DNA deprecated */
+/* 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 {
+ V3D_LIGHTING_FLAT = 0,
+ V3D_LIGHTING_STUDIO = 1,
+ V3D_LIGHTING_MATCAP = 2,
+};
+
+/* View3DShading->flag */
+enum {
+ V3D_SHADING_OBJECT_OUTLINE = (1 << 0),
+ V3D_SHADING_XRAY = (1 << 1),
+ V3D_SHADING_SHADOW = (1 << 2),
+ V3D_SHADING_SCENE_LIGHTS = (1 << 3),
+ V3D_SHADING_SPECULAR_HIGHLIGHT = (1 << 4),
+ V3D_SHADING_CAVITY = (1 << 5),
+ V3D_SHADING_MATCAP_FLIP_X = (1 << 6),
+ V3D_SHADING_SCENE_WORLD = (1 << 7),
+ V3D_SHADING_XRAY_WIREFRAME = (1 << 8),
+};
+
+/* View3DShading->color_type */
+enum {
+ V3D_SHADING_MATERIAL_COLOR = 0,
+ V3D_SHADING_RANDOM_COLOR = 1,
+ V3D_SHADING_SINGLE_COLOR = 2,
+ 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),
+ V3D_OVERLAY_HIDE_CURSOR = (1 << 1),
+ V3D_OVERLAY_BONE_SELECT = (1 << 2),
+ V3D_OVERLAY_LOOK_DEV = (1 << 3),
+ V3D_OVERLAY_WIREFRAMES = (1 << 4),
+ V3D_OVERLAY_HIDE_TEXT = (1 << 5),
+ V3D_OVERLAY_HIDE_MOTION_PATHS = (1 << 6),
+ V3D_OVERLAY_ONION_SKINS = (1 << 7),
+ V3D_OVERLAY_HIDE_BONES = (1 << 8),
+ V3D_OVERLAY_HIDE_OBJECT_XTRAS = (1 << 9),
+ V3D_OVERLAY_HIDE_OBJECT_ORIGINS = (1 << 10),
+};
+
+/* View3DOverlay->edit_flag */
+enum {
+ V3D_OVERLAY_EDIT_VERT_NORMALS = (1 << 0),
+ V3D_OVERLAY_EDIT_LOOP_NORMALS = (1 << 1),
+ V3D_OVERLAY_EDIT_FACE_NORMALS = (1 << 2),
+
+ V3D_OVERLAY_EDIT_OCCLUDE_WIRE = (1 << 3),
+
+ V3D_OVERLAY_EDIT_WEIGHT = (1 << 4),
+
+ V3D_OVERLAY_EDIT_EDGES = (1 << 5),
+ V3D_OVERLAY_EDIT_FACES = (1 << 6),
+ V3D_OVERLAY_EDIT_FACE_DOT = (1 << 7),
+
+ V3D_OVERLAY_EDIT_SEAMS = (1 << 8),
+ V3D_OVERLAY_EDIT_SHARP = (1 << 9),
+ V3D_OVERLAY_EDIT_CREASES = (1 << 10),
+ V3D_OVERLAY_EDIT_BWEIGHTS = (1 << 11),
+
+ V3D_OVERLAY_EDIT_FREESTYLE_EDGE = (1 << 12),
+ V3D_OVERLAY_EDIT_FREESTYLE_FACE = (1 << 13),
+
+ V3D_OVERLAY_EDIT_STATVIS = (1 << 14),
+ V3D_OVERLAY_EDIT_EDGE_LEN = (1 << 15),
+ V3D_OVERLAY_EDIT_EDGE_ANG = (1 << 16),
+ V3D_OVERLAY_EDIT_FACE_ANG = (1 << 17),
+ V3D_OVERLAY_EDIT_FACE_AREA = (1 << 18),
+ V3D_OVERLAY_EDIT_INDICES = (1 << 19),
+
+ V3D_OVERLAY_EDIT_CU_HANDLES = (1 << 20),
+ V3D_OVERLAY_EDIT_CU_NORMALS = (1 << 21),
+};
+
+/* View3DOverlay->arm_flag */
+enum {
+ V3D_OVERLAY_ARM_TRANSP_BONES = (1 << 0),
+};
+
+/* View3DOverlay->paint_flag */
+enum {
+ V3D_OVERLAY_PAINT_WIRE = (1 << 0),
+};
+
+/* View3DOverlay->wpaint_flag */
+enum {
+ V3D_OVERLAY_WPAINT_CONTOURS = (1 << 0),
+};
/* View3D->around */
enum {
@@ -346,49 +499,24 @@ enum {
#define V3D_SHOW_Y 4
#define V3D_SHOW_Z 8
-/* View3d->twtype (bits, we can combine them) */
-#define V3D_MANIP_TRANSLATE 1
-#define V3D_MANIP_ROTATE 2
-#define V3D_MANIP_SCALE 4
-
-/* View3d->twmode */
+/* Scene.orientation_type */
#define V3D_MANIP_GLOBAL 0
#define V3D_MANIP_LOCAL 1
#define V3D_MANIP_NORMAL 2
#define V3D_MANIP_VIEW 3
#define V3D_MANIP_GIMBAL 4
-#define V3D_MANIP_CUSTOM 5 /* anything of value 5 or higher is custom */
-
-/* View3d->twflag */
- /* USE = user setting, DRAW = based on selection */
-#define V3D_USE_MANIPULATOR 1
-#define V3D_DRAW_MANIPULATOR 2
-/* #define V3D_CALC_MANIPULATOR 4 */ /*UNUSED*/
+#define V3D_MANIP_CURSOR 5
+#define V3D_MANIP_CUSTOM 1024
-/* BGPic->flag */
-/* may want to use 1 for select ? */
+/* View3d.mpr_flag (also) */
enum {
- V3D_BGPIC_EXPANDED = (1 << 1),
- V3D_BGPIC_CAMERACLIP = (1 << 2),
- V3D_BGPIC_DISABLED = (1 << 3),
- V3D_BGPIC_FOREGROUND = (1 << 4),
-
- /* Camera framing options */
- V3D_BGPIC_CAMERA_ASPECT = (1 << 5), /* don't stretch to fit the camera view */
- V3D_BGPIC_CAMERA_CROP = (1 << 6), /* crop out the image */
-
- /* Axis flip options */
- V3D_BGPIC_FLIP_X = (1 << 7),
- V3D_BGPIC_FLIP_Y = (1 << 8),
+ /** All gizmos. */
+ V3D_GIZMO_HIDE = (1 << 0),
+ V3D_GIZMO_HIDE_NAVIGATE = (1 << 1),
+ V3D_GIZMO_HIDE_CONTEXT = (1 << 2),
+ V3D_GIZMO_HIDE_TOOL = (1 << 3),
};
-#define V3D_BGPIC_EXPANDED (V3D_BGPIC_EXPANDED | V3D_BGPIC_CAMERACLIP)
-
-/* BGPic->source */
-/* may want to use 1 for select ?*/
-#define V3D_BGPIC_IMAGE 0
-#define V3D_BGPIC_MOVIE 1
-
#define RV3D_CAMZOOM_MIN -30
#define RV3D_CAMZOOM_MAX 600
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index c76a447097e..abd35a3cc73 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -32,6 +32,7 @@
#define __DNA_WINDOWMANAGER_TYPES_H__
#include "DNA_listBase.h"
+#include "DNA_screen_types.h"
#include "DNA_vec_types.h"
#include "DNA_userdef_types.h"
@@ -41,6 +42,7 @@
struct wmWindowManager;
struct wmWindow;
+struct wmMsgBus;
struct wmEvent;
struct wmGesture;
struct wmOperatorType;
@@ -116,8 +118,7 @@ typedef struct ReportList {
#
#
typedef struct ReportTimerInfo {
- float col[3];
- float grayscale;
+ float col[4];
float widthfac;
} ReportTimerInfo;
@@ -159,12 +160,15 @@ typedef struct wmWindowManager {
char is_interface_locked; /* indicates whether interface is locked for user interaction */
char par[7];
+
+ struct wmMsgBus *message_bus;
+
} wmWindowManager;
/* wmWindowManager.initialized */
enum {
- WM_INIT_WINDOW = (1<<0),
- WM_INIT_KEYMAP = (1<<1),
+ WM_WINDOW_IS_INITIALIZED = (1<<0),
+ WM_KEYMAP_IS_INITIALIZED = (1<<1),
};
/* IME is win32 only! */
@@ -179,10 +183,21 @@ typedef struct wmWindow {
struct wmWindow *next, *prev;
void *ghostwin; /* don't want to include ghost.h stuff */
+ void *gpuctx; /* don't want to include gpu stuff */
+
+ struct wmWindow *parent; /* Parent window */
+
+ struct Scene *scene; /* Active scene displayed in this window. */
+ struct Scene *new_scene; /* temporary when switching */
+ char view_layer_name[64]; /* Active view layer displayed in this window. */
+
+ struct WorkSpaceInstanceHook *workspace_hook;
+
+ /** Global areas aren't part of the screen, but part of the window directly.
+ * \note Code assumes global areas with fixed height, fixed width not supported yet */
+ ScrAreaMap global_areas;
- struct bScreen *screen; /* active screen */
- struct bScreen *newscreen; /* temporary when switching */
- char screenname[64]; /* MAX_ID_NAME for matching window with active screen after file read */
+ struct bScreen *screen DNA_DEPRECATED;
short posx, posy, sizex, sizey; /* window coords */
short windowstate; /* borderless, full */
@@ -193,8 +208,7 @@ typedef struct wmWindow {
short modalcursor; /* the current modal cursor */
short grabcursor; /* cursor grab mode */
short addmousemove; /* internal: tag this for extra mousemove event, makes cursors/buttons active on UI switching */
- short multisamples; /* amount of samples for OpenGL FSA the ghost window was created with, if zero no FSA */
- short pad[3];
+ short pad[4];
int winid; /* winid also in screens, is for retrieving this window after read */
@@ -204,28 +218,25 @@ typedef struct wmWindow {
struct wmEvent *eventstate; /* storage for event system */
- struct wmSubWindow *curswin; /* internal for wm_subwindow.c only */
-
struct wmGesture *tweak; /* internal for wm_operators.c */
/* Input Method Editor data - complex character input (esp. for asian character input)
* Currently WIN32, runtime-only data */
struct wmIMEData *ime_data;
- int drawmethod, drawfail; /* internal for wm_draw.c only */
- ListBase drawdata; /* internal for wm_draw.c only */
-
ListBase queue; /* all events (ghost level events were handled) */
ListBase handlers; /* window+screen handlers, handled last */
ListBase modalhandlers; /* priority handlers, handled first */
- ListBase subwindows; /* opengl stuff for sub windows, see notes in wm_subwindow.c */
ListBase gesture; /* gesture stuff */
struct Stereo3dFormat *stereo3d_format; /* properties for stereoscopic displays */
/* custom drawing callbacks */
ListBase drawcalls;
+
+ /* Private runtime info to show text in the status bar. */
+ void *cursor_keymap_status;
} wmWindow;
#ifdef ime_data
@@ -311,6 +322,7 @@ typedef struct wmKeyMap {
char idname[64]; /* global editor keymaps, or for more per space/region */
short spaceid; /* same IDs as in DNA_space_types.h */
short regionid; /* see above */
+ char owner_id[64]; /* optional, see: #wmOwnerID */
short flag; /* general flags */
short kmi_id; /* last kmi id */
@@ -318,6 +330,8 @@ typedef struct wmKeyMap {
/* runtime */
/** Verify if enabled in the current context, use #WM_keymap_poll instead of direct calls. */
bool (*poll)(struct bContext *);
+ bool (*poll_modal_item)(const struct wmOperator *op, int value);
+
/** For modal, #EnumPropertyItem for now. */
const void *modal_items;
} wmKeyMap;
@@ -370,7 +384,6 @@ typedef struct wmOperator {
struct wmOperator *opm; /* current running macro, not saved */
struct uiLayout *layout; /* runtime for drawing */
short flag, pad[3];
-
} wmOperator;
/* operator type return flags: exec(), invoke() modal(), return values */
diff --git a/source/blender/makesdna/DNA_workspace_types.h b/source/blender/makesdna/DNA_workspace_types.h
new file mode 100644
index 00000000000..3ad5071fdf2
--- /dev/null
+++ b/source/blender/makesdna/DNA_workspace_types.h
@@ -0,0 +1,214 @@
+/*
+ * ***** 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_workspace_types.h
+ * \ingroup DNA
+ *
+ * Use API in BKE_workspace.h!
+ * Struct members marked with DNA_PRIVATE_WORKSPACE will throw a
+ * warning saying it's deprecated when used outside of workspace.c.
+ */
+
+#ifndef __DNA_WORKSPACE_TYPES_H__
+#define __DNA_WORKSPACE_TYPES_H__
+
+#include "DNA_scene_types.h"
+
+/* Same logic as DNA_DEPRECATED_ALLOW, but throws 'deprecated'
+ * warnings if DNA_PRIVATE_WORKSPACE_ALLOW is not defined */
+#ifdef DNA_PRIVATE_WORKSPACE_ALLOW
+ /* allow use of private items */
+# define DNA_PRIVATE_WORKSPACE
+#else
+# ifndef DNA_PRIVATE_WORKSPACE
+# define DNA_PRIVATE_WORKSPACE DNA_PRIVATE_ATTR
+# endif
+#endif
+
+#ifdef DNA_PRIVATE_READ_WRITE_ALLOW
+# define DNA_PRIVATE_WORKSPACE_READ_WRITE
+#else
+# ifndef DNA_PRIVATE_WORKSPACE_READ_WRITE
+# define DNA_PRIVATE_WORKSPACE_READ_WRITE DNA_PRIVATE_WORKSPACE
+# endif
+#endif
+
+/* Currently testing, allow to disable. */
+#define USE_WORKSPACE_TOOL
+
+#
+#
+typedef struct bToolRef_Runtime {
+ int cursor;
+
+ /** One of these 3 must be defined. */
+ char keymap[64];
+ char gizmo_group[64];
+ char data_block[64];
+
+ /** Use to infer primary operator to use when setting accelerator keys. */
+ char op[64];
+
+ /** Index when a tool is a member of a group. */
+ int index;
+} bToolRef_Runtime;
+
+
+/* Stored per mode. */
+typedef struct bToolRef {
+ struct bToolRef *next, *prev;
+ char idname[64];
+
+ /** Use to avoid initializing the same tool multiple times. */
+ short tag;
+
+ /** #bToolKey (spacetype, mode), used in 'WM_api.h' */
+ short space_type;
+ /**
+ * Value depends ont the 'space_type', object mode for 3D view, image editor has own mode too.
+ * RNA needs to handle using item function.
+ */
+ int mode;
+
+ /**
+ * Use for tool options, each group's name must match a tool name:
+ *
+ * {"Tool Name": {"SOME_OT_operator": {...}, ..}, ..}
+ *
+ * This is done since different tools may call the same operators with their own options.
+ */
+ IDProperty *properties;
+
+ /** Variables needed to operate the tool. */
+ bToolRef_Runtime *runtime;
+} bToolRef;
+
+
+/**
+ * \brief Wrapper for bScreen.
+ *
+ * bScreens are IDs and thus stored in a main list-base. We also want to store a list-base of them within the
+ * workspace (so each workspace can have its own set of screen-layouts) which would mess with the next/prev pointers.
+ * So we use this struct to wrap a bScreen pointer with another pair of next/prev pointers.
+ */
+typedef struct WorkSpaceLayout {
+ struct WorkSpaceLayout *next, *prev;
+
+ struct bScreen *screen;
+ /* The name of this layout, we override the RNA name of the screen with this (but not ID name itself) */
+ char name[64] DNA_PRIVATE_WORKSPACE; /* MAX_NAME */
+} WorkSpaceLayout;
+
+/** Optional tags, which features to use, aligned with #bAddon names by convention. */
+typedef struct wmOwnerID {
+ struct wmOwnerID *next, *prev;
+ char name[64] DNA_PRIVATE_WORKSPACE; /* MAX_NAME */
+} wmOwnerID;
+
+typedef struct WorkSpace {
+ ID id;
+
+ ListBase layouts DNA_PRIVATE_WORKSPACE; /* WorkSpaceLayout */
+ /* Store for each hook (so for each window) which layout has
+ * been activated the last time this workspace was visible. */
+ ListBase hook_layout_relations DNA_PRIVATE_WORKSPACE_READ_WRITE; /* WorkSpaceDataRelation */
+
+ /* Feature tagging (use for addons) */
+ ListBase owner_ids DNA_PRIVATE_WORKSPACE_READ_WRITE; /* wmOwnerID */
+
+ /* should be: '#ifdef USE_WORKSPACE_TOOL'. */
+
+ /** List of #bToolRef */
+ ListBase tools;
+
+ /**
+ * BAD DESIGN WARNING:
+ * This is a workaround for the topbar not knowing which tools spac */
+ char tools_space_type;
+ /** Type is different for each space-type. */
+ char tools_mode;
+ char _pad[2];
+
+ int object_mode;
+
+ int flags DNA_PRIVATE_WORKSPACE; /* enum eWorkSpaceFlags */
+
+ /* Number for workspace tab reordering in the UI. */
+ int order;
+
+ /* Info text from modal operators (runtime). */
+ char *status_text;
+} WorkSpace;
+
+/* internal struct, but exported for read/write */
+#if defined(DNA_PRIVATE_READ_WRITE_ALLOW) || defined(DNA_PRIVATE_WORKSPACE_ALLOW)
+
+/**
+ * Generic (and simple/primitive) struct for storing a history of assignments/relations
+ * of workspace data to non-workspace data in a listbase inside the workspace.
+ *
+ * Using this we can restore the old state of a workspace if the user switches back to it.
+ *
+ * Usage
+ * =====
+ * When activating a workspace, it should activate the screen-layout that was active in that
+ * workspace before *in this window*.
+ * More concretely:
+ * * There are two windows, win1 and win2.
+ * * Both show workspace ws1, but both also had workspace ws2 activated at some point before.
+ * * Last time ws2 was active in win1, screen-layout sl1 was activated.
+ * * Last time ws2 was active in win2, screen-layout sl2 was activated.
+ * * When changing from ws1 to ws2 in win1, screen-layout sl1 should be activated again.
+ * * When changing from ws1 to ws2 in win2, screen-layout sl2 should be activated again.
+ * So that means we have to store the active screen-layout in a per workspace, per window
+ * relation. This struct is used to store an active screen-layout for each window within the
+ * workspace.
+ * To find the screen-layout to activate for this window-workspace combination, simply lookup
+ * the WorkSpaceDataRelation with the workspace-hook of the window set as parent.
+ */
+typedef struct WorkSpaceDataRelation {
+ struct WorkSpaceDataRelation *next, *prev;
+
+ /* the data used to identify the relation (e.g. to find screen-layout (= value) from/for a hook) */
+ void *parent;
+ /* The value for this parent-data/workspace relation */
+ void *value;
+} WorkSpaceDataRelation;
+
+#endif /* DNA_PRIVATE_WORKSPACE_READ_WRITE */
+
+/**
+ * Little wrapper to store data that is going to be per window, but coming from the workspace.
+ * It allows us to keep workspace and window data completely separate.
+ */
+typedef struct WorkSpaceInstanceHook {
+ WorkSpace *active DNA_PRIVATE_WORKSPACE;
+ struct WorkSpaceLayout *act_layout DNA_PRIVATE_WORKSPACE;
+
+ /* Needed because we can't change workspaces/layouts in running handler loop, it would break context. */
+ WorkSpace *temp_workspace_store;
+ struct WorkSpaceLayout *temp_layout_store;
+} WorkSpaceInstanceHook;
+
+typedef enum eWorkSpaceFlags {
+ WORKSPACE_USE_FILTER_BY_ORIGIN = (1 << 1),
+} eWorkSpaceFlags;
+
+#endif /* __DNA_WORKSPACE_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h
index 0ae9bcd0256..7769833a835 100644
--- a/source/blender/makesdna/DNA_world_types.h
+++ b/source/blender/makesdna/DNA_world_types.h
@@ -47,18 +47,16 @@ struct MTex;
/**
* World defines general modeling data such as a background fill,
- * gravity, color model etc. It mixes game-data, rendering
- * data and modeling data. */
+ * gravity, color model etc. It mixes rendering data and modeling data. */
typedef struct World {
ID id;
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
+ DrawDataList drawdata; /* runtime (must be immediately after id for utilities to use it). */
- short colormodel, totex;
+ char _pad0[4];
short texact, mistype;
float horr, horg, horb;
- float zenr, zeng, zenb;
- float ambr, ambg, ambb;
/**
* Exposure= mult factor. unused now, but maybe back later. Kept in to be upward compat.
@@ -69,57 +67,21 @@ typedef struct World {
float linfac, logfac;
/**
- * Gravitation constant for the game world
- */
- float gravity; // XXX moved to scene->gamedata in 2.5
-
- /**
- * Radius of the activity bubble, in Manhattan length. Objects
- * outside the box are activity-culled. */
- float activityBoxRadius; // XXX moved to scene->gamedata in 2.5
-
- short skytype;
- /**
* Some world modes
* bit 0: Do mist
- * bit 1: Do stars
- * bit 2: (reserved) depth of field
- * bit 3: (gameengine): Activity culling is enabled.
- * bit 4: ambient occlusion
- * bit 5: (gameengine) : enable Bullet DBVT tree for view frustum culling
*/
short mode; // partially moved to scene->gamedata in 2.5
- short occlusionRes; /* resolution of occlusion Z buffer in pixel */ // XXX moved to scene->gamedata in 2.5
- short physicsEngine; /* here it's aligned */ // XXX moved to scene->gamedata in 2.5
- short ticrate, maxlogicstep, physubstep, maxphystep; // XXX moved to scene->gamedata in 2.5
+ short pad2[3];
float misi, miststa, mistdist, misthi;
- float starr DNA_DEPRECATED, starg DNA_DEPRECATED, starb DNA_DEPRECATED, stark DNA_DEPRECATED; /* Deprecated */
- float starsize DNA_DEPRECATED, starmindist DNA_DEPRECATED;
- float stardist DNA_DEPRECATED, starcolnoise DNA_DEPRECATED;
-
- /* unused now: DOF */
- short dofsta, dofend, dofmin, dofmax;
-
/* ambient occlusion */
- float aodist, aodistfac, aoenergy, aobias;
- short aomode, aosamp, aomix, aocolor;
- float ao_adapt_thresh, ao_adapt_speed_fac;
- float ao_approx_error, ao_approx_correction;
- float ao_indirect_energy, ao_env_energy, ao_pad2;
- short ao_indirect_bounces, ao_pad;
- short ao_samp_method, ao_gather_method, ao_approx_passes;
-
- /* assorted settings (in the middle of ambient occlusion settings for padding reasons) */
- short flag;
-
- /* ambient occlusion (contd...) */
- float *aosphere, *aotables;
+ float aodist, aoenergy;
+ /* assorted settings */
+ short flag, pad3[3];
struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
- struct MTex *mtex[18]; /* MAX_MTEX */
short pr_texture, use_nodes, pad[2];
/* previews */
@@ -128,71 +90,28 @@ typedef struct World {
/* nodes */
struct bNodeTree *nodetree;
+ float mistend, pad1; /* runtime : miststa + mistdist, used for drawing camera */
ListBase gpumaterial; /* runtime */
} World;
/* **************** WORLD ********************* */
-/* skytype */
-#define WO_SKYBLEND 1
-#define WO_SKYREAL 2
-#define WO_SKYPAPER 4
-/* while render: */
-#define WO_SKYTEX 8
-#define WO_ZENUP 16
-
/* mode */
#define WO_MIST 1
//#define WO_STARS 2 /* deprecated */
/*#define WO_DOF 4*/
-#define WO_ACTIVITY_CULLING 8
-#define WO_ENV_LIGHT 16
-#define WO_DBVT_CULLING 32
+//#define WO_ACTIVITY_CULLING 8 /* deprecated */
+//#define WO_ENV_LIGHT 16
+//#define WO_DBVT_CULLING 32 /* deprecated */
#define WO_AMB_OCC 64
-#define WO_INDIRECT_LIGHT 128
+//#define WO_INDIRECT_LIGHT 128
-/* aomix */
enum {
- WO_AOADD = 0,
-#ifdef DNA_DEPRECATED
- WO_AOSUB = 1, /* deprecated */
- WO_AOADDSUB = 2, /* deprecated */
-#endif
- WO_AOMUL = 3,
+ WO_MIST_QUADRATIC = 0,
+ WO_MIST_LINEAR = 1,
+ WO_MIST_INVERSE_QUADRATIC = 2,
};
-/* ao_samp_method - methods for sampling the AO hemi */
-#define WO_AOSAMP_CONSTANT 0
-#define WO_AOSAMP_HALTON 1
-#define WO_AOSAMP_HAMMERSLEY 2
-
-/* aomode (use distances & random sampling modes) */
-#define WO_AODIST 1
-#define WO_AORNDSMP 2
-#define WO_AOCACHE 4
-
-/* aocolor */
-#define WO_AOPLAIN 0
-#define WO_AOSKYCOL 1
-#define WO_AOSKYTEX 2
-
-/* ao_gather_method */
-#define WO_AOGATHER_RAYTRACE 0
-#define WO_AOGATHER_APPROX 1
-
-/* texco (also in DNA_material_types.h) */
-#define TEXCO_ANGMAP 64
-#define TEXCO_H_SPHEREMAP 256
-#define TEXCO_H_TUBEMAP 1024
-#define TEXCO_EQUIRECTMAP 2048
-
-/* mapto */
-#define WOMAP_BLEND 1
-#define WOMAP_HORIZ 2
-#define WOMAP_ZENUP 4
-#define WOMAP_ZENDOWN 8
-// #define WOMAP_MIST 16 /* Deprecated */
-
/* flag */
#define WO_DS_EXPAND (1<<0)
/* NOTE: this must have the same value as MA_DS_SHOW_TEXS,
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c
index 077bae741b8..2881f3138b2 100644
--- a/source/blender/makesdna/intern/dna_genfile.c
+++ b/source/blender/makesdna/intern/dna_genfile.c
@@ -313,10 +313,52 @@ BLI_INLINE const char *pad_up_4(const char *ptr)
}
/**
+ * Temporary DNA doversion for files that were created with Blender 2.80
+ * between October 2016, and November 2017 (>=280.0 and < 280.2).
+ *
+ * /note This would be way more efficient if we can get the version from SDNA
+ * So we could return true if version == 280 && subversion < 2.
+ *
+ * Returns true if we need to do the DNA renaming.
+ */
+static bool need_doversion_280(SDNA *sdna, int *data, const bool data_alloc)
+{
+ if (data_alloc == false) {
+ return false;
+ }
+
+ bool active_layer = false, render_layers = false;
+
+ const char *cp = (char *)data;
+ for (int nr = 0; nr < sdna->nr_names; nr++) {
+ if (strcmp(cp, "active_layer") == 0) {
+ active_layer = true;
+ if (active_layer && render_layers) {
+ return true;
+ }
+ }
+ else if (strcmp(cp, "render_layers") == 0) {
+ render_layers = true;
+ if (active_layer && render_layers) {
+ return true;
+ }
+ }
+
+ while (*cp) cp++;
+ cp++;
+ }
+
+ /* If someone adds only one of them to the DNA, don't! */
+ BLI_assert(!(active_layer || render_layers));
+ return false;
+}
+
+/**
* In sdna->data the data, now we convert that to something understandable
*/
static bool init_structDNA(
SDNA *sdna, bool do_endian_swap,
+ bool data_alloc,
const char **r_error_message)
{
int *data, *verg, gravity_fix = -1;
@@ -362,6 +404,10 @@ static bool init_structDNA(
return false;
}
+ /* Temporary DNA doversion for files that were created with Blender 2.80
+ * between 280.0 and 280.2. */
+ const bool doversion_280 = need_doversion_280(sdna, data, data_alloc);
+
cp = (char *)data;
for (int nr = 0; nr < sdna->nr_names; nr++) {
sdna->names[nr] = cp;
@@ -375,6 +421,28 @@ static bool init_structDNA(
gravity_fix = nr;
}
}
+ else if (doversion_280) {
+ if (strcmp(cp, "*render_layer") == 0) {
+ /* WorkSpace. */
+ sdna->names[nr] = "*view_layer";
+ }
+ else if (strcmp(cp, "*scene_layer") == 0) {
+ /* ParticleEditSettings. */
+ sdna->names[nr] = "*view_layer";
+ }
+ else if (strcmp(cp, "render_layers") == 0) {
+ /* Scene. */
+ sdna->names[nr] = "view_layers";
+ }
+ else if (strcmp(cp, "active_layer") == 0) {
+ /* Scene. */
+ sdna->names[nr] = "active_view_layer";
+ }
+ else if (strcmp(cp, "*cur_render_layer") == 0) {
+ /* FileGlobal. */
+ sdna->names[nr] = "*cur_view_layer";
+ }
+ }
while (*cp) cp++;
cp++;
@@ -408,9 +476,24 @@ static bool init_structDNA(
/* this is a patch, to change struct names without a conflict with SDNA */
/* be careful to use it, in this case for a system-struct (opengl/X) */
- if (*cp == 'b') {
- /* struct Screen was already used by X, 'bScreen' replaces the old IrisGL 'Screen' struct */
- if (strcmp("bScreen", cp) == 0) sdna->types[nr] = cp + 1;
+ /* struct Screen was already used by X, 'bScreen' replaces the old IrisGL 'Screen' struct */
+ if (strcmp("bScreen", cp) == 0) {
+ sdna->types[nr] = cp + 1;
+ }
+ /* Groups renamed to collections in 2.8 */
+ else if (strcmp("Collection", cp) == 0) {
+ sdna->types[nr] = "Group";
+ }
+ else if (strcmp("CollectionObject", cp) == 0) {
+ sdna->types[nr] = "GroupObject";
+ }
+ else if (doversion_280) {
+ if (strcmp(cp, "SceneLayer") == 0) {
+ sdna->types[nr] = "ViewLayer";
+ }
+ else if (strcmp(cp, "SceneLayerEngineData") == 0) {
+ sdna->types[nr] = "ViewLayerEngineData";
+ }
}
while (*cp) cp++;
@@ -554,7 +637,7 @@ SDNA *DNA_sdna_from_data(
sdna->data_alloc = data_alloc;
- if (init_structDNA(sdna, do_endian_swap, &error_message)) {
+ if (init_structDNA(sdna, do_endian_swap, data_alloc, &error_message)) {
return sdna;
}
else {
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index bf94c07baa1..e1cdc8f5983 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -100,12 +100,8 @@ static const char *includefiles[] = {
"DNA_sequence_types.h",
"DNA_effect_types.h",
"DNA_outliner_types.h",
- "DNA_property_types.h",
- "DNA_sensor_types.h",
- "DNA_controller_types.h",
- "DNA_actuator_types.h",
"DNA_sound_types.h",
- "DNA_group_types.h",
+ "DNA_collection_types.h",
"DNA_armature_types.h",
"DNA_action_types.h",
"DNA_constraint_types.h",
@@ -117,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",
@@ -130,6 +128,10 @@ static const char *includefiles[] = {
"DNA_freestyle_types.h",
"DNA_linestyle_types.h",
"DNA_cachefile_types.h",
+ "DNA_layer_types.h",
+ "DNA_workspace_types.h",
+ "DNA_lightprobe_types.h",
+
/* see comment above before editing! */
/* empty string to indicate end of includefiles */
@@ -504,6 +506,17 @@ static int preprocess_include(char *maindata, int len)
a -= 13;
cp += 13;
}
+ else if (strncmp("DNA_PRIVATE_WORKSPACE", cp, 21) == 0) {
+ /* Check for DNA_PRIVATE_WORKSPACE_READ_WRITE */
+ if (strncmp("_READ_WRITE", cp + 21, 11) == 0) {
+ a -= 31;
+ cp += 31;
+ }
+ else {
+ a -= 20;
+ cp += 20;
+ }
+ }
else {
md[0] = cp[0];
md++;
@@ -1313,12 +1326,8 @@ int main(int argc, char **argv)
#include "DNA_sequence_types.h"
#include "DNA_effect_types.h"
#include "DNA_outliner_types.h"
-#include "DNA_property_types.h"
-#include "DNA_sensor_types.h"
-#include "DNA_controller_types.h"
-#include "DNA_actuator_types.h"
#include "DNA_sound_types.h"
-#include "DNA_group_types.h"
+#include "DNA_collection_types.h"
#include "DNA_armature_types.h"
#include "DNA_action_types.h"
#include "DNA_constraint_types.h"
@@ -1330,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"
@@ -1343,4 +1354,8 @@ int main(int argc, char **argv)
#include "DNA_freestyle_types.h"
#include "DNA_linestyle_types.h"
#include "DNA_cachefile_types.h"
+#include "DNA_layer_types.h"
+#include "DNA_workspace_types.h"
+#include "DNA_lightprobe_types.h"
+
/* end of list */