diff options
Diffstat (limited to 'source/blender/makesdna')
36 files changed, 1187 insertions, 312 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 80640d8dffe..fd8cd8b2855 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -96,6 +96,17 @@ 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 { IDP_FLAG_GHOST = 1 << 7, /* this means the property is set but RNA will return false when checking @@ -104,6 +115,76 @@ enum { /* 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 overriden 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. */ + + /* 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; + + /* watch it: Sequence has identical beginning. */ /** * ID is the first thing included in all serializable types. It @@ -134,6 +215,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. + */ + void *orig_id; + void *py_instance; } ID; @@ -257,6 +345,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 +370,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 : (_bmain)->name) @@ -288,6 +378,12 @@ 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) + #ifdef GS # undef GS #endif @@ -299,7 +395,8 @@ typedef enum ID_Type { /* id->flag (persitent). */ enum { - LIB_FAKEUSER = 1 << 9, + LIB_OVERRIDE_STATIC_AUTO = 1 << 0, /* Allow automatic generation of overriding rules. */ + LIB_FAKEUSER = 1 << 9, }; /** @@ -334,6 +431,9 @@ 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_OK = 1 << 9, + /* tag datablock has having an extra user. */ LIB_TAG_EXTRAUSER = 1 << 2, /* tag datablock has having actually increased usercount for the extra virtual user. */ @@ -348,21 +448,32 @@ 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 version. */ + LIB_TAG_COPY_ON_WRITE = 1 << 12, + LIB_TAG_COPY_ON_WRITE_EVAL = 1 << 13, + /* 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 << 14, /* Datablock is not listed in Main database. */ + LIB_TAG_NO_USER_REFCOUNT = 1 << 15, /* 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 << 16, }; 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_COLLECTIONS = 1 << 6, + /* Special flag to check if SOMETHING was changed. */ + ID_RECALC_ALL = (~(int)0), }; /* To filter ID types (filter_id) */ @@ -400,9 +511,11 @@ 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, @@ -431,12 +544,14 @@ enum { 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, diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index a7f3d27e9d2..c8780c6b4b8 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -180,6 +180,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 */ @@ -238,6 +250,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*/ @@ -259,8 +273,10 @@ typedef struct bPoseChannel { struct bPoseChannel *bbone_prev; /* next/prev bones to use as handle references when calculating bbones (optional) */ struct bPoseChannel *bbone_next; - + void *temp; /* use for outliner */ + /* Runtime data for color and bbone segment matrix. */ + bPoseChannelDrawData *draw_data; } bPoseChannel; diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h index 52e40cbc098..c90599bb5cc 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 */ @@ -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_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 6a95865c11f..48fe82b3e1a 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) \ 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_fileglobal_types.h b/source/blender/makesdna/DNA_fileglobal_types.h index b2ab0d2a08d..ed9640c365f 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_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index a62538d1032..d5a5a1d5d4a 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -128,7 +128,7 @@ 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) */ + /* "volumetric" strokes */ PC_COLOR_VOLUMETRIC = (1 << 4), /* Use High quality fill */ PC_COLOR_HQ_FILL = (1 << 5) @@ -273,7 +273,7 @@ typedef enum eGPDlayer_Flag { 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), @@ -300,6 +300,7 @@ typedef struct bGPdata { short sbuffer_sflag; /* flags for stroke that cache represents */ void *sbuffer; /* stroke buffer (can hold GP_STROKE_BUFFER_MAX) */ float scolor[4]; /* buffer color using palettes */ + float sfill[4]; /* buffer fill color */ char pad[6]; /* padding for compiler alignment error */ short sflag; /* settings for palette color */ 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 index 45dd0cb9ff2..8f15aa85e97 100644 --- a/source/blender/makesdna/DNA_group_types.h +++ b/source/blender/makesdna/DNA_group_types.h @@ -60,6 +60,13 @@ typedef struct Group { * on the last used scene */ unsigned int layer; float dupli_ofs[3]; + + struct SceneCollection *collection; + struct ViewLayer *view_layer; } Group; + +#define GROUP_MASTER_COLLECTION(_group) \ + (((LayerCollection *)(_group)->view_layer->layer_collections.first)->scene_collection) + #endif /* __DNA_GROUP_TYPES_H__ */ diff --git a/source/blender/makesdna/DNA_lamp_types.h b/source/blender/makesdna/DNA_lamp_types.h index a2e39f93875..92703fa2d3b 100644 --- a/source/blender/makesdna/DNA_lamp_types.h +++ b/source/blender/makesdna/DNA_lamp_types.h @@ -67,7 +67,7 @@ typedef struct Lamp { short pad2; float clipsta, clipend; - float bias, soft, compressthresh, bleedbias, pad5; + float bias, soft, compressthresh, bleedbias, bleedexp; short bufsize, samp, buffers, filtertype; char bufflag, buftype; @@ -106,6 +106,14 @@ typedef struct Lamp { 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; + /* preview */ struct PreviewImage *preview; @@ -151,6 +159,7 @@ typedef struct Lamp { #define LA_SHAD_TEX (1 << 16) #define LA_SHOW_CONE (1 << 17) #define LA_SHOW_SHADOW_BOX (1 << 18) +#define LA_SHAD_CONTACT (1 << 19) /* layer_shadow */ #define LA_LAYER_SHADOW_BOTH 0 diff --git a/source/blender/makesdna/DNA_lattice_types.h b/source/blender/makesdna/DNA_lattice_types.h index 242d6f0feeb..28a401676fc 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..806c1ca76fc --- /dev/null +++ b/source/blender/makesdna/DNA_layer_types.h @@ -0,0 +1,163 @@ +/* + * ***** 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 refcount; + short sx, sy; + struct Object *object; + unsigned int lay; + int flag_legacy; + struct IDProperty *collection_properties; /* used by depsgraph, flushed from collection-tree */ +} Base; + +typedef struct CollectionOverride { + struct CollectionOverride *next, *prev; + char name[64]; /* MAX_NAME */ + /* TODO proper data */ +} CollectionOverride; + +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 SceneCollection *scene_collection; + short flag; + /* TODO(sergey): Get rid of this once we've got CoW in DEG, */ + short flag_evaluated; + short pad[2]; + ListBase object_bases; /* (ObjectBase *)LinkData->data - synced with collection->objects */ + ListBase overrides; + ListBase layer_collections; /* synced with collection->collections */ + struct IDProperty *properties; /* overrides */ + struct IDProperty *properties_evaluated; +} LayerCollection; + +typedef struct ViewLayer { + struct ViewLayer *next, *prev; + char name[64]; /* MAX_NAME */ + short active_collection; + short flag; + short pad[2]; + ListBase object_bases; /* ObjectBase */ + struct SceneStats *stats; /* default allocated now */ + struct Base *basact; + ListBase layer_collections; /* LayerCollection */ + struct IDProperty *properties; /* overrides */ + struct IDProperty *properties_evaluated; + + /* 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 */ +} ViewLayer; + +typedef struct SceneCollection { + struct SceneCollection *next, *prev; + char name[64]; /* MAX_NAME */ + int active_object_index; /* for UI */ + char type; + char pad[3]; + ListBase objects; /* (Object *)LinkData->data */ + ListBase scene_collections; /* nested collections */ +} SceneCollection; + +/* Base->flag */ +enum { + BASE_SELECTED = (1 << 0), + BASE_VISIBLED = (1 << 1), + BASE_SELECTABLED = (1 << 2), + BASE_FROMDUPLI = (1 << 3), + BASE_DIRTY_ENGINE_SETTINGS = (1 << 4), + BASE_FROM_SET = (1 << 5), /* To be set only by the depsgraph */ +}; + +/* LayerCollection->flag */ +enum { + COLLECTION_VIEWPORT = (1 << 0), /* Only used for group collections. */ + COLLECTION_SELECTABLE = (1 << 1), + COLLECTION_DISABLED = (1 << 2), + COLLECTION_RENDER = (1 << 3), /* Only used for group collections. */ +}; + +/* ViewLayer->flag */ +enum { + VIEW_LAYER_RENDER = (1 << 0), + VIEW_LAYER_ENGINE_DIRTY = (1 << 1), + VIEW_LAYER_FREESTYLE = (1 << 2), +}; + +/* SceneCollection->type */ +enum { + COLLECTION_TYPE_NONE = 0, + COLLECTION_TYPE_GROUP_INTERNAL = 1, +}; + +/* *************************************************************** */ +/* Engine Settings */ + +/* CollectionEngineSettings->type */ +typedef enum CollectionEngineSettingsType { + COLLECTION_MODE_NONE = 0, + COLLECTION_MODE_OBJECT = 1, + COLLECTION_MODE_EDIT = 2, + COLLECTION_MODE_PAINT_WEIGHT = 5, + COLLECTION_MODE_PAINT_VERTEX = 6, +} CollectionModeSettingsType; + +/* *************************************************************** */ + + +#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..649df714457 --- /dev/null +++ b/source/blender/makesdna/DNA_lightprobe_types.h @@ -0,0 +1,111 @@ +/* + * ***** 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 */ + + float data_draw_size; + + /* Runtime display data */ + float distfalloff, distgridinf; + float pad; +} 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), +}; + +/* 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, +}; + +#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 0c500e366a7..bc33b7ba6e2 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -90,6 +90,16 @@ typedef struct TexPaintSlot { int pad; } TexPaintSlot; +/* Clay engine */ + +/* MaterialRuntimeClay.flag */ +#define CLAY_OUTDATED 1 + +/* MaterialEngineSettingsClay.type */ +#define CLAY_MATCAP_NONE 0 +#define CLAY_MATCAP_SIMPLE 1 +#define CLAY_MATCAP_COMPLETE 2 + typedef struct Material { ID id; struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */ @@ -201,6 +211,18 @@ typedef struct Material { char nmap_tangent_names[9][64]; /* [MAX_MTFACE+1][MAX_NAME]; +1 for empty name */ int nmap_tangent_names_count, pad5; + /* Transparency */ + float alpha_threshold; + float refract_depth; + char blend_method; + char blend_shadow; + char blend_flag; + char pad6[5]; + + /* image to use for image/uv space, also bake target + * (not to be used shading/rendering pipeline, this is editor featyure only!). */ + struct Image *edit_image; + struct TexPaintSlot *texpaintslot; /* cached slot for painting. Make sure to recalculate before use * with refresh_texpaint_image_cache */ ListBase gpumaterial; /* runtime */ @@ -275,7 +297,7 @@ typedef struct Material { #define MA_ONLYSHADOW 1024 #define MA_HALO_XALPHA 1024 #define MA_STAR 0x800 -#define MA_FACETEXTURE 0x800 +// #define MA_FACETEXTURE 0x800 /* deprecated */ #define MA_HALOTEX 0x1000 #define MA_HALOPUNO 0x2000 #define MA_ONLYCAST 0x2000 @@ -297,7 +319,7 @@ typedef struct Material { /* 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_FACETEXTURE_ALPHA 0x20000000 /* deprecated */ #define MA_STR_B_UNITS 0x40000000 #define MA_STR_SURFDIFF 0x80000000 @@ -477,5 +499,31 @@ typedef struct Material { #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), + MA_BL_TRANSLUCENCY = (1 << 3), +}; + +/* blend_shadow */ +enum { + MA_BS_NONE = 0, + MA_BS_SOLID, + MA_BS_CLIP, + MA_BS_HASHED, +}; + #endif diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index 39e56925903..505b1f7157b 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -66,7 +66,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 +126,7 @@ typedef struct Mesh { short totcol; struct Multires *mr DNA_DEPRECATED; /* deprecated multiresolution modeling data, only keep for loading old files */ + void *batch_cache; } Mesh; /* deprecated by MTFace, only here for file reading */ diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index 8bb711339f7..6d38fe22ea1 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -186,22 +186,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 +243,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 +447,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 68d16700a73..d1f001fccc4 100644 --- a/source/blender/makesdna/DNA_meta_types.h +++ b/source/blender/makesdna/DNA_meta_types.h @@ -59,7 +59,11 @@ typedef struct MetaElem { float len; /* old, only used for backwards compat. use dimensions now */ float *mat, *imat; /* matrix and inverted matrix */ - + + /* Draw_Data: stores pointers used for shader attributes */ + float draw_scale_xform[3][4]; /* Matrix of Scale and Translation */ + float draw_stiffness_radius; /* radius of the stiffness circle (only in edit mode) */ + float pad; } MetaElem; typedef struct MetaBall { @@ -93,6 +97,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 766dd196562..283e801ea7a 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -420,7 +420,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; diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 8ae1a79f8f7..63eecebf44a 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 */ diff --git a/source/blender/makesdna/DNA_object_enums.h b/source/blender/makesdna/DNA_object_enums.h index 58f9e29297f..524c85948f3 100644 --- a/source/blender/makesdna/DNA_object_enums.h +++ b/source/blender/makesdna/DNA_object_enums.h @@ -46,4 +46,7 @@ typedef enum eObjectMode { /* 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) + #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 47467917315..e7ebd3b72d7 100644 --- a/source/blender/makesdna/DNA_object_force_types.h +++ b/source/blender/makesdna/DNA_object_force_types.h @@ -112,6 +112,12 @@ 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 */ } PartDeflect; diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index e0b4d117bd1..0b7dccee9ab 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -67,6 +67,31 @@ 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; + +/* Object Runtime display data */ +struct ObjectEngineData; +typedef void (*ObjectEngineDataInitCb)(struct ObjectEngineData *engine_data); +typedef void (*ObjectEngineDataFreeCb)(struct ObjectEngineData *engine_data); + +# +# +typedef struct ObjectEngineData { + struct ObjectEngineData *next, *prev; + struct DrawEngineType *engine_type; + /* Only nested data, NOT the engine data itself. */ + ObjectEngineDataFreeCb free; + /* Accumulated recalc flags, which corresponds to ID->recalc flags. */ + int recalc; +} ObjectEngineData; + #define MAX_VGROUP_NAME 64 /* bDeformGroup->flag */ @@ -145,9 +170,7 @@ 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 */ - - int mode; /* Local object mode */ - int restore_mode; /* Keep track of what mode to return to after toggling a mode */ + ListBase fmaps; /* list of facemaps */ /* materials */ struct Material **mat; /* material slots */ @@ -188,11 +211,11 @@ typedef struct Object { 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; + char pad; /* 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; @@ -226,7 +249,10 @@ typedef struct Object { float jump_speed; float fall_speed; unsigned char max_jumps; - char pad2[3]; + char pad2; + + /* Depsgraph */ + short base_flag; /* used by depsgraph, flushed from base */ /** Collision mask settings */ unsigned short col_group, col_mask; @@ -251,13 +277,15 @@ typedef struct Object { 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]; @@ -278,15 +306,16 @@ typedef struct Object { 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 */ + /* Runtime valuated curve-specific data, not stored in the file */ + struct CurveCache *curve_cache; + ListBase gpulamp; /* runtime, for glsl lamp display only */ ListBase pc_ids; ListBase *duplilist; /* for temporary dupli list storage, only for use by RNA API */ @@ -296,12 +325,23 @@ typedef struct Object { float ima_ofs[2]; /* offset for image empties */ ImageUser *iuser; /* must be non-null when oject is an empty image */ - void *pad3; + void *pad4; ListBase lodlevels; /* contains data for levels of detail */ LodLevel *currentlod; struct PreviewImage *preview; + + struct IDProperty *base_collection_properties; /* used by depsgraph, flushed from base */ + + ListBase drawdata; /* runtime, ObjectEngineData */ + int pad6; + int select_color; + + /* Mesh structure createrd during object evaluaiton. + * It has all modifiers applied. + */ + struct Mesh *mesh_evaluated; } Object; /* Warning, this is not used anymore because hooks are now modifiers */ @@ -340,6 +380,7 @@ typedef struct DupliObject { struct ParticleSystem *particle_system; unsigned int random_id; unsigned int pad; + struct IDProperty *collection_properties; } DupliObject; /* **************** OBJECT ********************* */ @@ -360,6 +401,7 @@ enum { OB_CAMERA = 11, OB_SPEAKER = 12, + OB_LIGHTPROBE = 13, /* OB_WAVE = 21, */ OB_LATTICE = 22, @@ -380,10 +422,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_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_AR /* partype: first 4 bits: type */ enum { @@ -515,12 +557,6 @@ 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 */ @@ -600,12 +636,6 @@ enum { 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, @@ -673,7 +703,13 @@ enum { OB_LOCK_ROTW = 1 << 9, 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 984e3334414..8e48bbdde1a 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,14 @@ 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), +}; /* TreeStoreElem->types */ #define TSE_NLA 1 /* NO ID */ @@ -96,6 +102,9 @@ 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 39 +#define TSE_LAYER_COLLECTION_BASE 40 /* 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 9dbd1a18703..5f86ec31d0b 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -166,8 +166,9 @@ typedef struct ParticleSettings { 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; @@ -259,7 +260,9 @@ typedef struct ParticleSettings { /* modified dm support */ short use_modifier_stack; - short pad5[3]; + + short pad5; + int pad8; float twist; float pad6; @@ -329,6 +332,8 @@ 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; } ParticleSystem; typedef enum eParticleDrawFlag { diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index b41e649b628..d2810efca08 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -47,6 +47,8 @@ extern "C" { #include "DNA_ID.h" #include "DNA_freestyle_types.h" #include "DNA_gpu_types.h" +#include "DNA_layer_types.h" +#include "DNA_material_types.h" #include "DNA_userdef_types.h" struct CurveMapping; @@ -65,19 +67,11 @@ 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 */ @@ -178,27 +172,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 */ @@ -544,6 +536,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 */ @@ -665,8 +663,8 @@ typedef struct RenderData { rcti disprect; /* information on different layers to be rendered */ - ListBase layers; - short actlay; + ListBase layers DNA_DEPRECATED; /* Converted to Scene->view_layers. */ + short actlay DNA_DEPRECATED; /* Converted to Scene->active_layer. */ /* number of mblur samples */ short mblur_samples; @@ -748,7 +746,7 @@ typedef struct RenderData { float unit_line_thickness; /* in pixels */ /* render engine */ - char engine[32]; + char engine[32] DNA_DEPRECATED; // XXX deprecated since 2.8 /* Cycles baking */ struct BakeData bake; @@ -772,6 +770,12 @@ typedef struct RenderData { } RenderData; /* *************************************************************** */ +/* Settings related to viewport drawing/render, only settings used by WorkSpace and Scene. */ +typedef struct ViewRender { + char engine_id[32]; +} ViewRender; + +/* *************************************************************** */ /* Render Conversion/Simplfication Settings */ /* control render convert and shading engine */ @@ -930,7 +934,7 @@ typedef struct GameData { #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_DISPLAY_LISTS (1 << 5) /* deprecated */ #define GAME_GLSL_NO_LIGHTS (1 << 6) #define GAME_GLSL_NO_SHADERS (1 << 7) #define GAME_GLSL_NO_SHADOWS (1 << 8) @@ -1257,17 +1261,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 */ @@ -1628,9 +1621,9 @@ 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]; @@ -1649,17 +1642,17 @@ 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... */ /* no, is on the right place (ton) */ struct RenderData r; struct AudioData audio; - + ListBase markers; - ListBase transform_spaces; - + ListBase transform_spaces DNA_DEPRECATED; + void *sound_scene; void *playback_handle; void *sound_scrub_handle; @@ -1668,11 +1661,8 @@ 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 */ @@ -1706,6 +1696,18 @@ typedef struct Scene { struct RigidBodyWorld *rigidbody_world; struct PreviewImage *preview; + + ListBase view_layers; + struct SceneCollection *collection; + int active_view_layer; + int pad4; + + IDProperty *collection_properties; /* settings to be overriden by layer collections */ + IDProperty *layer_properties; /* settings to be override by workspaces */ + + int pad5[2]; + + ViewRender view_render; } Scene; /* **************** RENDERDATA ********************* */ @@ -1897,6 +1899,8 @@ enum { /* 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_CLAY; +extern const char *RE_engine_id_BLENDER_EEVEE; extern const char *RE_engine_id_CYCLES; /* **************** SCENE ********************* */ @@ -1915,39 +1919,38 @@ 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_VISIBLED) != 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_VISIBLED) != 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_VISIBLED) != 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_VISIBLED) != 0)) +#define BASE_SELECTABLE(base) \ + (((base)->flag & BASE_SELECTABLED) != 0) +#define BASE_VISIBLE(base) ( \ + ((base)->flag & BASE_VISIBLED) != 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_EVAL_CTX(eval_ctx) \ + (((eval_ctx)->object_mode & OB_MODE_EDIT) ? OBACT((eval_ctx)->view_layer) : NULL) + +#define OBEDIT_FROM_WINDOW(window) \ + BKE_workspace_edit_object(WM_window_get_active_workspace(window), WM_window_get_active_scene(window)) #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) diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index a7718883438..46eb0cbade3 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" @@ -46,6 +47,7 @@ struct uiLayout; struct wmTimer; struct wmTooltipState; + typedef struct bScreen { ID id; @@ -53,10 +55,9 @@ typedef struct bScreen { 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 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) */ @@ -70,15 +71,16 @@ typedef struct bScreen { 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[2]; - 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 { @@ -194,6 +196,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; @@ -244,7 +253,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, ... */ @@ -268,9 +277,10 @@ typedef struct ARegion { ListBase ui_previews; /* uiPreview */ ListBase handlers; /* wmEventHandler */ ListBase panels_category; /* Panel categories runtime */ - + + struct wmManipulatorMap *manipulator_map; /* manipulator-map of this region */ struct wmTimer *regiontimer; /* blend in/out */ - + char *headerstr; /* use this string to draw info */ void *regiondata; /* XXX 2.50, need spacedata equivalent? */ } ARegion; diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 693917939ef..077ac4f7aa3 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -126,7 +126,9 @@ typedef struct SpaceButs { 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]; + char flag; + char collection_context; + char pad[6]; void *path; /* runtime */ int pathflag, dataicon; /* runtime */ @@ -180,8 +182,10 @@ typedef enum eSpaceButtons_Context { BCONTEXT_MODIFIER = 10, BCONTEXT_CONSTRAINT = 11, BCONTEXT_BONE_CONSTRAINT = 12, - BCONTEXT_RENDER_LAYER = 13, - + BCONTEXT_VIEW_LAYER = 13, + BCONTEXT_COLLECTION = 14, + BCONTEXT_WORKSPACE = 15, + /* always as last... */ BCONTEXT_TOT } eSpaceButtons_Context; @@ -206,6 +210,12 @@ typedef enum eSpaceButtons_Texture_Context { SB_TEXC_LINESTYLE = 5, } eSpaceButtons_Texture_Context; +/* sbuts->collection_context */ +typedef enum eSpaceButtons_Collection_Context { + SB_COLLECTION_CTX_VIEW_LAYER = 0, + SB_COLLECTION_CTX_GROUP = 1, +} eSpaceButtons_Collection_Context; + /* sbuts->align */ typedef enum eSpaceButtons_Align { BUT_FREE = 0, @@ -256,6 +266,9 @@ typedef struct SpaceOops { struct TreeStoreElem search_tse; short flag, outlinevis, storeflag, search_flags; + int filter; + char filter_state; + char pad[3]; /* pointers to treestore elements, grouped by (id, type, nr) in hashtable for faster searching */ void *treehash; @@ -271,23 +284,69 @@ typedef enum eSpaceOutliner_Flag { SO_SKIP_SORT_ALPHA = (1 << 4), } eSpaceOutliner_Flag; +/* SpaceOops->filter */ +typedef enum eSpaceOutliner_Filter { + SO_FILTER_SEARCH = (1 << 0), + SO_FILTER_ENABLE = (1 << 1), + 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), + 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), + 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), +} eSpaceOutliner_Filter; + +#define SO_FILTER_NO_OB_ALL (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_ANY (SO_FILTER_NO_OBJECT | \ + 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_VISIBLE = 0, + SO_FILTER_OB_SELECTED = 1, + SO_FILTER_OB_ACTIVE = 2, +} 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, + SO_LIBRARIES = 7, + /* SO_VERSE_SESSION = 8, */ /* deprecated! */ + /* SO_VERSE_MS = 9, */ /* deprecated! */ + SO_SEQUENCE = 10, + SO_DATABLOCKS = 11, + /* SO_USERDEF = 12, */ /* deprecated! */ + /* SO_KEYMAP = 13, */ /* deprecated! */ + SO_ID_ORPHANS = 14, + SO_VIEW_LAYER = 15, + SO_COLLECTIONS = 16, } eSpaceOutliner_Mode; /* SpaceOops->storeflag */ @@ -715,7 +774,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), @@ -944,7 +1003,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), diff --git a/source/blender/makesdna/DNA_text_types.h b/source/blender/makesdna/DNA_text_types.h index 17ef098a3bb..0a9b8c320b5 100644 --- a/source/blender/makesdna/DNA_text_types.h +++ b/source/blender/makesdna/DNA_text_types.h @@ -62,7 +62,7 @@ typedef struct Text { char *undo_buf; void *pad; int undo_pos, undo_len; - + double mtime; } Text; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index a7759a1d143..3da0bdb6ca2 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -140,6 +140,8 @@ 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; @@ -162,7 +164,7 @@ typedef struct ThemeUI { /* Interface Elements (buttons, menus, icons) */ uiWidgetColors wcol_regular, wcol_tool, 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; @@ -183,6 +185,14 @@ typedef struct ThemeUI { /* Axis Colors */ char xaxis[4], yaxis[4], zaxis[4]; + + /* Manipulator Colors. */ + char manipulator_hi[4]; + char manipulator_primary[4]; + char manipulator_secondary[4]; + char manipulator_a[4]; + char manipulator_b[4]; + char pad2[4]; } ThemeUI; /* try to put them all in one, if needed a special struct can be created as well @@ -501,7 +511,8 @@ typedef struct UserDef { short gp_settings; /* eGP_UserdefSettings */ short tb_leftmouse, tb_rightmouse; struct SolidLight light[3]; - short tw_hotspot, tw_flag, tw_handlesize, tw_size; + short manipulator_flag, manipulator_size; + int pad6; short textimeout, texcollectrate; short wmdrawmethod; /* eWM_DrawMethod */ short dragthreshold; @@ -607,7 +618,7 @@ typedef enum eUserPref_Flag { USER_FLAG_DEPRECATED_1 = (1 << 1), /* cleared */ 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 */ @@ -817,6 +828,12 @@ typedef enum eGP_UserdefSettings { GP_PAINT_DOSIMPLIFY = (1 << 1), } eGP_UserdefSettings; +enum { + USER_MANIPULATOR_DRAW = (1 << 0), + USER_MANIPULATOR_DRAW_NAVIGATE = (1 << 1), + USER_MANIPULATOR_SHADED = (1 << 8), +}; + /* Color Picker Types. * UserDef.color_picker_type */ typedef enum eColorPicker_Types { diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index b9894d46b5b..619f9fd4f6e 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -45,6 +45,7 @@ struct SmoothView3DStore; struct wmTimer; struct Material; struct GPUFX; +struct GPUViewport; /* This is needed to not let VC choke on near and far... old * proprietary MS extensions... */ @@ -65,21 +66,12 @@ struct GPUFX; /* The near/far thing is a Win EXCEPTION. Thus, leave near/far in the * code, and patch for windows. */ - -/* 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 View3DDebug { + float znear, zfar; + char background; + char pad[7]; +} View3DDebug; /* ********************************* */ @@ -111,8 +103,12 @@ typedef struct RegionView3D { struct wmTimer *smooth_timer; - /* transform widget matrix */ + /* transform manipulator 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]; + char _pad[4]; 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' */ @@ -130,7 +126,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; @@ -147,6 +143,7 @@ typedef struct RegionView3D { float rot_axis[3]; struct GPUFX *compositor; + struct GPUViewport *viewport; } RegionView3D; /* 3D ViewPort Struct */ @@ -173,9 +170,6 @@ 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 */ @@ -202,7 +196,7 @@ typedef struct View3D { short gridsubdiv; /* Number of subdivisions in the grid between each highlighted grid line */ char gridflag; - /* transform widget info */ + /* transform manipulator info */ char twtype, twmode, twflag; short flag3; @@ -217,8 +211,9 @@ typedef struct View3D { char multiview_eye; /* multiview current eye - for internal use */ - /* built-in shader effects (eGPUFXFlags) */ - char pad3[4]; + /* The active custom transform orientation of this 3D view. */ + short custom_orientation_index; + char pad3[2]; /* note, 'fx_settings.dof' is currently _not_ allocated, * instead set (temporarily) from camera */ @@ -245,6 +240,7 @@ typedef struct View3D { short prev_drawtype; short pad1; float pad2; + View3DDebug debug; } View3D; @@ -255,7 +251,7 @@ typedef struct View3D { /* View3D->flag (short) */ /*#define V3D_DISPIMAGE 1*/ /*UNUSED*/ -#define V3D_DISPBGPICS 2 +/*#define V3D_DISPBGPICS 2*/ /* UNUSED */ #define V3D_HIDE_HELPLINES 4 #define V3D_INVALID_BACKBUF 8 @@ -315,12 +311,19 @@ 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_MODE_SHADE_OVERRIDE (1 << 15) /* View3d->flag3 (short) */ #define V3D_SHOW_WORLD (1 << 0) +/* View3d->debug.background */ +enum { + V3D_DEBUG_BACKGROUND_NONE = (1 << 0), + V3D_DEBUG_BACKGROUND_GRADIENT = (1 << 1), + V3D_DEBUG_BACKGROUND_WORLD = (1 << 2), +}; + /* View3D->around */ enum { /* center of the bounding box */ @@ -362,38 +365,13 @@ enum { #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_CUSTOM 5 -/* BGPic->flag */ -/* may want to use 1 for select ? */ +/* View3d->twflag (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), + V3D_MANIPULATOR_DRAW = (1 << 0), }; -#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 20470ba862e..f03ff4ba8b7 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -41,6 +41,7 @@ struct wmWindowManager; struct wmWindow; +struct wmMsgBus; struct wmEvent; struct wmGesture; struct wmOperatorType; @@ -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,14 @@ typedef struct wmWindow { struct wmWindow *next, *prev; void *ghostwin; /* don't want to include ghost.h stuff */ + void *gwnctx; /* don't want to include gawin stuff */ + + struct Scene *scene; /* The scene displayed in this window. */ + struct Scene *new_scene; /* temporary when switching */ - 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 WorkSpaceInstanceHook *workspace_hook; + + struct bScreen *screen DNA_DEPRECATED; short posx, posy, sizex, sizey; /* window coords */ short windowstate; /* borderless, full */ @@ -193,8 +201,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,8 +211,6 @@ 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) @@ -219,7 +224,6 @@ typedef struct wmWindow { 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 */ @@ -311,6 +315,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 */ diff --git a/source/blender/makesdna/DNA_workspace_types.h b/source/blender/makesdna/DNA_workspace_types.h new file mode 100644 index 00000000000..894119b1e72 --- /dev/null +++ b/source/blender/makesdna/DNA_workspace_types.h @@ -0,0 +1,169 @@ +/* + * ***** 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 bToolDef { + /* either the keymap AND/OR manipulator_group must be defined. */ + char keymap[64]; + char manipulator_group[64]; + int spacetype; + /* index when a tool is a member of a group */ + int index; +} bToolDef; + +/** + * \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 DNA_PRIVATE_WORKSPACE; + /* 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 */ + ListBase scene_viewlayer_relations DNA_PRIVATE_WORKSPACE_READ_WRITE; /* WorkSpaceDataRelation */ + + /* Feature tagging (use for addons) */ + ListBase owner_ids DNA_PRIVATE_WORKSPACE_READ_WRITE; /* wmOwnerID */ + + /* Custom transform orientations */ + ListBase transform_orientations DNA_PRIVATE_WORKSPACE; + + int pad; + int flags DNA_PRIVATE_WORKSPACE; /* enum eWorkSpaceFlags */ + + short object_mode, object_mode_restore; + char _pad[4]; + + /* should be: '#ifdef USE_WORKSPACE_TOOL'. */ + bToolDef tool; + + struct ViewLayer *view_layer DNA_DEPRECATED; + struct ViewRender view_render; +} 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 comming 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_SCENE_SETTINGS = (1 << 0), + 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 5fd4c9fd407..3361e50e257 100644 --- a/source/blender/makesdna/DNA_world_types.h +++ b/source/blender/makesdna/DNA_world_types.h @@ -120,7 +120,8 @@ typedef struct World { 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]; + short pr_texture, use_nodes, pad; + short update_flag; /* XXX temporary flag waiting for depsgraph proper tagging */ /* previews */ struct PreviewImage *preview; @@ -128,6 +129,7 @@ typedef struct World { /* nodes */ struct bNodeTree *nodetree; + float mistend, pad1; /* runtime : miststa + mistdist, used for drawing camera */ ListBase gpumaterial; /* runtime */ } World; @@ -161,6 +163,12 @@ enum { WO_AOMUL = 3, }; +enum { + 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 diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 2e21223d042..c9385f98584 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; @@ -361,6 +403,10 @@ static bool init_structDNA( *r_error_message = "NAME error in SDNA file"; 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++) { @@ -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++; @@ -412,6 +480,14 @@ static bool init_structDNA( /* struct Screen was already used by X, 'bScreen' replaces the old IrisGL 'Screen' struct */ if (strcmp("bScreen", cp) == 0) sdna->types[nr] = cp + 1; } + 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++; cp++; @@ -554,7 +630,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 92d54e25829..f0f1c2210f0 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -130,6 +130,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 +508,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++; @@ -1342,4 +1357,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 */ |