diff options
author | Jacques Lucke <jacques@blender.org> | 2021-06-14 13:44:13 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-06-14 13:44:13 +0300 |
commit | dddcf1e9bbf4a6d1f4ff03eaf0cb7e9228b18ec5 (patch) | |
tree | c20defa7efd54c933d20a296abefe567909bb6c0 /source/blender/makesdna | |
parent | 3b162b7c185d089e93d892169a458d552196b7b6 (diff) | |
parent | c9dc55301cd7903b7ef7c045d337ada29aa809a1 (diff) |
Merge branch 'master' into temp-compact-node-prototypetemp-compact-node-prototype
Diffstat (limited to 'source/blender/makesdna')
39 files changed, 447 insertions, 116 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index d88db091cc2..dd262f78f6b 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -366,7 +366,7 @@ typedef struct Library { struct PackedFile *packedfile; - /* Temp data needed by read/write code. */ + /* Temp data needed by read/write code, and liboverride recursive resync. */ int temp_index; /** See BLENDER_FILE_VERSION, BLENDER_FILE_SUBVERSION, needed for do_versions. */ short versionfile, subversionfile; @@ -491,6 +491,11 @@ enum { * Note that this also applies to shapekeys, even though they are not 100% embedded data... */ LIB_EMBEDDED_DATA_LIB_OVERRIDE = 1 << 12, + /** + * The override data-block appears to not be needed anymore after resync with linked data, but it + * was kept around (because e.g. detected as user-edited). + */ + LIB_LIB_OVERRIDE_RESYNC_LEFTOVER = 1 << 13, }; /** @@ -550,8 +555,15 @@ enum { /* RESET_AFTER_USE tag existing data before linking so we know what is new. */ LIB_TAG_PRE_EXISTING = 1 << 11, - /* The data-block is a copy-on-write/localized version. */ + /** + * The data-block is a copy-on-write/localized version. + * + * \warning This should not be cleared on existing data. + * If support for this is needed, see T88026 as this flag controls memory ownership + * of physics *shared* pointers. + */ LIB_TAG_COPIED_ON_WRITE = 1 << 12, + LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT = 1 << 13, LIB_TAG_LOCALIZED = 1 << 14, @@ -586,14 +598,16 @@ typedef enum IDRecalcFlag { /* ** Object transformation changed. ** */ ID_RECALC_TRANSFORM = (1 << 0), - /* ** Object geometry changed. ** + /* ** Geometry changed. ** * * When object of armature type gets tagged with this flag, its pose is * re-evaluated. * When object of other type is tagged with this flag it makes the modifier * stack to be re-evaluated. * When object data type (mesh, curve, ...) gets tagged with this flag it - * makes all objects which shares this data-block to be updated. */ + * makes all objects which shares this data-block to be updated. + * When a collection gets tagged with this flag, all objects depending on the geometry and + * transforms on any of the objects in the collection are updated. */ ID_RECALC_GEOMETRY = (1 << 1), /* ** Animation or time changed and animation is to be re-evaluated. ** */ diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 5cc525a6cff..583e56de9c2 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -265,9 +265,10 @@ typedef struct bPoseChannel { * since the alternative is highly complicated - campbell */ struct bPoseChannel *custom_tx; - float custom_scale; - - char _pad1[4]; + float custom_scale; /* Deprecated */ + float custom_scale_xyz[3]; + float custom_translation[3]; + float custom_rotation_euler[3]; /** Transforms - written in by actions or transform. */ float loc[3]; @@ -417,9 +418,9 @@ typedef enum ePchan_DrawFlag { PCHAN_DRAW_NO_CUSTOM_BONE_SIZE = (1 << 0), } ePchan_DrawFlag; -#define PCHAN_CUSTOM_DRAW_SIZE(pchan) \ - (pchan)->custom_scale *( \ - ((pchan)->drawflag & PCHAN_DRAW_NO_CUSTOM_BONE_SIZE) ? 1.0f : (pchan)->bone->length) +/* Note: It doesn't take custom_scale_xyz into account */ +#define PCHAN_CUSTOM_BONE_LENGTH(pchan) \ + (((pchan)->drawflag & PCHAN_DRAW_NO_CUSTOM_BONE_SIZE) ? 1.0f : (pchan)->bone->length) #ifdef DNA_DEPRECATED_ALLOW /* PoseChannel->bboneflag */ diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h index 09304ce09f2..85780bc33c5 100644 --- a/source/blender/makesdna/DNA_armature_types.h +++ b/source/blender/makesdna/DNA_armature_types.h @@ -134,7 +134,7 @@ typedef struct bArmature { /** ID data is older than edit-mode data (TODO: move to edit-mode struct). */ char needs_flush_to_id; - char _pad0[7]; + char _pad0[3]; int flag; int drawtype; @@ -146,6 +146,9 @@ typedef struct bArmature { unsigned int layer_used; /** For buttons to work, both variables in this order together. */ unsigned int layer, layer_protected; + + /** Relative position of the axes on the bone, from head (0.0f) to tail (1.0f). */ + float axes_position; } bArmature; /* armature->flag */ @@ -230,8 +233,10 @@ typedef enum eBone_Flag { BONE_MULT_VG_ENV = (1 << 11), /** bone doesn't deform geometry */ BONE_NO_DEFORM = (1 << 12), +#ifdef DNA_DEPRECATED_ALLOW /** set to prevent destruction of its unkeyframed pose (after transform) */ BONE_UNKEYED = (1 << 13), +#endif /** set to prevent hinge child bones from influencing the transform center */ BONE_HINGE_CHILD_TRANSFORM = (1 << 14), #ifdef DNA_DEPRECATED_ALLOW diff --git a/source/blender/makesdna/DNA_boid_types.h b/source/blender/makesdna/DNA_boid_types.h index 882d4eb1b3b..540446ccd9d 100644 --- a/source/blender/makesdna/DNA_boid_types.h +++ b/source/blender/makesdna/DNA_boid_types.h @@ -97,7 +97,8 @@ typedef struct BoidRuleFollowLeader { } BoidRuleFollowLeader; typedef struct BoidRuleAverageSpeed { BoidRule rule; - float wander, level, speed, rt; + float wander, level, speed; + char _pad0[4]; } BoidRuleAverageSpeed; typedef struct BoidRuleFight { BoidRule rule; @@ -178,7 +179,7 @@ typedef struct BoidState { //} BoidSignal; // typedef struct BoidSignalDefine { // struct BoidSignalDefine *next, *prev; -// int id, rt; +// int id, _pad[4]; // char name[32]; //} BoidSignalDefine; diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index a11e7d77c67..986c009ac26 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -133,7 +133,8 @@ typedef struct BrushGpencilSettings { /** Factor to extend stroke extremes using fill tool. */ float fill_extend_fac; - char _pad3[4]; + /** Number of pixels to dilate fill area. */ + int dilate_pixels; struct CurveMapping *curve_sensitivity; struct CurveMapping *curve_strength; diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 07fbf263d80..a94bc4625df 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -534,6 +534,8 @@ typedef struct bRotLimitConstraint { float zmin, zmax; short flag; short flag2; + char euler_order; + char _pad[3]; } bRotLimitConstraint; /* Limit Scale Constraint */ diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 4f914089347..f6242679808 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -43,25 +43,7 @@ struct Key; struct Material; struct Object; struct VFont; - -/* These two Lines with # tell makesdna this struct can be excluded. */ -# -# -typedef struct PathPoint { - /** Grr, cant get rid of tilt yet. */ - float vec[4]; - float quat[4]; - float radius, weight; -} PathPoint; - -/* These two Lines with # tell makesdna this struct can be excluded. */ -# -# -typedef struct Path { - struct PathPoint *data; - int len; - float totdist; -} Path; +struct CurveEval; /* These two Lines with # tell makesdna this struct can be excluded. */ # @@ -72,7 +54,7 @@ typedef struct BevPoint { float sina, cosa; /** 3D Only. */ float dir[3], tan[3], quat[4]; - short split_tag, dupe_tag; + short dupe_tag; } BevPoint; /* These two Lines with # tell makesdna this struct can be excluded. */ @@ -319,6 +301,12 @@ typedef struct Curve { char _pad2[6]; float fsize_realtime; + /** + * A pointer to curve data from geometry nodes, currently only set for evaluated + * objects by the dependency graph iterator, and owned by #geometry_set_eval. + */ + struct CurveEval *curve_eval; + void *batch_cache; } Curve; @@ -347,7 +335,7 @@ enum { CU_BACK = 1 << 2, CU_PATH = 1 << 3, CU_FOLLOW = 1 << 4, - /* CU_UV_ORCO = 1 << 5, */ /* DEPRECATED */ + CU_PATH_CLAMP = 1 << 5, CU_DEFORM_BOUNDS_OFF = 1 << 6, CU_STRETCH = 1 << 7, /* CU_OFFS_PATHDIST = 1 << 8, */ /* DEPRECATED */ @@ -425,7 +413,6 @@ enum { /* Nurb.flag */ enum { CU_SMOOTH = 1 << 0, - CU_2D = 1 << 3, /* moved from type since 2.4x */ }; /* Nurb.type */ diff --git a/source/blender/makesdna/DNA_effect_types.h b/source/blender/makesdna/DNA_effect_types.h index 33f2e1b47c0..307a212a139 100644 --- a/source/blender/makesdna/DNA_effect_types.h +++ b/source/blender/makesdna/DNA_effect_types.h @@ -71,13 +71,15 @@ extern "C" { typedef struct Effect { struct Effect *next, *prev; - short type, flag, buttype, rt; + short type, flag, buttype; + char _pad0[2]; } Effect; typedef struct BuildEff { struct BuildEff *next, *prev; - short type, flag, buttype, rt; + short type, flag, buttype; + char _pad0[2]; float len, sfra; @@ -88,7 +90,8 @@ typedef struct BuildEff { typedef struct Particle { float co[3], no[3]; float time, lifetime; - short mat_nr, rt; + short mat_nr; + char _pad0[2]; } Particle; struct Collection; diff --git a/source/blender/makesdna/DNA_genfile.h b/source/blender/makesdna/DNA_genfile.h index 6fcbc53d47b..74d668a1081 100644 --- a/source/blender/makesdna/DNA_genfile.h +++ b/source/blender/makesdna/DNA_genfile.h @@ -63,6 +63,7 @@ typedef enum eSDNA_Type { #define SDNA_TYPE_VOID 9 SDNA_TYPE_INT64 = 10, SDNA_TYPE_UINT64 = 11, + SDNA_TYPE_INT8 = 12, } eSDNA_Type; /** diff --git a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h index 2478bbe88ba..a4ab38f6022 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h @@ -184,6 +184,8 @@ .layer_pass = 0, \ .hardeness = 1.0f, \ .curve_intensity = NULL, \ + .fading_end = 10.0f, \ + .fading_end_factor = 0.2f, \ } #define _DNA_DEFAULT_SimplifyGpencilModifierData \ @@ -251,6 +253,8 @@ .thickness_fac = 1.0f, \ .thickness = 30, \ .layer_pass = 0, \ + .fading_end = 10.0f, \ + .fading_end_factor = 0.2f, \ } #define _DNA_DEFAULT_TimeGpencilModifierData \ @@ -288,11 +292,21 @@ .edge_types = LRT_EDGE_FLAG_ALL_TYPE, \ .thickness = 25, \ .opacity = 1.0f, \ - .flags = LRT_GPENCIL_MATCH_OUTPUT_VGROUP | LRT_GPENCIL_SOFT_SELECTION, \ + .flags = LRT_GPENCIL_MATCH_OUTPUT_VGROUP, \ .crease_threshold = DEG2RAD(140.0f), \ .calculation_flags = LRT_ALLOW_DUPLI_OBJECTS | LRT_ALLOW_CLIPPING_BOUNDARIES, \ .angle_splitting_threshold = DEG2RAD(60.0f), \ .chaining_image_threshold = 0.001f, \ } +#define _DNA_DEFAULT_LengthGpencilModifierData \ + { \ + .start_fac = 0.1f,\ + .end_fac = 0.1f,\ + .overshoot_fac = 0.01f,\ + .pass_index = 0,\ + .material = NULL,\ + } + + /* clang-format off */ diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index bc046a3b830..410212ce100 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -54,6 +54,7 @@ typedef enum GpencilModifierType { eGpencilModifierType_Multiply = 17, eGpencilModifierType_Texture = 18, eGpencilModifierType_Lineart = 19, + eGpencilModifierType_Length = 20, /* Keep last. */ NUM_GREASEPENCIL_MODIFIER_TYPES, } GpencilModifierType; @@ -187,7 +188,12 @@ typedef struct ThickGpencilModifierData { int thickness; /** Custom index for passes. */ int layer_pass; - char _pad[4]; + /** Start/end distances of the fading effect. */ + float fading_start; + float fading_end; + float fading_end_factor; + /** Fading reference object */ + struct Object *object; struct CurveMapping *curve_thickness; } ThickGpencilModifierData; @@ -199,6 +205,7 @@ typedef enum eThickGpencil_Flag { GP_THICK_NORMALIZE = (1 << 4), GP_THICK_INVERT_LAYERPASS = (1 << 5), GP_THICK_INVERT_MATERIAL = (1 << 6), + GP_THICK_FADING = (1 << 7), } eThickGpencil_Flag; typedef struct TimeGpencilModifierData { @@ -291,9 +298,16 @@ typedef struct OpacityGpencilModifierData { int flag; /** Main Opacity factor. */ float factor; + /** Fading controlling object */ + int _pad0; + struct Object *object; + /** Start/end distances of the fading effect. */ + float fading_start; + float fading_end; + float fading_end_factor; /** Modify stroke, fill or both. */ char modify_color; - char _pad[3]; + char _pad1[3]; /** Custom index for passes. */ int layer_pass; @@ -309,6 +323,7 @@ typedef enum eOpacityGpencil_Flag { GP_OPACITY_INVERT_MATERIAL = (1 << 5), GP_OPACITY_CUSTOM_CURVE = (1 << 6), GP_OPACITY_NORMALIZE = (1 << 7), + GP_OPACITY_FADING = (1 << 8), } eOpacityGpencil_Flag; typedef struct ArrayGpencilModifierData { @@ -470,6 +485,39 @@ typedef enum eLatticeGpencil_Flag { GP_LATTICE_INVERT_MATERIAL = (1 << 4), } eLatticeGpencil_Flag; +typedef struct LengthGpencilModifierData { + GpencilModifierData modifier; + /** Material for filtering. */ + struct Material *material; + /** Layer name. */ + char layername[64]; + /** Custom index for passes. */ + int pass_index; + /** Flags. */ + int flag; + /** Custom index for passes. */ + int layer_pass; + /** Length. */ + float start_fac, end_fac; + /** Overshoot trajectory factor. */ + float overshoot_fac; + /** Modifier mode. */ + int mode; + char _pad[4]; +} LengthGpencilModifierData; + +typedef enum eLengthGpencil_Flag { + GP_LENGTH_INVERT_LAYER = (1 << 0), + GP_LENGTH_INVERT_PASS = (1 << 1), + GP_LENGTH_INVERT_LAYERPASS = (1 << 2), + GP_LENGTH_INVERT_MATERIAL = (1 << 3), +} eLengthGpencil_Flag; + +typedef enum eLengthGpencil_Type { + GP_LENGTH_RELATIVE = 0, + GP_LENGTH_ABSOLUTE = 1, +} eLengthGpencil_Type; + typedef struct MirrorGpencilModifierData { GpencilModifierData modifier; struct Object *object; @@ -616,6 +664,14 @@ typedef struct OffsetGpencilModifierData { float loc[3]; float rot[3]; float scale[3]; + /** Random Offset. */ + float rnd_offset[3]; + /** Random Rotation. */ + float rnd_rot[3]; + /** Random Scales. */ + float rnd_scale[3]; + /** (first element is the index) random values. */ + int seed; /** Custom index for passes. */ int layer_pass; } OffsetGpencilModifierData; @@ -626,6 +682,7 @@ typedef enum eOffsetGpencil_Flag { GP_OFFSET_INVERT_VGROUP = (1 << 2), GP_OFFSET_INVERT_LAYERPASS = (1 << 3), GP_OFFSET_INVERT_MATERIAL = (1 << 4), + GP_OFFSET_UNIFORM_RANDOM_SCALE = (1 << 5), } eOffsetGpencil_Flag; typedef struct SmoothGpencilModifierData { @@ -819,7 +876,7 @@ typedef enum eLineartGpencilModifierSource { typedef enum eLineArtGPencilModifierFlags { LRT_GPENCIL_INVERT_SOURCE_VGROUP = (1 << 0), LRT_GPENCIL_MATCH_OUTPUT_VGROUP = (1 << 1), - LRT_GPENCIL_SOFT_SELECTION = (1 << 2), + LRT_GPENCIL_BINARY_WEIGHTS = (1 << 2) /* Deprecated, this is removed for lack of use case. */, LRT_GPENCIL_IS_BAKED = (1 << 3), } eLineArtGPencilModifierFlags; @@ -868,7 +925,7 @@ typedef struct LineartGpencilModifierData { /* CPU mode */ float chaining_image_threshold; - float resample_length; + int _pad; /* Ported from SceneLineArt flags. */ int calculation_flags; diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 8facdca2f9c..ea3c1ff7275 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -47,7 +47,7 @@ struct Curve; #define GP_DEFAULT_CURVE_EDIT_CORNER_ANGLE M_PI_2 #define GPENCIL_MIN_FILL_FAC 0.05f -#define GPENCIL_MAX_FILL_FAC 5.0f +#define GPENCIL_MAX_FILL_FAC 8.0f /* ***************************************** */ /* GP Stroke Points */ @@ -112,6 +112,8 @@ typedef enum eGPDspoint_Flag { GP_SPOINT_TAG = (1 << 1), /* stroke point is temp tagged (for some editing operation) */ GP_SPOINT_TEMP_TAG = (1 << 2), + /* stroke point is temp tagged (for some editing operation) */ + GP_SPOINT_TEMP_TAG2 = (1 << 3), } eGPSPoint_Flag; /* ***************************************** */ @@ -558,6 +560,8 @@ typedef enum eGPDlayer_Flag { GP_LAYER_USE_MASK = (1 << 13), /*TODO: DEPRECATED */ /* Ruler Layer */ GP_LAYER_IS_RULER = (1 << 14), + /* Disable masks in viewlayer render */ + GP_LAYER_DISABLE_MASKS_IN_VIEWLAYER = (1 << 15), } eGPDlayer_Flag; /** #bGPDlayer.onion_flag */ diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h index 8bb94976414..c5e207c4e20 100644 --- a/source/blender/makesdna/DNA_ipo_types.h +++ b/source/blender/makesdna/DNA_ipo_types.h @@ -77,8 +77,9 @@ typedef struct IpoCurve { short totvert; /** Interpolation and extrapolation modes . */ short ipo, extrap; - /** Flag= settings; rt= ???. */ - short flag, rt; + /** Flag= settings. */ + short flag; + char _pad0[2]; /** Minimum/maximum y-extents for curve. */ float ymin, ymax; /** ???. */ diff --git a/source/blender/makesdna/DNA_light_defaults.h b/source/blender/makesdna/DNA_light_defaults.h index f3ccf14ac5b..5e5ce4bf540 100644 --- a/source/blender/makesdna/DNA_light_defaults.h +++ b/source/blender/makesdna/DNA_light_defaults.h @@ -68,6 +68,7 @@ .volume_fac = 1.0f, \ .att_dist = 40.0f, \ .sun_angle = DEG2RADF(0.526f), \ + .area_spread = DEG2RADF(180.0f), \ } /** \} */ diff --git a/source/blender/makesdna/DNA_light_types.h b/source/blender/makesdna/DNA_light_types.h index 3b7440aedd2..82ff3c95834 100644 --- a/source/blender/makesdna/DNA_light_types.h +++ b/source/blender/makesdna/DNA_light_types.h @@ -70,9 +70,9 @@ typedef struct Light { short area_shape; float area_size, area_sizey, area_sizez; + float area_spread; float sun_angle; - char _pad3[4]; /* texact is for buttons */ short texact, shadhalostep; diff --git a/source/blender/makesdna/DNA_lineart_types.h b/source/blender/makesdna/DNA_lineart_types.h index 31e221b74a0..860a6579bf7 100644 --- a/source/blender/makesdna/DNA_lineart_types.h +++ b/source/blender/makesdna/DNA_lineart_types.h @@ -35,9 +35,6 @@ #include "DNA_ID.h" #include "DNA_listBase.h" -struct Object; -struct Material; - /* Notice that we need to have this file although no struct defines. * Edge flags and usage flags are used by with scene/object/gpencil modifier bits, and those values * needs to stay consistent throughout. */ diff --git a/source/blender/makesdna/DNA_mesh_defaults.h b/source/blender/makesdna/DNA_mesh_defaults.h index 8326db66049..889f92eec95 100644 --- a/source/blender/makesdna/DNA_mesh_defaults.h +++ b/source/blender/makesdna/DNA_mesh_defaults.h @@ -37,6 +37,7 @@ .face_sets_color_seed = 0, \ .face_sets_color_default = 1, \ .flag = ME_REMESH_FIX_POLES | ME_REMESH_REPROJECT_VOLUME, \ + .editflag = ME_EDIT_MIRROR_VERTEX_GROUPS \ } /** \} */ diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index af20a63b907..3eb5920dfe6 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -263,7 +263,7 @@ enum { /* me->editflag */ enum { - ME_EDIT_VERTEX_GROUPS_X_SYMMETRY = 1 << 0, + ME_EDIT_MIRROR_VERTEX_GROUPS = 1 << 0, ME_EDIT_MIRROR_Y = 1 << 1, /* unused so far */ ME_EDIT_MIRROR_Z = 1 << 2, /* unused so far */ @@ -272,7 +272,11 @@ enum { ME_EDIT_PAINT_VERT_SEL = 1 << 5, }; -/* we cant have both flags enabled at once, +/* Helper macro to see if vertex group X mirror is on. */ +#define ME_USING_MIRROR_X_VERTEX_GROUPS(_me) \ + (((_me)->editflag & ME_EDIT_MIRROR_VERTEX_GROUPS) && ((_me)->symmetry & ME_SYMMETRY_X)) + +/* We cant have both flags enabled at once, * flags defined in DNA_scene_types.h */ #define ME_EDIT_PAINT_SEL_MODE(_me) \ (((_me)->editflag & ME_EDIT_PAINT_FACE_SEL) ? \ diff --git a/source/blender/makesdna/DNA_modifier_defaults.h b/source/blender/makesdna/DNA_modifier_defaults.h index 9335c360363..f6dac88051b 100644 --- a/source/blender/makesdna/DNA_modifier_defaults.h +++ b/source/blender/makesdna/DNA_modifier_defaults.h @@ -414,7 +414,8 @@ { \ .cache_file = NULL, \ .object_path = "", \ - .read_flag = MOD_MESHSEQ_READ_VERT | MOD_MESHSEQ_READ_POLY | MOD_MESHSEQ_READ_UV | MOD_MESHSEQ_READ_COLOR, \ + .read_flag = MOD_MESHSEQ_READ_VERT | MOD_MESHSEQ_READ_POLY | MOD_MESHSEQ_READ_UV | \ + MOD_MESHSEQ_READ_COLOR | MOD_MESHSEQ_INTERPOLATE_VERTICES, \ .velocity_scale = 1.0f, \ .reader = NULL, \ .reader_object_path = "", \ @@ -428,6 +429,7 @@ { \ .flag = MOD_MIR_AXIS_X | MOD_MIR_VGROUP, \ .tolerance = 0.001f, \ + .bisect_threshold = 0.001f, \ .uv_offset = {0.0f, 0.0f}, \ .uv_offset_copy = {0.0f, 0.0f}, \ .mirror_ob = NULL, \ diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index ca6f1467d9c..c61e940190f 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -368,6 +368,8 @@ typedef struct MirrorModifierData { short axis DNA_DEPRECATED; short flag; float tolerance; + float bisect_threshold; + char _pad[4]; float uv_offset[2]; float uv_offset_copy[2]; struct Object *mirror_ob; diff --git a/source/blender/makesdna/DNA_movieclip_defaults.h b/source/blender/makesdna/DNA_movieclip_defaults.h index 4aa1bd779c2..753147eb072 100644 --- a/source/blender/makesdna/DNA_movieclip_defaults.h +++ b/source/blender/makesdna/DNA_movieclip_defaults.h @@ -32,7 +32,7 @@ .build_size_flag = IMB_PROXY_25, \ .build_tc_flag = IMB_TC_RECORD_RUN | IMB_TC_FREE_RUN | \ IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN | IMB_TC_RECORD_RUN_NO_GAPS, \ - .quality = 90, \ + .quality = 50, \ } diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index f24d0e40d19..2ae48bfe0ad 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -45,6 +45,8 @@ struct bNodePreview; struct bNodeTreeExec; struct bNodeType; struct uiBlock; +struct Tex; +struct Material; #define NODE_MAXSTR 64 @@ -98,8 +100,8 @@ typedef struct bNodeSocket { void *storage; short type, flag; - /** Max. number of links. Read via nodeSocketLinkLimit, because the limit might be defined on the - * socket type. */ + /** Max. number of links. Read via nodeSocketLinkLimit, + * because the limit might be defined on the socket type. */ short limit; /** Input/output type. */ short in_out; @@ -125,6 +127,7 @@ typedef struct bNodeSocket { /** Custom dynamic defined label, MAX_NAME. */ char label[64]; + char description[64]; /** Cached data from execution. */ void *cache; @@ -164,9 +167,11 @@ typedef enum eNodeSocketDatatype { SOCK_IMAGE = 9, SOCK_GEOMETRY = 10, SOCK_COLLECTION = 11, + SOCK_TEXTURE = 12, + SOCK_MATERIAL = 13, } eNodeSocketDatatype; -/* socket shape */ +/* Socket shape. */ typedef enum eNodeSocketDisplayShape { SOCK_DISPLAY_SHAPE_CIRCLE = 0, SOCK_DISPLAY_SHAPE_SQUARE = 1, @@ -176,38 +181,43 @@ typedef enum eNodeSocketDisplayShape { SOCK_DISPLAY_SHAPE_DIAMOND_DOT = 5, } eNodeSocketDisplayShape; -/* socket side (input/output) */ +/* Socket side (input/output). */ typedef enum eNodeSocketInOut { SOCK_IN = 1 << 0, SOCK_OUT = 1 << 1, } eNodeSocketInOut; -/* sock->flag, first bit is select */ +/* #bNodeSocket.flag, first bit is selection. */ typedef enum eNodeSocketFlag { - /** hidden is user defined, to hide unused */ + /** Hidden is user defined, to hide unused sockets. */ SOCK_HIDDEN = (1 << 1), - /** for quick check if socket is linked */ + /** For quick check if socket is linked. */ SOCK_IN_USE = (1 << 2), - /** unavailable is for dynamic sockets */ + /** Unavailable is for dynamic sockets. */ SOCK_UNAVAIL = (1 << 3), // /** DEPRECATED dynamic socket (can be modified by user) */ // SOCK_DYNAMIC = (1 << 4), // /** DEPRECATED group socket should not be exposed */ // SOCK_INTERNAL = (1 << 5), - /** socket collapsed in UI */ + /** Socket collapsed in UI. */ SOCK_COLLAPSED = (1 << 6), - /** hide socket value, if it gets auto default */ + /** Hide socket value, if it gets auto default. */ SOCK_HIDE_VALUE = (1 << 7), - /** socket hidden automatically, to distinguish from manually hidden */ + /** Socket hidden automatically, to distinguish from manually hidden. */ SOCK_AUTO_HIDDEN__DEPRECATED = (1 << 8), SOCK_NO_INTERNAL_LINK = (1 << 9), /** Draw socket in a more compact form. */ SOCK_COMPACT = (1 << 10), /** Make the input socket accept multiple incoming links in the UI. */ SOCK_MULTI_INPUT = (1 << 11), + /** + * Don't show the socket's label in the interface, for situations where the + * type is obvious and the name takes up too much space. + */ + SOCK_HIDE_LABEL = (1 << 12), } eNodeSocketFlag; -/* limit data in bNode to what we want to see saved? */ +/* TODO: Limit data in bNode to what we want to see saved. */ typedef struct bNode { struct bNode *next, *prev, *new_node; @@ -348,6 +358,8 @@ typedef struct bNode { * composite out nodes when editing tree */ #define NODE_DO_OUTPUT_RECALC (1 << 17) +/* A preview for the data in this node can be displayed in the spreadsheet editor. */ +#define NODE_ACTIVE_PREVIEW (1 << 18) /* node->update */ /* XXX NODE_UPDATE is a generic update flag. More fine-grained updates @@ -454,7 +466,6 @@ typedef struct bNodeTree { short is_updating; /** Generic temporary flag for recursion check (DFS/BFS). */ short done; - char _pad2[4]; /** Specific node type this tree is used for. */ int nodetype DNA_DEPRECATED; @@ -465,6 +476,8 @@ typedef struct bNodeTree { short render_quality; /** Tile size for compositor engine. */ int chunksize; + /** Execution mode to use for compositor engine. */ + int execution_mode; rctf viewer_border; @@ -495,7 +508,7 @@ typedef struct bNodeTree { */ struct bNodeTreeExec *execdata; - /* callbacks */ + /* Callbacks. */ void (*progress)(void *, float progress); /** \warning may be called by different threads */ void (*stats_draw)(void *, const char *str); @@ -538,6 +551,12 @@ typedef enum eNodeTreeUpdate { NTREE_UPDATE_GROUP = (NTREE_UPDATE_GROUP_IN | NTREE_UPDATE_GROUP_OUT), } eNodeTreeUpdate; +/* tree->execution_mode */ +typedef enum eNodeTreeExecutionMode { + NTREE_EXECUTION_MODE_TILED = 0, + NTREE_EXECUTION_MODE_FULL_FRAME = 1, +} eNodeTreeExecutionMode; + /* socket value structs for input buttons * DEPRECATED now using ID properties */ @@ -590,7 +609,15 @@ typedef struct bNodeSocketValueCollection { struct Collection *value; } bNodeSocketValueCollection; -/* data structs, for node->storage */ +typedef struct bNodeSocketValueTexture { + struct Tex *value; +} bNodeSocketValueTexture; + +typedef struct bNodeSocketValueMaterial { + struct Material *value; +} bNodeSocketValueMaterial; + +/* Data structs, for node->storage. */ enum { CMP_NODE_MASKTYPE_ADD = 0, CMP_NODE_MASKTYPE_SUBTRACT = 1, @@ -614,7 +641,7 @@ enum { CMP_NODEFLAG_MASK_NO_FEATHER = (1 << 1), CMP_NODEFLAG_MASK_MOTION_BLUR = (1 << 2), - /* we may want multiple aspect options, exposed as an rna enum */ + /* We may want multiple aspect options, exposed as an rna enum. */ CMP_NODEFLAG_MASK_FIXED = (1 << 8), CMP_NODEFLAG_MASK_FIXED_SCENE = (1 << 9), }; @@ -629,7 +656,7 @@ typedef struct NodeFrame { short label_size; } NodeFrame; -/* this one has been replaced with ImageUser, keep it for do_versions() */ +/* This one has been replaced with ImageUser, keep it for do_versions(). */ typedef struct NodeImageAnim { int frames DNA_DEPRECATED; int sfra DNA_DEPRECATED; @@ -683,7 +710,7 @@ typedef struct NodeEllipseMask { char _pad[4]; } NodeEllipseMask; -/* layer info for image node outputs */ +/* Layer info for image node outputs. */ typedef struct NodeImageLayer { /* index in the Image->layers->passes lists */ int pass_index DNA_DEPRECATED; @@ -715,6 +742,12 @@ typedef struct NodeBilateralBlurData { char _pad[2]; } NodeBilateralBlurData; +typedef struct NodeAntiAliasingData { + float threshold; + float contrast_limit; + float corner_rounding; +} NodeAntiAliasingData; + /* NOTE: Only for do-version code. */ typedef struct NodeHueSat { float hue, sat, val; @@ -1108,6 +1141,14 @@ typedef struct NodeDenoise { char hdr; } NodeDenoise; +typedef struct NodeAttributeClamp { + /* CustomDataType. */ + uint8_t data_type; + + /* NodeClampOperation. */ + uint8_t operation; +} NodeAttributeClamp; + typedef struct NodeAttributeCompare { /* FloatCompareOperation. */ uint8_t operation; @@ -1119,6 +1160,14 @@ typedef struct NodeAttributeCompare { char _pad[5]; } NodeAttributeCompare; +typedef struct NodeAttributeMapRange { + /* GeometryNodeAttributeDataType */ + uint8_t data_type; + + /* NodeMapRangeType. */ + uint8_t interpolation_type; +} NodeAttributeMapRange; + typedef struct NodeAttributeMath { /* NodeMathOperation. */ uint8_t operation; @@ -1159,10 +1208,31 @@ typedef struct NodeAttributeVectorMath { uint8_t input_type_c; } NodeAttributeVectorMath; +typedef struct NodeAttributeVectorRotate { + /* GeometryNodeAttributeVectorRotateMode */ + uint8_t mode; + + /* GeometryNodeAttributeInputMode */ + uint8_t input_type_vector; + uint8_t input_type_center; + uint8_t input_type_axis; + uint8_t input_type_angle; + uint8_t input_type_rotation; + char _pad[2]; +} NodeAttributeVectorRotate; + typedef struct NodeAttributeColorRamp { ColorBand color_ramp; } NodeAttributeColorRamp; +typedef struct NodeAttributeCurveMap { + /* CustomDataType. */ + uint8_t data_type; + char _pad[7]; + CurveMapping *curve_vec; + CurveMapping *curve_rgb; +} NodeAttributeCurveMap; + typedef struct NodeInputVector { float vector[3]; } NodeInputVector; @@ -1255,10 +1325,9 @@ typedef struct NodeAttributeSeparateXYZ { typedef struct NodeAttributeConvert { /* CustomDataType. */ - uint8_t data_type; - char _pad[1]; + int8_t data_type; /* AttributeDomain. */ - int16_t domain; + int8_t domain; } NodeAttributeConvert; typedef struct NodeGeometryMeshCircle { @@ -1283,6 +1352,23 @@ typedef struct NodeGeometryMeshLine { uint8_t count_mode; } NodeGeometryMeshLine; +typedef struct NodeSwitch { + /* NodeSwitch. */ + uint8_t input_type; +} NodeSwitch; + +typedef struct NodeGeometryCurveResample { + /* GeometryNodeCurveSampleMode. */ + uint8_t mode; +} NodeGeometryCurveResample; + +typedef struct NodeGeometryAttributeTransfer { + /* AttributeDomain. */ + int8_t domain; + /* GeometryNodeAttributeTransferMapMode. */ + uint8_t mapping; +} NodeGeometryAttributeTransfer; + /* script node mode */ #define NODE_SCRIPT_INTERNAL 0 #define NODE_SCRIPT_EXTERNAL 1 @@ -1457,7 +1543,7 @@ enum { #define SHD_AO_INSIDE 1 #define SHD_AO_LOCAL 2 -/* Mapping node vector types */ +/* Mapping node vector types. */ enum { NODE_MAPPING_TYPE_POINT = 0, NODE_MAPPING_TYPE_TEXTURE = 1, @@ -1465,7 +1551,7 @@ enum { NODE_MAPPING_TYPE_NORMAL = 3, }; -/* Rotation node vector types */ +/* Rotation node vector types. */ enum { NODE_VECTOR_ROTATE_TYPE_AXIS = 0, NODE_VECTOR_ROTATE_TYPE_AXIS_X = 1, @@ -1552,6 +1638,7 @@ typedef enum NodeVectorMathOperation { NODE_VECTOR_MATH_TANGENT = 23, NODE_VECTOR_MATH_REFRACT = 24, NODE_VECTOR_MATH_FACEFORWARD = 25, + NODE_VECTOR_MATH_MULTIPLY_ADD = 26, } NodeVectorMathOperation; /* Boolean math node operations. */ @@ -1678,14 +1765,12 @@ typedef enum GeometryNodeAttributeProximityTargetType { GEO_NODE_ATTRIBUTE_PROXIMITY_TARGET_GEOMETRY_ELEMENT_FACES = 2, } GeometryNodeAttributeProximityTargetType; -/* Boolean Node */ typedef enum GeometryNodeBooleanOperation { GEO_NODE_BOOLEAN_INTERSECT = 0, GEO_NODE_BOOLEAN_UNION = 1, GEO_NODE_BOOLEAN_DIFFERENCE = 2, } GeometryNodeBooleanOperation; -/* Triangulate Node */ typedef enum GeometryNodeTriangulateNGons { GEO_NODE_TRIANGULATE_NGON_BEAUTY = 0, GEO_NODE_TRIANGULATE_NGON_EARCLIP = 1, @@ -1726,6 +1811,14 @@ typedef enum GeometryNodeRotatePointsType { GEO_NODE_POINT_ROTATE_TYPE_AXIS_ANGLE = 1, } GeometryNodeRotatePointsType; +typedef enum GeometryNodeAttributeVectorRotateMode { + GEO_NODE_VECTOR_ROTATE_TYPE_AXIS = 0, + GEO_NODE_VECTOR_ROTATE_TYPE_AXIS_X = 1, + GEO_NODE_VECTOR_ROTATE_TYPE_AXIS_Y = 2, + GEO_NODE_VECTOR_ROTATE_TYPE_AXIS_Z = 3, + GEO_NODE_VECTOR_ROTATE_TYPE_EULER_XYZ = 4, +} GeometryNodeAttributeVectorRotateMode; + typedef enum GeometryNodeAttributeRandomizeMode { GEO_NODE_ATTRIBUTE_RANDOMIZE_REPLACE_CREATE = 0, GEO_NODE_ATTRIBUTE_RANDOMIZE_ADD = 1, @@ -1777,6 +1870,16 @@ typedef enum GeometryNodeMeshLineCountMode { GEO_NODE_MESH_LINE_COUNT_RESOLUTION = 1, } GeometryNodeMeshLineCountMode; +typedef enum GeometryNodeCurveSampleMode { + GEO_NODE_CURVE_SAMPLE_COUNT = 0, + GEO_NODE_CURVE_SAMPLE_LENGTH = 1, +} GeometryNodeCurveSampleMode; + +typedef enum GeometryNodeAttributeTransferMapMode { + GEO_NODE_ATTRIBUTE_TRANSFER_NEAREST_FACE_INTERPOLATED = 0, + GEO_NODE_ATTRIBUTE_TRANSFER_NEAREST = 1, +} GeometryNodeAttributeTransferMapMode; + #ifdef __cplusplus } #endif diff --git a/source/blender/makesdna/DNA_object_force_types.h b/source/blender/makesdna/DNA_object_force_types.h index 37013f5b4d6..3d8418fb734 100644 --- a/source/blender/makesdna/DNA_object_force_types.h +++ b/source/blender/makesdna/DNA_object_force_types.h @@ -182,8 +182,8 @@ typedef struct EffectorWeights { /** Effector type specific weights. */ float weight[14]; float global_gravity; - short flag, rt[3]; - char _pad[4]; + short flag; + char _pad[2]; } EffectorWeights; /* EffectorWeights->flag */ @@ -267,10 +267,9 @@ typedef struct SoftBody { char namedVG_Spring_K[64]; /* baking */ - int sfra, efra; - int interval; + char _pad1[6]; /** Local==1: use local coords for baking. */ - short local, solverflags; + char local, solverflags; /* -- these must be kept for backwards compatibility -- */ /** Array of size totpointkey. */ diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 686cf2048eb..9951bdefbbb 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -144,6 +144,9 @@ typedef struct Object_Runtime { */ char is_data_eval_owned; + /** Start time of the mode transfer overlay animation. */ + double overlay_mode_transfer_start_time; + /** Axis aligned boundbox (in localspace). */ struct BoundBox *bb; @@ -169,6 +172,12 @@ typedef struct Object_Runtime { struct GeometrySet *geometry_set_eval; /** + * A GHash that contains geometry sets for intermediate stages of evaluation. The keys are just a + * hash and are not owned by the map. The geometry sets are owned. + */ + void *geometry_set_previews; + + /** * Mesh structure created during object evaluation. * It has deformation only modifiers applied on it. */ diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index cc40e26b92b..30b1fbe09d3 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -64,7 +64,7 @@ typedef struct BoidParticle { struct BoidData data; float gravity[3]; float wander[3]; - float rt; + char _pad0[4]; } BoidParticle; typedef struct ParticleSpring { @@ -82,7 +82,7 @@ typedef struct ChildParticle { float w[4]; /** Face vertex weights and offset. */ float fuv[4], foffset; - float rt; + char _pad0[4]; } ChildParticle; typedef struct ParticleTarget { @@ -99,7 +99,8 @@ typedef struct ParticleDupliWeight { short count; short flag; /** Only updated on file save and used on file load. */ - short index, rt; + short index; + char _pad0[2]; } ParticleDupliWeight; typedef struct ParticleData { @@ -191,7 +192,8 @@ typedef struct ParticleSettings { struct EffectorWeights *effector_weights; struct Collection *collision_group; - int flag, rt; + int flag; + char _pad1[4]; short type, from, distr, texact; /* physics modes */ short phystype, rotmode, avemode, reactevent; diff --git a/source/blender/makesdna/DNA_pointcache_types.h b/source/blender/makesdna/DNA_pointcache_types.h index de2fa3f10fe..ad5f386bf2b 100644 --- a/source/blender/makesdna/DNA_pointcache_types.h +++ b/source/blender/makesdna/DNA_pointcache_types.h @@ -107,7 +107,8 @@ typedef struct PointCache { int totpoint; /** Modifier stack index. */ int index; - short compression, rt; + short compression; + char _pad0[2]; char name[64]; char prev_name[64]; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index c7f7e610a1a..0b07b8271a5 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -952,7 +952,8 @@ typedef struct ParticleEditSettings { /** Runtime. */ void *paintcursor; - float emitterdist, rt; + float emitterdist; + char _pad0[4]; int selectmode; int edittype; @@ -1550,7 +1551,8 @@ typedef struct UnitSettings { typedef struct PhysicsSettings { float gravity[3]; - int flag, quick_cache_step, rt; + int flag, quick_cache_step; + char _pad0[4]; } PhysicsSettings; /* ------------------------------------------- */ diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index fa11a7dfd13..7e0bf81457d 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -57,6 +57,7 @@ typedef struct StripElem { char name[256]; /** Ignore when zeroed. */ int orig_width, orig_height; + float orig_fps; } StripElem; typedef struct StripCrop { @@ -172,7 +173,7 @@ typedef struct Sequence { float sat; float mul, handsize; - short anim_preseek; + short anim_preseek; /* UNUSED. */ /** Streamindex for movie or sound files with several streams. */ short streamindex; /** For multicam source selection. */ @@ -517,11 +518,11 @@ enum { SEQ_AUDIO_PAN_ANIMATED = (1 << 26), SEQ_AUDIO_DRAW_WAVEFORM = (1 << 27), - /* don't include Grease Pencil in OpenGL previews of Scene strips */ - SEQ_SCENE_NO_GPENCIL = (1 << 28), + /* don't include Annotations in OpenGL previews of Scene strips */ + SEQ_SCENE_NO_ANNOTATION = (1 << 28), SEQ_USE_VIEWS = (1 << 29), - /* access scene strips directly (like a metastrip) */ + /* Access scene strips directly (like a meta-strip). */ SEQ_SCENE_STRIPS = (1 << 30), SEQ_INVALID_EFFECT = (1u << 31), diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index c170e711756..71764d9308c 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -323,6 +323,8 @@ typedef enum eSpaceOutliner_Filter { SO_FILTER_NO_CHILDREN = (1 << 4), SO_FILTER_UNUSED_5 = (1 << 5), /* cleared */ + /** Show overrides that are defined/controlled by Blender. */ + SO_FILTER_SHOW_SYSTEM_OVERRIDES = SO_FILTER_UNUSED_5, /* re-use */ SO_FILTER_NO_OB_MESH = (1 << 6), SO_FILTER_NO_OB_ARMATURE = (1 << 7), SO_FILTER_NO_OB_EMPTY = (1 << 8), @@ -391,6 +393,7 @@ typedef enum eSpaceOutliner_Mode { /* SO_KEYMAP = 13, */ /* deprecated! */ SO_ID_ORPHANS = 14, SO_VIEW_LAYER = 15, + SO_OVERRIDES_LIBRARY = 16, } eSpaceOutliner_Mode; /* SpaceOutliner.storeflag */ @@ -777,8 +780,16 @@ typedef struct FileAssetSelectParams { FileSelectParams base_params; FileSelectAssetLibraryUID asset_library; + + short import_type; /* eFileAssetImportType */ + char _pad[6]; } FileAssetSelectParams; +typedef enum eFileAssetImportType { + FILE_ASSET_IMPORT_LINK = 0, + FILE_ASSET_IMPORT_APPEND = 1, +} eFileAssetImportType; + /** * A wrapper to store previous and next folder lists (#FolderList) for a specific browse mode * (#eFileBrowse_Mode). @@ -1520,6 +1531,7 @@ typedef struct bNodeTreePath { /** MAX_NAME. */ char node_name[64]; + char display_name[64]; } bNodeTreePath; typedef struct SpaceNode { @@ -1850,6 +1862,46 @@ typedef struct SpaceStatusBar { /** \name Spreadsheet * \{ */ +typedef struct SpreadsheetColumnID { + char *name; +} SpreadsheetColumnID; + +typedef struct SpreadsheetColumn { + struct SpreadsheetColumn *next, *prev; + /** + * Identifies the data in the column. + * This is a pointer instead of a struct to make it easier if we want to "subclass" + * #SpreadsheetColumnID in the future for different kinds of ids. + */ + SpreadsheetColumnID *id; +} SpreadsheetColumn; + +/** + * An item in SpaceSpreadsheet.context_path. + * This is a bases struct for the structs below. + */ +typedef struct SpreadsheetContext { + struct SpreadsheetContext *next, *prev; + /* eSpaceSpreadsheet_ContextType. */ + int type; + char _pad[4]; +} SpreadsheetContext; + +typedef struct SpreadsheetContextObject { + SpreadsheetContext base; + struct Object *object; +} SpreadsheetContextObject; + +typedef struct SpreadsheetContextModifier { + SpreadsheetContext base; + char *modifier_name; +} SpreadsheetContextModifier; + +typedef struct SpreadsheetContextNode { + SpreadsheetContext base; + char *node_name; +} SpreadsheetContextNode; + typedef struct SpaceSpreadsheet { SpaceLink *next, *prev; /** Storage of regions for inactive spaces. */ @@ -1859,7 +1911,16 @@ typedef struct SpaceSpreadsheet { char _pad0[6]; /* End 'SpaceLink' header. */ - struct ID *pinned_id; + /* List of #SpreadsheetColumn. */ + ListBase columns; + + /** + * List of #SpreadsheetContext. + * This is a path to the data that is displayed in the spreadsheet. + * It can be set explicitly by an action of the user (e.g. clicking the preview icon in a + * geometry node) or it can be derived from context automatically based on some heuristic. + */ + ListBase context_path; /* eSpaceSpreadsheet_FilterFlag. */ uint8_t filter_flag; @@ -1871,22 +1932,41 @@ typedef struct SpaceSpreadsheet { /* eSpaceSpreadsheet_ObjectContext. */ uint8_t object_eval_state; - char _pad1[4]; + /* eSpaceSpreadsheet_Flag. */ + uint32_t flag; SpaceSpreadsheet_Runtime *runtime; } SpaceSpreadsheet; -/** \} */ +typedef enum eSpaceSpreadsheet_Flag { + SPREADSHEET_FLAG_PINNED = (1 << 0), + SPREADSHEET_FLAG_CONTEXT_PATH_COLLAPSED = (1 << 1), +} eSpaceSpreadsheet_Flag; typedef enum eSpaceSpreadsheet_FilterFlag { SPREADSHEET_FILTER_SELECTED_ONLY = (1 << 0), } eSpaceSpreadsheet_FilterFlag; typedef enum eSpaceSpreadsheet_ObjectEvalState { - SPREADSHEET_OBJECT_EVAL_STATE_FINAL = 0, + SPREADSHEET_OBJECT_EVAL_STATE_EVALUATED = 0, SPREADSHEET_OBJECT_EVAL_STATE_ORIGINAL = 1, } eSpaceSpreadsheet_Context; +typedef enum eSpaceSpreadsheet_ContextType { + SPREADSHEET_CONTEXT_OBJECT = 0, + SPREADSHEET_CONTEXT_MODIFIER = 1, + SPREADSHEET_CONTEXT_NODE = 2, +} eSpaceSpreadsheet_ContextType; + +/** + * We can't just use UI_UNIT_X, because it does not take `widget.points` into account, which + * modifies the width of text as well. + */ +#define SPREADSHEET_WIDTH_UNIT \ + (UI_UNIT_X * UI_style_get_dpi()->widget.points / (float)UI_DEFAULT_TEXT_POINTS) + +/** \} */ + /* -------------------------------------------------------------------- */ /** \name Space Defines (eSpace_Type) * \{ */ diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 5381c524e4d..60c255e8637 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -57,7 +57,8 @@ typedef struct MTex { short colormodel, pmapto, pmaptoneg; short normapspace, which_output; float r, g, b, k; - float def_var, rt; + float def_var; + char _pad1[4]; /* common */ float colfac, varfac; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 4595b12e9d4..61d2c04d98b 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -642,11 +642,12 @@ typedef struct UserDef_Experimental { * when the release cycle is not alpha. */ char use_new_hair_type; char use_new_point_cloud_type; + char use_full_frame_compositor; char use_sculpt_vertex_colors; - char use_switch_object_operator; char use_sculpt_tools_tilt; char use_asset_browser; - char _pad[6]; + char use_override_templates; + char _pad[5]; /** `makesdna` does not allow empty structs. */ } UserDef_Experimental; diff --git a/source/blender/makesdna/DNA_view3d_defaults.h b/source/blender/makesdna/DNA_view3d_defaults.h index 10d0bafec61..9dfc37e57b1 100644 --- a/source/blender/makesdna/DNA_view3d_defaults.h +++ b/source/blender/makesdna/DNA_view3d_defaults.h @@ -70,6 +70,7 @@ \ .gpencil_paper_opacity = 0.5f, \ .gpencil_grid_opacity = 0.9f, \ + .gpencil_vertex_paint_opacity = 1.0f, \ } #define _DNA_DEFAULT_View3DCursor \ diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index b8e2256c3c6..2f4e4e57b9f 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -367,7 +367,7 @@ typedef struct View3D { #define V3D_LOCAL_COLLECTIONS (1 << 0) #define V3D_FLAG_UNUSED_1 (1 << 1) /* cleared */ #define V3D_HIDE_HELPLINES (1 << 2) -#define V3D_INVALID_BACKBUF (1 << 3) +#define V3D_FLAG_UNUSED_2 (1 << 3) /* cleared */ #define V3D_XR_SESSION_MIRROR (1 << 4) #define V3D_FLAG_UNUSED_10 (1 << 10) /* cleared */ @@ -380,6 +380,8 @@ typedef struct View3D { enum { /** The 3D view which the XR session was created in is flagged with this. */ V3D_RUNTIME_XR_SESSION_ROOT = (1 << 0), + /** Some operators override the depth buffer for dedicated occlusion operations. */ + V3D_RUNTIME_DEPTHBUF_OVERRIDDEN = (1 << 1), }; /** #RegionView3D.persp */ diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 68d69a671ba..59091fec4b8 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -278,8 +278,14 @@ typedef struct wmWindow { char event_queue_check_click; /** Enable when #KM_PRESS events are not handled (keyboard/mouse-buttons only). */ char event_queue_check_drag; + /** + * Enable when the drag was handled, + * to avoid mouse-motion continually triggering drag events which are not handled + * but add overhead to gizmo handling (for example), see T87511. + */ + char event_queue_check_drag_handled; - char _pad0[2]; + char _pad0[1]; /** Internal, lock pie creation from this event until released. */ short pie_event_type_lock; @@ -374,7 +380,12 @@ typedef struct wmKeyMapItem { /** Unique identifier. Positive for kmi that override builtins, negative otherwise. */ short id; char _pad[2]; - /** Rna pointer to access properties. */ + /** + * RNA pointer to access properties. + * + * \note The `ptr.owner_id` value must be NULL, as a signal not to use the context + * when running property callbacks such as ENUM item functions. + */ struct PointerRNA *ptr; } wmKeyMapItem; diff --git a/source/blender/makesdna/DNA_xr_types.h b/source/blender/makesdna/DNA_xr_types.h index 2ce32a723a7..8e63760fef7 100644 --- a/source/blender/makesdna/DNA_xr_types.h +++ b/source/blender/makesdna/DNA_xr_types.h @@ -58,6 +58,21 @@ typedef enum eXRSessionBasePoseType { XR_BASE_POSE_CUSTOM = 2, } eXRSessionBasePoseType; +/** XR action type. Enum values match those in GHOST_XrActionType enum for consistency. */ +typedef enum eXrActionType { + XR_BOOLEAN_INPUT = 1, + XR_FLOAT_INPUT = 2, + XR_VECTOR2F_INPUT = 3, + XR_POSE_INPUT = 4, + XR_VIBRATION_OUTPUT = 100, +} eXrActionType; + +typedef enum eXrOpFlag { + XR_OP_PRESS = 0, + XR_OP_RELEASE = 1, + XR_OP_MODAL = 2, +} eXrOpFlag; + #ifdef __cplusplus } #endif diff --git a/source/blender/makesdna/intern/dna_defaults.c b/source/blender/makesdna/intern/dna_defaults.c index 95272fb7804..2d55ea05867 100644 --- a/source/blender/makesdna/intern/dna_defaults.c +++ b/source/blender/makesdna/intern/dna_defaults.c @@ -316,6 +316,7 @@ SDNA_DEFAULT_DECL_STRUCT(ThickGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(TimeGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(TintGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(LineartGpencilModifierData); +SDNA_DEFAULT_DECL_STRUCT(LengthGpencilModifierData); #undef SDNA_DEFAULT_DECL_STRUCT @@ -541,6 +542,7 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = { SDNA_DEFAULT_DECL(TimeGpencilModifierData), SDNA_DEFAULT_DECL(TintGpencilModifierData), SDNA_DEFAULT_DECL(LineartGpencilModifierData), + SDNA_DEFAULT_DECL(LengthGpencilModifierData), }; #undef SDNA_DEFAULT_DECL #undef SDNA_DEFAULT_DECL_EX diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 3690a1126d4..a23c9087ffc 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -792,6 +792,9 @@ static void cast_primitive_type(const eSDNA_Type old_type, old_value_i = *((uint64_t *)old_data); old_value_f = (double)old_value_i; break; + case SDNA_TYPE_INT8: + old_value_i = (uint64_t) * ((int8_t *)old_data); + old_value_f = (double)old_value_i; } switch (new_type) { @@ -828,6 +831,9 @@ static void cast_primitive_type(const eSDNA_Type old_type, case SDNA_TYPE_UINT64: *((uint64_t *)new_data) = old_value_i; break; + case SDNA_TYPE_INT8: + *((int8_t *)new_data) = (int8_t)old_value_i; + break; } old_data += oldlen; @@ -1194,7 +1200,10 @@ static void reconstruct_struct(const DNA_ReconstructInfo *reconstruct_info, new_block + step->data.substruct.new_offset); break; case RECONSTRUCT_STEP_INIT_ZERO: - /* Do nothing, because the memory block has been calloced. */ + /* Do nothing, because the memory block are zeroed (from #MEM_callocN). + * + * Note that the struct could be initialized with the default struct, + * however this complicates versioning, especially with flags, see: D4500. */ break; } } @@ -1555,9 +1564,8 @@ DNA_ReconstructInfo *DNA_reconstruct_info_create(const SDNA *oldsdna, ReconstructStep *steps = create_reconstruct_steps_for_struct( oldsdna, newsdna, compare_flags, old_struct, new_struct); - int steps_len = new_struct->members_len; /* Comment the line below to skip the compression for debugging purposes. */ - steps_len = compress_reconstruct_steps(steps, new_struct->members_len); + const int steps_len = compress_reconstruct_steps(steps, new_struct->members_len); reconstruct_info->steps[new_struct_nr] = steps; reconstruct_info->step_counts[new_struct_nr] = steps_len; @@ -1652,6 +1660,7 @@ int DNA_elem_type_size(const eSDNA_Type elem_nr) switch (elem_nr) { case SDNA_TYPE_CHAR: case SDNA_TYPE_UCHAR: + case SDNA_TYPE_INT8: return 1; case SDNA_TYPE_SHORT: case SDNA_TYPE_USHORT: diff --git a/source/blender/makesdna/intern/dna_utils.c b/source/blender/makesdna/intern/dna_utils.c index 3cf5c52a4c6..f050934b5b3 100644 --- a/source/blender/makesdna/intern/dna_utils.c +++ b/source/blender/makesdna/intern/dna_utils.c @@ -235,9 +235,6 @@ void DNA_alias_maps(enum eDNA_RenameDir version_dir, GHash **r_struct_map, GHash if (version_dir == DNA_RENAME_STATIC_FROM_ALIAS) { const char *renames[][2] = { - /* Disable 'int8_t' until we support 'signed char', since changing negative - * values to a different type isn't supported and will change the value. */ - /* {"int8_t", "char"}, */ {"uint8_t", "uchar"}, {"int16_t", "short"}, {"uint16_t", "ushort"}, diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 26fc56cfa1d..85bcc94c335 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -1222,6 +1222,7 @@ static int make_structDNA(const char *base_directory, add_type("int64_t", 8); /* SDNA_TYPE_INT64 */ add_type("uint64_t", 8); /* SDNA_TYPE_UINT64 */ add_type("void", 0); /* SDNA_TYPE_VOID */ + add_type("int8_t", 1); /* SDNA_TYPE_INT8 */ /* the defines above shouldn't be output in the padding file... */ const int firststruct = types_len; @@ -1516,16 +1517,12 @@ int main(int argc, char **argv) * * - 'long': even though DNA supports, 'long' shouldn't be used since it can be either 32 or 64bit, * use int, int32_t or int64_t instead. - * - 'int8_t': as DNA doesn't yet support 'signed char' types, - * all char types are assumed to be unsigned. - * We should be able to support this, it's just not something which has been added yet. * * Only valid use would be as a runtime variable if an API expected a long, * but so far we don't have this happening. */ #ifdef __GNUC__ # pragma GCC poison long -# pragma GCC poison int8_t #endif #include "DNA_ID.h" |