Depsgraph: New dependency graph integration commit
[blender.git] / source / blender / makesdna / DNA_scene_types.h
index e055374502592de80f6fc2c016334a48f4ee5413..fe346eecec5aa751a060728767a5d228df95c2ce 100644 (file)
@@ -46,7 +46,10 @@ extern "C" {
 #include "DNA_listBase.h"
 #include "DNA_ID.h"
 #include "DNA_freestyle_types.h"
+#include "DNA_gpu_types.h"
+#include "DNA_userdef_types.h"
 
+struct CurveMapping;
 struct Object;
 struct Brush;
 struct World;
@@ -60,6 +63,7 @@ struct Editing;
 struct SceneStats;
 struct bGPdata;
 struct MovieClip;
+struct ColorSpace;
 
 /* ************************************************************* */
 /* Scene Data */
@@ -187,7 +191,7 @@ typedef struct SceneRenderLayer {
        int pass_xor;
 
        int samples;
-       int pad;
+       float pass_alpha_threshold;
        
        struct FreestyleConfig freestyleConfig;
 } SceneRenderLayer;
@@ -209,40 +213,110 @@ typedef struct SceneRenderLayer {
 #define SCE_LAY_NEG_ZMASK      0x80000
 
 /* srl->passflag */
-#define SCE_PASS_COMBINED                              (1<<0)
-#define SCE_PASS_Z                                             (1<<1)
-#define SCE_PASS_RGBA                                  (1<<2)
-#define SCE_PASS_DIFFUSE                               (1<<3)
-#define SCE_PASS_SPEC                                  (1<<4)
-#define SCE_PASS_SHADOW                                        (1<<5)
-#define SCE_PASS_AO                                            (1<<6)
-#define SCE_PASS_REFLECT                               (1<<7)
-#define SCE_PASS_NORMAL                                        (1<<8)
-#define SCE_PASS_VECTOR                                        (1<<9)
-#define SCE_PASS_REFRACT                               (1<<10)
-#define SCE_PASS_INDEXOB                               (1<<11)
-#define SCE_PASS_UV                                            (1<<12)
-#define SCE_PASS_INDIRECT                              (1<<13)
-#define SCE_PASS_MIST                                  (1<<14)
-#define SCE_PASS_RAYHITS                               (1<<15)
-#define SCE_PASS_EMIT                                  (1<<16)
-#define SCE_PASS_ENVIRONMENT                   (1<<17)
-#define SCE_PASS_INDEXMA                               (1<<18)
-#define SCE_PASS_DIFFUSE_DIRECT                        (1<<19)
-#define SCE_PASS_DIFFUSE_INDIRECT              (1<<20)
-#define SCE_PASS_DIFFUSE_COLOR                 (1<<21)
-#define SCE_PASS_GLOSSY_DIRECT                 (1<<22)
-#define SCE_PASS_GLOSSY_INDIRECT               (1<<23)
-#define SCE_PASS_GLOSSY_COLOR                  (1<<24)
-#define SCE_PASS_TRANSM_DIRECT                 (1<<25)
-#define SCE_PASS_TRANSM_INDIRECT               (1<<26)
-#define SCE_PASS_TRANSM_COLOR                  (1<<27)
-#define SCE_PASS_SUBSURFACE_DIRECT             (1<<28)
-#define SCE_PASS_SUBSURFACE_INDIRECT   (1<<29)
-#define SCE_PASS_SUBSURFACE_COLOR              (1<<30)
+typedef enum ScenePassType {
+       SCE_PASS_COMBINED                 = (1 << 0),
+       SCE_PASS_Z                        = (1 << 1),
+       SCE_PASS_RGBA                     = (1 << 2),
+       SCE_PASS_DIFFUSE                  = (1 << 3),
+       SCE_PASS_SPEC                     = (1 << 4),
+       SCE_PASS_SHADOW                   = (1 << 5),
+       SCE_PASS_AO                       = (1 << 6),
+       SCE_PASS_REFLECT                  = (1 << 7),
+       SCE_PASS_NORMAL                   = (1 << 8),
+       SCE_PASS_VECTOR                   = (1 << 9),
+       SCE_PASS_REFRACT                  = (1 << 10),
+       SCE_PASS_INDEXOB                  = (1 << 11),
+       SCE_PASS_UV                       = (1 << 12),
+       SCE_PASS_INDIRECT                 = (1 << 13),
+       SCE_PASS_MIST                     = (1 << 14),
+       SCE_PASS_RAYHITS                  = (1 << 15),
+       SCE_PASS_EMIT                     = (1 << 16),
+       SCE_PASS_ENVIRONMENT              = (1 << 17),
+       SCE_PASS_INDEXMA                  = (1 << 18),
+       SCE_PASS_DIFFUSE_DIRECT           = (1 << 19),
+       SCE_PASS_DIFFUSE_INDIRECT         = (1 << 20),
+       SCE_PASS_DIFFUSE_COLOR            = (1 << 21),
+       SCE_PASS_GLOSSY_DIRECT            = (1 << 22),
+       SCE_PASS_GLOSSY_INDIRECT          = (1 << 23),
+       SCE_PASS_GLOSSY_COLOR             = (1 << 24),
+       SCE_PASS_TRANSM_DIRECT            = (1 << 25),
+       SCE_PASS_TRANSM_INDIRECT          = (1 << 26),
+       SCE_PASS_TRANSM_COLOR             = (1 << 27),
+       SCE_PASS_SUBSURFACE_DIRECT        = (1 << 28),
+       SCE_PASS_SUBSURFACE_INDIRECT      = (1 << 29),
+       SCE_PASS_SUBSURFACE_COLOR         = (1 << 30),
+       SCE_PASS_DEBUG                    = (1 << 31),  /* This is a virtual pass. */
+} ScenePassType;
 
 /* note, srl->passflag is treestore element 'nr' in outliner, short still... */
 
+/* View - MultiView */
+typedef struct SceneRenderView {
+       struct SceneRenderView *next, *prev;
+
+       char name[64];  /* MAX_NAME */
+       char suffix[64];        /* MAX_NAME */
+
+       int viewflag;
+       int pad[2];
+       char pad2[4];
+
+} SceneRenderView;
+
+/* srv->viewflag */
+#define SCE_VIEW_DISABLE               (1<<0)
+
+/* scene.render.views_format */
+enum {
+       SCE_VIEWS_FORMAT_STEREO_3D = 0,
+       SCE_VIEWS_FORMAT_MULTIVIEW = 1,
+};
+
+/* ImageFormatData.views_output */
+enum {
+       R_IMF_VIEWS_INDIVIDUAL = 0,
+       R_IMF_VIEWS_STEREO_3D  = 1,
+       R_IMF_VIEWS_MULTIVIEW  = 2,
+};
+
+typedef struct Stereo3dFormat {
+       short flag;
+       char display_mode; /* encoding mode */
+       char anaglyph_type; /* anaglyph scheme for the user display */
+       char interlace_type;  /* interlace type for the user display */
+       char pad[3];
+} Stereo3dFormat;
+
+/* Stereo3dFormat.display_mode */
+typedef enum eStereoDisplayMode {
+       S3D_DISPLAY_ANAGLYPH    = 0,
+       S3D_DISPLAY_INTERLACE   = 1,
+       S3D_DISPLAY_PAGEFLIP    = 2,
+       S3D_DISPLAY_SIDEBYSIDE  = 3,
+       S3D_DISPLAY_TOPBOTTOM   = 4,
+} eStereoDisplayMode;
+
+/* Stereo3dFormat.flag */
+typedef enum eStereo3dFlag {
+       S3D_INTERLACE_SWAP        = (1 << 0),
+       S3D_SIDEBYSIDE_CROSSEYED  = (1 << 1),
+       S3D_SQUEEZED_FRAME        = (1 << 2),
+} eStereo3dFlag;
+
+/* Stereo3dFormat.anaglyph_type */
+typedef enum eStereo3dAnaglyphType {
+       S3D_ANAGLYPH_REDCYAN      = 0,
+       S3D_ANAGLYPH_GREENMAGENTA = 1,
+       S3D_ANAGLYPH_YELLOWBLUE   = 2,
+} eStereo3dAnaglyphType;
+
+/* Stereo3dFormat.interlace_type */
+typedef enum eStereo3dInterlaceType {
+       S3D_INTERLACE_ROW          = 0,
+       S3D_INTERLACE_COLUMN       = 1,
+       S3D_INTERLACE_CHECKERBOARD = 2,
+} eStereo3dInterlaceType;
+
 /* *************************************************************** */
 
 /* Generic image format settings,
@@ -280,7 +354,11 @@ typedef struct ImageFormatData {
        char  jp2_flag;
        char jp2_codec;
 
-       char pad[6];
+       char pad[5];
+
+       /* Multiview */
+       char views_format;
+       Stereo3dFormat stereo3d_format;
 
        /* color management */
        ColorManagedViewSettings view_settings;
@@ -316,6 +394,7 @@ typedef struct ImageFormatData {
 #define R_IMF_IMTYPE_H264           31
 #define R_IMF_IMTYPE_XVID           32
 #define R_IMF_IMTYPE_THEORA         33
+#define R_IMF_IMTYPE_PSD            34
 
 #define R_IMF_IMTYPE_INVALID        255
 
@@ -343,6 +422,12 @@ typedef struct ImageFormatData {
 #define R_IMF_EXR_CODEC_ZIP   2
 #define R_IMF_EXR_CODEC_PIZ   3
 #define R_IMF_EXR_CODEC_RLE   4
+#define R_IMF_EXR_CODEC_ZIPS  5
+#define R_IMF_EXR_CODEC_B44   6
+#define R_IMF_EXR_CODEC_B44A  7
+#define R_IMF_EXR_CODEC_DWAA  8
+#define R_IMF_EXR_CODEC_DWAB  9
+#define R_IMF_EXR_CODEC_MAX  10
 
 /* ImageFormatData.jp2_flag */
 #define R_IMF_JP2_FLAG_YCC          (1<<0)  /* when disabled use RGB */ /* was R_JPEG2K_YCC */
@@ -356,6 +441,42 @@ typedef struct ImageFormatData {
 /* ImageFormatData.cineon_flag */
 #define R_IMF_CINEON_FLAG_LOG (1<<0)  /* was R_CINEON_LOG */
 
+typedef struct BakeData {
+       struct ImageFormatData im_format;
+
+       char filepath[1024]; /* FILE_MAX */
+
+       short width, height;
+       short margin, flag;
+
+       float cage_extrusion;
+       float pad2;
+
+       char normal_swizzle[3];
+       char normal_space;
+
+       char save_mode;
+       char pad[3];
+
+       char cage[64];  /* MAX_NAME */
+} BakeData;
+
+/* (char) normal_swizzle */
+typedef enum BakeNormalSwizzle {
+       R_BAKE_POSX = 0,
+       R_BAKE_POSY = 1,
+       R_BAKE_POSZ = 2,
+       R_BAKE_NEGX = 3,
+       R_BAKE_NEGY = 4,
+       R_BAKE_NEGZ = 5,
+} BakeNormalSwizzle;
+
+/* (char) save_mode */
+typedef enum BakeSaveMode {
+       R_BAKE_SAVE_INTERNAL = 0,
+       R_BAKE_SAVE_EXTERNAL = 1,
+} BakeSaveMode;
+
 /* *************************************************************** */
 /* Render Data */
 
@@ -511,6 +632,7 @@ typedef struct RenderData {
        short bake_normal_space, bake_quad_split;
        float bake_maxdist, bake_biasdist;
        short bake_samples, bake_pad;
+       float bake_user_scale, bake_pad1;
 
        /* path to render output */
        char pic[1024]; /* 1024 = FILE_MAX */
@@ -535,8 +657,10 @@ typedef struct RenderData {
        /* render simplify */
        int simplify_flag;
        short simplify_subsurf;
-       short simplify_shadowsamples;
+       short simplify_subsurf_render;
+       short simplify_shadowsamples, pad9;
        float simplify_particles;
+       float simplify_particles_render;
        float simplify_aosss;
 
        /* cineon */
@@ -560,6 +684,18 @@ typedef struct RenderData {
 
        /* render engine */
        char engine[32];
+
+       /* Cycles baking */
+       struct BakeData bake;
+
+       int preview_start_resolution;
+       int pad;
+
+       /* MultiView */
+       ListBase views;
+       short actview;
+       short views_format;
+       short pad8[2];
 } RenderData;
 
 /* *************************************************************** */
@@ -662,7 +798,12 @@ typedef struct GameData {
        short obstacleSimulation;
        short raster_storage;
        float levelHeight;
-       float deactivationtime, lineardeactthreshold, angulardeactthreshold, pad2;
+       float deactivationtime, lineardeactthreshold, angulardeactthreshold;
+
+       /* Scene LoD */
+       short lodflag, pad2;
+       int scehysteresis, pad5;
+
 } GameData;
 
 #define STEREO_NOSTEREO                1
@@ -677,6 +818,7 @@ typedef struct GameData {
 #define STEREO_SIDEBYSIDE      6
 #define STEREO_VINTERLACE      7
 //#define STEREO_DOME          8
+#define STEREO_3DTVTOPBOTTOM 9
 
 /* physicsEngine */
 #define WOPHY_NONE             0
@@ -694,8 +836,8 @@ typedef struct GameData {
 #define RAS_STORE_VBO          3
 
 /* vsync */
-#define VSYNC_OFF      0
-#define VSYNC_O      1
+#define VSYNC_O      0
+#define VSYNC_OFF      1
 #define VSYNC_ADAPTIVE 2
 
 /* GameData.flag */
@@ -724,9 +866,18 @@ typedef struct GameData {
 #define GAME_PLAYER_DESKTOP_RESOLUTION         (1 << 1)
 
 /* GameData.matmode */
-#define GAME_MAT_TEXFACE       0
-#define GAME_MAT_MULTITEX      1
-#define GAME_MAT_GLSL          2
+enum {
+       GAME_MAT_TEXFACE    = 0, /* deprecated */
+       GAME_MAT_MULTITEX   = 1,
+       GAME_MAT_GLSL       = 2,
+};
+
+#if (DNA_DEPRECATED_GCC_POISON == 1)
+#pragma GCC poison GAME_MAT_TEXFACE
+#endif
+
+/* GameData.lodflag */
+#define SCE_LOD_USE_HYST               (1 << 0)
 
 /* UV Paint */
 #define UV_SCULPT_LOCK_BORDERS                         1
@@ -739,6 +890,19 @@ typedef struct GameData {
 #define UV_SCULPT_TOOL_RELAX_LAPLACIAN 1
 #define UV_SCULPT_TOOL_RELAX_HC                        2
 
+/* Stereo Flags */
+#define STEREO_RIGHT_NAME "right"
+#define STEREO_LEFT_NAME "left"
+#define STEREO_RIGHT_SUFFIX "_R"
+#define STEREO_LEFT_SUFFIX "_L"
+
+typedef enum StereoViews {
+       STEREO_LEFT_ID = 0,
+       STEREO_RIGHT_ID = 1,
+       STEREO_3D_ID = 2,
+       STEREO_MONO_ID = 3,
+} StereoViews;
+
 /* Markers */
 
 typedef struct TimeMarker {    
@@ -757,7 +921,9 @@ typedef struct TimeMarker {
 /* Paint Tool Base */
 typedef struct Paint {
        struct Brush *brush;
-       
+       struct Palette *palette;
+       struct CurveMapping *cavity_curve; /* cavity curve */
+
        /* WM Paint cursor */
        void *paint_cursor;
        unsigned char paint_cursor_col[4];
@@ -769,7 +935,8 @@ typedef struct Paint {
         * smooth the stroke */
        int num_input_samples;
        
-       int pad;
+       /* flags used for symmetry */
+       int symmetry_flags;
 } Paint;
 
 /* ------------------------------------------- */
@@ -779,15 +946,20 @@ typedef struct Paint {
 typedef struct ImagePaintSettings {
        Paint paint;
 
-       short flag, pad;
+       short flag, missing_data;
        
        /* for projection painting only */
        short seam_bleed, normal_angle;
        short screen_grab_size[2]; /* capture size for re-projection */
 
-       int pad1;
+       int mode;                  /* mode used for texture painting */
 
-       void *paintcursor;                      /* wm handle */
+       void *paintcursor;                 /* wm handle */
+       struct Image *stencil;     /* workaround until we support true layer masks */
+       struct Image *clone;       /* clone layer for image mode for projective texture painting */
+       struct Image *canvas;      /* canvas when the explicit system is used for painting */
+       float stencil_col[3];
+       float dither;              /* dither amount used when painting on byte images */
 } ImagePaintSettings;
 
 /* ------------------------------------------- */
@@ -820,6 +992,7 @@ typedef struct ParticleEditSettings {
 
        struct Scene *scene;
        struct Object *object;
+       struct Object *shape_object;
 } ParticleEditSettings;
 
 /* ------------------------------------------- */
@@ -838,10 +1011,21 @@ typedef struct Sculpt {
        int radial_symm[3];
 
        /* Maximum edge length for dynamic topology sculpting (in pixels) */
-       int detail_size;
+       float detail_size;
 
        /* Direction used for SCULPT_OT_symmetrize operator */
        int symmetrize_direction;
+
+       /* gravity factor for sculpting */
+       float gravity_factor;
+
+       /* scale for constant detail size */
+       float constant_detail;
+       float detail_percent;
+       float pad;
+
+       struct Object *gravity_object;
+       void *pad2;
 } Sculpt;
 
 typedef struct UvSculpt {
@@ -865,7 +1049,7 @@ typedef struct VPaint {
 /* VPaint.flag */
 enum {
        // VP_COLINDEX  = (1 << 0),  /* only paint onto active material*/  /* deprecated since before 2.49 */
-       VP_AREA         = (1 << 1),
+       // VP_AREA      = (1 << 1),  /* deprecated since 2.70 */
        VP_NORMALS      = (1 << 3),
        VP_SPRAY        = (1 << 4),
        // VP_MIRROR_X  = (1 << 5),  /* deprecated in 2.5x use (me->editflag & ME_EDIT_MIRROR_X) */
@@ -902,6 +1086,11 @@ typedef struct UnifiedPaintSettings {
        /* unified brush weight, [0, 1] */
        float weight;
 
+       /* unified brush color */
+       float rgb[3];
+       /* unified brush secondary color */
+       float secondary_rgb[3];
+
        /* user preferences for sculpt and paint */
        int flag;
 
@@ -909,18 +1098,39 @@ typedef struct UnifiedPaintSettings {
 
        /* record movement of mouse so that rake can start at an intuitive angle */
        float last_rake[2];
-       int pad;
+       float last_rake_angle;
+       
+       int last_stroke_valid;
+       float average_stroke_accum[3];
+       int average_stroke_counter;
+       
 
        float brush_rotation;
+       float brush_rotation_sec;
+
+       /*********************************************************************************
+        *  all data below are used to communicate with cursor drawing and tex sampling  *
+        *********************************************************************************/
+       int anchored_size;
+
+       float overlap_factor; /* normalization factor due to accumulated value of curve along spacing.
+                              * Calculated when brush spacing changes to dampen strength of stroke
+                              * if space attenuation is used*/
+       char draw_inverted;
+       /* check is there an ongoing stroke right now */
+       char stroke_active;
+
+       char draw_anchored;
+       char do_linear_conversion;
 
-       // all this below is used to communicate with the cursor drawing routine
-       int draw_anchored;
-       int   anchored_size;
        float anchored_initial_mouse[2];
 
+       /* radius of brush, premultiplied with pressure.
+        * In case of anchored brushes contains the anchored radius */
+       float pixel_radius;
+
        /* drawing pressure */
-       int draw_pressure;
-       float pressure_value;
+       float size_pressure_value;
 
        /* position of mouse, used to sample the texture */
        float tex_mouse[2];
@@ -928,17 +1138,17 @@ typedef struct UnifiedPaintSettings {
        /* position of mouse, used to sample the mask texture */
        float mask_tex_mouse[2];
 
-       /* radius of brush, premultiplied with pressure.
-        * In case of anchored brushes contains that radius */
-       float pixel_radius;
+       /* ColorSpace cache to avoid locking up during sampling */
+       struct ColorSpace *colorspace;
 } UnifiedPaintSettings;
 
 typedef enum {
        UNIFIED_PAINT_SIZE  = (1 << 0),
        UNIFIED_PAINT_ALPHA = (1 << 1),
        UNIFIED_PAINT_WEIGHT = (1 << 5),
+       UNIFIED_PAINT_COLOR = (1 << 6),
 
-       /* only used if unified size is enabled, mirros the brush flags
+       /* only used if unified size is enabled, mirrors the brush flags
         * BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */
        UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1 << 2),
        UNIFIED_PAINT_BRUSH_SIZE_PRESSURE   = (1 << 3),
@@ -982,17 +1192,6 @@ typedef struct ToolSettings {
         * paint */
        float vgroup_weight;
 
-       /* Subdivide Settings */
-       short cornertype;
-       short pad1;
-       /*Triangle to Quad conversion threshold*/
-       float jointrilimit;
-       /* Editmode Tools */
-       float degr; 
-       short step;
-       short turn; 
-       
-       float extr_offs;        /* extrude offset */
        float doublimit;        /* remove doubles limit */
        float normalsize;       /* size of normals */
        short automerge;
@@ -1000,30 +1199,22 @@ typedef struct ToolSettings {
        /* Selection Mode for Mesh */
        short selectmode;
 
-       /* Primitive Settings */
-       /* UV Sphere */
-       short segments;
-       short rings;
-       
-       /* Cylinder - Tube - Circle */
-       short vertices;
-
        /* UV Calculation */
-       short unwrapper;
-       float uvcalc_radius;
-       float uvcalc_cubesize;
+       char unwrapper;
+       char uvcalc_flag;
+       char uv_flag;
+       char uv_selectmode;
+
        float uvcalc_margin;
-       short uvcalc_mapdir;
-       short uvcalc_mapalign;
-       short uvcalc_flag;
-       short uv_flag, uv_selectmode;
-       short pad2;
-       
-       /* Grease Pencil */
-       short gpencil_flags;
-       
+
        /* Auto-IK */
-       short autoik_chainlen;
+       short autoik_chainlen;  /* runtime only */
+
+       /* 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 pad[4];
 
        /* Image Paint (8 byttse aligned please!) */
        struct ImagePaintSettings imapaint;
@@ -1036,16 +1227,13 @@ typedef struct ToolSettings {
 
        /* Select Group Threshold */
        float select_thresh;
-       
-       /* Graph Editor */
-       float clean_thresh;
 
        /* Auto-Keying Mode */
        short autokey_mode, autokey_flag;       /* defines in DNA_userdef_types.h */
 
        /* Multires */
        char multires_subdiv_type;
-       char pad3[5];
+       char pad3[1];
 
        /* Skeleton generation */
        short skgen_resolution;
@@ -1085,7 +1273,11 @@ typedef struct ToolSettings {
        short snap_flag, snap_target;
        short proportional, prop_mode;
        char proportional_objects; /* proportional edit, object mode */
-       char proportional_mask; /* proportional edit, object mode */
+       char proportional_mask; /* proportional edit, mask editing */
+       char proportional_action; /* proportional edit, action editor */
+       char proportional_fcurve; /* proportional edit, graph editor */
+       char lock_markers; /* lock marker editing */
+       char pad4[5];
 
        char auto_normalize; /*auto normalizing mode in wpaint*/
        char multipaint; /* paint multiple bones in wpaint */
@@ -1141,6 +1333,21 @@ typedef struct PhysicsSettings {
        int flag, quick_cache_step, rt;
 } PhysicsSettings;
 
+/* ------------------------------------------- */
+/* Safe Area options used in Camera View & VSE
+ */
+typedef struct DisplaySafeAreas {
+       /* each value represents the (x,y) margins as a multiplier.
+        * 'center' in this context is just the name for a different kind of safe-area */
+
+       float title[2];         /* Title Safe */
+       float action[2];        /* Image/Graphics Safe */
+
+       /* use for alternate aspect ratio */
+       float title_center[2];
+       float action_center[2];
+} DisplaySafeAreas;
+
 /* *************************************************************** */
 /* Scene ID-Block */
 
@@ -1167,7 +1374,8 @@ typedef struct Scene {
        
        short flag;                                                             /* various settings */
        
-       short use_nodes;
+       char use_nodes;
+       char pad[1];
        
        struct bNodeTree *nodetree;
        
@@ -1175,6 +1383,7 @@ typedef struct Scene {
        
        struct ToolSettings *toolsettings;              /* default allocated now */
        struct SceneStats *stats;                               /* default allocated now */
+       struct DisplaySafeAreas safe_areas;
 
        /* migrate or replace? depends on some internal things... */
        /* no, is on the right place (ton) */
@@ -1192,6 +1401,7 @@ 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;
        struct  DagForest *theDag;
        short dagflags;
        short recalc;                           /* recalc = counterpart of ob->recalc */
@@ -1228,12 +1438,14 @@ typedef struct Scene {
        struct RigidBodyWorld *rigidbody_world;
 } Scene;
 
-
 /* **************** RENDERDATA ********************* */
 
 /* flag */
        /* use preview range */
 #define SCER_PRV_RANGE (1<<0)
+#define SCER_LOCK_FRAME_SELECTION      (1<<1)
+       /* timeline/keyframe jumping - only selected items (on by default) */
+#define SCE_KEYS_NO_SELONLY    (1<<2)
 
 /* mode (int now) */
 #define R_OSA                  0x0001
@@ -1296,7 +1508,7 @@ typedef struct Scene {
 /* raytrace structure */
 #define R_RAYSTRUCTURE_AUTO                            0
 #define R_RAYSTRUCTURE_OCTREE                  1
-#define R_RAYSTRUCTURE_BLIBVH                  2
+#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 */
@@ -1327,6 +1539,8 @@ typedef struct Scene {
 /* #define R_RECURS_PROTECTION 0x20000 */
 #define R_TEXNODE_PREVIEW      0x40000
 #define R_VIEWPORT_PREVIEW     0x80000
+#define R_EXR_CACHE_FILE       0x100000
+#define R_MULTIVIEW                    0x200000
 
 /* r->stamp */
 #define R_STAMP_TIME   0x0001
@@ -1351,21 +1565,36 @@ typedef struct Scene {
 /*#define R_ALPHAKEY           2*/ /* deprecated, shouldn't be used */
 
 /* color_mgt_flag */
-#define R_COLOR_MANAGEMENT              (1 << 0)  /* deprecated, should only be used in versioning code only */
-/*#define R_COLOR_MANAGEMENT_PREDIVIDE    (1 << 1)*/  /* deprecated, shouldn't be used */
+enum {
+       R_COLOR_MANAGEMENT              = (1 << 0),  /* deprecated, should only be used in versioning code only */
+       /*R_COLOR_MANAGEMENT_PREDIVIDE    = (1 << 1)*/  /* deprecated, shouldn't be used */
+};
+
+#if 0  /* TODO */
+#if (DNA_DEPRECATED_GCC_POISON == 1)
+#pragma GCC poison R_COLOR_MANAGEMENT
+#endif
+#endif
 
 /* subimtype, flag options for imtype */
-#define R_OPENEXR_HALF    1                                      /*deprecated*/
-#define R_OPENEXR_ZBUF    2                                      /*deprecated*/
-#define R_PREVIEW_JPG    4                                       /*deprecated*/
-#define R_CINEON_LOG     8                                       /*deprecated*/
-#define R_TIFF_16BIT    16                                       /*deprecated*/
-
-#define R_JPEG2K_12BIT    32 /* Jpeg2000 */                      /*deprecated*/
-#define R_JPEG2K_16BIT    64                                     /*deprecated*/
-#define R_JPEG2K_YCC    128 /* when disabled use RGB */          /*deprecated*/
-#define R_JPEG2K_CINE_PRESET    256                              /*deprecated*/
-#define R_JPEG2K_CINE_48FPS        512                           /*deprecated*/
+enum {
+       R_OPENEXR_HALF  = 1,  /*deprecated*/
+       R_OPENEXR_ZBUF  = 2,  /*deprecated*/
+       R_PREVIEW_JPG   = 4,  /*deprecated*/
+       R_CINEON_LOG    = 8,  /*deprecated*/
+       R_TIFF_16BIT    = 16, /*deprecated*/
+
+       R_JPEG2K_12BIT                  =     32,  /* Jpeg2000 */                    /*deprecated*/
+       R_JPEG2K_16BIT                  =     64,                                    /*deprecated*/
+       R_JPEG2K_YCC                    =     128,  /* when disabled use RGB */      /*deprecated*/
+       R_JPEG2K_CINE_PRESET    =     256,                                   /*deprecated*/
+       R_JPEG2K_CINE_48FPS             =     512,                                   /*deprecated*/
+};
+
+#if (DNA_DEPRECATED_GCC_POISON == 1)
+#pragma GCC poison R_OPENEXR_HALF R_OPENEXR_ZBUF R_PREVIEW_JPG R_CINEON_LOG R_TIFF_16BIT
+#pragma GCC poison R_JPEG2K_12BIT R_JPEG2K_16BIT R_JPEG2K_YCC R_JPEG2K_CINE_PRESET R_JPEG2K_CINE_48FPS
+#endif
 
 /* bake_mode: same as RE_BAKE_xxx defines */
 /* bake_flag: */
@@ -1376,6 +1605,10 @@ typedef struct Scene {
 #define R_BAKE_MULTIRES                16
 #define R_BAKE_LORES_MESH      32
 #define R_BAKE_VCOL                    64
+#define R_BAKE_USERSCALE       128
+#define R_BAKE_CAGE                    256
+#define R_BAKE_SPLIT_MAT       512
+#define R_BAKE_AUTO_NAME       1024
 
 /* bake_normal_space */
 #define R_BAKE_SPACE_CAMERA     0
@@ -1392,7 +1625,10 @@ typedef struct Scene {
 
 /* sequencer seq_prev_type seq_rend_type */
 
-
+/* scene->r.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_CYCLES;
 
 /* **************** SCENE ********************* */
 
@@ -1477,6 +1713,7 @@ typedef struct Scene {
 #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
 
 /* toolsettings->selectmode */
 #define SCE_SELECT_VERTEX      1 /* for mesh */
@@ -1506,7 +1743,8 @@ typedef struct Scene {
 #define PROP_LIN               4
 #define PROP_CONST             5
 #define PROP_RANDOM            6
-#define PROP_MODE_MAX          7
+#define PROP_INVSQUARE         7
+#define PROP_MODE_MAX          8
 
 /* toolsettings->proportional */
 #define PROP_EDIT_OFF                  0
@@ -1546,8 +1784,8 @@ typedef enum eVGroupSelect {
 #define SCE_FRAME_DROP                 (1<<3)
 
 
-       /* return flag BKE_scene_base_iter_next function */
-#define F_ERROR                        -1
+       /* return flag BKE_scene_base_iter_next functions */
+/* #define F_ERROR                     -1 */  /* UNUSED */
 #define F_START                        0
 #define F_SCENE                        1
 #define F_DUPLI                        3
@@ -1558,27 +1796,50 @@ typedef enum eVGroupSelect {
 #define AUDIO_SCRUB                      (1<<2)
 #define AUDIO_VOLUME_ANIMATED     (1<<3)
 
-#define FFMPEG_MULTIPLEX_AUDIO  1 /* deprecated, you can choose none as audiocodec now */
-#define FFMPEG_AUTOSPLIT_OUTPUT 2
-#define FFMPEG_LOSSLESS_OUTPUT  4
+enum {
+       FFMPEG_MULTIPLEX_AUDIO  = 1,  /* deprecated, you can choose none as audiocodec now */
+       FFMPEG_AUTOSPLIT_OUTPUT = 2,
+       FFMPEG_LOSSLESS_OUTPUT  = 4,
+};
+
+#if (DNA_DEPRECATED_GCC_POISON == 1)
+#pragma GCC poison FFMPEG_MULTIPLEX_AUDIO
+#endif
+
 
 /* Paint.flags */
 typedef enum {
        PAINT_SHOW_BRUSH = (1 << 0),
        PAINT_FAST_NAVIGATE = (1 << 1),
        PAINT_SHOW_BRUSH_ON_SURFACE = (1 << 2),
+       PAINT_USE_CAVITY_MASK = (1 << 3)
 } PaintFlags;
 
+/* Paint.symmetry_flags
+ * (for now just a duplicate of sculpt symmetry flags) */
+typedef enum SymmetryFlags {
+       PAINT_SYMM_X = (1 << 0),
+       PAINT_SYMM_Y = (1 << 1),
+       PAINT_SYMM_Z = (1 << 2),
+       PAINT_SYMMETRY_FEATHER = (1 << 3)
+} SymmetryFlags;
+
+#define PAINT_SYMM_AXIS_ALL (PAINT_SYMM_X | PAINT_SYMM_Y | PAINT_SYMM_Z)
+
 /* Sculpt.flags */
 /* These can eventually be moved to paint flags? */
 typedef enum SculptFlags {
+       /* deprecated, part of paint struct symmetry_flags now */
        SCULPT_SYMM_X = (1 << 0),
        SCULPT_SYMM_Y = (1 << 1),
        SCULPT_SYMM_Z = (1 << 2),
+
        SCULPT_LOCK_X = (1 << 3),
        SCULPT_LOCK_Y = (1 << 4),
        SCULPT_LOCK_Z = (1 << 5),
+       /* deprecated, part of paint struct symmetry_flags now */
        SCULPT_SYMMETRY_FEATHER = (1 << 6),
+
        SCULPT_USE_OPENMP = (1 << 7),
        SCULPT_ONLY_DEFORM = (1 << 8),
        SCULPT_SHOW_DIFFUSE = (1 << 9),
@@ -1587,23 +1848,44 @@ typedef enum SculptFlags {
         * dynamic-topology mode */
        SCULPT_DYNTOPO_SMOOTH_SHADING = (1 << 10),
 
-       /* If set, dynamic-topology brushes will collapse short edges in
-        * addition to subdividing long ones */
-       SCULPT_DYNTOPO_COLLAPSE = (1 << 11)
+       /* If set, dynamic-topology brushes will subdivide short edges */
+       SCULPT_DYNTOPO_SUBDIVIDE = (1 << 12),
+       /* If set, dynamic-topology brushes will collapse short edges */
+       SCULPT_DYNTOPO_COLLAPSE = (1 << 11),
+
+       /* If set, dynamic-topology detail size will be constant in object space */
+       SCULPT_DYNTOPO_DETAIL_CONSTANT = (1 << 13),
+       SCULPT_DYNTOPO_DETAIL_BRUSH = (1 << 14),
 } SculptFlags;
 
+typedef enum ImagePaintMode {
+       IMAGEPAINT_MODE_MATERIAL, /* detect texture paint slots from the material */
+       IMAGEPAINT_MODE_IMAGE,    /* select texture paint image directly */
+} ImagePaintMode;
+
+#if (DNA_DEPRECATED_GCC_POISON == 1)
+#pragma GCC poison SCULPT_SYMM_X SCULPT_SYMM_Y SCULPT_SYMM_Z SCULPT_SYMMETRY_FEATHER
+#endif
+
+
 /* ImagePaintSettings.flag */
 #define IMAGEPAINT_DRAWING                             1
 // #define IMAGEPAINT_DRAW_TOOL                        2 // deprecated
 // #define IMAGEPAINT_DRAW_TOOL_DRAWING        4 // deprecated
 
 /* projection painting only */
-#define IMAGEPAINT_PROJECT_XRAY                        16
-#define IMAGEPAINT_PROJECT_BACKFACE            32
-#define IMAGEPAINT_PROJECT_FLAT                        64
-#define IMAGEPAINT_PROJECT_LAYER_CLONE 128
-#define IMAGEPAINT_PROJECT_LAYER_STENCIL       256
-#define IMAGEPAINT_PROJECT_LAYER_STENCIL_INV   512
+#define IMAGEPAINT_PROJECT_XRAY                        (1 << 4)
+#define IMAGEPAINT_PROJECT_BACKFACE            (1 << 5)
+#define IMAGEPAINT_PROJECT_FLAT                        (1 << 6)
+#define IMAGEPAINT_PROJECT_LAYER_CLONE (1 << 7)
+#define IMAGEPAINT_PROJECT_LAYER_STENCIL       (1 << 8)
+#define IMAGEPAINT_PROJECT_LAYER_STENCIL_INV   (1 << 9)
+
+
+#define IMAGEPAINT_MISSING_UVS       (1 << 0)
+#define IMAGEPAINT_MISSING_MATERIAL  (1 << 1)
+#define IMAGEPAINT_MISSING_TEX       (1 << 2)
+#define IMAGEPAINT_MISSING_STENCIL   (1 << 3)
 
 /* toolsettings->uvcalc_flag */
 #define UVCALC_FILLHOLES                       1
@@ -1632,6 +1914,12 @@ typedef enum SculptFlags {
 /* toolsettings->gpencil_flags */
 #define GP_TOOL_FLAG_PAINTSESSIONS_ON  (1<<0)
 
+/* toolsettings->gpencil_src */
+typedef enum eGPencil_Source_3D {
+       GP_TOOL_SOURCE_SCENE    = 0,
+       GP_TOOL_SOURCE_OBJECT   = 1
+} eGPencil_Source_3d;
+
 /* toolsettings->particle flag */
 #define PE_KEEP_LENGTHS                        1
 #define PE_LOCK_FIRST                  2