diff options
Diffstat (limited to 'source/blender/makesdna')
33 files changed, 298 insertions, 146 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 2c9888ec06e..76af761ff27 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -400,16 +400,17 @@ typedef struct Library { ID id; struct FileData *filedata; /** Path name used for reading, can be relative and edited in the outliner. */ - char name[1024]; + char filepath[1024]; /** - * Absolute filepath, this is only for convenience, - * 'name' is the real path used on file read but in - * some cases its useful to access the absolute one. - * This is set on file read. - * Use BKE_library_filepath_set() rather than setting 'name' - * directly and it will be kept in sync - campbell */ - char filepath[1024]; + * Run-time only, absolute file-path (set on read). + * This is only for convenience, `filepath` is the real path + * used on file read but in some cases its useful to access the absolute one. + * + * Use #BKE_library_filepath_set() rather than setting `filepath` + * directly and it will be kept in sync - campbell + */ + char filepath_abs[1024]; /** Set for indirectly linked libs, used in the outliner and while reading. */ struct Library *parent; @@ -557,21 +558,21 @@ typedef enum ID_Type { /* fluidsim Ipo */ #define ID_FLUIDSIM MAKE_ID2('F', 'S') -#define ID_FAKE_USERS(id) ((((ID *)id)->flag & LIB_FAKEUSER) ? 1 : 0) -#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_FAKE_USERS(id) ((((const ID *)id)->flag & LIB_FAKEUSER) ? 1 : 0) +#define ID_REAL_USERS(id) (((const ID *)id)->us - ID_FAKE_USERS(id)) +#define ID_EXTRA_USERS(id) (((const ID *)id)->tag & LIB_TAG_EXTRAUSER ? 1 : 0) #define ID_CHECK_UNDO(id) \ ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM) && (GS((id)->name) != ID_WS)) #define ID_BLEND_PATH(_bmain, _id) \ - ((_id)->lib ? (_id)->lib->filepath : BKE_main_blendfile_path((_bmain))) + ((_id)->lib ? (_id)->lib->filepath_abs : BKE_main_blendfile_path((_bmain))) #define ID_BLEND_PATH_FROM_GLOBAL(_id) \ - ((_id)->lib ? (_id)->lib->filepath : BKE_main_blendfile_path_from_global()) + ((_id)->lib ? (_id)->lib->filepath_abs : BKE_main_blendfile_path_from_global()) -#define ID_MISSING(_id) ((((ID *)(_id))->tag & LIB_TAG_MISSING) != 0) +#define ID_MISSING(_id) ((((const ID *)(_id))->tag & LIB_TAG_MISSING) != 0) -#define ID_IS_LINKED(_id) (((ID *)(_id))->lib != NULL) +#define ID_IS_LINKED(_id) (((const ID *)(_id))->lib != NULL) #define LIB_IS_VIRTUAL(_lib) (((_lib)->flag & LIBRARY_FLAG_VIRTUAL) != 0) #define ID_IS_LINKED_DATABLOCK(_id) (ID_IS_LINKED(_id) && !LIB_IS_VIRTUAL(((ID *)(_id))->lib)) #define ID_IS_LINKED_DATAPATH(_id) (ID_IS_LINKED(_id) && LIB_IS_VIRTUAL(((ID *)(_id))->lib)) @@ -579,10 +580,17 @@ typedef enum ID_Type { /* Note that this is a fairly high-level check, should be used at user interaction level, not in * BKE_library_override typically (especially due to the check on LIB_TAG_EXTERN). */ #define ID_IS_OVERRIDABLE_LIBRARY(_id) \ - (ID_IS_LINKED(_id) && !ID_MISSING(_id) && (((ID *)(_id))->tag & LIB_TAG_EXTERN) != 0) + (ID_IS_LINKED(_id) && !ID_MISSING(_id) && (((const ID *)(_id))->tag & LIB_TAG_EXTERN) != 0) + +#define ID_IS_OVERRIDE_LIBRARY_REAL(_id) \ + (((const ID *)(_id))->override_library != NULL && \ + ((const ID *)(_id))->override_library->reference != NULL) + +#define ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id) \ + ((((const ID *)(_id))->flag & LIB_EMBEDDED_DATA_LIB_OVERRIDE) != 0) #define ID_IS_OVERRIDE_LIBRARY(_id) \ - (((ID *)(_id))->override_library != NULL && ((ID *)(_id))->override_library->reference != NULL) + (ID_IS_OVERRIDE_LIBRARY_REAL(_id) || ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id)) #define ID_IS_OVERRIDE_LIBRARY_TEMPLATE(_id) \ (((ID *)(_id))->override_library != NULL && ((ID *)(_id))->override_library->reference == NULL) @@ -624,6 +632,11 @@ enum { * we want to restore if possible, and silently drop if it's missing. */ LIB_INDIRECT_WEAK_LINK = 1 << 11, + /** + * The data-block is a sub-data of another one, which is an override. + * Note that this also applies to shapekeys, even though they are not 100% embedded data... + */ + LIB_EMBEDDED_DATA_LIB_OVERRIDE = 1 << 12, }; /** diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index c95a701a78a..98e858dbf41 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -703,8 +703,9 @@ typedef struct bDopeSheet { /** String to search for in displayed names of F-Curves, or NlaTracks/GP Layers/etc. */ char searchstr[64]; - /** Flags to use for filtering data. */ + /** Flags to use for filtering data #eAnimFilter_Flags. */ int filterflag; + /** #eDopeSheet_FilterFlag2 */ int filterflag2; /** Standard flags. */ int flag; diff --git a/source/blender/makesdna/DNA_brush_defaults.h b/source/blender/makesdna/DNA_brush_defaults.h index f315cc4b8a0..2ec4f4ee991 100644 --- a/source/blender/makesdna/DNA_brush_defaults.h +++ b/source/blender/makesdna/DNA_brush_defaults.h @@ -47,6 +47,7 @@ .crease_pinch_factor = 0.5f, \ .normal_radius_factor = 0.5f, \ .area_radius_factor = 0.5f, \ + .disconnected_distance_max = 0.1f, \ .sculpt_plane = SCULPT_DISP_DIR_AREA, \ .cloth_damping = 0.01, \ .cloth_mass = 1, \ diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 7490dbe5cdc..4056faf359f 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -439,6 +439,21 @@ typedef struct Brush { float rgb[3]; /** Opacity. */ float alpha; + /** Hardness */ + float hardness; + /** Flow */ + float flow; + /** Wet Mix */ + float wet_mix; + float wet_persistence; + /** Density */ + float density; + + /** Tip Shape */ + /* Factor that controls the shape of the brush tip by rounding the corners of a square. */ + /* 0.0 value produces a square, 1.0 produces a circle. */ + float tip_roundness; + float tip_scale_x; /** Background color. */ float secondary_rgb[3]; @@ -503,16 +518,14 @@ typedef struct Brush { float texture_sample_bias; int curve_preset; - float hardness; + + /* Maximun distance to search fake neighbors from a vertex. */ + float disconnected_distance_max; /* automasking */ int automasking_flags; int automasking_boundary_edges_propagation_steps; - /* Factor that controls the shape of the brush tip by rounding the corners of a square. */ - /* 0.0 value produces a square, 1.0 produces a circle. */ - float tip_roundness; - int elastic_deform_type; float elastic_deform_volume_preservation; @@ -670,6 +683,7 @@ typedef enum eBrushFlags2 { BRUSH_MULTIPLANE_SCRAPE_DYNAMIC = (1 << 0), BRUSH_MULTIPLANE_SCRAPE_PLANES_PREVIEW = (1 << 1), BRUSH_POSE_IK_ANCHORED = (1 << 2), + BRUSH_USE_CONNECTED_ONLY = (1 << 3), } eBrushFlags2; typedef enum { @@ -720,6 +734,8 @@ typedef enum eBrushSculptTool { SCULPT_TOOL_CLAY_THUMB = 25, SCULPT_TOOL_CLOTH = 26, SCULPT_TOOL_DRAW_FACE_SETS = 27, + SCULPT_TOOL_PAINT = 28, + SCULPT_TOOL_SMEAR = 29, } eBrushSculptTool; /* Brush.uv_sculpt_tool */ @@ -762,6 +778,8 @@ typedef enum eBrushUVSculptTool { SCULPT_TOOL_ELASTIC_DEFORM, \ SCULPT_TOOL_POSE, \ SCULPT_TOOL_DRAW_FACE_SETS, \ + SCULPT_TOOL_PAINT, \ + SCULPT_TOOL_SMEAR, \ \ /* These brushes could handle dynamic topology, \ \ * but user feedback indicates it's better not to */ \ diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 65087a6d459..85d9a04a902 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -61,7 +61,8 @@ typedef struct bConstraint { /** Constraint name, MAX_NAME. */ char name[64]; - char _pad[2]; + /* Flag for panel and subpanel closed / open state in the UI. */ + short ui_expand_flag; /** Amount of influence exherted by constraint (0.0-1.0). */ float enforce; @@ -689,8 +690,8 @@ typedef enum eBConstraint_Types { /* flag 0x20 (1 << 5) was used to indicate that a constraint was evaluated * using a 'local' hack for posebones only. */ typedef enum eBConstraint_Flags { - /* expand for UI */ - CONSTRAINT_EXPAND = (1 << 0), + /* Expansion for old box constraint layouts. Just for versioning. */ + CONSTRAINT_EXPAND_DEPRECATED = (1 << 0), /* pre-check for illegal object name or bone name */ CONSTRAINT_DISABLE = (1 << 2), /* to indicate which Ipo should be shown, maybe for 3d access later too */ diff --git a/source/blender/makesdna/DNA_curveprofile_types.h b/source/blender/makesdna/DNA_curveprofile_types.h index 63e1049b636..ca00f783905 100644 --- a/source/blender/makesdna/DNA_curveprofile_types.h +++ b/source/blender/makesdna/DNA_curveprofile_types.h @@ -43,13 +43,22 @@ typedef struct CurveProfilePoint { float x, y; /** Flag selection state and others. */ short flag; - /** Flags for both handle's type (eBezTriple_Handle). */ + /** Flags for both handle's type (eBezTriple_Handle auto, vect, free, and aligned supported). */ char h1, h2; + /** Handle locations, keep together. + * \note For now the two handle types are set to the same type in RNA. */ + float h1_loc[2]; + float h2_loc[2]; + char _pad[4]; + /** Runtime pointer to the point's profile for updating the curve with no direct reference. */ + struct CurveProfile *profile; } CurveProfilePoint; /** #CurveProfilePoint.flag */ enum { PROF_SELECT = (1 << 0), + PROF_H1_SELECT = (1 << 1), + PROF_H2_SELECT = (1 << 2), }; /** Defines a profile. */ @@ -76,10 +85,11 @@ typedef struct CurveProfile { /** #CurveProfile.flag */ enum { - PROF_USE_CLIP = (1 << 0), /* Keep control points inside bounding rectangle. */ - /* PROF_SYMMETRY_MODE = (1 << 1), */ /* Unused for now. */ - PROF_SAMPLE_STRAIGHT_EDGES = (1 << 2), /* Sample extra points on straight edges. */ - PROF_SAMPLE_EVEN_LENGTHS = (1 << 3), /* Put segments evenly spaced along the path. */ + PROF_USE_CLIP = (1 << 0), /* Keep control points inside bounding rectangle. */ + /* PROF_SYMMETRY_MODE = (1 << 1), Unused for now. */ + PROF_SAMPLE_STRAIGHT_EDGES = (1 << 2), /* Sample extra points on straight edges. */ + PROF_SAMPLE_EVEN_LENGTHS = (1 << 3), /* Put segments evenly spaced along the path. */ + PROF_DIRTY_PRESET = (1 << 4), /* Marks when the dynamic preset has been changed. */ }; typedef enum eCurveProfilePresets { diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index e4999fd4464..c24bbccae1e 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -148,10 +148,9 @@ typedef enum CustomDataType { CD_CUSTOMLOOPNORMAL = 41, CD_SCULPT_FACE_SETS = 42, - /* Hair and PointCloud */ CD_LOCATION = 43, - CD_RADIUS = 44, CD_HAIRCURVE = 45, + CD_RADIUS = 44, CD_HAIRMAPPING = 46, CD_PROP_COLOR = 47, @@ -205,7 +204,7 @@ typedef enum CustomDataType { #define CD_MASK_TESSLOOPNORMAL (1LL << CD_TESSLOOPNORMAL) #define CD_MASK_CUSTOMLOOPNORMAL (1LL << CD_CUSTOMLOOPNORMAL) #define CD_MASK_SCULPT_FACE_SETS (1LL << CD_SCULPT_FACE_SETS) -#define CD_MASK_PROP_COLOR (1LL << CD_PROP_COLOR) +#define CD_MASK_PROP_COLOR (1ULL << CD_PROP_COLOR) /** Data types that may be defined for all mesh elements types. */ #define CD_MASK_GENERIC_DATA (CD_MASK_PROP_FLOAT | CD_MASK_PROP_INT32 | CD_MASK_PROP_STRING) diff --git a/source/blender/makesdna/DNA_fluid_types.h b/source/blender/makesdna/DNA_fluid_types.h index e8a22d8c821..e3f4865e894 100644 --- a/source/blender/makesdna/DNA_fluid_types.h +++ b/source/blender/makesdna/DNA_fluid_types.h @@ -45,6 +45,7 @@ enum { FLUID_DOMAIN_USE_FRACTIONS = (1 << 13), /* Use second order obstacles. */ FLUID_DOMAIN_DELETE_IN_OBSTACLE = (1 << 14), /* Delete fluid inside obstacles. */ FLUID_DOMAIN_USE_DIFFUSION = (1 << 15), /* Use diffusion (e.g. viscosity, surface tension). */ + FLUID_DOMAIN_USE_RESUMABLE_CACHE = (1 << 16), /* Determine if cache should be resumable. */ }; /* Border collisions. */ @@ -214,6 +215,7 @@ enum { #define FLUID_DOMAIN_DIR_SCRIPT "script" #define FLUID_DOMAIN_SMOKE_SCRIPT "smoke_script.py" #define FLUID_DOMAIN_LIQUID_SCRIPT "liquid_script.py" +#define FLUID_CACHE_VERSION "C01" /* Cache file names. */ #define FLUID_NAME_CONFIG "config" @@ -224,24 +226,24 @@ enum { #define FLUID_NAME_GUIDING "fluid_guiding" /* Fluid object names.*/ -#define FLUID_NAME_FLAGS "flags" -#define FLUID_NAME_VELOCITY "vel" -#define FLUID_NAME_VELOCITYTMP "velocityTmp" +#define FLUID_NAME_FLAGS "flags" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_VELOCITY "velocity" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_VELOCITYTMP "velocity_previous" /* == OpenVDB grid attribute name. */ #define FLUID_NAME_VELOCITYX "x_vel" #define FLUID_NAME_VELOCITYY "y_vel" #define FLUID_NAME_VELOCITYZ "z_vel" #define FLUID_NAME_PRESSURE "pressure" -#define FLUID_NAME_PHIOBS "phiObs" +#define FLUID_NAME_PHIOBS "phi_obstacle" /* == OpenVDB grid attribute name. */ #define FLUID_NAME_PHISIN "phiSIn" -#define FLUID_NAME_PHIIN "phiIn" -#define FLUID_NAME_PHIOUT "phiOut" +#define FLUID_NAME_PHIIN "phi_inflow" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_PHIOUT "phi_out" /* == OpenVDB grid attribute name. */ #define FLUID_NAME_FORCES "forces" #define FLUID_NAME_FORCE_X "x_force" #define FLUID_NAME_FORCE_Y "y_force" #define FLUID_NAME_FORCE_Z "z_force" #define FLUID_NAME_NUMOBS "numObs" #define FLUID_NAME_PHIOBSSIN "phiObsSIn" -#define FLUID_NAME_PHIOBSIN "phiObsIn" +#define FLUID_NAME_PHIOBSIN "phi_obstacle_inflow" #define FLUID_NAME_OBVEL "obvel" #define FLUID_NAME_OBVELC "obvelC" #define FLUID_NAME_OBVEL_X "x_obvel" @@ -254,44 +256,48 @@ enum { #define FLUID_NAME_INVEL_Y "y_invel" #define FLUID_NAME_INVEL_Z "z_invel" #define FLUID_NAME_PHIOUTSIN "phiOutSIn" -#define FLUID_NAME_PHIOUTIN "phiOutIn" +#define FLUID_NAME_PHIOUTIN "phi_out_inflow" /* Smoke object names. */ -#define FLUID_NAME_SHADOW "shadow" -#define FLUID_NAME_EMISSION "emission" +#define FLUID_NAME_SHADOW "shadow" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_EMISSION "emission" /* == OpenVDB grid attribute name. */ #define FLUID_NAME_EMISSIONIN "emissionIn" -#define FLUID_NAME_DENSITY "density" -#define FLUID_NAME_DENSITYIN "densityIn" +#define FLUID_NAME_DENSITY "density" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_DENSITYIN "density_inflow" /* == OpenVDB grid attribute name. */ #define FLUID_NAME_HEAT "heat" #define FLUID_NAME_HEATIN "heatIn" -#define FLUID_NAME_COLORR "color_r" -#define FLUID_NAME_COLORG "color_g" -#define FLUID_NAME_COLORB "color_b" -#define FLUID_NAME_COLORRIN "color_r_in" -#define FLUID_NAME_COLORGIN "color_g_in" -#define FLUID_NAME_COLORBIN "color_b_in" -#define FLUID_NAME_FLAME "flame" -#define FLUID_NAME_FUEL "fuel" -#define FLUID_NAME_REACT "react" -#define FLUID_NAME_FUELIN "fuelIn" -#define FLUID_NAME_REACTIN "reactIn" +#define FLUID_NAME_TEMPERATURE "temperature" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_TEMPERATUREIN "temperature_inflow" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_COLORR "color_r" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_COLORG "color_g" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_COLORB "color_b" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_COLORRIN "color_r_inflow" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_COLORGIN "color_g_inflow" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_COLORBIN "color_b_inflow" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_FLAME "flame" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_FUEL "fuel" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_REACT "react" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_FUELIN "fuel_inflow" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_REACTIN "react_inflow" /* == OpenVDB grid attribute name. */ /* Liquid object names. */ -#define FLUID_NAME_PHIPARTS "phiParts" -#define FLUID_NAME_PHI "phi" -#define FLUID_NAME_PHITMP "phiTmp" +#define FLUID_NAME_PHIPARTS "phi_particles" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_PHI "phi" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_PHITMP "phi_previous" /* == OpenVDB grid attribute name. */ #define FLUID_NAME_VELOCITYOLD "velOld" #define FLUID_NAME_VELOCITYPARTS "velParts" #define FLUID_NAME_MAPWEIGHTS "mapWeights" #define FLUID_NAME_PP "pp" #define FLUID_NAME_PVEL "pVel" +#define FLUID_NAME_PARTS "particles" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_PARTSVELOCITY "particles_velocity" /* == OpenVDB grid attribute name. */ #define FLUID_NAME_PINDEX "pindex" #define FLUID_NAME_GPI "gpi" #define FLUID_NAME_CURVATURE "gpi" /* Noise object names. */ #define FLUID_NAME_VELOCITY_NOISE "velocity_noise" -#define FLUID_NAME_DENSITY_NOISE "density_noise" +#define FLUID_NAME_DENSITY_NOISE "density_noise" /* == OpenVDB grid attribute name. */ #define FLUID_NAME_PHIIN_NOISE "phiIn_noise" #define FLUID_NAME_PHIOUT_NOISE "phiOut_noise" #define FLUID_NAME_PHIOBS_NOISE "phiObs_noise" @@ -306,11 +312,11 @@ enum { #define FLUID_NAME_TEXTURE_U2 "textureU2" #define FLUID_NAME_TEXTURE_V2 "textureV2" #define FLUID_NAME_TEXTURE_W2 "textureW2" -#define FLUID_NAME_UV0 "uvGrid0" -#define FLUID_NAME_UV1 "uvGrid1" -#define FLUID_NAME_COLORR_NOISE "color_r_noise" -#define FLUID_NAME_COLORG_NOISE "color_g_noise" -#define FLUID_NAME_COLORB_NOISE "color_b_noise" +#define FLUID_NAME_UV0 "uv_grid_0" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_UV1 "uv_grid_1" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_COLORR_NOISE "color_r_noise" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_COLORG_NOISE "color_g_noise" /* == OpenVDB grid attribute name. */ +#define FLUID_NAME_COLORB_NOISE "color_b_noise" /* == OpenVDB grid attribute name. */ #define FLUID_NAME_FLAME_NOISE "flame_noise" #define FLUID_NAME_FUEL_NOISE "fuel_noise" #define FLUID_NAME_REACT_NOISE "react_noise" @@ -321,7 +327,8 @@ enum { #define FLUID_NAME_PP_MESH "pp_mesh" #define FLUID_NAME_FLAGS_MESH "flags_mesh" #define FLUID_NAME_LMESH "lMesh" -#define FLUID_NAME_VELOCITYVEC_MESH "lVelMesh" +/* == OpenVDB grid attribute name. */ +#define FLUID_NAME_VELOCITYVEC_MESH "vertex_velocities_mesh" #define FLUID_NAME_VELOCITY_MESH "velocity_mesh" #define FLUID_NAME_PINDEX_MESH "pindex_mesh" #define FLUID_NAME_GPI_MESH "gpi_mesh" @@ -329,18 +336,28 @@ enum { /* Particles object names. */ #define FLUID_NAME_PP_PARTICLES "ppSnd" #define FLUID_NAME_PVEL_PARTICLES "pVelSnd" -#define FLUID_NAME_PFORCE_PARTICLES "pForceSnd" #define FLUID_NAME_PLIFE_PARTICLES "pLifeSnd" -#define FLUID_NAME_VELOCITY_PARTICLES "velocity_particles" -#define FLUID_NAME_FLAGS_PARTICLES "flags_particles" -#define FLUID_NAME_PHI_PARTICLES "phi_particles" -#define FLUID_NAME_PHIOBS_PARTICLES "phiObs_particles" -#define FLUID_NAME_PHIOUT_PARTICLES "phiOut_particles" -#define FLUID_NAME_NORMAL_PARTICLES "normal_particles" -#define FLUID_NAME_NEIGHBORRATIO_PARTICLES "neighborRatio_particles" -#define FLUID_NAME_TRAPPEDAIR_PARTICLES "trappedAir_particles" -#define FLUID_NAME_WAVECREST_PARTICLES "waveCrest_particles" -#define FLUID_NAME_KINETICENERGY_PARTICLES "kineticEnergy_particles" +#define FLUID_NAME_PFORCE_PARTICLES "pForceSnd" +/* == OpenVDB grid attribute name. */ +#define FLUID_NAME_PARTS_PARTICLES "particles_secondary" +/* == OpenVDB grid attribute name. */ +#define FLUID_NAME_PARTSVEL_PARTICLES "particles_velocity_secondary" +/* == OpenVDB grid attribute name. */ +#define FLUID_NAME_PARTSLIFE_PARTICLES "particles_life_secondary" +#define FLUID_NAME_PARTSFORCE_PARTICLES "particles_force_secondary" +#define FLUID_NAME_VELOCITY_PARTICLES "velocity_secondary" +#define FLUID_NAME_FLAGS_PARTICLES "flags_secondary" +#define FLUID_NAME_PHI_PARTICLES "phi_secondary" +#define FLUID_NAME_PHIOBS_PARTICLES "phiObs_secondary" +#define FLUID_NAME_PHIOUT_PARTICLES "phiOut_secondary" +#define FLUID_NAME_NORMAL_PARTICLES "normal_secondary" +#define FLUID_NAME_NEIGHBORRATIO_PARTICLES "neighbor_ratio_secondary" +/* == OpenVDB grid attribute name. */ +#define FLUID_NAME_TRAPPEDAIR_PARTICLES "trapped_air_secondary" +/* == OpenVDB grid attribute name. */ +#define FLUID_NAME_WAVECREST_PARTICLES "wave_crest_secondary" +/* == OpenVDB grid attribute name. */ +#define FLUID_NAME_KINETICENERGY_PARTICLES "kinetic_energy_secondary" /* Guiding object names. */ #define FLUID_NAME_VELT "velT" @@ -349,9 +366,9 @@ enum { #define FLUID_NAME_PHIGUIDEIN "phiGuideIn" #define FLUID_NAME_GUIDEVELC "guidevelC" #define FLUID_NAME_GUIDEVEL_X "x_guidevel" -#define FLUID_NAME_GUIDEVEL_Y "Y_guidevel" +#define FLUID_NAME_GUIDEVEL_Y "y_guidevel" #define FLUID_NAME_GUIDEVEL_Z "z_guidevel" -#define FLUID_NAME_GUIDEVEL "guidevel" +#define FLUID_NAME_GUIDEVEL "velocity_guide" /* Cache file extensions. */ #define FLUID_DOMAIN_EXTENSION_UNI ".uni" @@ -374,7 +391,18 @@ enum { enum { FLUID_DOMAIN_CACHE_REPLAY = 0, FLUID_DOMAIN_CACHE_MODULAR = 1, - FLUID_DOMAIN_CACHE_FINAL = 2, + FLUID_DOMAIN_CACHE_ALL = 2, +}; + +enum { + VDB_COMPRESSION_BLOSC = 0, + VDB_COMPRESSION_ZIP = 1, + VDB_COMPRESSION_NONE = 2, +}; + +enum { + VDB_PRECISION_HALF_FLOAT = 0, + VDB_PRECISION_FULL_FLOAT = 1, }; /* Deprecated values (i.e. all defines and enums below this line up until typedefs). */ @@ -391,12 +419,6 @@ enum { SM_HRES_FULLSAMPLE = 2, }; -enum { - VDB_COMPRESSION_BLOSC = 0, - VDB_COMPRESSION_ZIP = 1, - VDB_COMPRESSION_NONE = 2, -}; - typedef struct FluidDomainVertexVelocity { float vel[3]; } FluidDomainVertexVelocity; @@ -566,7 +588,8 @@ typedef struct FluidDomainSettings { char cache_directory[1024]; char error[64]; /* Bake error description. */ short cache_type; - char _pad8[2]; /* Unused. */ + char cache_id[4]; /* Run-time only */ + char _pad8[6]; /* Time options. */ float dt; @@ -591,17 +614,17 @@ typedef struct FluidDomainSettings { char coba_field; /* Simulation field used for the color mapping. */ char interp_method; + /* OpenVDB cache options. */ + int openvdb_compression; + float clipping; + char openvdb_data_depth; + char _pad9[7]; /* Unused. */ + /* -- Deprecated / unsed options (below). -- */ /* View options. */ int viewsettings; - char _pad9[4]; /* Unused. */ - - /* OpenVDB cache options. */ - int openvdb_comp; - float clipping; - char data_depth; - char _pad10[7]; /* Unused. */ + char _pad10[4]; /* Unused. */ /* Pointcache options. */ /* Smoke uses only one cache from now on (index [0]), but keeping the array for now for reading diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index 674999ab465..5d35db1a960 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -58,7 +58,7 @@ typedef enum GpencilModifierMode { eGpencilModifierMode_Realtime = (1 << 0), eGpencilModifierMode_Render = (1 << 1), eGpencilModifierMode_Editmode = (1 << 2), - eGpencilModifierMode_Expanded = (1 << 3), + eGpencilModifierMode_Expanded_DEPRECATED = (1 << 3), } GpencilModifierMode; typedef enum { @@ -72,7 +72,7 @@ typedef struct GpencilModifierData { int type, mode; int stackindex; short flag; - short _pad; + short ui_expand_flag; /** MAX_NAME. */ char name[64]; diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index c3180ae79db..b6e2910a1b0 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -735,10 +735,10 @@ typedef enum eGP_DrawMode { #define GPENCIL_ANY_EDIT_MODE(gpd) \ ((gpd) && ((gpd)->flag & \ (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE))) -#define GPENCIL_PAINT_MODE(gpd) ((gpd) && (gpd->flag & (GP_DATA_STROKE_PAINTMODE))) +#define GPENCIL_PAINT_MODE(gpd) ((gpd) && (gpd->flag & GP_DATA_STROKE_PAINTMODE)) #define GPENCIL_SCULPT_MODE(gpd) ((gpd) && (gpd->flag & GP_DATA_STROKE_SCULPTMODE)) #define GPENCIL_WEIGHT_MODE(gpd) ((gpd) && (gpd->flag & GP_DATA_STROKE_WEIGHTMODE)) -#define GPENCIL_VERTEX_MODE(gpd) ((gpd) && (gpd->flag & (GP_DATA_STROKE_VERTEXMODE))) +#define GPENCIL_VERTEX_MODE(gpd) ((gpd) && (gpd->flag & GP_DATA_STROKE_VERTEXMODE)) #define GPENCIL_SCULPT_OR_WEIGHT_MODE(gpd) \ ((gpd) && ((gpd)->flag & (GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE))) #define GPENCIL_NONE_EDIT_MODE(gpd) \ diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h index 11a6a937e92..0ffb6c8a76a 100644 --- a/source/blender/makesdna/DNA_image_types.h +++ b/source/blender/makesdna/DNA_image_types.h @@ -129,7 +129,7 @@ typedef struct Image { ID id; /** File path, 1024 = FILE_MAX. */ - char name[1024]; + char filepath[1024]; /** Not written in file. */ struct MovieCache *cache; diff --git a/source/blender/makesdna/DNA_key_types.h b/source/blender/makesdna/DNA_key_types.h index 3685290e571..a1cc6f89314 100644 --- a/source/blender/makesdna/DNA_key_types.h +++ b/source/blender/makesdna/DNA_key_types.h @@ -113,7 +113,7 @@ typedef struct Key { /** * Can never be 0, this is used for detecting old data. - * current free uid for keyblocks + * current free UID for key-blocks. */ int uidgen; } Key; diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 357c3260121..6a4ec65318b 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -112,7 +112,7 @@ typedef enum eMaterialGPencilStyle_Flag { /* protected from further editing */ GP_MATERIAL_LOCKED = (1 << 2), /* do onion skinning */ - GP_MATERIAL_ONIONSKIN = (1 << 3), + GP_MATERIAL_HIDE_ONIONSKIN = (1 << 3), /* clamp texture */ GP_MATERIAL_TEX_CLAMP = (1 << 4), /* mix fill texture */ diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index acc020ec710..9435cb3bd78 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -46,6 +46,7 @@ struct MLoopTri; struct MLoopUV; struct MPoly; struct MVert; +struct MPropCol; struct Material; struct Mesh; struct Multires; @@ -244,9 +245,9 @@ typedef struct TFace { /** #Mesh_Runtime.wrapper_type */ typedef enum eMeshWrapperType { - /** Use mesh data (#Mesh.mvert,#Mesh.medge, #Mesh.mloop, #Mesh.mpoly). */ + /** Use mesh data (#Mesh.mvert, #Mesh.medge, #Mesh.mloop, #Mesh.mpoly). */ ME_WRAPPER_TYPE_MDATA = 0, - /** Use edit-mesh data (#Mesh.#edit_mesh, #Mesh_Runtime.edit_data). */ + /** Use edit-mesh data (#Mesh.edit_mesh, #Mesh_Runtime.edit_data). */ ME_WRAPPER_TYPE_BMESH = 1, /* ME_WRAPPER_TYPE_SUBD = 2, */ /* TODO */ } eMeshWrapperType; @@ -285,7 +286,7 @@ enum { ME_AUTOSMOOTH = 1 << 5, ME_FLAG_UNUSED_6 = 1 << 6, /* cleared */ ME_FLAG_UNUSED_7 = 1 << 7, /* cleared */ - ME_FLAG_UNUSED_8 = 1 << 8, /* cleared */ + ME_REMESH_REPROJECT_VERTEX_COLORS = 1 << 8, ME_DS_EXPAND = 1 << 9, ME_SCULPT_DYNAMIC_TOPOLOGY = 1 << 10, ME_REMESH_SMOOTH_NORMALS = 1 << 11, diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index 04deecde43e..cc2ba3fb999 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -345,7 +345,7 @@ typedef struct MLoopCol { } MLoopCol; typedef struct MPropCol { - float col[4]; + float color[4]; } MPropCol; /** Multi-Resolution loop data. */ diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 1413db4baea..05daf6caa47 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -394,6 +394,8 @@ typedef struct BevelModifierData { short flags; /** Used to interpret the bevel value. */ short val_flags; + /** For the type and how we build the bevel's profile. */ + short profile_type; /** Flags to tell the tool how to limit the bevel. */ short lim_flags; /** Flags to direct how edge weights are applied to verts. */ @@ -407,6 +409,7 @@ typedef struct BevelModifierData { short miter_outer; /** The method to use for creating >2-way intersections */ short vmesh_method; + char _pad0[2]; /** Controls profile shape (0->1, .5 is round). */ float profile; /** if the MOD_BEVEL_ANGLE is set, @@ -417,6 +420,7 @@ typedef struct BevelModifierData { * this will be the name of the vert group, MAX_VGROUP_NAME */ char defgrp_name[64]; + char _pad1[4]; /** Curve info for the custom profile */ struct CurveProfile *custom_profile; @@ -429,12 +433,15 @@ enum { MOD_BEVEL_ANGLE = (1 << 3), MOD_BEVEL_WEIGHT = (1 << 4), MOD_BEVEL_VGROUP = (1 << 5), - MOD_BEVEL_CUSTOM_PROFILE = (1 << 7), - /* MOD_BEVEL_SAMPLE_STRAIGHT = (1 << 8), */ /* UNUSED */ - /* unused = (1 << 9), */ - /* unused = (1 << 10), */ - /* unused = (1 << 11), */ - /* unused = (1 << 12), */ +/* unused = (1 << 6), */ +#ifdef DNA_DEPRECATED_ALLOW + MOD_BEVEL_CUSTOM_PROFILE_DEPRECATED = (1 << 7), +#endif + /* unused = (1 << 8), */ + /* unused = (1 << 9), */ + /* unused = (1 << 10), */ + /* unused = (1 << 11), */ + /* unused = (1 << 12), */ MOD_BEVEL_OVERLAP_OK = (1 << 13), MOD_BEVEL_EVEN_WIDTHS = (1 << 14), MOD_BEVEL_HARDEN_NORMALS = (1 << 15), @@ -446,6 +453,13 @@ enum { MOD_BEVEL_AMT_WIDTH = 1, MOD_BEVEL_AMT_DEPTH = 2, MOD_BEVEL_AMT_PERCENT = 3, + MOD_BEVEL_AMT_ABSOLUTE = 4, +}; + +/* BevelModifierData->profile_type */ +enum { + MOD_BEVEL_PROFILE_SUPERELLIPSE = 0, + MOD_BEVEL_PROFILE_CUSTOM = 1, }; /* BevelModifierData->edge_flags */ diff --git a/source/blender/makesdna/DNA_movieclip_types.h b/source/blender/makesdna/DNA_movieclip_types.h index 94d11095108..d750a7f3148 100644 --- a/source/blender/makesdna/DNA_movieclip_types.h +++ b/source/blender/makesdna/DNA_movieclip_types.h @@ -78,7 +78,7 @@ typedef struct MovieClip { struct AnimData *adt; /** File path, 1024 = FILE_MAX. */ - char name[1024]; + char filepath[1024]; /** Sequence or movie. */ int source; diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 4ff0e531168..993aad92564 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -844,6 +844,15 @@ typedef struct NodeTexSky { float sun_direction[3]; float turbidity; float ground_albedo; + float sun_size; + float sun_elevation; + float sun_rotation; + int altitude; + float air_density; + float dust_density; + float ozone_density; + char sun_disc; + char _pad[3]; } NodeTexSky; typedef struct NodeTexImage { @@ -1171,8 +1180,9 @@ enum { }; /* sky texture */ -#define SHD_SKY_OLD 0 -#define SHD_SKY_NEW 1 +#define SHD_SKY_PREETHAM 0 +#define SHD_SKY_HOSEK 1 +#define SHD_SKY_NISHITA 2 /* environment texture */ #define SHD_PROJ_EQUIRECTANGULAR 0 diff --git a/source/blender/makesdna/DNA_object_force_types.h b/source/blender/makesdna/DNA_object_force_types.h index 7f022f104e6..78f645deaa2 100644 --- a/source/blender/makesdna/DNA_object_force_types.h +++ b/source/blender/makesdna/DNA_object_force_types.h @@ -92,6 +92,10 @@ typedef struct PartDeflect { * How much force is converted into "air flow", i.e. * force used as the velocity of surrounding medium. */ float f_flow; + /** How much force is reduced when acting parallel to a surface, e.g. cloth. */ + float f_wind_factor; + + char _pad0[4]; /** Noise size for noise effector, restlength for harmonic effector. */ float f_size; diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h index 9776063f220..d8a7599e4cb 100644 --- a/source/blender/makesdna/DNA_outliner_types.h +++ b/source/blender/makesdna/DNA_outliner_types.h @@ -62,8 +62,7 @@ enum { TSE_DRAG_AFTER = (1 << 8), /* Needed because outliner-only elements can be active */ TSE_ACTIVE = (1 << 9), - /* Needed because walk selection should not activate */ - TSE_ACTIVE_WALK = (1 << 10), + /* TSE_ACTIVE_WALK = (1 << 10), */ /* Unused */ TSE_DRAG_ANY = (TSE_DRAG_INTO | TSE_DRAG_BEFORE | TSE_DRAG_AFTER), }; diff --git a/source/blender/makesdna/DNA_scene_defaults.h b/source/blender/makesdna/DNA_scene_defaults.h index 4b6f079aa28..7f01e58f2af 100644 --- a/source/blender/makesdna/DNA_scene_defaults.h +++ b/source/blender/makesdna/DNA_scene_defaults.h @@ -218,8 +218,10 @@ .bloom_radius = 6.5f, \ .bloom_clamp = 0.0f, \ \ - .motion_blur_samples = 8, \ .motion_blur_shutter = 0.5f, \ + .motion_blur_depth_scale = 100.0f, \ + .motion_blur_max = 32, \ + .motion_blur_steps = 1, \ \ .shadow_cube_size = 512, \ .shadow_cascade_size = 1024, \ @@ -325,7 +327,7 @@ .doublimit = 0.001, \ .vgroup_weight = 1.0f, \ .uvcalc_margin = 0.001f, \ - .uvcalc_flag = UVCALC_TRANSFORM_CORRECT, \ + .uvcalc_flag = UVCALC_TRANSFORM_CORRECT_SLIDE, \ .unwrapper = 1, \ .select_thresh = 0.01f, \ \ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index c50e48982b3..dd62ddb640f 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1590,7 +1590,6 @@ typedef struct SceneEEVEE { float gi_irradiance_smoothing; float gi_glossy_clamp; float gi_filter_quality; - char _pad[4]; float gi_cubemap_draw_size; float gi_irradiance_draw_size; @@ -1628,8 +1627,11 @@ typedef struct SceneEEVEE { float bloom_radius; float bloom_clamp; - int motion_blur_samples; + int motion_blur_samples DNA_DEPRECATED; + int motion_blur_max; + int motion_blur_steps; float motion_blur_shutter; + float motion_blur_depth_scale; int shadow_method DNA_DEPRECATED; int shadow_cube_size; @@ -2172,7 +2174,7 @@ typedef enum eSculptFlags { SCULPT_FLAG_UNUSED_6 = (1 << 6), /* cleared */ - SCULPT_USE_OPENMP = (1 << 7), + SCULPT_FLAG_UNUSED_7 = (1 << 7), /* cleared */ SCULPT_ONLY_DEFORM = (1 << 8), // SCULPT_SHOW_DIFFUSE = (1 << 9), // deprecated @@ -2233,10 +2235,12 @@ enum { #define UVCALC_FILLHOLES (1 << 0) /** would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */ #define UVCALC_NO_ASPECT_CORRECT (1 << 1) -/** adjust UV's while transforming to avoid distortion */ -#define UVCALC_TRANSFORM_CORRECT (1 << 2) +/** Adjust UV's while transforming with Vert or Edge Slide. */ +#define UVCALC_TRANSFORM_CORRECT_SLIDE (1 << 2) /** Use mesh data after subsurf to compute UVs*/ #define UVCALC_USESUBSURF (1 << 3) +/** adjust UV's while transforming to avoid distortion */ +#define UVCALC_TRANSFORM_CORRECT (1 << 4) /* ToolSettings.uv_flag */ #define UV_SYNC_SELECTION 1 diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 07cba2bad1c..f9fcbdab55d 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -41,6 +41,7 @@ struct uiLayout; struct wmDrawBuffer; struct wmTimer; struct wmTooltipState; +struct PointerRNA; /* TODO Doing this is quite ugly :) * Once the top-bar is merged bScreen should be refactored to use ScrAreaMap. */ @@ -135,6 +136,15 @@ typedef struct Panel_Runtime { /* For instanced panels: Index of the list item the panel corresponds to. */ int list_index; + + /** + * Pointer for storing which data the panel corresponds to. + * Useful when there can be multiple instances of the same panel type. + * + * \note A panel and its sub-panels share the same custom data pointer. + * This avoids freeing the same pointer twice when panels are removed. + */ + struct PointerRNA *custom_data_ptr; } Panel_Runtime; /** The part from uiBlock that needs saved in file. */ @@ -427,7 +437,7 @@ typedef struct ARegion { /** Private, cached notifier events. */ short do_draw; /** Private, cached notifier events. */ - short do_draw_overlay; + short do_draw_paintcursor; /** Private, set for indicate drawing overlapped. */ short overlap; /** Temporary copy of flag settings for clean fullscreen. */ @@ -609,7 +619,7 @@ enum { /* regiontype, first two are the default set */ /* Do NOT change order, append on end. Types are hardcoded needed */ -enum { +typedef enum eRegionType { RGN_TYPE_WINDOW = 0, RGN_TYPE_HEADER = 1, RGN_TYPE_CHANNELS = 2, @@ -625,7 +635,7 @@ enum { RGN_TYPE_EXECUTE = 10, RGN_TYPE_FOOTER = 11, RGN_TYPE_TOOL_HEADER = 12, -}; +} eRegionType; /* use for function args */ #define RGN_TYPE_ANY -1 diff --git a/source/blender/makesdna/DNA_shader_fx_types.h b/source/blender/makesdna/DNA_shader_fx_types.h index 18a4e8655a3..f19181bf07d 100644 --- a/source/blender/makesdna/DNA_shader_fx_types.h +++ b/source/blender/makesdna/DNA_shader_fx_types.h @@ -50,7 +50,7 @@ typedef enum ShaderFxMode { eShaderFxMode_Realtime = (1 << 0), eShaderFxMode_Render = (1 << 1), eShaderFxMode_Editmode = (1 << 2), - eShaderFxMode_Expanded = (1 << 3), + eShaderFxMode_Expanded_DEPRECATED = (1 << 3), } ShaderFxMode; typedef enum { @@ -64,7 +64,8 @@ typedef struct ShaderFxData { int type, mode; int stackindex; short flag; - char _pad[2]; + /* Expansion for shader effect panels and sub-panels. */ + short ui_expand_flag; /** MAX_NAME. */ char name[64]; @@ -171,6 +172,10 @@ typedef struct PixelShaderFxData { ShaderFxData_Runtime runtime; } PixelShaderFxData; +typedef enum ePixelShaderFx_Flag { + FX_PIXEL_FILTER_NEAREST = (1 << 0), +} ePixelShaderFx_Flag; + typedef struct RimShaderFxData { ShaderFxData shaderfx; int offset[2]; diff --git a/source/blender/makesdna/DNA_sound_types.h b/source/blender/makesdna/DNA_sound_types.h index 04ac9d4e5be..35ff3a658ba 100644 --- a/source/blender/makesdna/DNA_sound_types.h +++ b/source/blender/makesdna/DNA_sound_types.h @@ -36,7 +36,7 @@ typedef struct bSound { * The path to the sound file. */ /** 1024 = FILE_MAX. */ - char name[1024]; + char filepath[1024]; /** * The packed file. diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 4c329117a13..812ac4b4ccd 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -1205,7 +1205,11 @@ typedef struct SpaceText { struct Text *text; - int top, left; + /** Determines at what line the top of the text is displayed. */ + int top; + + /** Determines the horizontal scroll (in columns). */ + int left; char _pad1[4]; short flags; diff --git a/source/blender/makesdna/DNA_text_types.h b/source/blender/makesdna/DNA_text_types.h index dbd5def74d4..27663ffcbdd 100644 --- a/source/blender/makesdna/DNA_text_types.h +++ b/source/blender/makesdna/DNA_text_types.h @@ -43,10 +43,21 @@ typedef struct TextLine { typedef struct Text { ID id; - char *name; + /** + * Optional file path, when NULL text is considered internal. + * Otherwise this path will be used when saving/reloading. + * + * When set this is where the file will or has been saved. + */ + char *filepath; + + /** + * Python code object for this text (cached result of #Py_CompileStringObject). + */ void *compiled; - int flags, nlines; + int flags; + char _pad0[4]; ListBase lines; TextLine *curl, *sell; @@ -57,12 +68,15 @@ typedef struct Text { #define TXT_TABSIZE 4 -/* text flags */ +/** #Text.flags */ enum { + /** Set if the file in run-time differs from the file on disk, or if there is no file on disk. */ TXT_ISDIRTY = 1 << 0, + /** When the text hasn't been written to a file. #Text.filepath may be NULL or invalid. */ TXT_ISMEM = 1 << 2, + /** Should always be set if the Text is not to be written into the `.blend`. */ TXT_ISEXT = 1 << 3, - /** Used by space handler scriptlinks. */ + /** Load the script as a Python module when loading the `.blend` file. */ TXT_ISSCRIPT = 1 << 4, TXT_FLAG_UNUSED_8 = 1 << 8, /* cleared */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 63e7a90547e..d751ad9ac47 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -619,8 +619,11 @@ typedef struct UserDef_FileSpaceData { typedef struct UserDef_Experimental { char use_undo_legacy; + char use_new_particle_system; + char use_new_hair_type; + char use_cycles_debug; /** `makesdna` does not allow empty structs. */ - char _pad0[7]; + char _pad0[4]; } UserDef_Experimental; #define USER_EXPERIMENTAL_TEST(userdef, member) \ @@ -633,12 +636,12 @@ typedef struct UserDef { /** #eUserPref_Flag. */ int flag; /** #eDupli_ID_Flags. */ - short dupflag; + unsigned int dupflag; /** #eUserPref_PrefFlag preferences for the preferences. */ char pref_flag; char savetime; char mouse_emulate_3_button_modifier; - char _pad4[3]; + char _pad4[1]; /** FILE_MAXDIR length. */ char tempdir[768]; char fontdir[768]; @@ -1150,6 +1153,13 @@ typedef enum eDupli_ID_Flags { USER_DUP_HAIR = (1 << 14), USER_DUP_POINTCLOUD = (1 << 15), USER_DUP_VOLUME = (1 << 16), + + USER_DUP_OBDATA = (~0) & ((1 << 24) - 1), + + /* Those are not exposed as user preferences, only used internaly. */ + USER_DUP_OBJECT = (1 << 24), + /* USER_DUP_COLLECTION = (1 << 25), */ /* UNUSED, keep because we may implement. */ + } eDupli_ID_Flags; /** diff --git a/source/blender/makesdna/DNA_vfont_types.h b/source/blender/makesdna/DNA_vfont_types.h index 295552635fe..086fb2bc905 100644 --- a/source/blender/makesdna/DNA_vfont_types.h +++ b/source/blender/makesdna/DNA_vfont_types.h @@ -36,7 +36,7 @@ typedef struct VFont { ID id; /** 1024 = FILE_MAX. */ - char name[1024]; + char filepath[1024]; struct VFontData *data; struct PackedFile *packedfile; diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt index 01e3971a216..0f2761e311e 100644 --- a/source/blender/makesdna/intern/CMakeLists.txt +++ b/source/blender/makesdna/intern/CMakeLists.txt @@ -96,6 +96,7 @@ set(SRC ${CMAKE_CURRENT_BINARY_DIR}/dna_verify.c ${SRC_DNA_INC} + ${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h dna_rename_defs.h dna_utils.h ) diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index cf7c201795e..3d95eba4aed 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -963,11 +963,10 @@ static int elem_strcmp(const char *name, const char *oname) * Returns whether the specified field exists according to the struct format * pointed to by old. * - * \param sdna: Old SDNA - * \param type: Current field type name - * \param name: Current field name - * \param old: Pointer to struct information in sdna - * \return true when existing, false otherwise. + * \param type: Current field type name. + * \param name: Current field name. + * \param old: Pointer to struct information in sdna. + * \return true when existing, false otherwise.. */ static bool elem_exists_impl( /* Expand SDNA. */ @@ -995,6 +994,9 @@ static bool elem_exists_impl( return false; } +/** + * \param sdna: Old SDNA. + */ static bool elem_exists(const SDNA *sdna, const char *type, const char *name, const short *old) { return elem_exists_impl( @@ -1079,7 +1081,7 @@ static const char *find_elem(const SDNA *sdna, /** * Converts the contents of a single field of a struct, of a non-struct type, - * from oldsdna to newsdna format. + * from \a oldsdna to \a newsdna format. * * \param newsdna: SDNA of current Blender * \param oldsdna: SDNA of Blender that saved file diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h index aabc16c4111..f2cf72843bd 100644 --- a/source/blender/makesdna/intern/dna_rename_defs.h +++ b/source/blender/makesdna/intern/dna_rename_defs.h @@ -77,6 +77,9 @@ DNA_STRUCT_RENAME_ELEM(FluidDomainSettings, guiding_parent, guide_parent) DNA_STRUCT_RENAME_ELEM(FluidDomainSettings, guiding_source, guide_source) DNA_STRUCT_RENAME_ELEM(FluidDomainSettings, guiding_vel_factor, guide_vel_factor) DNA_STRUCT_RENAME_ELEM(FluidEffectorSettings, guiding_mode, guide_mode) +DNA_STRUCT_RENAME_ELEM(Image, name, filepath) +DNA_STRUCT_RENAME_ELEM(Library, name, filepath) +DNA_STRUCT_RENAME_ELEM(MovieClip, name, filepath) DNA_STRUCT_RENAME_ELEM(Object, col, color) DNA_STRUCT_RENAME_ELEM(Object, dup_group, instance_collection) DNA_STRUCT_RENAME_ELEM(Object, dupfacesca, instance_faces_scale) @@ -84,8 +87,10 @@ DNA_STRUCT_RENAME_ELEM(Object, size, scale) DNA_STRUCT_RENAME_ELEM(ParticleSettings, dup_group, instance_collection) DNA_STRUCT_RENAME_ELEM(ParticleSettings, dup_ob, instance_object) DNA_STRUCT_RENAME_ELEM(ParticleSettings, dupliweights, instance_weights) +DNA_STRUCT_RENAME_ELEM(Text, name, filepath) DNA_STRUCT_RENAME_ELEM(ThemeSpace, scrubbing_background, time_scrub_background) DNA_STRUCT_RENAME_ELEM(ThemeSpace, show_back_grad, background_type) +DNA_STRUCT_RENAME_ELEM(VFont, name, filepath) DNA_STRUCT_RENAME_ELEM(View3D, far, clip_end) DNA_STRUCT_RENAME_ELEM(View3D, near, clip_start) DNA_STRUCT_RENAME_ELEM(View3D, ob_centre, ob_center) @@ -100,6 +105,7 @@ DNA_STRUCT_RENAME_ELEM(bPoseChannel, curveOutY, curve_out_y) DNA_STRUCT_RENAME_ELEM(bPoseChannel, scaleIn, scale_in_x) DNA_STRUCT_RENAME_ELEM(bPoseChannel, scaleOut, scale_out_x) DNA_STRUCT_RENAME_ELEM(bSameVolumeConstraint, flag, free_axis) +DNA_STRUCT_RENAME_ELEM(bSound, name, filepath) DNA_STRUCT_RENAME_ELEM(bTheme, tact, space_action) DNA_STRUCT_RENAME_ELEM(bTheme, tbuts, space_properties) DNA_STRUCT_RENAME_ELEM(bTheme, tclip, space_clip) diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 083806350e7..6d220454364 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -217,7 +217,7 @@ void BLI_system_backtrace(FILE *fp) /** * Ensure type \c str to is in the #types array. * \param str: Struct name without any qualifiers. - * \param len: The struct size in bytes. + * \param size: The struct size in bytes. * \return Index in the #types array. */ static int add_type(const char *str, int size); |