Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_ID.h47
-rw-r--r--source/blender/makesdna/DNA_action_types.h10
-rw-r--r--source/blender/makesdna/DNA_anim_types.h2
-rw-r--r--source/blender/makesdna/DNA_armature_types.h4
-rw-r--r--source/blender/makesdna/DNA_asset_types.h7
-rw-r--r--source/blender/makesdna/DNA_brush_enums.h6
-rw-r--r--source/blender/makesdna/DNA_brush_types.h2
-rw-r--r--source/blender/makesdna/DNA_cachefile_types.h19
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h4
-rw-r--r--source/blender/makesdna/DNA_curve_defaults.h2
-rw-r--r--source/blender/makesdna/DNA_curve_types.h13
-rw-r--r--source/blender/makesdna/DNA_curveprofile_types.h7
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h11
-rw-r--r--source/blender/makesdna/DNA_defaults.h8
-rw-r--r--source/blender/makesdna/DNA_effect_types.h2
-rw-r--r--source/blender/makesdna/DNA_fileglobal_types.h2
-rw-r--r--source/blender/makesdna/DNA_fluid_types.h4
-rw-r--r--source/blender/makesdna/DNA_genfile.h68
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_defaults.h30
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_types.h76
-rw-r--r--source/blender/makesdna/DNA_gpu_types.h2
-rw-r--r--source/blender/makesdna/DNA_image_types.h17
-rw-r--r--source/blender/makesdna/DNA_layer_types.h2
-rw-r--r--source/blender/makesdna/DNA_lightprobe_types.h2
-rw-r--r--source/blender/makesdna/DNA_lineart_types.h5
-rw-r--r--source/blender/makesdna/DNA_material_types.h2
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h286
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h32
-rw-r--r--source/blender/makesdna/DNA_meta_types.h4
-rw-r--r--source/blender/makesdna/DNA_modifier_defaults.h1
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h298
-rw-r--r--source/blender/makesdna/DNA_movieclip_defaults.h28
-rw-r--r--source/blender/makesdna/DNA_movieclip_types.h10
-rw-r--r--source/blender/makesdna/DNA_nla_types.h4
-rw-r--r--source/blender/makesdna/DNA_node_types.h386
-rw-r--r--source/blender/makesdna/DNA_object_force_types.h4
-rw-r--r--source/blender/makesdna/DNA_object_types.h74
-rw-r--r--source/blender/makesdna/DNA_outliner_types.h6
-rw-r--r--source/blender/makesdna/DNA_particle_types.h47
-rw-r--r--source/blender/makesdna/DNA_pointcache_types.h2
-rw-r--r--source/blender/makesdna/DNA_pointcloud_types.h2
-rw-r--r--source/blender/makesdna/DNA_rigidbody_types.h16
-rw-r--r--source/blender/makesdna/DNA_scene_defaults.h6
-rw-r--r--source/blender/makesdna/DNA_scene_types.h80
-rw-r--r--source/blender/makesdna/DNA_screen_types.h23
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h117
-rw-r--r--source/blender/makesdna/DNA_shader_fx_types.h2
-rw-r--r--source/blender/makesdna/DNA_simulation_types.h2
-rw-r--r--source/blender/makesdna/DNA_space_defaults.h67
-rw-r--r--source/blender/makesdna/DNA_space_types.h249
-rw-r--r--source/blender/makesdna/DNA_texture_types.h18
-rw-r--r--source/blender/makesdna/DNA_tracking_types.h44
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h51
-rw-r--r--source/blender/makesdna/DNA_view2d_types.h18
-rw-r--r--source/blender/makesdna/DNA_view3d_defaults.h1
-rw-r--r--source/blender/makesdna/DNA_view3d_enums.h3
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h33
-rw-r--r--source/blender/makesdna/DNA_volume_types.h22
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h49
-rw-r--r--source/blender/makesdna/DNA_workspace_types.h4
-rw-r--r--source/blender/makesdna/DNA_xr_types.h15
-rw-r--r--source/blender/makesdna/intern/CMakeLists.txt1
-rw-r--r--source/blender/makesdna/intern/dna_defaults.c22
-rw-r--r--source/blender/makesdna/intern/dna_genfile.c67
-rw-r--r--source/blender/makesdna/intern/dna_rename_defs.h36
-rw-r--r--source/blender/makesdna/intern/dna_utils.c32
-rw-r--r--source/blender/makesdna/intern/dna_utils.h31
-rw-r--r--source/blender/makesdna/intern/makesdna.c10
68 files changed, 1724 insertions, 833 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index d829d707a71..060b55ffe5c 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -147,17 +147,18 @@ typedef struct IDProperty {
#define DEFAULT_ALLOC_FOR_NULL_STRINGS 64
/*->type*/
-enum {
+typedef enum eIDPropertyType {
IDP_STRING = 0,
IDP_INT = 1,
IDP_FLOAT = 2,
+ /** Array containing int, floats, doubles or groups. */
IDP_ARRAY = 5,
IDP_GROUP = 6,
IDP_ID = 7,
IDP_DOUBLE = 8,
IDP_IDPARRAY = 9,
- IDP_NUMTYPES = 10,
-};
+} eIDPropertyType;
+#define IDP_NUMTYPES 10
/** Used by some IDP utils, keep values in sync with type enum above. */
enum {
@@ -211,11 +212,15 @@ typedef struct IDOverrideLibraryPropertyOperation {
char _pad0[2];
/* Sub-item references, if needed (for arrays or collections only).
- * We need both reference and local values to allow e.g. insertion into collections
+ * We need both reference and local values to allow e.g. insertion into RNA collections
* (constraints, modifiers...).
- * In collection case, if names are defined, they are used in priority.
- * Names are pointers (instead of char[64]) to save some space, NULL when unset.
- * Indices are -1 when unset. */
+ * In RNA collection case, if names are defined, they are used in priority.
+ * Names are pointers (instead of char[64]) to save some space, NULL or empty string when unset.
+ * Indices are -1 when unset.
+ *
+ * NOTE: For insertion operations in RNA collections, reference may not actually exist in the
+ * linked reference data. It is used to identify the anchor of the insertion operation (i.e. the
+ * item after or before which the new local item should be inserted), in the local override. */
char *subitem_reference_name;
char *subitem_local_name;
int subitem_reference_index;
@@ -311,8 +316,22 @@ typedef struct IDOverrideLibrary {
struct ID *storage;
IDOverrideLibraryRuntime *runtime;
+
+ void *_pad_0;
+
+ unsigned int flag;
+ char _pad_1[4];
} IDOverrideLibrary;
+/* IDOverrideLibrary->flag */
+enum {
+ /**
+ * The override data-block should not be considered as part of an override hierarchy (generally
+ * because it was created as an single override, outside of any hierarchy consideration).
+ */
+ IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY = 1 << 0,
+};
+
/* watch it: Sequence has identical beginning. */
/**
* ID is the first thing included in all serializable types. It
@@ -427,12 +446,21 @@ typedef struct Library {
struct PackedFile *packedfile;
+ ushort tag;
+ char _pad_0[6];
+
/* 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;
} Library;
+/* Library.tag */
+enum eLibrary_Tag {
+ /* Automatic recursive resync was needed when linking/loading data from that library. */
+ LIBRARY_TAG_RESYNC_REQUIRED = 1 << 0,
+};
+
/**
* A weak library/ID reference for local data that has been appended, to allow re-using that local
* data instead of creating a new copy of it in future appends.
@@ -457,7 +485,7 @@ typedef struct LibraryWeakReference {
enum ePreviewImage_Flag {
PRV_CHANGED = (1 << 0),
PRV_USER_EDITED = (1 << 1), /* if user-edited, do not auto-update this anymore! */
- PRV_UNFINISHED = (1 << 2), /* The preview is not done rendering yet. */
+ PRV_RENDERING = (1 << 2), /* Rendering was invoked. Cleared on file read. */
};
/* for PreviewImage->tag */
@@ -798,6 +826,9 @@ typedef enum IDRecalcFlag {
*/
ID_RECALC_TAG_FOR_UNDO = (1 << 24),
+ /* The node tree has changed in a way that affects its output nodes. */
+ ID_RECALC_NTREE_OUTPUT = (1 << 25),
+
/***************************************************************************
* Pseudonyms, to have more semantic meaning in the actual code without
* using too much low-level and implementation specific tags. */
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index e899e6bd3ec..82b20483902 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -468,7 +468,7 @@ typedef enum eRotationModes {
typedef struct bPose {
/** List of pose channels, PoseBones in RNA. */
ListBase chanbase;
- /** Ghash for quicker string lookups. */
+ /** Use a hash-table for quicker string lookups. */
struct GHash *chanhash;
/* Flat array of pose channels. It references pointers from
@@ -682,6 +682,10 @@ typedef struct bAction {
int idroot;
char _pad[4];
+ /** Start and end of the manually set intended playback frame range. Used by UI and
+ * some editing tools, but doesn't directly affect animation evaluation in any way. */
+ float frame_start, frame_end;
+
PreviewImage *preview;
} bAction;
@@ -695,6 +699,10 @@ typedef enum eAction_Flags {
ACT_MUTED = (1 << 9),
/* ACT_PROTECTED = (1 << 10), */ /* UNUSED */
/* ACT_DISABLED = (1 << 11), */ /* UNUSED */
+ /** The action has a manually set intended playback frame range. */
+ ACT_FRAME_RANGE = (1 << 12),
+ /** The action is intended to be a cycle (requires ACT_FRAME_RANGE). */
+ ACT_CYCLIC = (1 << 13),
} eAction_Flags;
/* ************************************************ */
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index 5dbed6b4d24..bd9f9d8ec3d 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -348,7 +348,7 @@ typedef enum eDriverTarget_Flag {
/** idtype can only be 'Object' */
DTAR_FLAG_ID_OB_ONLY = (1 << 1),
- /* "localspace" flags */
+ /* "local-space" flags. */
/** base flag - basically "pre parent+constraints" */
DTAR_FLAG_LOCALSPACE = (1 << 2),
/** include constraints transformed to space including parents */
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index 3b65378f9eb..566ffd19669 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -124,11 +124,11 @@ typedef struct bArmature {
ListBase bonebase;
- /** Ghash for quicker lookups of bones by name. */
+ /** Use a hash-table for quicker lookups of bones by name. */
struct GHash *bonehash;
void *_pad1;
- /** Editbone listbase, we use pointer so we can check state. */
+ /** #EditBone list (use an allocated pointer so the state can be checked). */
ListBase *edbo;
/* active bones should work like active object where possible
diff --git a/source/blender/makesdna/DNA_asset_types.h b/source/blender/makesdna/DNA_asset_types.h
index f5bdad3e79e..bd604b90b5a 100644
--- a/source/blender/makesdna/DNA_asset_types.h
+++ b/source/blender/makesdna/DNA_asset_types.h
@@ -56,6 +56,9 @@ typedef struct AssetFilterSettings {
* more than that from the file. So pointers to other IDs or ID data are strictly forbidden.
*/
typedef struct AssetMetaData {
+ /** Runtime type, to reference event callbacks. Only valid for local assets. */
+ struct AssetTypeInfo *local_type_info;
+
/** Custom asset meta-data. Cannot store pointers to IDs (#STRUCT_NO_DATABLOCK_IDPROPERTIES)! */
struct IDProperty *properties;
@@ -72,8 +75,12 @@ typedef struct AssetMetaData {
* #catalog_id is updated. */
char catalog_simple_name[64]; /* MAX_NAME */
+ /** Optional name of the author for display in the UI. Dynamic length. */
+ char *author;
+
/** Optional description of this asset for display in the UI. Dynamic length. */
char *description;
+
/** User defined tags for this asset. The asset manager uses these for filtering, but how they
* function exactly (e.g. how they are registered to provide a list of searchable available tags)
* is up to the asset-engine. */
diff --git a/source/blender/makesdna/DNA_brush_enums.h b/source/blender/makesdna/DNA_brush_enums.h
index 72b2db89cef..2f41389f2c6 100644
--- a/source/blender/makesdna/DNA_brush_enums.h
+++ b/source/blender/makesdna/DNA_brush_enums.h
@@ -522,7 +522,7 @@ typedef enum eBrushUVSculptTool {
SCULPT_TOOL_SLIDE_RELAX, \
SCULPT_TOOL_MASK) == 0)
-/* ImagePaintSettings.tool */
+/** #ImagePaintSettings.tool */
typedef enum eBrushImagePaintTool {
PAINT_TOOL_DRAW = 0,
PAINT_TOOL_SOFTEN = 1,
@@ -532,6 +532,9 @@ typedef enum eBrushImagePaintTool {
PAINT_TOOL_MASK = 5,
} eBrushImagePaintTool;
+/* The enums here should be kept in sync with the weight paint tool.
+ * This is because #smooth_brush_toggle_on and #smooth_brush_toggle_off
+ * assumes that the blur brush has the same enum value. */
typedef enum eBrushVertexPaintTool {
VPAINT_TOOL_DRAW = 0,
VPAINT_TOOL_BLUR = 1,
@@ -539,6 +542,7 @@ typedef enum eBrushVertexPaintTool {
VPAINT_TOOL_SMEAR = 3,
} eBrushVertexPaintTool;
+/* See #eBrushVertexPaintTool when changing this definition. */
typedef enum eBrushWeightPaintTool {
WPAINT_TOOL_DRAW = 0,
WPAINT_TOOL_BLUR = 1,
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 634ebdff253..4976168a890 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -123,7 +123,7 @@ typedef struct BrushGpencilSettings {
int sculpt_mode_flag;
/** Preset type (used to reset brushes - internal). */
short preset_type;
- /** Brush preselected mode (Active/Material/Vertexcolor). */
+ /** Brush preselected mode (Active/Material/Vertex-color). */
short brush_draw_mode;
/** Randomness for Hue. */
diff --git a/source/blender/makesdna/DNA_cachefile_types.h b/source/blender/makesdna/DNA_cachefile_types.h
index 0f4c53a6e7e..65e1dd6c096 100644
--- a/source/blender/makesdna/DNA_cachefile_types.h
+++ b/source/blender/makesdna/DNA_cachefile_types.h
@@ -59,6 +59,18 @@ typedef struct CacheObjectPath {
char path[4096];
} CacheObjectPath;
+/* CacheFileLayer::flag */
+enum { CACHEFILE_LAYER_HIDDEN = (1 << 0) };
+
+typedef struct CacheFileLayer {
+ struct CacheFileLayer *next, *prev;
+
+ /** 1024 = FILE_MAX. */
+ char filepath[1024];
+ int flag;
+ int _pad;
+} CacheFileLayer;
+
/* CacheFile::velocity_unit
* Determines what temporal unit is used to interpret velocity vectors for motion blur effects. */
enum {
@@ -73,6 +85,8 @@ typedef struct CacheFile {
/** Paths of the objects inside of the archive referenced by this CacheFile. */
ListBase object_paths;
+ ListBase layers;
+
/** 1024 = FILE_MAX. */
char filepath[1024];
@@ -109,7 +123,10 @@ typedef struct CacheFile {
/** Size in megabytes for the prefetch cache used by the Cycles Procedural. */
int prefetch_cache_size;
- char _pad2[7];
+ /** Index of the currently selected layer in the UI, starts at 1. */
+ int active_layer;
+
+ char _pad2[3];
char velocity_unit;
/* Name of the velocity property in the archive. */
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 28756395f7d..d587bd8082b 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -728,7 +728,7 @@ typedef enum eBConstraint_Flags {
/* bConstraint->ownspace/tarspace */
typedef enum eBConstraint_SpaceTypes {
- /** Default for all - worldspace. */
+ /** Default for all - world-space. */
CONSTRAINT_SPACE_WORLD = 0,
/** For all - custom space. */
CONSTRAINT_SPACE_CUSTOM = 5,
@@ -939,7 +939,7 @@ typedef enum eTrackToAxis_Modes {
/* Shrinkwrap flags */
typedef enum eShrinkwrap_Flags {
- /* Also raycast in the opposite direction. */
+ /* Also ray-cast in the opposite direction. */
CON_SHRINKWRAP_PROJECT_OPPOSITE = (1 << 0),
/* Invert the cull mode when projecting opposite. */
CON_SHRINKWRAP_PROJECT_INVERT_CULL = (1 << 1),
diff --git a/source/blender/makesdna/DNA_curve_defaults.h b/source/blender/makesdna/DNA_curve_defaults.h
index 557615fd047..614653db2b8 100644
--- a/source/blender/makesdna/DNA_curve_defaults.h
+++ b/source/blender/makesdna/DNA_curve_defaults.h
@@ -34,7 +34,7 @@
.pathlen = 100, \
.resolu = 12, \
.resolv = 12, \
- .width = 1.0, \
+ .offset = 1.0, \
.wordspace = 1.0, \
.spacing = 1.0f, \
.linedist = 1.0, \
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index a2433dbbbbd..c1c8fe06121 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -228,16 +228,15 @@ typedef struct Curve {
/** Creation-time type of curve datablock. */
short type;
- /** Keep a short because of BKE_object_obdata_texspace_get(). */
- short texflag;
- char _pad0[6];
+ char texflag;
+ char _pad0[7];
short twist_mode;
float twist_smooth, smallcaps_scale;
int pathlen;
short bevresol, totcol;
int flag;
- float width, ext1, ext2;
+ float offset, extrude, bevel_radius;
/* default */
short resolu, resolv;
@@ -421,10 +420,8 @@ enum {
enum {
CU_POLY = 0,
CU_BEZIER = 1,
- CU_BSPLINE = 2,
- CU_CARDINAL = 3,
CU_NURBS = 4,
- CU_TYPE = (CU_POLY | CU_BEZIER | CU_BSPLINE | CU_CARDINAL | CU_NURBS),
+ CU_TYPE = (CU_POLY | CU_BEZIER | CU_NURBS),
/* only for adding */
CU_PRIMITIVE = 0xF00,
@@ -457,6 +454,8 @@ enum {
typedef enum eBezTriple_Flag {
/* SELECT */
BEZT_FLAG_TEMP_TAG = (1 << 1), /* always clear. */
+ /* Can be used to ignore keyframe points for certain operations. */
+ BEZT_FLAG_IGNORE_TAG = (1 << 2),
} eBezTriple_Flag;
/* h1 h2 (beztriple) */
diff --git a/source/blender/makesdna/DNA_curveprofile_types.h b/source/blender/makesdna/DNA_curveprofile_types.h
index 7c76251adc3..447e94d2659 100644
--- a/source/blender/makesdna/DNA_curveprofile_types.h
+++ b/source/blender/makesdna/DNA_curveprofile_types.h
@@ -29,13 +29,6 @@
extern "C" {
#endif
-/** Number of points in high resolution table is dynamic up to a maximum. */
-#define PROF_TABLE_MAX 512
-/** Number of table points per control point. */
-#define PROF_RESOL 16
-/** Dynamic size of widget's high resolution table. Input should be profile->totpoint. */
-#define PROF_TABLE_LEN(n_pts) min_ii(PROF_TABLE_MAX, (((n_pts - 1)) * PROF_RESOL) + 1)
-
/**
* Each control point that makes up the profile.
* \note The flags use the same enum as Bezier curves, but they aren't guaranteed
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index 36bdd4915ff..629a5e88de7 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -134,17 +134,21 @@ typedef enum CustomDataType {
CD_CLOTH_ORCO = 23,
/* CD_RECAST = 24, */ /* UNUSED */
- /* BMESH ONLY START */
CD_MPOLY = 25,
CD_MLOOP = 26,
CD_SHAPE_KEYINDEX = 27,
CD_SHAPEKEY = 28,
CD_BWEIGHT = 29,
+ /**
+ * Usage of #CD_CREASE depends on where on the Mesh the layer is added:
+ * - For vertex creasing, this is persistent data across all modes and is stored in the file.
+ * - For edge creasing, it is runtime data which is only used in edit-mode before being copied
+ * to #MEdge when exiting edit-mode.
+ */
CD_CREASE = 30,
CD_ORIGSPACE_MLOOP = 31,
CD_PREVIEW_MLOOPCOL = 32,
CD_BM_ELEM_PYPTR = 33,
- /* BMESH ONLY END */
CD_PAINT_MASK = 34,
CD_GRID_PAINT_MASK = 35,
@@ -164,7 +168,6 @@ typedef enum CustomDataType {
CD_PROP_COLOR = 47,
CD_PROP_FLOAT3 = 48,
CD_PROP_FLOAT2 = 49,
-
CD_PROP_BOOL = 50,
CD_HAIRLENGTH = 51,
@@ -197,7 +200,6 @@ typedef enum CustomDataType {
#define CD_MASK_CLOTH_ORCO (1 << CD_CLOTH_ORCO)
// #define CD_MASK_RECAST (1 << CD_RECAST) /* DEPRECATED */
-/* BMESH ONLY START */
#define CD_MASK_MPOLY (1 << CD_MPOLY)
#define CD_MASK_MLOOP (1 << CD_MLOOP)
#define CD_MASK_SHAPE_KEYINDEX (1 << CD_SHAPE_KEYINDEX)
@@ -207,7 +209,6 @@ typedef enum CustomDataType {
#define CD_MASK_ORIGSPACE_MLOOP (1LL << CD_ORIGSPACE_MLOOP)
#define CD_MASK_PREVIEW_MLOOPCOL (1LL << CD_PREVIEW_MLOOPCOL)
#define CD_MASK_BM_ELEM_PYPTR (1LL << CD_BM_ELEM_PYPTR)
-/* BMESH ONLY END */
#define CD_MASK_PAINT_MASK (1LL << CD_PAINT_MASK)
#define CD_MASK_GRID_PAINT_MASK (1LL << CD_GRID_PAINT_MASK)
diff --git a/source/blender/makesdna/DNA_defaults.h b/source/blender/makesdna/DNA_defaults.h
index 1549e33b267..ef7f573e7a8 100644
--- a/source/blender/makesdna/DNA_defaults.h
+++ b/source/blender/makesdna/DNA_defaults.h
@@ -36,7 +36,9 @@ extern "C" {
extern const void *DNA_default_table[SDNA_TYPE_MAX];
-char *_DNA_struct_default_alloc_impl(const char *data_src, size_t size, const char *alloc_str);
+uint8_t *_DNA_struct_default_alloc_impl(const uint8_t *data_src,
+ size_t size,
+ const char *alloc_str);
/**
* Wrap with macro that casts correctly.
@@ -46,7 +48,9 @@ char *_DNA_struct_default_alloc_impl(const char *data_src, size_t size, const ch
#define DNA_struct_default_alloc(struct_name) \
(struct_name *)_DNA_struct_default_alloc_impl( \
- DNA_default_table[SDNA_TYPE_FROM_STRUCT(struct_name)], sizeof(struct_name), __func__)
+ (const uint8_t *)DNA_default_table[SDNA_TYPE_FROM_STRUCT(struct_name)], \
+ sizeof(struct_name), \
+ __func__)
#ifdef __cplusplus
}
diff --git a/source/blender/makesdna/DNA_effect_types.h b/source/blender/makesdna/DNA_effect_types.h
index 3de13169616..2e086a2834c 100644
--- a/source/blender/makesdna/DNA_effect_types.h
+++ b/source/blender/makesdna/DNA_effect_types.h
@@ -27,7 +27,7 @@
extern "C" {
#endif
-/* Don't forget, new effects also in writefile.c for DNA! */
+/* Don't forget, new effects also in `writefile.c` for DNA! */
#define PAF_MAXMULT 4
diff --git a/source/blender/makesdna/DNA_fileglobal_types.h b/source/blender/makesdna/DNA_fileglobal_types.h
index a0285215ff9..3b6fb60cc2e 100644
--- a/source/blender/makesdna/DNA_fileglobal_types.h
+++ b/source/blender/makesdna/DNA_fileglobal_types.h
@@ -50,7 +50,7 @@ typedef struct FileGlobal {
/** Hash from buildinfo. */
char build_hash[16];
/** File path where this was saved, for recover (1024 = FILE_MAX). */
- char filename[1024];
+ char filepath[1024];
} FileGlobal;
/* minversion: in file, the oldest past blender version you can use compliant */
diff --git a/source/blender/makesdna/DNA_fluid_types.h b/source/blender/makesdna/DNA_fluid_types.h
index 0cbef540306..d8065410f2b 100644
--- a/source/blender/makesdna/DNA_fluid_types.h
+++ b/source/blender/makesdna/DNA_fluid_types.h
@@ -513,7 +513,7 @@ typedef struct FluidDomainSettings {
float p1[3]; /* End point of BB in local space. */
float dp0[3]; /* Difference from object center to grid start point. */
float cell_size[3]; /* Size of simulation cell in local space. */
- float global_size[3]; /* Global size of domain axises. */
+ float global_size[3]; /* Global size of domain axes. */
float prev_loc[3];
int shift[3]; /* Current domain shift in simulation cells. */
float shift_f[3]; /* Exact domain shift. */
@@ -694,7 +694,7 @@ typedef struct FluidDomainSettings {
char openvdb_data_depth;
char _pad11[7]; /* Unused. */
- /* -- Deprecated / unsed options (below). -- */
+ /* -- Deprecated / unused options (below). -- */
/* View options. */
int viewsettings;
diff --git a/source/blender/makesdna/DNA_genfile.h b/source/blender/makesdna/DNA_genfile.h
index fda1cbaeae6..dd118658003 100644
--- a/source/blender/makesdna/DNA_genfile.h
+++ b/source/blender/makesdna/DNA_genfile.h
@@ -83,8 +83,11 @@ enum eSDNA_StructCompare {
SDNA_CMP_UNKNOWN = 3,
};
+/**
+ * Constructs and returns a decoded SDNA structure from the given encoded SDNA data block.
+ */
struct SDNA *DNA_sdna_from_data(const void *data,
- const int data_len,
+ int data_len,
bool do_endian_swap,
bool data_alloc,
const char **r_error_message);
@@ -97,22 +100,58 @@ const struct SDNA *DNA_sdna_current_get(void);
void DNA_sdna_current_free(void);
struct DNA_ReconstructInfo;
+/**
+ * Pre-process information about how structs in \a newsdna can be reconstructed from structs in
+ * \a oldsdna. This information is then used to speedup #DNA_struct_reconstruct.
+ */
struct DNA_ReconstructInfo *DNA_reconstruct_info_create(const struct SDNA *oldsdna,
const struct SDNA *newsdna,
const char *compare_flags);
void DNA_reconstruct_info_free(struct DNA_ReconstructInfo *reconstruct_info);
+/**
+ * Returns the index of the struct info for the struct with the specified name.
+ */
int DNA_struct_find_nr_ex(const struct SDNA *sdna, const char *str, unsigned int *index_last);
int DNA_struct_find_nr(const struct SDNA *sdna, const char *str);
+/**
+ * Does endian swapping on the fields of a struct value.
+ *
+ * \param sdna: SDNA of the struct_nr belongs to
+ * \param struct_nr: Index of struct info within sdna
+ * \param data: Struct data that is to be converted
+ */
void DNA_struct_switch_endian(const struct SDNA *sdna, int struct_nr, char *data);
+/**
+ * Constructs and returns an array of byte flags with one element for each struct in oldsdna,
+ * indicating how it compares to newsdna.
+ */
const char *DNA_struct_get_compareflags(const struct SDNA *sdna, const struct SDNA *newsdna);
+/**
+ * \param reconstruct_info: Information preprocessed by #DNA_reconstruct_info_create.
+ * \param old_struct_nr: Index of struct info within oldsdna.
+ * \param blocks: The number of array elements.
+ * \param old_blocks: Array of struct data.
+ * \return An allocated reconstructed struct.
+ */
void *DNA_struct_reconstruct(const struct DNA_ReconstructInfo *reconstruct_info,
int old_struct_nr,
int blocks,
const void *old_blocks);
+/**
+ * Returns the offset of the field with the specified name and type within the specified
+ * struct type in #SDNA, -1 on failure.
+ */
int DNA_elem_offset(struct SDNA *sdna, const char *stype, const char *vartype, const char *name);
+/**
+ * Returns the size of struct fields of the specified type and name.
+ *
+ * \param type: Index into sdna->types/types_size
+ * \param name: Index into sdna->names,
+ * needed to extract possible pointer/array information.
+ */
int DNA_elem_size_nr(const struct SDNA *sdna, short type, short name);
bool DNA_struct_find(const struct SDNA *sdna, const char *stype);
@@ -121,11 +160,22 @@ bool DNA_struct_elem_find(const struct SDNA *sdna,
const char *vartype,
const char *name);
-int DNA_elem_type_size(const eSDNA_Type elem_nr);
+/**
+ * Returns the size in bytes of a primitive type.
+ */
+int DNA_elem_type_size(eSDNA_Type elem_nr);
+/**
+ * Rename a struct
+ */
bool DNA_sdna_patch_struct(struct SDNA *sdna,
const char *struct_name_old,
const char *struct_name_new);
+/**
+ * Replace \a elem_old with \a elem_new for struct \a struct_name
+ * handles search & replace, maintaining surrounding non-identifier characters
+ * such as pointer & array size.
+ */
bool DNA_sdna_patch_struct_member(struct SDNA *sdna,
const char *struct_name,
const char *elem_old,
@@ -134,14 +184,28 @@ bool DNA_sdna_patch_struct_member(struct SDNA *sdna,
void DNA_sdna_alias_data_ensure(struct SDNA *sdna);
/* Alias lookups (using runtime struct member names). */
+
+/**
+ * \note requires #DNA_sdna_alias_data_ensure_structs_map to be called.
+ */
int DNA_struct_alias_find_nr_ex(const struct SDNA *sdna,
const char *str,
unsigned int *index_last);
+/**
+ * \note requires #DNA_sdna_alias_data_ensure_structs_map to be called.
+ */
int DNA_struct_alias_find_nr(const struct SDNA *sdna, const char *str);
+/**
+ * \note requires #DNA_sdna_alias_data_ensure_structs_map to be called.
+ */
bool DNA_struct_alias_elem_find(const struct SDNA *sdna,
const char *stype,
const char *vartype,
const char *name);
+/**
+ * Separated from #DNA_sdna_alias_data_ensure because it's not needed
+ * unless we want to lookup aliased struct names (#DNA_struct_alias_find_nr and friends).
+ */
void DNA_sdna_alias_data_ensure_structs_map(struct SDNA *sdna);
#ifdef __cplusplus
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h
index 11299ae9717..c51a615bfb6 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h
@@ -315,10 +315,12 @@
.opacity = 1.0f, \
.flags = LRT_GPENCIL_MATCH_OUTPUT_VGROUP, \
.crease_threshold = DEG2RAD(140.0f), \
- .calculation_flags = LRT_ALLOW_DUPLI_OBJECTS | LRT_ALLOW_CLIPPING_BOUNDARIES | LRT_USE_CREASE_ON_SHARP_EDGES, \
+ .calculation_flags = LRT_ALLOW_DUPLI_OBJECTS | LRT_ALLOW_CLIPPING_BOUNDARIES | \
+ LRT_USE_CREASE_ON_SHARP_EDGES | LRT_FILTER_FACE_MARK_KEEP_CONTOUR, \
.angle_splitting_threshold = DEG2RAD(60.0f), \
.chaining_image_threshold = 0.001f, \
.chain_smooth_tolerance = 0.2f,\
+ .stroke_depth_offset = 0.05,\
}
#define _DNA_DEFAULT_LengthGpencilModifierData \
@@ -332,6 +334,11 @@
.point_density = 30.0f,\
.segment_influence = 0.0f,\
.max_angle = DEG2RAD(170.0f),\
+ .rand_start_fac = 0.0f,\
+ .rand_end_fac = 0.0f,\
+ .rand_offset = 0.0f,\
+ .seed = 0,\
+ .step = 4,\
}
#define _DNA_DEFAULT_DashGpencilModifierData \
@@ -352,5 +359,26 @@
.mat_nr = -1, \
}
+#define _DNA_DEFAULT_ShrinkwrapGpencilModifierData \
+ { \
+ .target = NULL, \
+ .aux_target = NULL, \
+ .keep_dist = 0.05f, \
+ .shrink_type = MOD_SHRINKWRAP_NEAREST_SURFACE, \
+ .shrink_opts = MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR, \
+ .shrink_mode = 0, \
+ .proj_limit = 0.0f, \
+ .proj_axis = 0, \
+ .subsurf_levels = 0, \
+ .material = NULL, \
+ .layername = "", \
+ .vgname = "", \
+ .pass_index = 0, \
+ .flag = 0, \
+ .layer_pass = 0, \
+ .smooth_factor = 0.05f, \
+ .smooth_step = 1, \
+ }
+
/* clang-format off */
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index ea5c81761c6..b361372ff8b 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -28,6 +28,7 @@ extern "C" {
#endif
struct LatticeDeformData;
+struct ShrinkwrapTreeData;
/* WARNING ALERT! TYPEDEF VALUES ARE WRITTEN IN FILES! SO DO NOT CHANGE!
* (ONLY ADD NEW ITEMS AT THE END)
@@ -58,6 +59,7 @@ typedef enum GpencilModifierType {
eGpencilModifierType_WeightProximity = 21,
eGpencilModifierType_Dash = 22,
eGpencilModifierType_WeightAngle = 23,
+ eGpencilModifierType_Shrinkwrap = 24,
/* Keep last. */
NUM_GREASEPENCIL_MODIFIER_TYPES,
} GpencilModifierType;
@@ -260,7 +262,7 @@ typedef struct ColorGpencilModifierData {
int pass_index;
/** Flags. */
int flag;
- /** Hsv factors. */
+ /** HSV factors. */
float hsv[3];
/** Modify stroke, fill or both. */
char modify_color;
@@ -490,10 +492,17 @@ typedef struct LengthGpencilModifierData {
int layer_pass;
/** Length. */
float start_fac, end_fac;
+ /** Random length factors. */
+ float rand_start_fac, rand_end_fac, rand_offset;
/** Overshoot trajectory factor. */
float overshoot_fac;
+ /** (first element is the index) random values. */
+ int seed;
+ /** How many frames before recalculate randoms. */
+ int step;
/** Modifier mode. */
int mode;
+ char _pad[4];
/* Curvature parameters. */
float point_density;
float segment_influence;
@@ -507,6 +516,7 @@ typedef enum eLengthGpencil_Flag {
GP_LENGTH_INVERT_MATERIAL = (1 << 3),
GP_LENGTH_USE_CURVATURE = (1 << 4),
GP_LENGTH_INVERT_CURVATURE = (1 << 5),
+ GP_LENGTH_USE_RANDOM = (1 << 6),
} eLengthGpencil_Flag;
typedef enum eLengthGpencil_Type {
@@ -728,7 +738,7 @@ typedef struct SmoothGpencilModifierData {
int pass_index;
/** Several flags. */
int flag;
- /** Factor of noise. */
+ /** Factor of smooth. */
float factor;
/** How many times apply smooth. */
int step;
@@ -978,6 +988,8 @@ typedef enum eLineArtGPencilModifierFlags {
LRT_GPENCIL_BINARY_WEIGHTS = (1 << 2) /* Deprecated, this is removed for lack of use case. */,
LRT_GPENCIL_IS_BAKED = (1 << 3),
LRT_GPENCIL_USE_CACHE = (1 << 4),
+ LRT_GPENCIL_OFFSET_TOWARDS_CUSTOM_CAMERA = (1 << 5),
+ LRT_GPENCIL_INVERT_COLLECTION = (1 << 6),
} eLineArtGPencilModifierFlags;
typedef enum eLineartGpencilMaskSwitches {
@@ -1004,6 +1016,8 @@ typedef struct LineartGpencilModifierData {
short level_start;
short level_end;
+ struct Object *source_camera;
+
struct Object *source_object;
struct Collection *source_collection;
@@ -1042,7 +1056,6 @@ typedef struct LineartGpencilModifierData {
/** Strength for smoothing jagged chains. */
float chain_smooth_tolerance;
- int _pad1;
/* CPU mode */
float chaining_image_threshold;
@@ -1053,6 +1066,9 @@ typedef struct LineartGpencilModifierData {
/* #eLineArtGPencilModifierFlags, modifier internal state. */
int flags;
+ /* Move strokes towards camera to avoid clipping while preserve depth for the viewport. */
+ float stroke_depth_offset;
+
/* Runtime data. */
/* Because we can potentially only compute features lines once per modifier stack (Use Cache), we
@@ -1068,6 +1084,60 @@ typedef struct LineartGpencilModifierData {
} LineartGpencilModifierData;
+typedef struct ShrinkwrapGpencilModifierData {
+ GpencilModifierData modifier;
+ /** Shrink target. */
+ struct Object *target;
+ /** Additional shrink target. */
+ struct Object *aux_target;
+ /** Material for filtering. */
+ struct Material *material;
+ /** Layer name. */
+ char layername[64];
+ /** Optional vertexgroup filter name, MAX_VGROUP_NAME. */
+ char vgname[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Flags. */
+ int flag;
+ /** Custom index for passes. */
+ int layer_pass;
+ /** Distance offset to keep from mesh/projection point. */
+ float keep_dist;
+ /** Shrink type projection. */
+ short shrink_type;
+ /** Shrink options. */
+ char shrink_opts;
+ /** Shrink to surface mode. */
+ char shrink_mode;
+ /** Limit the projection ray cast. */
+ float proj_limit;
+ /** Axis to project over. */
+ char proj_axis;
+
+ /** If using projection over vertex normal this controls the level of subsurface that must be
+ * done before getting the vertex coordinates and normal
+ */
+ char subsurf_levels;
+ char _pad[6];
+ /** Factor of smooth. */
+ float smooth_factor;
+ /** How many times apply smooth. */
+ int smooth_step;
+
+ /** Runtime only. */
+ struct ShrinkwrapTreeData *cache_data;
+} ShrinkwrapGpencilModifierData;
+
+typedef enum eShrinkwrapGpencil_Flag {
+ GP_SHRINKWRAP_INVERT_LAYER = (1 << 0),
+ GP_SHRINKWRAP_INVERT_PASS = (1 << 1),
+ GP_SHRINKWRAP_INVERT_LAYERPASS = (1 << 3),
+ GP_SHRINKWRAP_INVERT_MATERIAL = (1 << 4),
+ /* Keep next bit as is to be equals to mesh modifier flag to reuse functions. */
+ GP_SHRINKWRAP_INVERT_VGROUP = (1 << 6),
+} eShrinkwrapGpencil_Flag;
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/makesdna/DNA_gpu_types.h b/source/blender/makesdna/DNA_gpu_types.h
index 8cea1451525..7d1e7d4e4f2 100644
--- a/source/blender/makesdna/DNA_gpu_types.h
+++ b/source/blender/makesdna/DNA_gpu_types.h
@@ -28,7 +28,7 @@ extern "C" {
#endif
/* Keep for 'Camera' versioning. */
-/** Properties for dof effect. */
+/** Properties for DOF effect. */
typedef struct GPUDOFSettings {
/** Focal distance for depth of field. */
float focus_distance;
diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h
index 30ca9540735..64c8fd3e3a9 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -51,16 +51,13 @@ typedef struct ImageUser {
/** Offset within movie, start frame in global time. */
int offset, sfra;
/** Cyclic flag. */
- char _pad0, cycl;
- char ok;
+ char cycl;
/** Multiview current eye - for internal use of drawing routines. */
char multiview_eye;
short pass;
- char _pad1[2];
int tile;
- int _pad2;
/** Listbase indices, for menu browsing or retrieve buffer. */
short multi_index, view, layer;
@@ -112,9 +109,7 @@ typedef struct ImageTile {
struct ImageTile_Runtime runtime;
- char ok;
- char _pad[3];
-
+ char _pad[4];
int tile_number;
char label[64];
} ImageTile;
@@ -147,6 +142,12 @@ typedef enum eImageTextureResolution {
IMA_TEXTURE_RESOLUTION_LEN
} eImageTextureResolution;
+typedef struct Image_Runtime {
+ /* Mutex used to guarantee thread-safe access to the cached ImBuf of the corresponding image ID.
+ */
+ void *cache_mutex;
+} Image_Runtime;
+
typedef struct Image {
ID id;
@@ -213,6 +214,8 @@ typedef struct Image {
/** ImageView. */
ListBase views;
struct Stereo3dFormat *stereo3d_format;
+
+ Image_Runtime runtime;
} Image;
/* **************** IMAGE ********************* */
diff --git a/source/blender/makesdna/DNA_layer_types.h b/source/blender/makesdna/DNA_layer_types.h
index 520f989452c..63e4597150c 100644
--- a/source/blender/makesdna/DNA_layer_types.h
+++ b/source/blender/makesdna/DNA_layer_types.h
@@ -68,7 +68,7 @@ typedef enum eViewLayerCryptomatteFlags {
VIEW_LAYER_CRYPTOMATTE_OBJECT = (1 << 0),
VIEW_LAYER_CRYPTOMATTE_MATERIAL = (1 << 1),
VIEW_LAYER_CRYPTOMATTE_ASSET = (1 << 2),
- /* VIEW_LAYER_CRYPTOMATTE_ACCURATE = (1 << 3), */ /* DEPRECATED */
+ VIEW_LAYER_CRYPTOMATTE_ACCURATE = (1 << 3),
} eViewLayerCryptomatteFlags;
#define VIEW_LAYER_CRYPTOMATTE_ALL \
(VIEW_LAYER_CRYPTOMATTE_OBJECT | VIEW_LAYER_CRYPTOMATTE_MATERIAL | VIEW_LAYER_CRYPTOMATTE_ASSET)
diff --git a/source/blender/makesdna/DNA_lightprobe_types.h b/source/blender/makesdna/DNA_lightprobe_types.h
index 3386722a072..d8ab21727c1 100644
--- a/source/blender/makesdna/DNA_lightprobe_types.h
+++ b/source/blender/makesdna/DNA_lightprobe_types.h
@@ -153,7 +153,7 @@ BLI_STATIC_ASSERT_ALIGN(LightGridCache, 16)
typedef struct LightCacheTexture {
struct GPUTexture *tex;
- /** Copy of GPU datas to create GPUTextures on file read. */
+ /** Copy of GPU data to create GPUTextures on file read. */
char *data;
int tex_size[3];
char data_type;
diff --git a/source/blender/makesdna/DNA_lineart_types.h b/source/blender/makesdna/DNA_lineart_types.h
index bdc9bcb6980..3e77d566d27 100644
--- a/source/blender/makesdna/DNA_lineart_types.h
+++ b/source/blender/makesdna/DNA_lineart_types.h
@@ -49,6 +49,11 @@ typedef enum eLineartMainFlags {
LRT_ALLOW_OVERLAP_EDGE_TYPES = (1 << 14),
LRT_USE_CREASE_ON_SMOOTH_SURFACES = (1 << 15),
LRT_USE_CREASE_ON_SHARP_EDGES = (1 << 16),
+ LRT_USE_CUSTOM_CAMERA = (1 << 17),
+ LRT_FILTER_FACE_MARK_KEEP_CONTOUR = (1 << 18),
+ LRT_USE_BACK_FACE_CULLING = (1 << 19),
+ LRT_USE_IMAGE_BOUNDARY_TRIMMING = (1 << 20),
+ LRT_CHAIN_PRESERVE_DETAILS = (1 << 22),
} eLineartMainFlags;
typedef enum eLineartEdgeFlag {
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 4d4a4bae72e..b91d681df0c 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -293,7 +293,7 @@ typedef struct Material {
/* #define TEXCO_STRESS (1 << 14) */ /* deprecated */
/* #define TEXCO_SPEED (1 << 15) */ /* deprecated */
-/* mapto */
+/** #MTex.mapto */
#define MAP_COL (1 << 0)
#define MAP_ALPHA (1 << 7)
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 97f14b2195d..bf50100b302 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -74,7 +74,7 @@ struct MLoopTri_Store {
int len_alloc;
};
-/* not saved in file! */
+/** Runtime data, not saved in files. */
typedef struct Mesh_Runtime {
/* Evaluated mesh for objects which do not have effective modifiers.
* This mesh is used as a result of modifier stack evaluation.
@@ -82,27 +82,37 @@ typedef struct Mesh_Runtime {
struct Mesh *mesh_eval;
void *eval_mutex;
- struct EditMeshData *edit_data;
- void *batch_cache;
+ /* A separate mutex is needed for normal calculation, because sometimes
+ * the normals are needed while #eval_mutex is already locked. */
+ void *normals_mutex;
- struct SubdivCCG *subdiv_ccg;
- void *_pad1;
- int subdiv_ccg_tot_level;
- char _pad2[4];
+ /** Needed to ensure some thread-safety during render data pre-processing. */
+ void *render_mutex;
- int64_t cd_dirty_vert;
- int64_t cd_dirty_edge;
- int64_t cd_dirty_loop;
- int64_t cd_dirty_poly;
+ /** Lazily initialized SoA data from the #edit_mesh field in #Mesh. */
+ struct EditMeshData *edit_data;
+
+ /**
+ * Data used to efficiently draw the mesh in the viewport, especially useful when
+ * the same mesh is used in many objects or instances. See `draw_cache_impl_mesh.c`.
+ */
+ void *batch_cache;
+ /** Cache for derived triangulation of the mesh. */
struct MLoopTri_Store looptris;
- /** `BVHCache` defined in 'BKE_bvhutil.c' */
+ /** Cache for BVH trees generated for the mesh. Defined in 'BKE_bvhutil.c' */
struct BVHCache *bvh_cache;
- /** Non-manifold boundary data for Shrinkwrap Target Project. */
+ /** Cache of non-manifold boundary data for Shrinkwrap Target Project. */
struct ShrinkwrapBoundaryData *shrinkwrap_data;
+ /** Needed in case we need to lazily initialize the mesh. */
+ CustomData_MeshMasks cd_mask_extra;
+
+ struct SubdivCCG *subdiv_ccg;
+ int subdiv_ccg_tot_level;
+
/** Set by modifier stack if only deformed from original. */
char deformed_only;
/**
@@ -122,10 +132,26 @@ typedef struct Mesh_Runtime {
*/
char wrapper_type_finalize;
- char _pad[4];
+ /**
+ * Settings for lazily evaluating the subdivision on the CPU if needed. These are
+ * set in the modifier when GPU subdivision can be performed.
+ */
+ char subsurf_apply_render;
+ char subsurf_use_optimal_display;
+ char _pad[2];
+ int subsurf_resolution;
- /** Needed in case we need to lazily initialize the mesh. */
- CustomData_MeshMasks cd_mask_extra;
+ void *_pad2;
+
+ /**
+ * Used to mark when derived data needs to be recalculated for a certain layer.
+ * Currently only normals.
+ */
+
+ int64_t cd_dirty_vert;
+ int64_t cd_dirty_edge;
+ int64_t cd_dirty_loop;
+ int64_t cd_dirty_poly;
} Mesh_Runtime;
@@ -137,101 +163,191 @@ typedef struct Mesh {
/** Old animation system, deprecated for 2.5. */
struct Ipo *ipo DNA_DEPRECATED;
struct Key *key;
- struct Material **mat;
- struct MSelect *mselect;
- /* BMESH ONLY */
- /* New face structures. */
- struct MPoly *mpoly;
- struct MLoop *mloop;
- struct MLoopUV *mloopuv;
- struct MLoopCol *mloopcol;
- /* END BMESH ONLY */
+ /**
+ * An array of materials, with length #totcol. These can be overridden by material slots
+ * on #Object. Indices in #MPoly.mat_nr control which material is used for every face.
+ */
+ struct Material **mat;
/**
- * Legacy face storage (quads & tries only),
- * faces are now stored in #Mesh.mpoly & #Mesh.mloop arrays.
- *
- * \note This would be marked deprecated however the particles still use this at run-time
- * for placing particles on the mesh (something which should be eventually upgraded).
+ * Array of vertices. Edges and faces are defined by indices into this array.
+ * \note This pointer is for convenient access to the #CD_MVERT layer in #vdata.
*/
- struct MFace *mface;
- /** Store tessellation face UV's and texture here. */
- struct MTFace *mtface;
- /** Deprecated, use mtface. */
- struct TFace *tface DNA_DEPRECATED;
- /** Array of verts. */
struct MVert *mvert;
- /** Array of edges. */
+ /**
+ * Array of edges, containing vertex indices. For simple triangle or quad meshes, edges could be
+ * calculated from the #MPoly and #MLoop arrays, however, edges need to be stored explicitly to
+ * edge domain attributes and to support loose edges that aren't connected to faces.
+ * \note This pointer is for convenient access to the #CD_MEDGE layer in #edata.
+ */
struct MEdge *medge;
- /** Deform-group vertices. */
- struct MDeformVert *dvert;
- /** List of bDeformGroup names and flag only. */
- ListBase vertex_group_names;
+ /**
+ * Face topology storage of the size and offset of each face's section of the #mloop face corner
+ * array. Also stores various flags and the `material_index` attribute.
+ * \note This pointer is for convenient access to the #CD_MPOLY layer in #pdata.
+ */
+ struct MPoly *mpoly;
+ /**
+ * The vertex and edge index at each face corner.
+ * \note This pointer is for convenient access to the #CD_MLOOP layer in #ldata.
+ */
+ struct MLoop *mloop;
- /* array of colors for the tessellated faces, must be number of tessellated
- * faces * 4 in length */
- struct MCol *mcol;
- struct Mesh *texcomesh;
+ /** The number of vertices (#MVert) in the mesh, and the size of #vdata. */
+ int totvert;
+ /** The number of edges (#MEdge) in the mesh, and the size of #edata. */
+ int totedge;
+ /** The number of polygons/faces (#MPoly) in the mesh, and the size of #pdata. */
+ int totpoly;
+ /** The number of face corners (#MLoop) in the mesh, and the size of #ldata. */
+ int totloop;
- /* When the object is available, the preferred access method is: BKE_editmesh_from_object(ob) */
- /** Not saved in file. */
- struct BMEditMesh *edit_mesh;
+ CustomData vdata, edata, pdata, ldata;
- struct CustomData vdata, edata, fdata;
+ /** "Vertex group" vertices. */
+ struct MDeformVert *dvert;
+ /**
+ * List of vertex group (#bDeformGroup) names and flags only. Actual weights are stored in dvert.
+ * \note This pointer is for convenient access to the #CD_MDEFORMVERT layer in #vdata.
+ */
+ ListBase vertex_group_names;
+ /** The active index in the #vertex_group_names list. */
+ int vertex_group_active_index;
- /* BMESH ONLY */
- struct CustomData pdata, ldata;
- /* END BMESH ONLY */
+ /**
+ * The index of the active attribute in the UI. The attribute list is a combination of the
+ * generic type attributes from vertex, edge, face, and corner custom data.
+ */
+ int attributes_active_index;
- int totvert, totedge, totface, totselect;
+ /**
+ * 2D vector data used for UVs. "UV" data can also be stored as generic attributes in #ldata.
+ * \note This pointer is for convenient access to the #CD_MLOOPUV layer in #ldata.
+ */
+ struct MLoopUV *mloopuv;
+ /**
+ * The active vertex corner color layer, if it exists. Also called "Vertex Color" in Blender's
+ * UI, even though it is stored per face corner.
+ * \note This pointer is for convenient access to the #CD_MLOOPCOL layer in #ldata.
+ */
+ struct MLoopCol *mloopcol;
- /* BMESH ONLY */
- int totpoly, totloop;
- /* END BMESH ONLY */
+ /**
+ * Runtime storage of the edit mode mesh. If it exists, it generally has the most up-to-date
+ * information about the mesh.
+ * \note When the object is available, the preferred access method is #BKE_editmesh_from_object.
+ */
+ struct BMEditMesh *edit_mesh;
- int attributes_active_index;
- int vertex_group_active_index;
+ /**
+ * This array represents the selection order when the user manually picks elements in edit-mode,
+ * some tools take advantage of this information. All elements in this array are expected to be
+ * selected, see #BKE_mesh_mselect_validate which ensures this. For procedurally created meshes,
+ * this is generally empty (selections are stored as boolean attributes in the corresponding
+ * custom data).
+ */
+ struct MSelect *mselect;
+
+ /** The length of the #mselect array. */
+ int totselect;
- /* the last selected vertex/edge/face are used for the active face however
- * this means the active face must always be selected, this is to keep track
- * of the last selected face and is similar to the old active face flag where
- * the face does not need to be selected, -1 is inactive */
+ /**
+ * In most cases the last selected element (see #mselect) represents the active element.
+ * For faces we make an exception and store the active face separately so it can be active
+ * even when no faces are selected. This is done to prevent flickering in the material properties
+ * and UV Editor which base the content they display on the current material which is controlled
+ * by the active face.
+ *
+ * \note This is mainly stored for use in edit-mode.
+ */
int act_face;
- /* texture space, copied as one block in editobject.c */
+ /**
+ * An optional mesh owned elsewhere (by #Main) that can be used to override
+ * the texture space #loc and #size.
+ * \note Vertex indices should be aligned for this to work usefully.
+ */
+ struct Mesh *texcomesh;
+
+ /** Texture space location and size, used for procedural coordinates when rendering. */
float loc[3];
float size[3];
+ char texflag;
- short texflag, flag;
+ /** Various flags used when editing the mesh. */
+ char editflag;
+ /** Mostly more flags used when editing or displaying the mesh. */
+ short flag;
+
+ /**
+ * The angle for auto smooth in radians. `M_PI` (180 degrees) causes all edges to be smooth.
+ */
float smoothresh;
- /* customdata flag, for bevel-weight and crease, which are now optional */
- char cd_flag, _pad;
+ /**
+ * Flag for choosing whether or not so store bevel weight and crease as custom data layers in the
+ * edit mesh (they are always stored in #MVert and #MEdge currently). In the future, this data
+ * may be stored as generic named attributes (see T89054 and T93602).
+ */
+ char cd_flag;
- char subdiv DNA_DEPRECATED, subdivr DNA_DEPRECATED;
- /** Only kept for backwards compat, not used anymore. */
- char subsurftype DNA_DEPRECATED;
- char editflag;
+ /**
+ * User-defined symmetry flag (#eMeshSymmetryType) that causes editing operations to maintain
+ * symmetrical geometry. Supported by operations such as transform and weight-painting.
+ */
+ char symmetry;
+ /** The length of the #mat array. */
short totcol;
- float remesh_voxel_size;
- float remesh_voxel_adaptivity;
+ /** Choice between different remesh methods in the UI. */
char remesh_mode;
- /* Indicates the symmetry that a mesh has, according to the artist, so that tools can
- * consistently ensure that this symmetry is maintained. */
- char symmetry;
+ char subdiv DNA_DEPRECATED;
+ char subdivr DNA_DEPRECATED;
+ char subsurftype DNA_DEPRECATED;
- char _pad1[2];
+ /**
+ * Deprecated. Store of runtime data for tessellation face UVs and texture.
+ *
+ * \note This would be marked deprecated, however the particles still use this at run-time
+ * for placing particles on the mesh (something which should be eventually upgraded).
+ */
+ struct MTFace *mtface;
+ /** Deprecated, use mtface. */
+ struct TFace *tface DNA_DEPRECATED;
+
+ /* Deprecated. Array of colors for the tessellated faces, must be number of tessellated
+ * faces * 4 in length. This is stored in #fdata, and deprecated. */
+ struct MCol *mcol;
+
+ /**
+ * Deprecated face storage (quads & triangles only);
+ * faces are now pointed to by #Mesh.mpoly and #Mesh.mloop.
+ *
+ * \note This would be marked deprecated, however the particles still use this at run-time
+ * for placing particles on the mesh (something which should be eventually upgraded).
+ */
+ struct MFace *mface;
+ /* Deprecated storage of old faces (only triangles or quads). */
+ CustomData fdata;
+ /* Deprecated size of #fdata. */
+ int totface;
+
+ /** Per-mesh settings for voxel remesh. */
+ float remesh_voxel_size;
+ float remesh_voxel_adaptivity;
int face_sets_color_seed;
/* Stores the initial Face Set to be rendered white. This way the overlay can be enabled by
* default and Face Sets can be used without affecting the color of the mesh. */
int face_sets_color_default;
+ char _pad1[4];
+
void *_pad2;
+
Mesh_Runtime runtime;
} Mesh;
@@ -255,16 +371,17 @@ typedef enum eMeshWrapperType {
ME_WRAPPER_TYPE_MDATA = 0,
/** Use edit-mesh data (#Mesh.edit_mesh, #Mesh_Runtime.edit_data). */
ME_WRAPPER_TYPE_BMESH = 1,
- /* ME_WRAPPER_TYPE_SUBD = 2, */ /* TODO */
+ /** Use subdivision mesh data (#Mesh_Runtime.mesh_eval). */
+ ME_WRAPPER_TYPE_SUBD = 2,
} eMeshWrapperType;
-/* texflag */
+/** #Mesh.texflag */
enum {
ME_AUTOSPACE = 1,
ME_AUTOSPACE_EVALUATED = 2,
};
-/* me->editflag */
+/** #Mesh.editflag */
enum {
ME_EDIT_MIRROR_VERTEX_GROUPS = 1 << 0,
ME_EDIT_MIRROR_Y = 1 << 1, /* unused so far */
@@ -286,7 +403,7 @@ enum {
((_me)->editflag & ME_EDIT_PAINT_VERT_SEL) ? SCE_SELECT_VERTEX : \
0)
-/* me->flag */
+/** #Mesh.flag */
enum {
ME_FLAG_UNUSED_0 = 1 << 0, /* cleared */
ME_FLAG_UNUSED_1 = 1 << 1, /* cleared */
@@ -306,26 +423,27 @@ enum {
ME_REMESH_REPROJECT_SCULPT_FACE_SETS = 1 << 15,
};
-/* me->cd_flag */
+/** #Mesh.cd_flag */
enum {
ME_CDFLAG_VERT_BWEIGHT = 1 << 0,
ME_CDFLAG_EDGE_BWEIGHT = 1 << 1,
ME_CDFLAG_EDGE_CREASE = 1 << 2,
+ ME_CDFLAG_VERT_CREASE = 1 << 3,
};
-/* me->remesh_mode */
+/** #Mesh.remesh_mode */
enum {
REMESH_VOXEL = 0,
REMESH_QUAD = 1,
};
-/* Subsurf Type */
+/** #SubsurfModifierData.subdivType */
enum {
ME_CC_SUBSURF = 0,
ME_SIMPLE_SUBSURF = 1,
};
-/* me->symmetry */
+/** #Mesh.symmetry */
typedef enum eMeshSymmetryType {
ME_SYMMETRY_X = 1 << 0,
ME_SYMMETRY_Y = 1 << 1,
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index bc6b35c8e43..22c523901c0 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -41,12 +41,8 @@ extern "C" {
*/
typedef struct MVert {
float co[3];
- /**
- * Cache the normal, can always be recalculated from surrounding faces.
- * See #CD_CUSTOMLOOPNORMAL for custom normals.
- */
- short no[3];
char flag, bweight;
+ char _pad[2];
} MVert;
/** #MVert.flag */
@@ -106,19 +102,15 @@ enum {
};
/**
- * Mesh Loops.
- * Each loop represents the corner of a polygon (#MPoly).
+ * Mesh Face Corners.
+ * "Loop" is an internal name for the corner of a polygon (#MPoly).
*
* Typically accessed from #Mesh.mloop.
*/
typedef struct MLoop {
- /** Vertex index. */
+ /** Vertex index into an #MVert array. */
unsigned int v;
- /**
- * Edge index.
- *
- * \note The e here is because we want to move away from relying on edge hashes.
- */
+ /** Edge index into an #MEdge array. */
unsigned int e;
} MLoop;
@@ -291,8 +283,22 @@ typedef struct MDeformWeight {
float weight;
} MDeformWeight;
+/**
+ * Stores all of an element's vertex groups, and their weight values.
+ */
typedef struct MDeformVert {
+ /**
+ * Array of weight indices and values.
+ * - There must not be any duplicate #def_nr indices.
+ * - Groups in the array are unordered.
+ * - Indices outside the usable range of groups are ignored.
+ */
struct MDeformWeight *dw;
+ /**
+ * The length of the #dw array.
+ * \note This is not necessarily the same length as the total number of vertex groups.
+ * However, generally it isn't larger.
+ */
int totweight;
/** Flag is only in use as a run-time tag at the moment. */
int flag;
diff --git a/source/blender/makesdna/DNA_meta_types.h b/source/blender/makesdna/DNA_meta_types.h
index d257363b6ef..e489ba7d7ac 100644
--- a/source/blender/makesdna/DNA_meta_types.h
+++ b/source/blender/makesdna/DNA_meta_types.h
@@ -83,8 +83,8 @@ typedef struct MetaBall {
char flag, flag2;
short totcol;
/** Used to store MB_AUTOSPACE. */
- short texflag;
- char _pad[1];
+ char texflag;
+ char _pad[2];
/**
* ID data is older than edit-mode data (TODO: move to edit-mode struct).
diff --git a/source/blender/makesdna/DNA_modifier_defaults.h b/source/blender/makesdna/DNA_modifier_defaults.h
index 5b2694f420b..78ab41031a6 100644
--- a/source/blender/makesdna/DNA_modifier_defaults.h
+++ b/source/blender/makesdna/DNA_modifier_defaults.h
@@ -429,6 +429,7 @@
.uv_offset = {0.0f, 0.0f}, \
.uv_offset_copy = {0.0f, 0.0f}, \
.mirror_ob = NULL, \
+ .use_correct_order_on_merge = true, \
}
#define _DNA_DEFAULT_MultiresModifierData \
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 631db64ddd3..1d0796bda8b 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -121,28 +121,28 @@ typedef struct ModifierData {
int type, mode;
char _pad0[4];
short flag;
- /* An "expand" bit for each of the modifier's (sub)panels (uiPanelDataExpansion). */
+ /** An "expand" bit for each of the modifier's (sub)panels (#uiPanelDataExpansion). */
short ui_expand_flag;
/** MAX_NAME. */
char name[64];
char *error;
- /* Pointer to a ModifierData in the original domain. */
+ /** Pointer to a #ModifierData in the original domain. */
struct ModifierData *orig_modifier_data;
- /* Runtime field which contains unique identifier of the modifier. */
+ /** Runtime field which contains unique identifier of the modifier. */
SessionUUID session_uuid;
- /* Runtime field which contains runtime data which is specific to a modifier type. */
+ /** Runtime field which contains runtime data which is specific to a modifier type. */
void *runtime;
void *_pad1;
} ModifierData;
typedef enum {
- /* This modifier has been inserted in local override, and hence can be fully edited. */
+ /** This modifier has been inserted in local override, and hence can be fully edited. */
eModifierFlag_OverrideLibrary_Local = (1 << 0),
- /* This modifier does not own its caches, but instead shares them with another modifier. */
+ /** This modifier does not own its caches, but instead shares them with another modifier. */
eModifierFlag_SharedCaches = (1 << 1),
/**
* This modifier is the object's active modifier. Used for context in the node editor.
@@ -151,7 +151,9 @@ typedef enum {
eModifierFlag_Active = (1 << 2),
} ModifierFlag;
-/* not a real modifier */
+/**
+ * \note Not a real modifier.
+ */
typedef struct MappingInfoModifierData {
ModifierData modifier;
@@ -194,6 +196,13 @@ typedef enum {
SUBSURF_BOUNDARY_SMOOTH_PRESERVE_CORNERS = 1,
} eSubsurfBoundarySmooth;
+typedef struct SubsurfRuntimeData {
+ /* Cached subdivision surface descriptor, with topology and settings. */
+ struct Subdiv *subdiv;
+ char set_by_draw_code;
+ char _pad[7];
+} SubsurfRuntimeData;
+
typedef struct SubsurfModifierData {
ModifierData modifier;
@@ -219,7 +228,7 @@ typedef struct LatticeModifierData {
void *_pad1;
} LatticeModifierData;
-/* Lattice modifier flags. */
+/** #LatticeModifierData.flag */
enum {
MOD_LATTICE_INVERT_VGROUP = (1 << 0),
};
@@ -237,12 +246,12 @@ typedef struct CurveModifierData {
void *_pad1;
} CurveModifierData;
-/* Curve modifier flags */
+/** #CurveModifierData.flag */
enum {
MOD_CURVE_INVERT_VGROUP = (1 << 0),
};
-/* CurveModifierData->defaxis */
+/** #CurveModifierData.defaxis */
enum {
MOD_CURVE_POSX = 1,
MOD_CURVE_POSY = 2,
@@ -264,7 +273,7 @@ typedef struct BuildModifierData {
int seed;
} BuildModifierData;
-/* Build Modifier -> flag */
+/** #BuildModifierData.flag */
enum {
/** order of vertices is randomized */
MOD_BUILD_FLAG_RANDOMIZE = (1 << 0),
@@ -272,7 +281,7 @@ enum {
MOD_BUILD_FLAG_REVERSE = (1 << 1),
};
-/* Mask Modifier */
+/** Mask Modifier. */
typedef struct MaskModifierData {
ModifierData modifier;
@@ -289,13 +298,13 @@ typedef struct MaskModifierData {
void *_pad1;
} MaskModifierData;
-/* Mask Modifier -> mode */
+/** #MaskModifierData.mode */
enum {
MOD_MASK_MODE_VGROUP = 0,
MOD_MASK_MODE_ARM = 1,
};
-/* Mask Modifier -> flag */
+/** #MaskModifierData.flag */
enum {
MOD_MASK_INV = (1 << 0),
MOD_MASK_SMOOTH = (1 << 1),
@@ -304,63 +313,68 @@ enum {
typedef struct ArrayModifierData {
ModifierData modifier;
- /* the object with which to cap the start of the array. */
+ /** The object with which to cap the start of the array. */
struct Object *start_cap;
- /* the object with which to cap the end of the array. */
+ /** The object with which to cap the end of the array. */
struct Object *end_cap;
- /* the curve object to use for MOD_ARR_FITCURVE. */
+ /** The curve object to use for #MOD_ARR_FITCURVE. */
struct Object *curve_ob;
- /* the object to use for object offset. */
+ /** The object to use for object offset. */
struct Object *offset_ob;
- /* a constant duplicate offset;
- * 1 means the duplicates are 1 unit apart
+ /**
+ * A constant duplicate offset;
+ * 1 means the duplicates are 1 unit apart.
*/
float offset[3];
- /* a scaled factor for duplicate offsets;
- * 1 means the duplicates are 1 object-width apart
+ /**
+ * A scaled factor for duplicate offsets;
+ * 1 means the duplicates are 1 object-width apart.
*/
float scale[3];
- /* the length over which to distribute the duplicates */
+ /** The length over which to distribute the duplicates. */
float length;
- /* the limit below which to merge vertices in adjacent duplicates */
+ /** The limit below which to merge vertices in adjacent duplicates. */
float merge_dist;
- /* determines how duplicate count is calculated; one of:
- * - MOD_ARR_FIXEDCOUNT -> fixed
- * - MOD_ARR_FITLENGTH -> calculated to fit a set length
- * - MOD_ARR_FITCURVE -> calculated to fit the length of a Curve object
+ /**
+ * Determines how duplicate count is calculated; one of:
+ * - #MOD_ARR_FIXEDCOUNT -> fixed.
+ * - #MOD_ARR_FITLENGTH -> calculated to fit a set length.
+ * - #MOD_ARR_FITCURVE -> calculated to fit the length of a Curve object.
*/
int fit_type;
- /* flags specifying how total offset is calculated; binary OR of:
- * - MOD_ARR_OFF_CONST -> total offset += offset
- * - MOD_ARR_OFF_RELATIVE -> total offset += relative * object width
- * - MOD_ARR_OFF_OBJ -> total offset += offset_ob's matrix
- * total offset is the sum of the individual enabled offsets
+ /**
+ * Flags specifying how total offset is calculated; binary OR of:
+ * - #MOD_ARR_OFF_CONST -> total offset += offset.
+ * - #MOD_ARR_OFF_RELATIVE -> total offset += relative * object width.
+ * - #MOD_ARR_OFF_OBJ -> total offset += offset_ob's matrix.
+ * Total offset is the sum of the individual enabled offsets.
*/
int offset_type;
- /* general flags:
- * MOD_ARR_MERGE -> merge vertices in adjacent duplicates
+ /**
+ * General flags:
+ * #MOD_ARR_MERGE -> merge vertices in adjacent duplicates.
*/
int flags;
- /* the number of duplicates to generate for MOD_ARR_FIXEDCOUNT */
+ /** The number of duplicates to generate for #MOD_ARR_FIXEDCOUNT. */
int count;
float uv_offset[2];
} ArrayModifierData;
-/* ArrayModifierData->fit_type */
+/** #ArrayModifierData.fit_type */
enum {
MOD_ARR_FIXEDCOUNT = 0,
MOD_ARR_FITLENGTH = 1,
MOD_ARR_FITCURVE = 2,
};
-/* ArrayModifierData->offset_type */
+/** #ArrayModifierData.offset_type */
enum {
MOD_ARR_OFF_CONST = (1 << 0),
MOD_ARR_OFF_RELATIVE = (1 << 1),
MOD_ARR_OFF_OBJ = (1 << 2),
};
-/* ArrayModifierData->flags */
+/** #ArrayModifierData.flags */
enum {
MOD_ARR_MERGE = (1 << 0),
MOD_ARR_MERGEFINAL = (1 << 1),
@@ -374,14 +388,22 @@ typedef struct MirrorModifierData {
short flag;
float tolerance;
float bisect_threshold;
- char _pad[4];
+
+ /** Mirror modifier used to merge the old vertex into its new copy, which would break code
+ * relying on access to the original geometry vertices. However, modifying this behavior to the
+ * correct one (i.e. merging the copy vertices into their original sources) has several potential
+ * effects on other modifiers and tools, so we need to keep that incorrect behavior for existing
+ * modifiers, and only use the new correct one for new modifiers. */
+ uint8_t use_correct_order_on_merge;
+
+ char _pad[3];
float uv_offset[2];
float uv_offset_copy[2];
struct Object *mirror_ob;
void *_pad1;
} MirrorModifierData;
-/* MirrorModifierData->flag */
+/** #MirrorModifierData.flag */
enum {
MOD_MIR_CLIPPING = (1 << 0),
MOD_MIR_MIRROR_U = (1 << 1),
@@ -408,7 +430,7 @@ typedef struct EdgeSplitModifierData {
int flags;
} EdgeSplitModifierData;
-/* EdgeSplitModifierData->flags */
+/** #EdgeSplitModifierData.flags */
enum {
MOD_EDGESPLIT_FROMANGLE = (1 << 1),
MOD_EDGESPLIT_FROMFLAG = (1 << 2),
@@ -460,7 +482,7 @@ typedef struct BevelModifierData {
void *_pad2;
} BevelModifierData;
-/* BevelModifierData->flags and BevelModifierData->lim_flags */
+/** #BevelModifierData.flags and BevelModifierData.lim_flags */
enum {
#ifdef DNA_DEPRECATED_ALLOW
MOD_BEVEL_VERT_DEPRECATED = (1 << 1),
@@ -483,7 +505,7 @@ enum {
MOD_BEVEL_HARDEN_NORMALS = (1 << 15),
};
-/* BevelModifierData->val_flags (not used as flags any more) */
+/** #BevelModifierData.val_flags (not used as flags any more) */
enum {
MOD_BEVEL_AMT_OFFSET = 0,
MOD_BEVEL_AMT_WIDTH = 1,
@@ -492,19 +514,19 @@ enum {
MOD_BEVEL_AMT_ABSOLUTE = 4,
};
-/* BevelModifierData->profile_type */
+/** #BevelModifierData.profile_type */
enum {
MOD_BEVEL_PROFILE_SUPERELLIPSE = 0,
MOD_BEVEL_PROFILE_CUSTOM = 1,
};
-/* BevelModifierData->edge_flags */
+/** #BevelModifierData.edge_flags */
enum {
MOD_BEVEL_MARK_SEAM = (1 << 0),
MOD_BEVEL_MARK_SHARP = (1 << 1),
};
-/* BevelModifierData->face_str_mode */
+/** #BevelModifierData.face_str_mode */
enum {
MOD_BEVEL_FACE_STRENGTH_NONE = 0,
MOD_BEVEL_FACE_STRENGTH_NEW = 1,
@@ -512,20 +534,20 @@ enum {
MOD_BEVEL_FACE_STRENGTH_ALL = 3,
};
-/* BevelModifier->miter_inner and ->miter_outer */
+/** #BevelModifier.miter_inner & #BevelModifier.miter_outer */
enum {
MOD_BEVEL_MITER_SHARP = 0,
MOD_BEVEL_MITER_PATCH = 1,
MOD_BEVEL_MITER_ARC = 2,
};
-/* BevelModifier->vmesh_method */
+/** #BevelModifier.vmesh_method */
enum {
MOD_BEVEL_VMESH_ADJ = 0,
MOD_BEVEL_VMESH_CUTOFF = 1,
};
-/* BevelModifier->affect_type */
+/** #BevelModifier.affect_type */
enum {
MOD_BEVEL_AFFECT_VERTICES = 0,
MOD_BEVEL_AFFECT_EDGES = 1,
@@ -545,7 +567,7 @@ typedef struct FluidModifierData {
void *_pad1;
} FluidModifierData;
-/* Fluid modifier flags */
+/** #FluidModifierData.type */
enum {
MOD_FLUID_TYPE_DOMAIN = (1 << 0),
MOD_FLUID_TYPE_FLOW = (1 << 1),
@@ -555,7 +577,8 @@ enum {
typedef struct DisplaceModifierData {
ModifierData modifier;
- /* keep in sync with MappingInfoModifierData */
+ /* Keep in sync with #MappingInfoModifierData. */
+
struct Tex *texture;
struct Object *map_object;
char map_bone[64];
@@ -575,12 +598,12 @@ typedef struct DisplaceModifierData {
char _pad[6];
} DisplaceModifierData;
-/* DisplaceModifierData->flag */
+/** #DisplaceModifierData.flag */
enum {
MOD_DISP_INVERT_VGROUP = (1 << 0),
};
-/* DisplaceModifierData->direction */
+/** #DisplaceModifierData.direction */
enum {
MOD_DISP_DIR_X = 0,
MOD_DISP_DIR_Y = 1,
@@ -590,7 +613,7 @@ enum {
MOD_DISP_DIR_CLNOR = 5,
};
-/* DisplaceModifierData->texmapping */
+/** #DisplaceModifierData.texmapping */
enum {
MOD_DISP_MAP_LOCAL = 0,
MOD_DISP_MAP_GLOBAL = 1,
@@ -598,7 +621,7 @@ enum {
MOD_DISP_MAP_UV = 3,
};
-/* DisplaceModifierData->space */
+/** #DisplaceModifierData.space */
enum {
MOD_DISP_SPACE_LOCAL = 0,
MOD_DISP_SPACE_GLOBAL = 1,
@@ -606,9 +629,10 @@ enum {
typedef struct UVProjectModifierData {
ModifierData modifier;
-
- /* the objects which do the projecting */
- /** MOD_UVPROJECT_MAXPROJECTORS. */
+ /**
+ * The objects which do the projecting.
+ * \note 10=MOD_UVPROJECT_MAXPROJECTORS.
+ */
struct Object *projectors[10];
char _pad2[4];
int num_projectors;
@@ -641,7 +665,7 @@ typedef struct DecimateModifierData {
float defgrp_factor;
short flag, mode;
- /* runtime only */
+ /** runtime only. */
int face_count;
} DecimateModifierData;
@@ -670,7 +694,7 @@ typedef struct SmoothModifierData {
} SmoothModifierData;
-/* Smooth modifier flags */
+/** #SmoothModifierData.flag */
enum {
MOD_SMOOTH_INVERT_VGROUP = (1 << 0),
MOD_SMOOTH_X = (1 << 1),
@@ -687,11 +711,13 @@ typedef struct CastModifierData {
float size;
/** MAX_VGROUP_NAME. */
char defgrp_name[64];
- short flag, type;
+ short flag;
+ /** Cast modifier projection type. */
+ short type;
void *_pad1;
} CastModifierData;
-/* Cast modifier flags */
+/** #CastModifierData.flag */
enum {
/* And what bout (1 << 0) flag? ;) */
MOD_CAST_INVERT_VGROUP = (1 << 0),
@@ -702,7 +728,7 @@ enum {
MOD_CAST_SIZE_FROM_RADIUS = (1 << 5),
};
-/* Cast modifier projection types */
+/** #CastModifierData.type */
enum {
MOD_CAST_TYPE_SPHERE = 0,
MOD_CAST_TYPE_CYLINDER = 1,
@@ -712,7 +738,8 @@ enum {
typedef struct WaveModifierData {
ModifierData modifier;
- /* keep in sync with MappingInfoModifierData */
+ /* Keep in sync with #MappingInfoModifierData. */
+
struct Tex *texture;
struct Object *map_object;
char map_bone[64];
@@ -720,7 +747,7 @@ typedef struct WaveModifierData {
char uvlayer_name[64];
int uvlayer_tmp;
int texmapping;
- /* end MappingInfoModifierData */
+ /* End MappingInfoModifierData. */
struct Object *objectcenter;
/** MAX_VGROUP_NAME. */
@@ -737,7 +764,7 @@ typedef struct WaveModifierData {
void *_pad2;
} WaveModifierData;
-/* WaveModifierData.flag */
+/** #WaveModifierData.flag */
enum {
MOD_WAVE_INVERT_VGROUP = (1 << 0),
MOD_WAVE_X = (1 << 1),
@@ -767,7 +794,7 @@ enum {
MOD_HOOK_INVERT_VGROUP = (1 << 1),
};
-/* same as WarpModifierFalloff */
+/** \note same as #WarpModifierFalloff */
typedef enum {
eHook_Falloff_None = 0,
eHook_Falloff_Curve = 1,
@@ -824,15 +851,17 @@ typedef struct ClothModifierData {
/** Definition is in DNA_cloth_types.h. */
struct ClothCollSettings *coll_parms;
- /* PointCache can be shared with other instances of ClothModifierData.
- * Inspect (modifier.flag & eModifierFlag_SharedCaches) to find out. */
+ /**
+ * PointCache can be shared with other instances of #ClothModifierData.
+ * Inspect `modifier.flag & eModifierFlag_SharedCaches` to find out.
+ */
/** Definition is in DNA_object_force_types.h. */
struct PointCache *point_cache;
struct ListBase ptcaches;
- /* XXX nasty hack, remove once hair can be separated from cloth modifier data */
+ /** XXX: nasty hack, remove once hair can be separated from cloth modifier data. */
struct ClothHairData *hairdata;
- /* grid geometry values of hair continuum */
+ /** Grid geometry values of hair continuum. */
float hair_grid_min[3];
float hair_grid_max[3];
int hair_grid_res[3];
@@ -899,20 +928,20 @@ typedef struct BooleanModifierData {
char bm_flag;
} BooleanModifierData;
-/* BooleanModifierData->operation */
+/** #BooleanModifierData.operation */
typedef enum {
eBooleanModifierOp_Intersect = 0,
eBooleanModifierOp_Union = 1,
eBooleanModifierOp_Difference = 2,
} BooleanModifierOp;
-/* BooleanModifierData->solver */
+/** #BooleanModifierData.solver */
typedef enum {
eBooleanModifierSolver_Fast = 0,
eBooleanModifierSolver_Exact = 1,
} BooleanModifierSolver;
-/* BooleanModifierData->flag */
+/** #BooleanModifierData.flag */
enum {
eBooleanModifierFlag_Self = (1 << 0),
eBooleanModifierFlag_Object = (1 << 1),
@@ -920,7 +949,7 @@ enum {
eBooleanModifierFlag_HoleTolerant = (1 << 3),
};
-/* bm_flag only used when G_DEBUG. */
+/** #BooleanModifierData.bm_flag (only used when #G_DEBUG is set). */
enum {
eBooleanModifierBMeshFlag_BMesh_Separate = (1 << 0),
eBooleanModifierBMeshFlag_BMesh_NoDissolve = (1 << 1),
@@ -1094,7 +1123,7 @@ typedef enum {
eMultiresModifierFlag_UseSculptBaseMesh = (1 << 4),
} MultiresModifierFlag;
-/* DEPRECATED, only used for versioning. */
+/** DEPRECATED: only used for versioning. */
typedef struct FluidsimModifierData {
ModifierData modifier;
@@ -1103,7 +1132,7 @@ typedef struct FluidsimModifierData {
void *_pad1;
} FluidsimModifierData;
-/* DEPRECATED, only used for versioning. */
+/** DEPRECATED: only used for versioning. */
typedef struct SmokeModifierData {
ModifierData modifier;
@@ -1142,7 +1171,7 @@ typedef struct ShrinkwrapModifierData {
char _pad[2];
} ShrinkwrapModifierData;
-/* Shrinkwrap->shrinkType */
+/** #ShrinkwrapModifierData.shrinkType */
enum {
MOD_SHRINKWRAP_NEAREST_SURFACE = 0,
MOD_SHRINKWRAP_PROJECT = 1,
@@ -1150,7 +1179,7 @@ enum {
MOD_SHRINKWRAP_TARGET_PROJECT = 3,
};
-/* Shrinkwrap->shrinkMode */
+/** #ShrinkwrapModifierData.shrinkMode */
enum {
/** Move vertex to the surface of the target object (keepDist towards original position) */
MOD_SHRINKWRAP_ON_SURFACE = 0,
@@ -1164,7 +1193,7 @@ enum {
MOD_SHRINKWRAP_ABOVE_SURFACE = 4,
};
-/* Shrinkwrap->shrinkOpts */
+/** #ShrinkwrapModifierData.shrinkOpts */
enum {
/** allow shrinkwrap to move the vertex in the positive direction of axis */
MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR = (1 << 0),
@@ -1188,7 +1217,7 @@ enum {
#define MOD_SHRINKWRAP_CULL_TARGET_MASK \
(MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE | MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)
-/* Shrinkwrap->projAxis */
+/** #ShrinkwrapModifierData.projAxis */
enum {
/** projection over normal is used if no axis is selected */
MOD_SHRINKWRAP_PROJECT_OVER_NORMAL = 0,
@@ -1220,7 +1249,7 @@ typedef struct SimpleDeformModifierData {
void *_pad1;
} SimpleDeformModifierData;
-/* SimpleDeform->flag */
+/** #SimpleDeformModifierData.flag */
enum {
MOD_SIMPLEDEFORM_FLAG_INVERT_VGROUP = (1 << 0),
};
@@ -1426,7 +1455,9 @@ enum {
typedef struct WarpModifierData {
ModifierData modifier;
- /* keep in sync with MappingInfoModifierData */
+
+ /* Keep in sync with #MappingInfoModifierData. */
+
struct Tex *texture;
struct Object *map_object;
char map_bone[64];
@@ -1434,7 +1465,7 @@ typedef struct WarpModifierData {
char uvlayer_name[64];
int uvlayer_tmp;
int texmapping;
- /* end MappingInfoModifierData */
+ /* End #MappingInfoModifierData. */
struct Object *object_from;
struct Object *object_to;
@@ -1454,12 +1485,13 @@ typedef struct WarpModifierData {
void *_pad1;
} WarpModifierData;
-/* WarpModifierData->flag */
+/** #WarpModifierData.flag */
enum {
MOD_WARP_VOLUME_PRESERVE = (1 << 0),
MOD_WARP_INVERT_VGROUP = (1 << 1),
};
+/** \note same as #HookModifierFalloff. */
typedef enum {
eWarp_Falloff_None = 0,
eWarp_Falloff_Curve = 1,
@@ -1500,7 +1532,7 @@ typedef struct WeightVGEditModifierData {
char mask_defgrp_name[64];
/* Texture masking. */
- /** Which channel to use as weightf. */
+ /** Which channel to use as weight/mask. */
int mask_tex_use_channel;
/** The texture. */
struct Tex *mask_texture;
@@ -1518,7 +1550,7 @@ typedef struct WeightVGEditModifierData {
void *_pad1;
} WeightVGEditModifierData;
-/* WeightVGEdit flags. */
+/** #WeightVGEdit.edit_flags */
enum {
MOD_WVG_EDIT_WEIGHTS_NORMALIZE = (1 << 0),
MOD_WVG_INVERT_FALLOFF = (1 << 1),
@@ -1573,7 +1605,7 @@ typedef struct WeightVGMixModifierData {
char _pad1[3];
} WeightVGMixModifierData;
-/* How second vgroup's weights affect first ones. */
+/** #WeightVGMixModifierData.mix_mode (how second vgroup's weights affect first ones). */
enum {
/** Second weights replace weights. */
MOD_WVG_MIX_SET = 1,
@@ -1591,7 +1623,7 @@ enum {
MOD_WVG_MIX_AVG = 7,
};
-/* What vertices to affect. */
+/** #WeightVGMixModifierData.mix_set (what vertices to affect). */
enum {
/** Affect all vertices. */
MOD_WVG_SET_ALL = 1,
@@ -1605,7 +1637,7 @@ enum {
MOD_WVG_SET_AND = 5,
};
-/* WeightVGMix->flag */
+/** #WeightVGMixModifierData.flag */
enum {
MOD_WVG_MIX_INVERT_VGROUP_MASK = (1 << 0),
MOD_WVG_MIX_WEIGHTS_NORMALIZE = (1 << 1),
@@ -1623,8 +1655,9 @@ typedef struct WeightVGProximityModifierData {
/** The custom mapping curve. */
struct CurveMapping *cmap_curve;
- /* Proximity modes. */
+ /** Modes of proximity weighting. */
int proximity_mode;
+ /** Options for proximity weighting. */
int proximity_flags;
/* Target object from which to calculate vertices distances. */
@@ -1654,20 +1687,21 @@ typedef struct WeightVGProximityModifierData {
float min_dist, max_dist;
/* Put here to avoid breaking existing struct... */
- /** Using MOD_WVG_MAPPING_* enums. */
+ /**
+ * Mapping modes (using MOD_WVG_MAPPING_* enums). */
short falloff_type;
/* Padding... */
char _pad0[2];
} WeightVGProximityModifierData;
-/* Modes of proximity weighting. */
+/** #WeightVGProximityModifierData.proximity_mode */
enum {
MOD_WVG_PROXIMITY_OBJECT = 1, /* source vertex to other location */
MOD_WVG_PROXIMITY_GEOMETRY = 2, /* source vertex to other geometry */
};
-/* Flags options for proximity weighting. */
+/** #WeightVGProximityModifierData.proximity_flags */
enum {
/* Use nearest vertices of target obj, in MOD_WVG_PROXIMITY_GEOMETRY mode. */
MOD_WVG_PROXIMITY_GEOM_VERTS = (1 << 0),
@@ -1681,7 +1715,8 @@ enum {
};
/* Defines common to all WeightVG modifiers. */
-/* Mapping modes. */
+
+/** #WeightVGProximityModifierData.falloff_type */
enum {
MOD_WVG_MAPPING_NONE = 0,
MOD_WVG_MAPPING_CURVE = 1,
@@ -1695,7 +1730,7 @@ enum {
MOD_WVG_MAPPING_STEP = 9, /* Median Step. */
};
-/* Tex channel to be used as mask. */
+/** #WeightVGProximityModifierData.mask_tex_use_channel */
enum {
MOD_WVG_MASK_TEX_USE_INT = 1,
MOD_WVG_MASK_TEX_USE_RED = 2,
@@ -1717,13 +1752,13 @@ typedef struct DynamicPaintModifierData {
char _pad[4];
} DynamicPaintModifierData;
-/* Dynamic paint modifier flags */
+/** #DynamicPaintModifierData.type */
enum {
MOD_DYNAMICPAINT_TYPE_CANVAS = (1 << 0),
MOD_DYNAMICPAINT_TYPE_BRUSH = (1 << 1),
};
-/* Remesh modifier */
+/** Remesh modifier. */
typedef enum eRemeshModifierFlags {
MOD_REMESH_FLOOD_FILL = (1 << 0),
MOD_REMESH_SMOOTH_SHADING = (1 << 1),
@@ -1762,7 +1797,7 @@ typedef struct RemeshModifierData {
float adaptivity;
} RemeshModifierData;
-/* Skin modifier */
+/** Skin modifier. */
typedef struct SkinModifierData {
ModifierData modifier;
@@ -1775,19 +1810,19 @@ typedef struct SkinModifierData {
char _pad[2];
} SkinModifierData;
-/* SkinModifierData.symmetry_axes */
+/** #SkinModifierData.symmetry_axes */
enum {
MOD_SKIN_SYMM_X = (1 << 0),
MOD_SKIN_SYMM_Y = (1 << 1),
MOD_SKIN_SYMM_Z = (1 << 2),
};
-/* SkinModifierData.flag */
+/** #SkinModifierData.flag */
enum {
MOD_SKIN_SMOOTH_SHADING = 1,
};
-/* Triangulate modifier */
+/** Triangulate modifier. */
typedef struct TriangulateModifierData {
ModifierData modifier;
@@ -1797,7 +1832,7 @@ typedef struct TriangulateModifierData {
int min_vertices;
} TriangulateModifierData;
-/* TriangulateModifierData.flag */
+/** #TriangulateModifierData.flag */
enum {
#ifdef DNA_DEPRECATED_ALLOW
MOD_TRIANGULATE_BEAUTY = (1 << 0), /* deprecated */
@@ -1805,18 +1840,19 @@ enum {
MOD_TRIANGULATE_KEEP_CUSTOMLOOP_NORMALS = 1 << 1,
};
-/* Triangulate methods - NGons */
+/** #TriangulateModifierData.ngon_method triangulate method (N-gons). */
enum {
MOD_TRIANGULATE_NGON_BEAUTY = 0,
MOD_TRIANGULATE_NGON_EARCLIP = 1,
};
-/* Triangulate methods - Quads */
+/** #TriangulateModifierData.quad_method triangulate method (quads). */
enum {
MOD_TRIANGULATE_QUAD_BEAUTY = 0,
MOD_TRIANGULATE_QUAD_FIXED = 1,
MOD_TRIANGULATE_QUAD_ALTERNATE = 2,
MOD_TRIANGULATE_QUAD_SHORTEDGE = 3,
+ MOD_TRIANGULATE_QUAD_LONGEDGE = 4,
};
typedef struct LaplacianSmoothModifierData {
@@ -1829,7 +1865,7 @@ typedef struct LaplacianSmoothModifierData {
short flag, repeat;
} LaplacianSmoothModifierData;
-/* Smooth modifier flags */
+/** #LaplacianSmoothModifierData.flag */
enum {
MOD_LAPLACIANSMOOTH_X = (1 << 1),
MOD_LAPLACIANSMOOTH_Y = (1 << 2),
@@ -1884,7 +1920,7 @@ enum {
MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND = 1,
};
-/* Corrective Smooth modifier flags */
+/** #CorrectiveSmoothModifierData.flag */
enum {
MOD_CORRECTIVESMOOTH_INVERT_VGROUP = (1 << 0),
MOD_CORRECTIVESMOOTH_ONLY_SMOOTH = (1 << 1),
@@ -1918,12 +1954,12 @@ typedef struct UVWarpModifierData {
char uvlayer_name[64];
} UVWarpModifierData;
-/* UVWarp modifier flags */
+/** #UVWarpModifierData.flag */
enum {
MOD_UVWARP_INVERT_VGROUP = 1 << 0,
};
-/* cache modifier */
+/** Mesh cache modifier. */
typedef struct MeshCacheModifierData {
ModifierData modifier;
@@ -1959,7 +1995,7 @@ typedef struct MeshCacheModifierData {
char filepath[1024];
} MeshCacheModifierData;
-/* MeshCache modifier flags. */
+/** #MeshCacheModifierData.flag */
enum {
MOD_MESHCACHE_INVERT_VERTEX_GROUP = 1 << 0,
};
@@ -2004,13 +2040,15 @@ typedef struct LaplacianDeformModifierData {
} LaplacianDeformModifierData;
-/* Laplacian Deform modifier flags */
+/** #LaplacianDeformModifierData.flag */
enum {
MOD_LAPLACIANDEFORM_BIND = 1 << 0,
MOD_LAPLACIANDEFORM_INVERT_VGROUP = 1 << 1,
};
-/* many of these options match 'solidify' */
+/**
+ * \note many of these options match 'solidify'.
+ */
typedef struct WireframeModifierData {
ModifierData modifier;
/** MAX_VGROUP_NAME. */
@@ -2045,13 +2083,13 @@ typedef struct WeldModifierData {
char _pad[2];
} WeldModifierData;
-/* WeldModifierData->flag */
+/** #WeldModifierData.flag */
enum {
MOD_WELD_INVERT_VGROUP = (1 << 0),
MOD_WELD_LOOSE_EDGES = (1 << 1),
};
-/* #WeldModifierData.mode */
+/** #WeldModifierData.mode */
enum {
MOD_WELD_MODE_ALL = 0,
MOD_WELD_MODE_CONNECTED = 1,
@@ -2092,7 +2130,7 @@ typedef struct DataTransferModifierData {
void *_pad2;
} DataTransferModifierData;
-/* DataTransferModifierData.flags */
+/** #DataTransferModifierData.flags */
enum {
MOD_DATATRANSFER_OBSRC_TRANSFORM = 1 << 0,
MOD_DATATRANSFER_MAP_MAXDIST = 1 << 1,
@@ -2105,7 +2143,7 @@ enum {
MOD_DATATRANSFER_USE_POLY = 1u << 31,
};
-/* Set Split Normals modifier */
+/** Set Split Normals modifier. */
typedef struct NormalEditModifierData {
ModifierData modifier;
/** MAX_VGROUP_NAME. */
@@ -2123,20 +2161,20 @@ typedef struct NormalEditModifierData {
void *_pad1;
} NormalEditModifierData;
-/* NormalEditModifierData.mode */
+/** #NormalEditModifierData.mode */
enum {
MOD_NORMALEDIT_MODE_RADIAL = 0,
MOD_NORMALEDIT_MODE_DIRECTIONAL = 1,
};
-/* NormalEditModifierData.flags */
+/** #NormalEditModifierData.flags */
enum {
MOD_NORMALEDIT_INVERT_VGROUP = (1 << 0),
MOD_NORMALEDIT_USE_DIRECTION_PARALLEL = (1 << 1),
MOD_NORMALEDIT_NO_POLYNORS_FIX = (1 << 2),
};
-/* NormalEditModifierData.mix_mode */
+/** #NormalEditModifierData.mix_mode */
enum {
MOD_NORMALEDIT_MIX_COPY = 0,
MOD_NORMALEDIT_MIX_ADD = 1,
@@ -2161,7 +2199,7 @@ typedef struct MeshSeqCacheModifierData {
char reader_object_path[1024];
} MeshSeqCacheModifierData;
-/* MeshSeqCacheModifierData.read_flag */
+/** #MeshSeqCacheModifierData.read_flag */
enum {
MOD_MESHSEQ_READ_VERT = (1 << 0),
MOD_MESHSEQ_READ_POLY = (1 << 1),
@@ -2206,7 +2244,7 @@ typedef struct SurfaceDeformModifierData {
void *_pad1;
} SurfaceDeformModifierData;
-/* Surface Deform modifier flags */
+/** Surface Deform modifier flags. */
enum {
/* This indicates "do bind on next modifier evaluation" as well as "is bound". */
MOD_SDEF_BIND = (1 << 0),
@@ -2215,7 +2253,7 @@ enum {
MOD_SDEF_SPARSE_BIND = (1 << 2),
};
-/* Surface Deform vertex bind modes */
+/** Surface Deform vertex bind modes. */
enum {
MOD_SDEF_MODE_LOOPTRI = 0,
MOD_SDEF_MODE_NGON = 1,
@@ -2235,14 +2273,14 @@ typedef struct WeightedNormalModifierData {
/* Name/id of the generic PROP_INT cdlayer storing face weights. */
#define MOD_WEIGHTEDNORMALS_FACEWEIGHT_CDLAYER_ID "__mod_weightednormals_faceweight"
-/* WeightedNormalModifierData.mode */
+/** #WeightedNormalModifierData.mode */
enum {
MOD_WEIGHTEDNORMAL_MODE_FACE = 0,
MOD_WEIGHTEDNORMAL_MODE_ANGLE = 1,
MOD_WEIGHTEDNORMAL_MODE_FACE_ANGLE = 2,
};
-/* WeightedNormalModifierData.flag */
+/** #WeightedNormalModifierData.flag */
enum {
MOD_WEIGHTEDNORMAL_KEEP_SHARP = (1 << 0),
MOD_WEIGHTEDNORMAL_INVERT_VGROUP = (1 << 1),
@@ -2262,8 +2300,10 @@ typedef struct NodesModifierData {
struct bNodeTree *node_group;
struct NodesModifierSettings settings;
- /* Contains logged information from the last evaluation. This can be used to help the user to
- * debug a node tree. */
+ /**
+ * Contains logged information from the last evaluation.
+ * This can be used to help the user to debug a node tree.
+ */
void *runtime_eval_log;
void *_pad1;
} NodesModifierData;
@@ -2296,7 +2336,7 @@ typedef struct MeshToVolumeModifierData {
void *_pad3;
} MeshToVolumeModifierData;
-/* MeshToVolumeModifierData->resolution_mode */
+/** #MeshToVolumeModifierData.resolution_mode */
typedef enum MeshToVolumeModifierResolutionMode {
MESH_TO_VOLUME_RESOLUTION_MODE_VOXEL_AMOUNT = 0,
MESH_TO_VOLUME_RESOLUTION_MODE_VOXEL_SIZE = 1,
@@ -2314,7 +2354,7 @@ typedef struct VolumeDisplaceModifierData {
float texture_sample_radius;
} VolumeDisplaceModifierData;
-/* VolumeDisplaceModifierData->texture_map_mode */
+/** #VolumeDisplaceModifierData.texture_map_mode */
enum {
MOD_VOLUME_DISPLACE_MAP_LOCAL = 0,
MOD_VOLUME_DISPLACE_MAP_GLOBAL = 1,
diff --git a/source/blender/makesdna/DNA_movieclip_defaults.h b/source/blender/makesdna/DNA_movieclip_defaults.h
index 753147eb072..441c2231009 100644
--- a/source/blender/makesdna/DNA_movieclip_defaults.h
+++ b/source/blender/makesdna/DNA_movieclip_defaults.h
@@ -45,6 +45,34 @@
.frame_offset = 0, \
}
+#define _DNA_DEFAULT_MovieClipUser \
+ { \
+ .framenr = 1, \
+ .render_size = MCLIP_PROXY_RENDER_SIZE_FULL, \
+ .render_flag = 0, \
+ }
+
+#define _DNA_DEFAULT_MovieClipScopes \
+ { \
+ .ok = 0, \
+ .use_track_mask = 0, \
+ .track_preview_height = 120, \
+ .frame_width = 0, \
+ .frame_height = 0, \
+ .undist_marker = _DNA_DEFAULT_MovieTrackingMarker, \
+ .track_pos = {0, 0}, \
+ .track_disabled = 0, \
+ .track_locked = 0, \
+ .scene_framenr = 0, \
+ .slide_scale = {0.0f, 0.0f}, \
+ }
+
+/* initialize as all zeros. */
+#define _DNA_DEFAULT_MovieTrackingMarker \
+ { \
+ .pos = {0.0f, 0.0f}, \
+ }
+
/** \} */
/* clang-format on */
diff --git a/source/blender/makesdna/DNA_movieclip_types.h b/source/blender/makesdna/DNA_movieclip_types.h
index 8e01a9e1f1f..08064e6242b 100644
--- a/source/blender/makesdna/DNA_movieclip_types.h
+++ b/source/blender/makesdna/DNA_movieclip_types.h
@@ -160,7 +160,7 @@ typedef struct MovieClipScopes {
float slide_scale[2];
} MovieClipScopes;
-/* MovieClipProxy->build_size_flag */
+/** #MovieClipProxy.build_size_flag */
enum {
MCLIP_PROXY_SIZE_25 = (1 << 0),
MCLIP_PROXY_SIZE_50 = (1 << 1),
@@ -172,13 +172,13 @@ enum {
MCLIP_PROXY_UNDISTORTED_SIZE_100 = (1 << 7),
};
-/* MovieClip->source */
+/** #MovieClip.source */
enum {
MCLIP_SRC_SEQUENCE = 1,
MCLIP_SRC_MOVIE = 2,
};
-/* MovieClip->flag */
+/** #MovieClip.flag */
enum {
MCLIP_USE_PROXY = (1 << 0),
MCLIP_USE_PROXY_CUSTOM_DIR = (1 << 1),
@@ -188,7 +188,7 @@ enum {
MCLIP_TIMECODE_FLAGS = (MCLIP_USE_PROXY | MCLIP_USE_PROXY_CUSTOM_DIR),
};
-/* MovieClip->render_size */
+/** #MovieClip.render_size */
enum {
MCLIP_PROXY_RENDER_SIZE_FULL = 0,
MCLIP_PROXY_RENDER_SIZE_25 = 1,
@@ -197,7 +197,7 @@ enum {
MCLIP_PROXY_RENDER_SIZE_100 = 4,
};
-/* MovieClip->render_flag */
+/** #MovieClip.render_flag */
enum {
MCLIP_PROXY_RENDER_UNDISTORT = 1,
/** Use original, if proxy is not found. */
diff --git a/source/blender/makesdna/DNA_nla_types.h b/source/blender/makesdna/DNA_nla_types.h
index 7808dd68384..82edc0e1816 100644
--- a/source/blender/makesdna/DNA_nla_types.h
+++ b/source/blender/makesdna/DNA_nla_types.h
@@ -33,7 +33,7 @@ struct Ipo;
struct Object;
struct bAction;
-/* simple uniform modifier structure, assumed it can hold all type info */
+/** Simple uniform modifier structure, assumed it can hold all type info. */
typedef struct bActionModifier {
struct bActionModifier *next, *prev;
short type, flag;
@@ -95,7 +95,7 @@ typedef struct bActionStrip {
#define ACTSTRIPMODE_BLEND 0
#define ACTSTRIPMODE_ADD 1
-/* strip->flag */
+/** #bActionStrip.flag */
typedef enum eActStrip_Flag {
ACTSTRIP_SELECT = (1 << 0),
ACTSTRIP_USESTRIDE = (1 << 1),
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 99c83b57521..0b24dfea0b0 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -38,6 +38,7 @@ struct ID;
struct Image;
struct ListBase;
struct Material;
+struct PreviewImage;
struct Tex;
struct bGPdata;
struct bNodeInstanceHash;
@@ -80,8 +81,21 @@ typedef struct bNodeStack {
#define NS_CR_FIT 4
#define NS_CR_STRETCH 5
+/** Workaround to forward-declare C++ type in C header. */
+#ifdef __cplusplus
+namespace blender::nodes {
+class NodeDeclaration;
+class SocketDeclaration;
+} // namespace blender::nodes
+using NodeDeclarationHandle = blender::nodes::NodeDeclaration;
+using SocketDeclarationHandle = blender::nodes::SocketDeclaration;
+#else
+typedef struct NodeDeclarationHandle NodeDeclarationHandle;
+typedef struct SocketDeclarationHandle SocketDeclarationHandle;
+#endif
+
typedef struct bNodeSocket {
- struct bNodeSocket *next, *prev, *new_sock;
+ struct bNodeSocket *next, *prev;
/** User-defined properties. */
IDProperty *prop;
@@ -92,15 +106,21 @@ typedef struct bNodeSocket {
/** MAX_NAME. */
char name[64];
- /* XXX deprecated, only used for the Image and OutputFile nodes,
- * should be removed at some point.
- */
- /** Custom storage. */
+ /** Only used for the Image and OutputFile nodes, should be removed at some point. */
void *storage;
- short type, flag;
- /** Max. number of links. Read via nodeSocketLinkLimit,
- * because the limit might be defined on the socket type. */
+ /**
+ * The socket's data type. #eNodeSocketDatatype.
+ */
+ short type;
+ /** #eNodeSocketFlag */
+ short flag;
+ /**
+ * Maximum number of links that can connect to the socket. Read via #nodeSocketLinkLimit, because
+ * the limit might be defined on the socket type, in which case this value does not have any
+ * effect. It is necessary to store this in the socket because it is exposed as an RNA property
+ * for custom nodes.
+ */
short limit;
/** Input/output type. */
short in_out;
@@ -109,6 +129,10 @@ typedef struct bNodeSocket {
/** Runtime type identifier. */
char idname[64];
+ /**
+ * The location of the sockets, in the view-space of the node editor.
+ * \note These are runtime data-- only calculated when drawing, and could be removed from DNA.
+ */
float locx, locy;
/** Default input value used for unlinked sockets. */
@@ -145,16 +169,26 @@ typedef struct bNodeSocket {
* restores pointer from matching own_index. */
struct bNodeSocket *groupsock DNA_DEPRECATED;
- /** A link pointer, set in ntreeUpdateTree. */
+ /** A link pointer, set in #BKE_ntree_update_main. */
struct bNodeLink *link;
/* XXX deprecated, socket input values are stored in default_value now.
* kept for forward compatibility */
/** Custom data for inputs, only UI writes in this. */
bNodeStack ns DNA_DEPRECATED;
+
+ /**
+ * References a socket declaration that is owned by `node->declaration`. This is only runtime
+ * data. It has to be updated when the node declaration changes.
+ */
+ const SocketDeclarationHandle *declaration;
+
+ /** #eNodeTreeChangedFlag. */
+ uint32_t changed_flag;
+ char _pad[4];
} bNodeSocket;
-/* sock->type */
+/** #bNodeSocket.type & #bNodeSocketType.type */
typedef enum eNodeSocketDatatype {
SOCK_CUSTOM = -1, /* socket has no integer type */
SOCK_FLOAT = 0,
@@ -173,7 +207,7 @@ typedef enum eNodeSocketDatatype {
SOCK_MATERIAL = 13,
} eNodeSocketDatatype;
-/* Socket shape. */
+/** Socket shape. */
typedef enum eNodeSocketDisplayShape {
SOCK_DISPLAY_SHAPE_CIRCLE = 0,
SOCK_DISPLAY_SHAPE_SQUARE = 1,
@@ -183,13 +217,13 @@ 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;
-/* #bNodeSocket.flag, first bit is selection. */
+/** #bNodeSocket.flag, first bit is selection. */
typedef enum eNodeSocketFlag {
/** Hidden is user defined, to hide unused sockets. */
SOCK_HIDDEN = (1 << 1),
@@ -219,19 +253,9 @@ typedef enum eNodeSocketFlag {
SOCK_HIDE_LABEL = (1 << 12),
} eNodeSocketFlag;
-/** Workaround to forward-declare C++ type in C header. */
-#ifdef __cplusplus
-namespace blender::nodes {
-class NodeDeclaration;
-}
-using NodeDeclarationHandle = blender::nodes::NodeDeclaration;
-#else
-typedef struct NodeDeclarationHandle NodeDeclarationHandle;
-#endif
-
-/* TODO: 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;
+ struct bNode *next, *prev;
/** User-defined properties. */
IDProperty *prop;
@@ -250,8 +274,9 @@ typedef struct bNode {
/** Used as a boolean for execution. */
uint8_t need_exec;
-
- char _pad[1];
+ char _pad2[5];
+ /** #eNodeTreeChangedFlag. */
+ uint32_t changed_flag;
/** Custom user-defined color. */
float color[3];
@@ -292,10 +317,8 @@ typedef struct bNode {
char _pad1[4];
- /** Entire boundbox (worldspace). */
+ /** Entire bound-box (world-space). */
rctf totr;
- /** Optional buttons area. */
- rctf butr;
/** Optional preview area. */
rctf prvr;
/**
@@ -315,8 +338,6 @@ typedef struct bNode {
char branch_tag;
/** Used at runtime when iterating over node branches. */
char iter_flag;
- /** Runtime during drawing. */
- struct uiBlock *block;
/**
* Describes the desired interface of the node. This is run-time data only.
@@ -345,7 +366,7 @@ typedef struct bNode {
#define NODE_PREVIEW 4
#define NODE_HIDDEN 8
#define NODE_ACTIVE 16
-#define NODE_ACTIVE_ID 32
+// #define NODE_ACTIVE_ID 32 /* deprecated */
/* Used to indicate which group output node is used and which viewer node is active. */
#define NODE_DO_OUTPUT 64
#define __NODE_GROUP_EDIT 128 /* DEPRECATED */
@@ -354,8 +375,7 @@ typedef struct bNode {
/* node is disabled */
#define NODE_MUTED 512
// #define NODE_CUSTOM_NAME 1024 /* deprecated! */
-/* group node types: use const outputs by default */
-#define NODE_CONST_OUTPUT (1 << 11)
+// #define NODE_CONST_OUTPUT (1 << 11) /* deprecated */
/* node is always behind others */
#define NODE_BACKGROUND (1 << 12)
/* automatic flag for nodes included in transforms */
@@ -384,10 +404,6 @@ typedef struct bNode {
#define __NODE_ACTIVE_PREVIEW (1 << 18) /* deprecated */
/* node->update */
-/* XXX NODE_UPDATE is a generic update flag. More fine-grained updates
- * might be used in the future, but currently all work the same way.
- */
-#define NODE_UPDATE 0xFFFF /* generic update flag (includes all others) */
#define NODE_UPDATE_ID 1 /* associated id data block has changed */
#define NODE_UPDATE_OPERATOR 2 /* node update triggered from update operator */
@@ -495,8 +511,12 @@ typedef struct bNodeTree {
*/
int cur_index;
int flag;
- /** Update flags. */
- int update;
+ /**
+ * Keeps track of what changed in the node tree until the next update.
+ * Should not be changed directly, instead use the functions in `BKE_node_tree_update.h`.
+ * #eNodeTreeChangedFlag.
+ */
+ uint32_t changed_flag;
/** Flag to prevent re-entrant update calls. */
short is_updating;
/** Generic temporary flag for recursion check (DFS/BFS). */
@@ -530,7 +550,11 @@ typedef struct bNodeTree {
* in case multiple different editors are used and make context ambiguous.
*/
bNodeInstanceKey active_viewer_key;
- char _pad[4];
+ /**
+ * A hash of the topology of the node tree leading up to the outputs. This is used to determine
+ * of the node tree changed in a way that requires updating geometry nodes or shaders.
+ */
+ uint32_t output_topology_hash;
/** Execution data.
*
@@ -550,19 +574,24 @@ typedef struct bNodeTree {
int (*test_break)(void *);
void (*update_draw)(void *);
void *tbh, *prh, *sdh, *udh;
+
+ /** Image representing what the node group does. */
+ struct PreviewImage *preview;
} bNodeTree;
-/* ntree->type, index */
-#define NTREE_CUSTOM -1 /* for dynamically registered custom types */
+/** #NodeTree.type, index */
+
+#define NTREE_UNDEFINED -2 /* Represents #NodeTreeTypeUndefined type. */
+#define NTREE_CUSTOM -1 /* for dynamically registered custom types */
#define NTREE_SHADER 0
#define NTREE_COMPOSIT 1
#define NTREE_TEXTURE 2
#define NTREE_GEOMETRY 3
-/* ntree->init, flag */
+/** #NodeTree.init, flag */
#define NTREE_TYPE_INIT 1
-/* ntree->flag */
+/** #NodeTree.flag */
#define NTREE_DS_EXPAND (1 << 0) /* for animation editors */
#define NTREE_COM_OPENCL (1 << 1) /* use opencl */
#define NTREE_TWO_PASS (1 << 2) /* two pass */
@@ -573,20 +602,6 @@ typedef struct bNodeTree {
/* tree is localized copy, free when deleting node groups */
/* #define NTREE_IS_LOCALIZED (1 << 5) */
-/* ntree->update */
-typedef enum eNodeTreeUpdate {
- NTREE_UPDATE = 0xFFFF, /* generic update flag (includes all others) */
- NTREE_UPDATE_LINKS = (1 << 0), /* links have been added or removed */
- NTREE_UPDATE_NODES = (1 << 1), /* nodes or sockets have been added or removed */
- NTREE_UPDATE_GROUP_IN = (1 << 4), /* group inputs have changed */
- NTREE_UPDATE_GROUP_OUT = (1 << 5), /* group outputs have changed */
- /* The field interface has changed. So e.g. an output that was always a field before is not
- * anymore. This implies that the field type inferencing has to be done again. */
- NTREE_UPDATE_FIELD_INFERENCING = (1 << 6),
- /* group has changed (generic flag including all other group flags) */
- NTREE_UPDATE_GROUP = (NTREE_UPDATE_GROUP_IN | NTREE_UPDATE_GROUP_OUT),
-} eNodeTreeUpdate;
-
/* tree->execution_mode */
typedef enum eNodeTreeExecutionMode {
NTREE_EXECUTION_MODE_TILED = 0,
@@ -653,7 +668,8 @@ typedef struct bNodeSocketValueMaterial {
struct Material *value;
} bNodeSocketValueMaterial;
-/* Data structs, for node->storage. */
+/* Data structs, for `node->storage`. */
+
enum {
CMP_NODE_MASKTYPE_ADD = 0,
CMP_NODE_MASKTYPE_SUBTRACT = 1,
@@ -692,7 +708,7 @@ typedef struct NodeFrame {
short label_size;
} NodeFrame;
-/* This one has been replaced with ImageUser, keep it for do_versions(). */
+/** \note This one has been replaced with #ImageUser, keep it for do_versions(). */
typedef struct NodeImageAnim {
int frames DNA_DEPRECATED;
int sfra DNA_DEPRECATED;
@@ -746,7 +762,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;
@@ -784,7 +800,7 @@ typedef struct NodeAntiAliasingData {
float corner_rounding;
} NodeAntiAliasingData;
-/* NOTE: Only for do-version code. */
+/** \note Only for do-version code. */
typedef struct NodeHueSat {
float hue, sat, val;
} NodeHueSat;
@@ -796,7 +812,9 @@ typedef struct NodeImageFile {
int sfra, efra;
} NodeImageFile;
-/* XXX first struct fields should match NodeImageFile to ensure forward compatibility */
+/**
+ * XXX: first struct fields should match #NodeImageFile to ensure forward compatibility.
+ */
typedef struct NodeImageMultiFile {
/** 1024 = FILE_MAX. */
char base_path[1024];
@@ -904,6 +922,11 @@ typedef struct NodeColorspill {
float uspillr, uspillg, uspillb;
} NodeColorspill;
+typedef struct NodeConvertColorSpace {
+ char from_color_space[64];
+ char to_color_space[64];
+} NodeConvertColorSpace;
+
typedef struct NodeDilateErode {
char falloff;
} NodeDilateErode;
@@ -1045,7 +1068,7 @@ typedef struct NodeShaderPrincipled {
char _pad[3];
} NodeShaderPrincipled;
-/* TEX_output */
+/** TEX_output. */
typedef struct TexNodeOutput {
char name[64];
} TexNodeOutput;
@@ -1183,6 +1206,16 @@ typedef struct NodeDenoise {
char prefilter;
} NodeDenoise;
+typedef struct NodeMapRange {
+ /* CustomDataType */
+ uint8_t data_type;
+
+ /* NodeMapRangeType. */
+ uint8_t interpolation_type;
+ uint8_t clamp;
+ char _pad[5];
+} NodeMapRange;
+
typedef struct NodeAttributeClamp {
/* CustomDataType. */
uint8_t data_type;
@@ -1235,6 +1268,13 @@ typedef struct NodeRandomValue {
uint8_t data_type;
} NodeRandomValue;
+typedef struct NodeAccumulateField {
+ /* CustomDataType. */
+ uint8_t data_type;
+ /* AttributeDomain. */
+ uint8_t domain;
+} NodeAccumulateField;
+
typedef struct NodeAttributeRandomize {
/* CustomDataType. */
uint8_t data_type;
@@ -1280,10 +1320,22 @@ typedef struct NodeAttributeCurveMap {
CurveMapping *curve_rgb;
} NodeAttributeCurveMap;
+typedef struct NodeInputBool {
+ uint8_t boolean;
+} NodeInputBool;
+
+typedef struct NodeInputInt {
+ int integer;
+} NodeInputInt;
+
typedef struct NodeInputVector {
float vector[3];
} NodeInputVector;
+typedef struct NodeInputColor {
+ float color[4];
+} NodeInputColor;
+
typedef struct NodeInputString {
char *string;
} NodeInputString;
@@ -1322,6 +1374,11 @@ typedef struct NodeGeometryPointTranslate {
uint8_t input_type;
} NodeGeometryPointTranslate;
+typedef struct NodeGeometryExtrudeMesh {
+ /* GeometryNodeExtrudeMeshMode */
+ uint8_t mode;
+} NodeGeometryExtrudeMesh;
+
typedef struct NodeGeometryObjectInfo {
/* GeometryNodeTransformSpace. */
uint8_t transform_space;
@@ -1421,6 +1478,11 @@ typedef struct NodeGeometryCurveSplineType {
uint8_t spline_type;
} NodeGeometryCurveSplineType;
+typedef struct NodeGeometrySetCurveHandlePositions {
+ /* GeometryNodeCurveHandleMode. */
+ uint8_t mode;
+} NodeGeometrySetCurveHandlePositions;
+
typedef struct NodeGeometryCurveSetHandles {
/* GeometryNodeCurveHandleType. */
uint8_t handle_type;
@@ -1435,6 +1497,11 @@ typedef struct NodeGeometryCurveSelectHandles {
uint8_t mode;
} NodeGeometryCurveSelectHandles;
+typedef struct NodeGeometryCurvePrimitiveArc {
+ /* GeometryNodeCurvePrimitiveArcMode. */
+ uint8_t mode;
+} NodeGeometryCurvePrimitiveArc;
+
typedef struct NodeGeometryCurvePrimitiveLine {
/* GeometryNodeCurvePrimitiveLineMode. */
uint8_t mode;
@@ -1492,13 +1559,27 @@ typedef struct NodeGeometryAttributeTransfer {
uint8_t mapping;
} NodeGeometryAttributeTransfer;
+typedef struct NodeGeometryTransferAttribute {
+ /* CustomDataType. */
+ int8_t data_type;
+ /* AttributeDomain. */
+ int8_t domain;
+ /* GeometryNodeAttributeTransferMode. */
+ uint8_t mode;
+ char _pad[1];
+} NodeGeometryTransferAttribute;
+
typedef struct NodeGeometryRaycast {
/* GeometryNodeRaycastMapMode. */
uint8_t mapping;
+ /* CustomDataType. */
+ int8_t data_type;
+
+ /* Deprecated input types in new Ray-cast node. Can be removed when legacy nodes are no longer
+ * supported. */
uint8_t input_type_ray_direction;
uint8_t input_type_ray_length;
- char _pad[1];
} NodeGeometryRaycast;
typedef struct NodeGeometryCurveFill {
@@ -1527,6 +1608,38 @@ typedef struct NodeGeometryStringToCurves {
char _pad[1];
} NodeGeometryStringToCurves;
+typedef struct NodeGeometryDeleteGeometry {
+ /* AttributeDomain. */
+ int8_t domain;
+ /* GeometryNodeDeleteGeometryMode. */
+ int8_t mode;
+} NodeGeometryDeleteGeometry;
+
+typedef struct NodeGeometrySeparateGeometry {
+ /* AttributeDomain. */
+ int8_t domain;
+} NodeGeometrySeparateGeometry;
+
+typedef struct NodeGeometryImageTexture {
+ int interpolation;
+ int extension;
+} NodeGeometryImageTexture;
+
+typedef struct NodeGeometryViewer {
+ /* CustomDataType. */
+ int8_t data_type;
+} NodeGeometryViewer;
+
+typedef struct NodeFunctionCompare {
+ /* NodeCompareOperation */
+ int8_t operation;
+ /* eNodeSocketDatatype */
+ int8_t data_type;
+ /* NodeCompareMode */
+ int8_t mode;
+ char _pad[1];
+} NodeFunctionCompare;
+
/* script node mode */
#define NODE_SCRIPT_INTERNAL 0
#define NODE_SCRIPT_EXTERNAL 1
@@ -1538,14 +1651,17 @@ typedef struct NodeGeometryStringToCurves {
#define NODE_IES_INTERNAL 0
#define NODE_IES_EXTERNAL 1
-/* frame node flags */
+/* Frame node flags. */
+
#define NODE_FRAME_SHRINK 1 /* keep the bounding box minimal */
#define NODE_FRAME_RESIZEABLE 2 /* test flag, if frame can be resized by user */
-/* proxy node flags */
+/* Proxy node flags. */
+
#define NODE_PROXY_AUTOTYPE 1 /* automatically change output type based on link */
-/* comp channel matte */
+/* Comp channel matte. */
+
#define CMP_NODE_CHANNEL_MATTE_CS_RGB 1
#define CMP_NODE_CHANNEL_MATTE_CS_HSV 2
#define CMP_NODE_CHANNEL_MATTE_CS_YUV 3
@@ -1567,7 +1683,7 @@ typedef struct NodeGeometryStringToCurves {
#define SHD_VECT_TRANSFORM_SPACE_OBJECT 1
#define SHD_VECT_TRANSFORM_SPACE_CAMERA 2
-/* attribute */
+/** #NodeShaderAttribute.type */
enum {
SHD_ATTRIBUTE_GEOMETRY = 0,
SHD_ATTRIBUTE_OBJECT = 1,
@@ -1701,7 +1817,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,
@@ -1709,7 +1825,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,
@@ -1721,7 +1837,6 @@ enum {
/* math node clamp */
#define SHD_MATH_CLAMP 1
-/* Math node operations. */
typedef enum NodeMathOperation {
NODE_MATH_ADD = 0,
NODE_MATH_SUBTRACT = 1,
@@ -1765,7 +1880,6 @@ typedef enum NodeMathOperation {
NODE_MATH_SMOOTH_MAX = 39,
} NodeMathOperation;
-/* Vector Math node operations. */
typedef enum NodeVectorMathOperation {
NODE_VECTOR_MATH_ADD = 0,
NODE_VECTOR_MATH_SUBTRACT = 1,
@@ -1799,24 +1913,39 @@ typedef enum NodeVectorMathOperation {
NODE_VECTOR_MATH_MULTIPLY_ADD = 26,
} NodeVectorMathOperation;
-/* Boolean math node operations. */
-enum {
+typedef enum NodeBooleanMathOperation {
NODE_BOOLEAN_MATH_AND = 0,
NODE_BOOLEAN_MATH_OR = 1,
NODE_BOOLEAN_MATH_NOT = 2,
-};
-/* Float compare node operations. */
-typedef enum FloatCompareOperation {
- NODE_FLOAT_COMPARE_LESS_THAN = 0,
- NODE_FLOAT_COMPARE_LESS_EQUAL = 1,
- NODE_FLOAT_COMPARE_GREATER_THAN = 2,
- NODE_FLOAT_COMPARE_GREATER_EQUAL = 3,
- NODE_FLOAT_COMPARE_EQUAL = 4,
- NODE_FLOAT_COMPARE_NOT_EQUAL = 5,
-} FloatCompareOperation;
-
-/* Float to Int node operations. */
+ NODE_BOOLEAN_MATH_NAND = 3,
+ NODE_BOOLEAN_MATH_NOR = 4,
+ NODE_BOOLEAN_MATH_XNOR = 5,
+ NODE_BOOLEAN_MATH_XOR = 6,
+
+ NODE_BOOLEAN_MATH_IMPLY = 7,
+ NODE_BOOLEAN_MATH_NIMPLY = 8,
+} NodeBooleanMathOperation;
+
+typedef enum NodeCompareMode {
+ NODE_COMPARE_MODE_ELEMENT = 0,
+ NODE_COMPARE_MODE_LENGTH = 1,
+ NODE_COMPARE_MODE_AVERAGE = 2,
+ NODE_COMPARE_MODE_DOT_PRODUCT = 3,
+ NODE_COMPARE_MODE_DIRECTION = 4
+} NodeCompareMode;
+
+typedef enum NodeCompareOperation {
+ NODE_COMPARE_LESS_THAN = 0,
+ NODE_COMPARE_LESS_EQUAL = 1,
+ NODE_COMPARE_GREATER_THAN = 2,
+ NODE_COMPARE_GREATER_EQUAL = 3,
+ NODE_COMPARE_EQUAL = 4,
+ NODE_COMPARE_NOT_EQUAL = 5,
+ NODE_COMPARE_COLOR_BRIGHTER = 6,
+ NODE_COMPARE_COLOR_DARKER = 7,
+} NodeCompareOperation;
+
typedef enum FloatToIntRoundingMode {
FN_NODE_FLOAT_TO_INT_ROUND = 0,
FN_NODE_FLOAT_TO_INT_FLOOR = 1,
@@ -1824,13 +1953,13 @@ typedef enum FloatToIntRoundingMode {
FN_NODE_FLOAT_TO_INT_TRUNCATE = 3,
} FloatToIntRoundingMode;
-/* Clamp node types. */
+/** Clamp node types. */
enum {
NODE_CLAMP_MINMAX = 0,
NODE_CLAMP_RANGE = 1,
};
-/* Map range node types. */
+/** Map range node types. */
enum {
NODE_MAP_RANGE_LINEAR = 0,
NODE_MAP_RANGE_STEPPED = 1,
@@ -1842,14 +1971,15 @@ enum {
#define SHD_MIXRGB_USE_ALPHA 1
#define SHD_MIXRGB_CLAMP 2
-/* subsurface */
+/* Subsurface. */
+
enum {
#ifdef DNA_DEPRECATED_ALLOW
SHD_SUBSURFACE_COMPATIBLE = 0, /* Deprecated */
SHD_SUBSURFACE_CUBIC = 1,
SHD_SUBSURFACE_GAUSSIAN = 2,
#endif
- SHD_SUBSURFACE_DIFFUSION = 3,
+ SHD_SUBSURFACE_BURLEY = 3,
SHD_SUBSURFACE_RANDOM_WALK_FIXED_RADIUS = 4,
SHD_SUBSURFACE_RANDOM_WALK = 5,
};
@@ -1873,25 +2003,29 @@ enum {
/* viewer and composite output. */
#define CMP_NODE_OUTPUT_IGNORE_ALPHA 1
-/* Plane track deform node */
+/* Plane track deform node. */
+
enum {
CMP_NODEFLAG_PLANETRACKDEFORM_MOTION_BLUR = 1,
};
-/* Stabilization node */
+/* Stabilization node. */
+
enum {
CMP_NODEFLAG_STABILIZE_INVERSE = 1,
};
/* Set Alpha Node. */
-/* `NodeSetAlpha.mode` */
+
+/** #NodeSetAlpha.mode */
typedef enum CMPNodeSetAlphaMode {
CMP_NODE_SETALPHA_MODE_APPLY = 0,
CMP_NODE_SETALPHA_MODE_REPLACE_ALPHA = 1,
} CMPNodeSetAlphaMode;
/* Denoise Node. */
-/* `NodeDenoise.prefilter` */
+
+/** #NodeDenoise.prefilter */
typedef enum CMPNodeDenoisePrefilter {
CMP_NODE_DENOISE_PREFILTER_FAST = 0,
CMP_NODE_DENOISE_PREFILTER_NONE = 1,
@@ -1985,6 +2119,7 @@ typedef enum GeometryNodeTriangulateQuads {
GEO_NODE_TRIANGULATE_QUAD_FIXED = 1,
GEO_NODE_TRIANGULATE_QUAD_ALTERNATE = 2,
GEO_NODE_TRIANGULATE_QUAD_SHORTEDGE = 3,
+ GEO_NODE_TRIANGULATE_QUAD_LONGEDGE = 4,
} GeometryNodeTriangulateQuads;
typedef enum GeometryNodePointInstanceType {
@@ -2016,11 +2151,22 @@ typedef enum GeometryNodeDistributePointsOnFacesMode {
GEO_NODE_POINT_DISTRIBUTE_POINTS_ON_FACES_POISSON = 1,
} GeometryNodeDistributePointsOnFacesMode;
+typedef enum GeometryNodeExtrudeMeshMode {
+ GEO_NODE_EXTRUDE_MESH_VERTICES = 0,
+ GEO_NODE_EXTRUDE_MESH_EDGES = 1,
+ GEO_NODE_EXTRUDE_MESH_FACES = 2,
+} GeometryNodeExtrudeMeshMode;
+
typedef enum GeometryNodeRotatePointsType {
GEO_NODE_POINT_ROTATE_TYPE_EULER = 0,
GEO_NODE_POINT_ROTATE_TYPE_AXIS_ANGLE = 1,
} GeometryNodeRotatePointsType;
+typedef enum FunctionNodeRotatePointsType {
+ FN_NODE_ROTATE_EULER_TYPE_EULER = 0,
+ FN_NODE_ROTATE_EULER_TYPE_AXIS_ANGLE = 1,
+} FunctionNodeRotatePointsType;
+
typedef enum GeometryNodeAttributeVectorRotateMode {
GEO_NODE_VECTOR_ROTATE_TYPE_AXIS = 0,
GEO_NODE_VECTOR_ROTATE_TYPE_AXIS_X = 1,
@@ -2041,6 +2187,11 @@ typedef enum GeometryNodeRotatePointsSpace {
GEO_NODE_POINT_ROTATE_SPACE_POINT = 1,
} GeometryNodeRotatePointsSpace;
+typedef enum FunctionNodeRotateEulerSpace {
+ FN_NODE_ROTATE_EULER_SPACE_OBJECT = 0,
+ FN_NODE_ROTATE_EULER_SPACE_LOCAL = 1,
+} FunctionNodeRotateEulerSpace;
+
typedef enum GeometryNodeAlignRotationToVectorAxis {
GEO_NODE_ALIGN_ROTATION_TO_VECTOR_AXIS_X = 0,
GEO_NODE_ALIGN_ROTATION_TO_VECTOR_AXIS_Y = 1,
@@ -2054,6 +2205,19 @@ typedef enum GeometryNodeAlignRotationToVectorPivotAxis {
GEO_NODE_ALIGN_ROTATION_TO_VECTOR_PIVOT_AXIS_Z = 3,
} GeometryNodeAlignRotationToVectorPivotAxis;
+typedef enum NodeAlignEulerToVectorAxis {
+ FN_NODE_ALIGN_EULER_TO_VECTOR_AXIS_X = 0,
+ FN_NODE_ALIGN_EULER_TO_VECTOR_AXIS_Y = 1,
+ FN_NODE_ALIGN_EULER_TO_VECTOR_AXIS_Z = 2,
+} NodeAlignEulerToVectorAxis;
+
+typedef enum NodeAlignEulerToVectorPivotAxis {
+ FN_NODE_ALIGN_EULER_TO_VECTOR_PIVOT_AXIS_AUTO = 0,
+ FN_NODE_ALIGN_EULER_TO_VECTOR_PIVOT_AXIS_X = 1,
+ FN_NODE_ALIGN_EULER_TO_VECTOR_PIVOT_AXIS_Y = 2,
+ FN_NODE_ALIGN_EULER_TO_VECTOR_PIVOT_AXIS_Z = 3,
+} NodeAlignEulerToVectorPivotAxis;
+
typedef enum GeometryNodeTransformSpace {
GEO_NODE_TRANSFORM_SPACE_ORIGINAL = 0,
GEO_NODE_TRANSFORM_SPACE_RELATIVE = 1,
@@ -2080,6 +2244,11 @@ typedef enum GeometryNodeMeshLineCountMode {
GEO_NODE_MESH_LINE_COUNT_RESOLUTION = 1,
} GeometryNodeMeshLineCountMode;
+typedef enum GeometryNodeCurvePrimitiveArcMode {
+ GEO_NODE_CURVE_PRIMITIVE_ARC_TYPE_POINTS = 0,
+ GEO_NODE_CURVE_PRIMITIVE_ARC_TYPE_RADIUS = 1,
+} GeometryNodeCurvePrimitiveArcMode;
+
typedef enum GeometryNodeCurvePrimitiveLineMode {
GEO_NODE_CURVE_PRIMITIVE_LINE_MODE_POINTS = 0,
GEO_NODE_CURVE_PRIMITIVE_LINE_MODE_DIRECTION = 1
@@ -2115,9 +2284,15 @@ typedef enum GeometryNodeCurveFilletMode {
} GeometryNodeCurveFilletMode;
typedef enum GeometryNodeAttributeTransferMapMode {
+ GEO_NODE_LEGACY_ATTRIBUTE_TRANSFER_NEAREST_FACE_INTERPOLATED = 0,
+ GEO_NODE_LEGACY_ATTRIBUTE_TRANSFER_NEAREST = 1,
+} GeometryNodeAttributeTransferMapMode;
+
+typedef enum GeometryNodeAttributeTransferMode {
GEO_NODE_ATTRIBUTE_TRANSFER_NEAREST_FACE_INTERPOLATED = 0,
GEO_NODE_ATTRIBUTE_TRANSFER_NEAREST = 1,
-} GeometryNodeAttributeTransferMapMode;
+ GEO_NODE_ATTRIBUTE_TRANSFER_INDEX = 2,
+} GeometryNodeAttributeTransferMode;
typedef enum GeometryNodeRaycastMapMode {
GEO_NODE_RAYCAST_INTERPOLATED = 0,
@@ -2158,6 +2333,21 @@ typedef enum GeometryNodeStringToCurvesAlignYMode {
GEO_NODE_STRING_TO_CURVES_ALIGN_Y_BOTTOM = 4,
} GeometryNodeStringToCurvesAlignYMode;
+typedef enum GeometryNodeDeleteGeometryMode {
+ GEO_NODE_DELETE_GEOMETRY_MODE_ALL = 0,
+ GEO_NODE_DELETE_GEOMETRY_MODE_EDGE_FACE = 1,
+ GEO_NODE_DELETE_GEOMETRY_MODE_ONLY_FACE = 2,
+} GeometryNodeDeleteGeometryMode;
+
+typedef enum GeometryNodeRealizeInstancesFlag {
+ GEO_NODE_REALIZE_INSTANCES_LEGACY_BEHAVIOR = (1 << 0),
+} GeometryNodeRealizeInstancesFlag;
+
+typedef enum GeometryNodeScaleElementsMode {
+ GEO_NODE_SCALE_ELEMENTS_UNIFORM = 0,
+ GEO_NODE_SCALE_ELEMENTS_SINGLE_AXIS = 1,
+} GeometryNodeScaleElementsMode;
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/makesdna/DNA_object_force_types.h b/source/blender/makesdna/DNA_object_force_types.h
index fcaac4ded76..7d0d4c0d460 100644
--- a/source/blender/makesdna/DNA_object_force_types.h
+++ b/source/blender/makesdna/DNA_object_force_types.h
@@ -30,7 +30,9 @@
extern "C" {
#endif
-/* pd->forcefield: Effector Fields types */
+struct BodySpring;
+
+/** #PartDeflect.forcefield: Effector Fields types. */
typedef enum ePFieldType {
/** (this is used for general effector weight). */
PFIELD_NULL = 0,
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 5a88ce7c9f5..602f968634e 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -57,7 +57,7 @@ struct SculptSession;
struct SoftBody;
struct bGPdata;
-/* Vertex Groups - Name Info */
+/** Vertex Groups - Name Info */
typedef struct bDeformGroup {
struct bDeformGroup *next, *prev;
/** MAX_VGROUP_NAME. */
@@ -66,7 +66,7 @@ typedef struct bDeformGroup {
char flag, _pad0[7];
} bDeformGroup;
-/* Face Maps. */
+/** Face Maps. */
typedef struct bFaceMap {
struct bFaceMap *next, *prev;
/** MAX_VGROUP_NAME. */
@@ -107,7 +107,7 @@ typedef struct BoundBox {
char _pad0[4];
} BoundBox;
-/* boundbox flag */
+/** #BoundBox.flag */
enum {
BOUNDBOX_DISABLED = (1 << 0),
BOUNDBOX_DIRTY = (1 << 1),
@@ -115,7 +115,7 @@ enum {
struct CustomData_MeshMasks;
-/* Not saved in file! */
+/** Not saved in file! */
typedef struct Object_Runtime {
/**
* The custom data layer mask that was last used
@@ -126,7 +126,12 @@ typedef struct Object_Runtime {
/** Did last modifier stack generation need mapping support? */
char last_need_mapping;
- char _pad0[3];
+ /** Opaque data reserved for management of objects in collection context.
+ * E.g. used currently to check for potential duplicates of objects in a collection, after
+ * remapping process. */
+ char collection_management;
+
+ char _pad0[2];
/** Only used for drawing the parent/child help-line. */
float parent_display_origin[3];
@@ -147,7 +152,7 @@ typedef struct Object_Runtime {
/** Start time of the mode transfer overlay animation. */
double overlay_mode_transfer_start_time;
- /** Axis aligned boundbox (in localspace). */
+ /** Axis aligned bound-box (in local-space). */
struct BoundBox *bb;
/**
@@ -176,6 +181,12 @@ typedef struct Object_Runtime {
*/
struct Mesh *mesh_deform_eval;
+ /* Evaluated mesh cage in edit mode. */
+ struct Mesh *editmesh_eval_cage;
+
+ /** Cached cage bounding box of `editmesh_eval_cage` for selection. */
+ struct BoundBox *editmesh_bb_cage;
+
/**
* Original grease pencil bGPdata pointer, before object->data was changed to point
* to gpd_eval.
@@ -205,6 +216,12 @@ typedef struct Object_Runtime {
unsigned short local_collections_bits;
short _pad2[3];
+
+ float (*crazyspace_deform_imats)[3][3];
+ float (*crazyspace_deform_cos)[3];
+ int crazyspace_num_verts;
+
+ int _pad3[3];
} Object_Runtime;
typedef struct ObjectLineArt {
@@ -246,7 +263,7 @@ typedef struct Object {
/** String describing subobject info, MAX_ID_NAME-2. */
char parsubstr[64];
struct Object *parent, *track;
- /* if ob->proxy (or proxy_group), this object is proxy for object ob->proxy */
+ /* If `ob->proxy` (or proxy_group), this object is proxy for object `ob->proxy`. */
/* proxy_from is set in target back to the proxy. */
struct Object *proxy, *proxy_group, *proxy_from;
/** Old animation system, deprecated for 2.5. */
@@ -311,7 +328,7 @@ typedef struct Object {
float rotAxis[3], drotAxis[3];
/** Axis angle rotation - angle part. */
float rotAngle, drotAngle;
- /** Final worldspace matrix with constraints & animsys applied. */
+ /** Final world-space matrix with constraints & animsys applied. */
float obmat[4][4];
/** Inverse result of parent, so that object doesn't 'stick' to parent. */
float parentinv[4][4];
@@ -322,8 +339,7 @@ typedef struct Object {
* Inverse matrix of 'obmat' for any other use than rendering!
*
* \note this isn't assured to be valid as with 'obmat',
- * before using this value you should do...
- * invert_m4_m4(ob->imat, ob->obmat);
+ * before using this value you should do: `invert_m4_m4(ob->imat, ob->obmat)`
*/
float imat[4][4];
@@ -436,7 +452,7 @@ typedef struct Object {
Object_Runtime runtime;
} Object;
-/* Warning, this is not used anymore because hooks are now modifiers */
+/** DEPRECATED: this is not used anymore because hooks are now modifiers. */
typedef struct ObHook {
struct ObHook *next, *prev;
@@ -466,7 +482,7 @@ typedef struct ObHook {
/* used many places, should be specialized. */
#define SELECT 1
-/* type */
+/** #Object.type */
enum {
OB_EMPTY = 0,
OB_MESH = 1,
@@ -501,6 +517,9 @@ enum {
/* check if the object type supports materials */
#define OB_TYPE_SUPPORT_MATERIAL(_type) \
(((_type) >= OB_MESH && (_type) <= OB_MBALL) || ((_type) >= OB_GPENCIL && (_type) <= OB_VOLUME))
+/** Does the object have some render-able geometry (unlike empties, cameras, etc.). */
+#define OB_TYPE_IS_GEOMETRY(_type) \
+ (ELEM(_type, OB_MESH, OB_SURF, OB_FONT, OB_MBALL, OB_GPENCIL, OB_HAIR, OB_POINTCLOUD, OB_VOLUME))
#define OB_TYPE_SUPPORT_VGROUP(_type) (ELEM(_type, OB_MESH, OB_LATTICE, OB_GPENCIL))
#define OB_TYPE_SUPPORT_EDITMODE(_type) \
(ELEM(_type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE))
@@ -541,7 +560,7 @@ enum {
case ID_PT: \
case ID_VO
-/* partype: first 4 bits: type */
+/** #Object.partype: first 4 bits: type. */
enum {
PARTYPE = (1 << 4) - 1,
PAROBJECT = 0,
@@ -552,7 +571,7 @@ enum {
};
-/* (short) transflag */
+/** #Object.transflag (short) */
enum {
OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK = 1 << 0,
OB_TRANSFLAG_UNUSED_1 = 1 << 1, /* cleared */
@@ -574,7 +593,7 @@ enum {
OB_DUPLI = OB_DUPLIVERTS | OB_DUPLICOLLECTION | OB_DUPLIFACES | OB_DUPLIPARTS,
};
-/* (short) trackflag / upflag */
+/** #Object.trackflag / #Object.upflag (short) */
enum {
OB_POSX = 0,
OB_POSY = 1,
@@ -584,7 +603,7 @@ enum {
OB_NEGZ = 5,
};
-/* dtx: flags (short) */
+/** #Object.dtx draw type extra flags (short) */
enum {
OB_DRAWBOUNDOX = 1 << 0,
OB_AXIS = 1 << 1,
@@ -603,7 +622,7 @@ enum {
OB_USE_GPENCIL_LIGHTS = 1 << 10,
};
-/* empty_drawtype: no flags */
+/** #Object.empty_drawtype: no flags */
enum {
OB_ARROWS = 1,
OB_PLAINAXES = 2,
@@ -615,7 +634,10 @@ enum {
OB_EMPTY_IMAGE = 8,
};
-/* gpencil add types */
+/**
+ * Grease-pencil add types.
+ * TODO: doesn't need to be DNA, local to `OBJECT_OT_gpencil_add`.
+ */
enum {
GP_EMPTY = 0,
GP_STROKE = 1,
@@ -625,7 +647,7 @@ enum {
GP_LRT_COLLECTION = 5,
};
-/* boundtype */
+/** #Object.boundtype */
enum {
OB_BOUND_BOX = 0,
OB_BOUND_SPHERE = 1,
@@ -639,7 +661,7 @@ enum {
/* **************** BASE ********************* */
-/* base->flag_legacy */
+/** #Base.flag_legacy */
enum {
BA_WAS_SEL = (1 << 1),
/* NOTE: BA_HAS_RECALC_DATA can be re-used later if freed in readfile.c. */
@@ -668,7 +690,7 @@ enum {
# define OB_FLAG_UNUSED_12 (1 << 12) /* cleared */
#endif
-/* ob->visibility_flag */
+/** #Object.visibility_flag */
enum {
OB_HIDE_VIEWPORT = 1 << 0,
OB_HIDE_SELECT = 1 << 1,
@@ -683,7 +705,7 @@ enum {
OB_SHADOW_CATCHER = 1 << 10
};
-/* ob->shapeflag */
+/** #Object.shapeflag */
enum {
OB_SHAPE_LOCK = 1 << 0,
#ifdef DNA_DEPRECATED_ALLOW
@@ -692,7 +714,7 @@ enum {
OB_SHAPE_EDIT_MODE = 1 << 2,
};
-/* ob->nlaflag */
+/** #Object.nlaflag */
enum {
OB_ADS_UNUSED_1 = 1 << 0, /* cleared */
OB_ADS_UNUSED_2 = 1 << 1, /* cleared */
@@ -708,7 +730,7 @@ enum {
/* OB_ADS_SHOWPARTS = 1 << 14, */ /* UNUSED */
};
-/* ob->protectflag */
+/** #Object.protectflag */
enum {
OB_LOCK_LOCX = 1 << 0,
OB_LOCK_LOCY = 1 << 1,
@@ -726,13 +748,13 @@ enum {
OB_LOCK_ROT4D = 1 << 10,
};
-/* ob->duplicator_visibility_flag */
+/** #Object.duplicator_visibility_flag */
enum {
OB_DUPLI_FLAG_VIEWPORT = 1 << 0,
OB_DUPLI_FLAG_RENDER = 1 << 1,
};
-/* ob->empty_image_depth */
+/** #Object.empty_image_depth */
#define OB_EMPTY_IMAGE_DEPTH_DEFAULT 0
#define OB_EMPTY_IMAGE_DEPTH_FRONT 1
#define OB_EMPTY_IMAGE_DEPTH_BACK 2
diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h
index ebf3d4a248c..a50d0524998 100644
--- a/source/blender/makesdna/DNA_outliner_types.h
+++ b/source/blender/makesdna/DNA_outliner_types.h
@@ -41,13 +41,13 @@ typedef struct TreeStoreElem {
/** Used only to store data in blend files. */
typedef struct TreeStore {
- /** Was previously used for memory preallocation. */
+ /** Was previously used for memory pre-allocation. */
int totelem DNA_DEPRECATED;
/** Number of elements in data array. */
int usedelem;
/**
- * Elements to be packed from mempool in writefile.c
- * or extracted to mempool in readfile.c
+ * Elements to be packed from mempool in `writefile.c`
+ * or extracted to mempool in `readfile.c`.
*/
TreeStoreElem *data;
} TreeStore;
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index a51c532dfb3..5add664f624 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -72,7 +72,7 @@ typedef struct ParticleSpring {
unsigned int particle_index[2], delete_flag;
} ParticleSpring;
-/* Child particles are created around or between parent particles */
+/** Child particles are created around or between parent particles. */
typedef struct ChildParticle {
/** Face index on the final derived mesh. */
int num;
@@ -364,8 +364,7 @@ typedef struct ParticleSystem {
int flag, totpart, totunexist, totchild, totcached, totchildcache;
/* NOTE: Recalc is one of ID_RECALC_PSYS_ALL flags.
*
- * TODO(sergey): Use part->id.recalc instead of this duplicated flag
- * somehow. */
+ * TODO(sergey): Use #ParticleSettings.id.recalc instead of this duplicated flag somehow. */
int recalc;
short target_psys, totkeyed, bakespace;
char _pad1[6];
@@ -438,9 +437,11 @@ typedef enum eParticleDrawFlag {
PART_DRAW_HAIR_GRID = (1 << 18),
} eParticleDrawFlag;
-/* part->type
+/**
+ * #ParticleSettings.type
* Hair is always baked static in object/geometry space.
- * Other types (normal particles) are in global space and not static baked. */
+ * Other types (normal particles) are in global space and not static baked.
+ */
enum {
PART_EMITTER = 0,
/* REACTOR type currently unused */
@@ -458,7 +459,7 @@ enum {
PART_FLUID_SPRAYFOAMBUBBLE = 12,
};
-/* Mirroring Mantaflow particle types from particle.h (Mantaflow header). */
+/** Mirroring Mantaflow particle types from particle.h (Mantaflow header). */
enum {
/* PARTICLE_TYPE_NONE = (0 << 0), */ /* UNUSED */
/* PARTICLE_TYPE_NEW = (1 << 0), */ /* UNUSED */
@@ -470,7 +471,7 @@ enum {
/* PARTICLE_TYPE_INVALID = (1 << 30), */ /* UNUSED */
};
-/* part->flag */
+/** #ParticleSettings.flag */
#define PART_REACT_STA_END 1
#define PART_REACT_MULTIPLE 2
@@ -514,26 +515,26 @@ enum {
#define PART_SELF_EFFECT (1 << 22)
-/* part->from */
+/** #ParticleSettings.from */
#define PART_FROM_VERT 0
#define PART_FROM_FACE 1
#define PART_FROM_VOLUME 2
/* #define PART_FROM_PARTICLE 3 deprecated! */
#define PART_FROM_CHILD 4
-/* part->distr */
+/** #ParticleSettings.distr */
#define PART_DISTR_JIT 0
#define PART_DISTR_RAND 1
#define PART_DISTR_GRID 2
-/* part->phystype */
+/** #ParticleSettings.phystype */
#define PART_PHYS_NO 0
#define PART_PHYS_NEWTON 1
#define PART_PHYS_KEYED 2
#define PART_PHYS_BOIDS 3
#define PART_PHYS_FLUID 4
-/* part->kink */
+/** #ParticleSettings.kink */
typedef enum eParticleKink {
PART_KINK_NO = 0,
PART_KINK_CURL = 1,
@@ -543,7 +544,7 @@ typedef enum eParticleKink {
PART_KINK_SPIRAL = 5,
} eParticleKink;
-/* part->child_flag */
+/** #ParticleSettings.child_flag */
typedef enum eParticleChildFlag {
PART_CHILD_USE_CLUMP_NOISE = (1 << 0),
PART_CHILD_USE_CLUMP_CURVE = (1 << 1),
@@ -551,22 +552,22 @@ typedef enum eParticleChildFlag {
PART_CHILD_USE_TWIST_CURVE = (1 << 3),
} eParticleChildFlag;
-/* part->shape_flag */
+/** #ParticleSettings.shape_flag */
typedef enum eParticleShapeFlag {
PART_SHAPE_CLOSE_TIP = (1 << 0),
} eParticleShapeFlag;
-/* part->draw_col */
+/* #ParticleSettings.draw_col */
#define PART_DRAW_COL_NONE 0
#define PART_DRAW_COL_MAT 1
#define PART_DRAW_COL_VEL 2
#define PART_DRAW_COL_ACC 3
-/* part->time_flag */
+/* #ParticleSettings.time_flag */
#define PART_TIME_AUTOSF 1 /* Automatic subframes */
-/* part->draw_as */
-/* part->ren_as */
+/* #ParticleSettings.draw_as */
+/* #ParticleSettings.ren_as */
#define PART_DRAW_NOT 0
#define PART_DRAW_DOT 1
#define PART_DRAW_HALO 1
@@ -580,13 +581,13 @@ typedef enum eParticleShapeFlag {
#define PART_DRAW_BB 9 /* deprecated */
#define PART_DRAW_REND 10
-/* part->integrator */
+/* #ParticleSettings.integrator */
#define PART_INT_EULER 0
#define PART_INT_MIDPOINT 1
#define PART_INT_RK4 2
#define PART_INT_VERLET 3
-/* part->rotmode */
+/* #ParticleSettings.rotmode */
#define PART_ROT_NOR 1
#define PART_ROT_VEL 2
#define PART_ROT_GLOB_X 3
@@ -597,7 +598,7 @@ typedef enum eParticleShapeFlag {
#define PART_ROT_OB_Z 8
#define PART_ROT_NOR_TAN 9
-/* part->avemode */
+/* #ParticleSettings.avemode */
#define PART_AVE_VELOCITY 1
#define PART_AVE_RAND 2
#define PART_AVE_HORIZONTAL 3
@@ -606,12 +607,12 @@ typedef enum eParticleShapeFlag {
#define PART_AVE_GLOBAL_Y 6
#define PART_AVE_GLOBAL_Z 7
-/* part->reactevent */
+/* #ParticleSettings.reactevent */
#define PART_EVENT_DEATH 0
#define PART_EVENT_COLLIDE 1
#define PART_EVENT_NEAR 2
-/* part->childtype */
+/* #ParticleSettings.childtype */
#define PART_CHILD_PARTICLES 1
#define PART_CHILD_FACES 2
@@ -675,7 +676,7 @@ typedef enum eParticleShapeFlag {
#define PTARGET_MODE_FRIEND 1
#define PTARGET_MODE_ENEMY 2
-/* mapto */
+/** #MTex.mapto */
typedef enum eParticleTextureInfluence {
/* init */
PAMAP_TIME = (1 << 0), /* emission time */
diff --git a/source/blender/makesdna/DNA_pointcache_types.h b/source/blender/makesdna/DNA_pointcache_types.h
index 7de0bb29c46..2b6e1c4f7de 100644
--- a/source/blender/makesdna/DNA_pointcache_types.h
+++ b/source/blender/makesdna/DNA_pointcache_types.h
@@ -131,8 +131,8 @@ typedef struct PointCache {
void (*free_edit)(struct PTCacheEdit *edit);
} PointCache;
+/** #PointCache.flag */
enum {
- /* pointcache->flag */
PTCACHE_BAKED = 1 << 0,
PTCACHE_OUTDATED = 1 << 1,
PTCACHE_SIMULATION_VALID = 1 << 2,
diff --git a/source/blender/makesdna/DNA_pointcloud_types.h b/source/blender/makesdna/DNA_pointcloud_types.h
index 26f1db3324b..53fda29a33a 100644
--- a/source/blender/makesdna/DNA_pointcloud_types.h
+++ b/source/blender/makesdna/DNA_pointcloud_types.h
@@ -54,7 +54,7 @@ typedef struct PointCloud {
void *batch_cache;
} PointCloud;
-/* PointCloud.flag */
+/** #PointCloud.flag */
enum {
PT_DS_EXPAND = (1 << 0),
};
diff --git a/source/blender/makesdna/DNA_rigidbody_types.h b/source/blender/makesdna/DNA_rigidbody_types.h
index aa11e74e89d..f653905e169 100644
--- a/source/blender/makesdna/DNA_rigidbody_types.h
+++ b/source/blender/makesdna/DNA_rigidbody_types.h
@@ -38,7 +38,7 @@ struct EffectorWeights;
/* ******************************** */
/* RigidBody World */
-/* Container for data shared by original and evaluated copies of RigidBodyWorld */
+/** Container for data shared by original and evaluated copies of #RigidBodyWorld. */
typedef struct RigidBodyWorld_Shared {
/* cache */
struct PointCache *pointcache;
@@ -90,7 +90,7 @@ typedef struct RigidBodyWorld {
float time_scale;
} RigidBodyWorld;
-/* Flags for RigidBodyWorld */
+/** RigidBodyWorld.flag */
typedef enum eRigidBodyWorld_Flag {
/* should sim world be skipped when evaluating (user setting) */
RBW_FLAG_MUTED = (1 << 0),
@@ -170,7 +170,7 @@ typedef struct RigidBodyOb {
struct RigidBodyOb_Shared *shared;
} RigidBodyOb;
-/* Participation types for RigidBodyOb */
+/** #RigidBodyOb.type */
typedef enum eRigidBodyOb_Type {
/* active geometry participant in simulation. is directly controlled by sim */
RBO_TYPE_ACTIVE = 0,
@@ -178,7 +178,7 @@ typedef enum eRigidBodyOb_Type {
RBO_TYPE_PASSIVE = 1,
} eRigidBodyOb_Type;
-/* Flags for RigidBodyOb */
+/** #RigidBodyOb.flag */
typedef enum eRigidBodyOb_Flag {
/* rigidbody is kinematic (controlled by the animation system) */
RBO_FLAG_KINEMATIC = (1 << 0),
@@ -198,7 +198,7 @@ typedef enum eRigidBodyOb_Flag {
RBO_FLAG_USE_DEFORM = (1 << 7),
} eRigidBodyOb_Flag;
-/* RigidBody Collision Shape */
+/** Rigid Body Collision Shape. */
typedef enum eRigidBody_Shape {
/** Simple box (i.e. bounding box). */
RB_SHAPE_BOX = 0,
@@ -304,7 +304,7 @@ typedef struct RigidBodyCon {
void *physics_constraint;
} RigidBodyCon;
-/* Participation types for RigidBodyOb */
+/** Participation types for #RigidBodyOb.type */
typedef enum eRigidBodyCon_Type {
/** lets bodies rotate around a specified point */
RBC_TYPE_POINT = 0,
@@ -333,13 +333,13 @@ typedef enum eRigidBodyCon_Type {
RBC_TYPE_MOTOR = 11,
} eRigidBodyCon_Type;
-/* Spring implementation type for RigidBodyOb */
+/** Spring implementation type for RigidBodyOb. */
typedef enum eRigidBodyCon_SpringType {
RBC_SPRING_TYPE1 = 0, /* btGeneric6DofSpringConstraint */
RBC_SPRING_TYPE2 = 1, /* btGeneric6DofSpring2Constraint */
} eRigidBodyCon_SpringType;
-/* Flags for RigidBodyCon */
+/** #RigidBodyCon.flag */
typedef enum eRigidBodyCon_Flag {
/* constraint influences rigid body motion */
RBC_FLAG_ENABLED = (1 << 0),
diff --git a/source/blender/makesdna/DNA_scene_defaults.h b/source/blender/makesdna/DNA_scene_defaults.h
index 9ffadfe40a9..502abfbdf1d 100644
--- a/source/blender/makesdna/DNA_scene_defaults.h
+++ b/source/blender/makesdna/DNA_scene_defaults.h
@@ -47,6 +47,7 @@
.width = 512, \
.height = 512, \
.margin = 16, \
+ .margin_type = R_BAKE_ADJACENT_FACES, \
.normal_space = R_BAKE_SPACE_TANGENT, \
.normal_swizzle = {R_BAKE_POSX, R_BAKE_POSY, R_BAKE_POSZ}, \
}
@@ -102,7 +103,8 @@
.dither_intensity = 1.0f, \
\
.bake_mode = 0, \
- .bake_filter = 16, \
+ .bake_margin = 16, \
+ .bake_margin_type = R_BAKE_ADJACENT_FACES, \
.bake_flag = R_BAKE_CLEAR, \
.bake_samples = 256, \
.bake_biasdist = 0.001f, \
@@ -376,3 +378,5 @@
}
/* clang-format off */
+
+/** \} */
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index f3926e46ebc..36fef503efc 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -34,7 +34,7 @@
#include "DNA_ID.h"
#include "DNA_color_types.h" /* color management */
-#include "DNA_customdata_types.h" /* Scene's runtime cddata masks. */
+#include "DNA_customdata_types.h" /* Scene's runtime custom-data masks. */
#include "DNA_layer_types.h"
#include "DNA_listBase.h"
#include "DNA_vec_types.h"
@@ -195,7 +195,7 @@ typedef struct AudioData {
/* *************************************************************** */
/* Render Layers */
-/* Render Layer */
+/** Render Layer. */
typedef struct SceneRenderLayer {
struct SceneRenderLayer *next, *prev;
@@ -323,7 +323,7 @@ typedef enum eScenePassType {
#define RE_PASSNAME_BLOOM "BloomCol"
#define RE_PASSNAME_VOLUME_LIGHT "VolumeDir"
-/* View - MultiView */
+/** View - MultiView. */
typedef struct SceneRenderView {
struct SceneRenderView *next, *prev;
@@ -563,11 +563,18 @@ typedef struct BakeData {
char target;
char save_mode;
- char _pad[6];
+ char margin_type;
+ char _pad[5];
struct Object *cage_object;
} BakeData;
+/** #BakeData.margin_type (char) */
+typedef enum eBakeMarginType {
+ R_BAKE_ADJACENT_FACES = 0,
+ R_BAKE_EXTEND = 1,
+} eBakeMarginType;
+
/** #BakeData.normal_swizzle (char) */
typedef enum eBakeNormalSwizzle {
R_BAKE_POSX = 0,
@@ -715,11 +722,14 @@ typedef struct RenderData {
/* Bake Render options */
short bake_mode, bake_flag;
- short bake_filter, bake_samples;
+ short bake_margin, bake_samples;
+ short bake_margin_type;
+ char _pad9[6];
float bake_biasdist, bake_user_scale;
/* path to render output */
/** 1024 = FILE_MAX. */
+ /* NOTE: Excluded from `BKE_bpath_foreach_path_` / `scene_foreach_path` code. */
char pic[1024];
/* stamps flags. */
@@ -784,12 +794,12 @@ typedef struct RenderData {
struct CurveMapping mblur_shutter_curve;
} RenderData;
-/* RenderData.quality_flag */
+/** #RenderData.quality_flag */
typedef enum eQualityOption {
SCE_PERF_HQ_NORMALS = (1 << 0),
} eQualityOption;
-/* RenderData.hair_type */
+/** #RenderData.hair_type */
typedef enum eHairType {
SCE_HAIR_SHAPE_STRAND = 0,
SCE_HAIR_SHAPE_STRIP = 1,
@@ -798,7 +808,7 @@ typedef enum eHairType {
/* *************************************************************** */
/* Render Conversion/Simplification Settings */
-/* control render convert and shading engine */
+/** Control render convert and shading engine. */
typedef struct RenderProfile {
struct RenderProfile *next, *prev;
char name[32];
@@ -828,7 +838,7 @@ typedef struct RenderProfile {
#define STEREO_RIGHT_SUFFIX "_R"
#define STEREO_LEFT_SUFFIX "_L"
-/* View3D.stereo3d_camera / View3D.multiview_eye / ImageUser.multiview_eye */
+/** #View3D.stereo3d_camera / #View3D.multiview_eye / #ImageUser.multiview_eye */
typedef enum eStereoViews {
STEREO_LEFT_ID = 0,
STEREO_RIGHT_ID = 1,
@@ -860,12 +870,12 @@ typedef struct Paint_Runtime {
char _pad[2];
} Paint_Runtime;
-/* We might want to store other things here. */
+/** We might want to store other things here. */
typedef struct PaintToolSlot {
struct Brush *brush;
} PaintToolSlot;
-/* Paint Tool Base */
+/** Paint Tool Base. */
typedef struct Paint {
struct Brush *brush;
@@ -902,7 +912,7 @@ typedef struct Paint {
/* ------------------------------------------- */
/* Image Paint */
-/* Texture/Image Editor */
+/** Texture/Image Editor. */
typedef struct ImagePaintSettings {
Paint paint;
@@ -933,7 +943,7 @@ typedef struct ImagePaintSettings {
/* ------------------------------------------- */
/* Particle Edit */
-/* Settings for a Particle Editing Brush */
+/** Settings for a Particle Editing Brush. */
typedef struct ParticleBrushData {
/** Common setting. */
short size;
@@ -943,7 +953,7 @@ typedef struct ParticleBrushData {
float strength;
} ParticleBrushData;
-/* Particle Edit Mode Settings */
+/** Particle Edit Mode Settings. */
typedef struct ParticleEditSettings {
short flag;
short totrekey;
@@ -970,7 +980,7 @@ typedef struct ParticleEditSettings {
/* ------------------------------------------- */
/* Sculpt */
-/* Sculpt */
+/** Sculpt. */
typedef struct Sculpt {
Paint paint;
@@ -1005,7 +1015,7 @@ typedef struct UvSculpt {
Paint paint;
} UvSculpt;
-/* grease pencil drawing brushes */
+/** Grease pencil drawing brushes. */
typedef struct GpPaint {
Paint paint;
int flag;
@@ -1019,21 +1029,21 @@ enum {
GPPAINT_FLAG_USE_VERTEXCOLOR = 1,
};
-/* Grease pencil vertex paint. */
+/** Grease pencil vertex paint. */
typedef struct GpVertexPaint {
Paint paint;
int flag;
char _pad[4];
} GpVertexPaint;
-/* Grease pencil sculpt paint. */
+/** Grease pencil sculpt paint. */
typedef struct GpSculptPaint {
Paint paint;
int flag;
char _pad[4];
} GpSculptPaint;
-/* Grease pencil weight paint. */
+/** Grease pencil weight paint. */
typedef struct GpWeightPaint {
Paint paint;
int flag;
@@ -1043,7 +1053,7 @@ typedef struct GpWeightPaint {
/* ------------------------------------------- */
/* Vertex Paint */
-/* Vertex Paint */
+/** Vertex Paint. */
typedef struct VPaint {
Paint paint;
char flag;
@@ -1061,7 +1071,7 @@ enum {
/* ------------------------------------------- */
/* GPencil Stroke Sculpting */
-/* GP_Sculpt_Settings.lock_axis */
+/** #GP_Sculpt_Settings.lock_axis */
typedef enum eGP_Lockaxis_Types {
GP_LOCKAXIS_VIEW = 0,
GP_LOCKAXIS_X = 1,
@@ -1070,7 +1080,7 @@ typedef enum eGP_Lockaxis_Types {
GP_LOCKAXIS_CURSOR = 4,
} eGP_Lockaxis_Types;
-/* Settings for a GPencil Speed Guide */
+/** Settings for a GPencil Speed Guide. */
typedef struct GP_Sculpt_Guide {
char use_guide;
char use_snapping;
@@ -1084,7 +1094,7 @@ typedef struct GP_Sculpt_Guide {
struct Object *reference_object;
} GP_Sculpt_Guide;
-/* GPencil Stroke Sculpting Settings */
+/** GPencil Stroke Sculpting Settings. */
typedef struct GP_Sculpt_Settings {
/** Runtime. */
void *paintcursor;
@@ -1133,7 +1143,7 @@ typedef enum eGP_vertex_SelectMaskFlag {
GP_VERTEX_MASK_SELECTMODE_SEGMENT = (1 << 2),
} eGP_Vertex_SelectMaskFlag;
-/* Settings for GP Interpolation Operators */
+/** Settings for GP Interpolation Operators. */
typedef struct GP_Interpolate_Settings {
/** Custom interpolation curve (for use with GP_IPO_CURVEMAP). */
struct CurveMapping *custom_ipo;
@@ -1254,7 +1264,7 @@ typedef struct UnifiedPaintSettings {
struct ColorSpace *colorspace;
} UnifiedPaintSettings;
-/* UnifiedPaintSettings.flag */
+/** #UnifiedPaintSettings.flag */
typedef enum {
UNIFIED_PAINT_SIZE = (1 << 0),
UNIFIED_PAINT_ALPHA = (1 << 1),
@@ -1312,7 +1322,7 @@ enum {
/* *************************************************************** */
/* Stats */
-/* Stats for Meshes */
+/** Stats for Meshes. */
typedef struct MeshStatVis {
char type;
char _pad1[2];
@@ -1340,8 +1350,10 @@ typedef struct SequencerToolSettings {
short snap_flag;
/* eSeqOverlapMode */
int overlap_mode;
- /** When there are many snap points, 0-1 range corresponds to resolution from boundbox to all
- * possible snap points. */
+ /**
+ * When there are many snap points,
+ * 0-1 range corresponds to resolution from bound-box to all possible snap points.
+ */
int snap_distance;
int pivot_point;
} SequencerToolSettings;
@@ -1569,8 +1581,8 @@ typedef struct PhysicsSettings {
char _pad0[4];
} PhysicsSettings;
-/* ------------------------------------------- */
-/* Safe Area options used in Camera View & Sequencer
+/**
+ * Safe Area options used in Camera View & Sequencer.
*/
typedef struct DisplaySafeAreas {
/* each value represents the (x,y) margins as a multiplier.
@@ -1586,8 +1598,9 @@ typedef struct DisplaySafeAreas {
float action_center[2];
} DisplaySafeAreas;
-/* ------------------------------------------- */
-/* Scene Display - used for store scene specific display settings for the 3d view */
+/**
+ * Scene Display - used for store scene specific display settings for the 3d view.
+ */
typedef struct SceneDisplay {
/** Light direction for shadows/highlight. */
float light_direction[3];
@@ -2066,6 +2079,9 @@ enum {
#define SCE_SNAP_MODE_VOLUME (1 << 3)
#define SCE_SNAP_MODE_EDGE_MIDPOINT (1 << 4)
#define SCE_SNAP_MODE_EDGE_PERPENDICULAR (1 << 5)
+#define SCE_SNAP_MODE_GEOM \
+ (SCE_SNAP_MODE_VERTEX | SCE_SNAP_MODE_EDGE | SCE_SNAP_MODE_FACE | \
+ SCE_SNAP_MODE_EDGE_PERPENDICULAR | SCE_SNAP_MODE_EDGE_MIDPOINT)
/** #SequencerToolSettings.snap_mode */
#define SEQ_SNAP_TO_STRIPS (1 << 0)
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index d5b7458ae7b..1a1d7cba7af 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -154,6 +154,9 @@ typedef struct Panel_Runtime {
/* Pointer to the panel's block. Useful when changes to panel #uiBlocks
* need some context from traversal of the panel "tree". */
struct uiBlock *block;
+
+ /* Non-owning pointer. The context is stored in the block. */
+ struct bContextStore *context;
} Panel_Runtime;
/** The part from uiBlock that needs saved in file. */
@@ -241,7 +244,7 @@ typedef struct PanelCategoryDyn {
rcti rect;
} PanelCategoryDyn;
-/* region stack of active tabs */
+/** Region stack of active tabs. */
typedef struct PanelCategoryStack {
struct PanelCategoryStack *next, *prev;
char idname[64];
@@ -458,6 +461,9 @@ typedef struct ARegion_Runtime {
/* The offset needed to not overlap with window scrollbars. Only used by HUD regions for now. */
int offset_x, offset_y;
+
+ /* Maps uiBlock->name to uiBlock for faster lookups. */
+ struct GHash *block_name_map;
} ARegion_Runtime;
typedef struct ARegion {
@@ -648,9 +654,11 @@ enum {
#define UILST_FLT_SORT_MASK (((unsigned int)(UILST_FLT_SORT_REVERSE | UILST_FLT_SORT_LOCK)) - 1)
-/* regiontype, first two are the default set */
-/* Do NOT change order, append on end. Types are hardcoded needed */
-typedef enum eRegionType {
+/**
+ * regiontype, first two are the default set.
+ * \warning Do NOT change order, append on end. Types are hard-coded needed.
+ */
+typedef enum eRegion_Type {
RGN_TYPE_WINDOW = 0,
RGN_TYPE_HEADER = 1,
RGN_TYPE_CHANNELS = 2,
@@ -666,9 +674,12 @@ typedef enum eRegionType {
RGN_TYPE_EXECUTE = 10,
RGN_TYPE_FOOTER = 11,
RGN_TYPE_TOOL_HEADER = 12,
+ /* Region type used exclusively by internal code and add-ons to register draw callbacks to the XR
+ * context (surface, mirror view). Does not represent any real region. */
+ RGN_TYPE_XR = 13,
-#define RGN_TYPE_LEN (RGN_TYPE_TOOL_HEADER + 1)
-} eRegionType;
+#define RGN_TYPE_LEN (RGN_TYPE_XR + 1)
+} eRegion_Type;
/* use for function args */
#define RGN_TYPE_ANY -1
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index 828702f9aa8..5fe67a34dae 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -47,6 +47,10 @@ struct SequenceLookup;
struct VFont;
struct bSound;
+/* -------------------------------------------------------------------- */
+/** \name Sequence & Editing Structs
+ * \{ */
+
/* strlens; 256= FILE_MAXFILE, 768= FILE_MAXDIR */
typedef struct StripAnim {
@@ -79,9 +83,13 @@ typedef struct StripTransform {
} StripTransform;
typedef struct StripColorBalance {
+ int method;
float lift[3];
float gamma[3];
float gain[3];
+ float slope[3];
+ float offset[3];
+ float power[3];
int flag;
char _pad[4];
/* float exposure; */
@@ -175,7 +183,8 @@ typedef struct Sequence {
/** Starting and ending points of the strip in the sequence. */
int startdisp, enddisp;
float sat;
- float mul, handsize;
+ float mul;
+ float _pad;
short anim_preseek; /* UNUSED. */
/** Streamindex for movie or sound files with several streams. */
@@ -233,18 +242,20 @@ typedef struct Sequence {
float blend_opacity;
/* Tag color showed if `SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG` is set. */
- int16_t color_tag;
- char _pad4[6];
+ int8_t color_tag;
+
+ char alpha_mode;
+ char _pad4[2];
+
+ int cache_flag;
/* is sfra needed anymore? - it looks like its only used in one place */
/** Starting frame according to the timeline of the scene. */
int sfra;
- char alpha_mode;
- char _pad[2];
-
/* Multiview */
char views_format;
+ char _pad1[3];
struct Stereo3dFormat *stereo3d_format;
struct IDProperty *prop;
@@ -252,9 +263,6 @@ typedef struct Sequence {
/* modifiers */
ListBase modifiers;
- int cache_flag;
- int _pad2[3];
-
SequenceRuntime runtime;
} Sequence;
@@ -286,9 +294,11 @@ typedef struct Editing {
/** 1024 = FILE_MAX. */
char proxy_dir[1024];
- int over_ofs, over_cfra;
- int over_flag, proxy_storage;
- rctf over_border;
+ int proxy_storage;
+
+ int overlay_frame_ofs, overlay_frame_abs;
+ int overlay_frame_flag;
+ rctf overlay_frame_rect;
struct SeqCache *cache;
@@ -305,7 +315,12 @@ typedef struct Editing {
void *_pad1;
} Editing;
-/* ************* Effect Variable Structs ********* */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Effect Variable Structs
+ * \{ */
+
typedef struct WipeVars {
float edgeWidth, angle;
short forward, wipetype;
@@ -354,7 +369,7 @@ typedef struct SpeedControlVars {
float speed_fader_frame_number;
} SpeedControlVars;
-/* SpeedControlVars.speed_control_type */
+/** #SpeedControlVars.speed_control_type */
enum {
SEQ_SPEED_STRETCH = 0,
SEQ_SPEED_MULTIPLY = 1,
@@ -371,7 +386,7 @@ typedef struct TextVars {
char text[512];
struct VFont *text_font;
int text_blf_id;
- int text_size;
+ float text_size;
float color[4], shadow_color[4], box_color[4];
float loc[2];
float wrap_width;
@@ -381,7 +396,7 @@ typedef struct TextVars {
char _pad[5];
} TextVars;
-/* TextVars.flag */
+/** #TextVars.flag */
enum {
SEQ_TEXT_SHADOW = (1 << 0),
SEQ_TEXT_BOX = (1 << 1),
@@ -389,14 +404,14 @@ enum {
SEQ_TEXT_ITALIC = (1 << 3),
};
-/* TextVars.align */
+/** #TextVars.align */
enum {
SEQ_TEXT_ALIGN_X_LEFT = 0,
SEQ_TEXT_ALIGN_X_CENTER = 1,
SEQ_TEXT_ALIGN_X_RIGHT = 2,
};
-/* TextVars.align_y */
+/** #TextVars.align_y */
enum {
SEQ_TEXT_ALIGN_Y_TOP = 0,
SEQ_TEXT_ALIGN_Y_CENTER = 1,
@@ -412,7 +427,11 @@ typedef struct ColorMixVars {
float factor;
} ColorMixVars;
-/* ***************** Sequence modifiers ****************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Sequence Modifiers
+ * \{ */
typedef struct SequenceModifierData {
struct SequenceModifierData *next, *prev;
@@ -435,6 +454,11 @@ typedef struct ColorBalanceModifierData {
float color_multiply;
} ColorBalanceModifierData;
+enum {
+ SEQ_COLOR_BALANCE_METHOD_LIFTGAMMAGAIN = 0,
+ SEQ_COLOR_BALANCE_METHOD_SLOPEOFFSETPOWER = 1,
+};
+
typedef struct CurvesModifierData {
SequenceModifierData modifier;
@@ -478,7 +502,11 @@ enum {
SEQ_TONEMAP_RD_PHOTORECEPTOR = 1,
};
-/* ***************** Scopes ****************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Scopes
+ * \{ */
typedef struct SequencerScopes {
struct ImBuf *reference_ibuf;
@@ -494,9 +522,9 @@ typedef struct SequencerScopes {
#define SELECT 1
-/* Editor->over_flag */
-#define SEQ_EDIT_OVERLAY_SHOW 1
-#define SEQ_EDIT_OVERLAY_ABS 2
+/** #Editor.overlay_frame_flag */
+#define SEQ_EDIT_OVERLAY_FRAME_SHOW 1
+#define SEQ_EDIT_OVERLAY_FRAME_ABS 2
#define SEQ_STRIP_OFSBOTTOM 0.05f
#define SEQ_STRIP_OFSTOP 0.95f
@@ -511,10 +539,15 @@ typedef struct SequencerScopes {
#define SEQ_SPEED_UNUSED_3 (1 << 2) /* cleared */
#define SEQ_SPEED_USE_INTERPOLATION (1 << 3)
-/* ***************** SEQUENCE ****************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Flags & Types
+ * \{ */
+
#define SEQ_NAME_MAXSTR 64
-/* seq->flag */
+/** #Sequence.flag */
enum {
/* SELECT */
SEQ_LEFTSEL = (1 << 1),
@@ -557,7 +590,7 @@ enum {
SEQ_INVALID_EFFECT = (1u << 31),
};
-/* StripProxy->storage */
+/** #StripProxy.storage */
enum {
SEQ_STORAGE_PROXY_CUSTOM_FILE = (1 << 1), /* store proxy in custom directory */
SEQ_STORAGE_PROXY_CUSTOM_DIR = (1 << 2), /* store proxy in custom file */
@@ -572,6 +605,9 @@ enum {
#define SEQ_COLOR_BALANCE_INVERSE_GAIN 1
#define SEQ_COLOR_BALANCE_INVERSE_GAMMA 2
#define SEQ_COLOR_BALANCE_INVERSE_LIFT 4
+#define SEQ_COLOR_BALANCE_INVERSE_SLOPE 8
+#define SEQ_COLOR_BALANCE_INVERSE_OFFSET 16
+#define SEQ_COLOR_BALANCE_INVERSE_POWER 32
/* !!! has to be same as IMB_imbuf.h IMB_PROXY_... and IMB_TC_... */
@@ -587,18 +623,22 @@ enum {
#define SEQ_PROXY_TC_RECORD_RUN_NO_GAPS 8
#define SEQ_PROXY_TC_ALL 15
-/* SeqProxy->build_flags */
+/** SeqProxy.build_flags */
enum {
SEQ_PROXY_SKIP_EXISTING = 1,
};
-/* seq->alpha_mode */
+/** #Sequence.alpha_mode */
enum {
SEQ_ALPHA_STRAIGHT = 0,
SEQ_ALPHA_PREMUL = 1,
};
-/* seq->type WATCH IT: SEQ_TYPE_EFFECT BIT is used to determine if this is an effect strip!!! */
+/**
+ * #Sequence.type
+ *
+ * \warning #SEQ_TYPE_EFFECT BIT is used to determine if this is an effect strip!
+ */
enum {
SEQ_TYPE_IMAGE = 0,
SEQ_TYPE_META = 1,
@@ -667,7 +707,7 @@ enum {
/* modifiers */
-/* SequenceModifierData->type */
+/** #SequenceModifierData.type */
enum {
seqModifierType_ColorBalance = 1,
seqModifierType_Curves = 2,
@@ -680,7 +720,7 @@ enum {
NUM_SEQUENCE_MODIFIER_TYPES,
};
-/* SequenceModifierData->flag */
+/** #SequenceModifierData.flag */
enum {
SEQUENCE_MODIFIER_MUTE = (1 << 0),
SEQUENCE_MODIFIER_EXPANDED = (1 << 1),
@@ -698,13 +738,14 @@ enum {
SEQUENCE_MASK_TIME_ABSOLUTE = 1,
};
-/* Sequence->cache_flag
- * SEQ_CACHE_STORE_RAW
- * SEQ_CACHE_STORE_PREPROCESSED
- * SEQ_CACHE_STORE_COMPOSITE
- * FINAL_OUT is ignored
+/**
+ * #Sequence.cache_flag
+ * - #SEQ_CACHE_STORE_RAW
+ * - #SEQ_CACHE_STORE_PREPROCESSED
+ * - #SEQ_CACHE_STORE_COMPOSITE
+ * - #FINAL_OUT is ignored
*
- * Editing->cache_flag
+ * #Editing.cache_flag
* all entries
*/
enum {
@@ -731,7 +772,7 @@ enum {
SEQ_CACHE_STORE_THUMBNAIL = (1 << 12),
};
-/* Sequence->color_tag. */
+/** #Sequence.color_tag. */
typedef enum SequenceColorTag {
SEQUENCE_COLOR_NONE = -1,
SEQUENCE_COLOR_01,
diff --git a/source/blender/makesdna/DNA_shader_fx_types.h b/source/blender/makesdna/DNA_shader_fx_types.h
index 01e3b3a5230..be787c1760f 100644
--- a/source/blender/makesdna/DNA_shader_fx_types.h
+++ b/source/blender/makesdna/DNA_shader_fx_types.h
@@ -77,7 +77,7 @@ typedef struct ShaderFxData {
char *error;
} ShaderFxData;
-/* Runtime temp data */
+/** Runtime temp data. */
typedef struct ShaderFxData_Runtime {
float loc[3];
char _pad[4];
diff --git a/source/blender/makesdna/DNA_simulation_types.h b/source/blender/makesdna/DNA_simulation_types.h
index a700c9fe2f8..b14301ed32d 100644
--- a/source/blender/makesdna/DNA_simulation_types.h
+++ b/source/blender/makesdna/DNA_simulation_types.h
@@ -38,7 +38,7 @@ typedef struct Simulation {
char _pad[4];
} Simulation;
-/* Simulation.flag */
+/** #Simulation.flag */
enum {
SIM_DS_EXPAND = (1 << 0),
};
diff --git a/source/blender/makesdna/DNA_space_defaults.h b/source/blender/makesdna/DNA_space_defaults.h
new file mode 100644
index 00000000000..785abb39cc9
--- /dev/null
+++ b/source/blender/makesdna/DNA_space_defaults.h
@@ -0,0 +1,67 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/** \file
+ * \ingroup DNA
+ */
+
+#pragma once
+
+/* Struct members on own line. */
+/* clang-format off */
+
+/* -------------------------------------------------------------------- */
+/** \name SpaceClip Struct
+ * \{ */
+
+#define _DNA_DEFAULT_MaskSpaceInfo \
+ { \
+ .draw_flag = 0, \
+ .draw_type = MASK_DT_OUTLINE, \
+ .overlay_mode = MASK_OVERLAY_ALPHACHANNEL, \
+ }
+
+#define _DNA_DEFAULT_SpaceClip \
+ { \
+ .spacetype = SPACE_CLIP, \
+ .link_flag = 0, \
+ .xof = 0, \
+ .yof = 0, \
+ .xlockof = 0, \
+ .ylockof = 0, \
+ .zoom = 1.0f, \
+ .user = _DNA_DEFAULT_MovieClipUser, \
+ .scopes = _DNA_DEFAULT_MovieClipScopes, \
+ .flag = SC_SHOW_MARKER_PATTERN | SC_SHOW_TRACK_PATH | SC_SHOW_GRAPH_TRACKS_MOTION | \
+ SC_SHOW_GRAPH_FRAMES | SC_SHOW_ANNOTATION, \
+ .mode = SC_MODE_TRACKING, \
+ .view = SC_VIEW_CLIP, \
+ .path_length = 20, \
+ .loc = {0, 0}, \
+ .scale = 0, \
+ .angle = 0, \
+ .stabmat = _DNA_DEFAULT_UNIT_M4, \
+ .unistabmat = _DNA_DEFAULT_UNIT_M4, \
+ .postproc_flag = 0, \
+ .gpencil_src = SC_GPENCIL_SRC_CLIP, \
+ .around = V3D_AROUND_CENTER_MEDIAN, \
+ .cursor = {0, 0}, \
+ .mask_info = _DNA_DEFAULT_MaskSpaceInfo, \
+ }
+
+/** \} */
+
+/* clang-format on */
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 2f3f52a6b82..4e12f135242 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -61,16 +61,23 @@ struct bNodeTree;
struct wmOperator;
struct wmTimer;
-/* Defined in `buttons_intern.h`. */
+/** Defined in `buttons_intern.h`. */
typedef struct SpaceProperties_Runtime SpaceProperties_Runtime;
-/* Defined in `node_intern.h`. */
+/** Defined in `node_intern.hh`. */
+#ifdef __cplusplus
+namespace blender::ed::space_node {
+struct SpaceNode_Runtime;
+} // namespace blender::ed::space_node
+using SpaceNode_Runtime = blender::ed::space_node::SpaceNode_Runtime;
+#else
typedef struct SpaceNode_Runtime SpaceNode_Runtime;
+#endif
-/* Defined in `file_intern.h`. */
+/** Defined in `file_intern.h`. */
typedef struct SpaceFile_Runtime SpaceFile_Runtime;
-/* Defined in `spreadsheet_intern.hh`. */
+/** Defined in `spreadsheet_intern.hh`. */
typedef struct SpaceSpreadsheet_Runtime SpaceSpreadsheet_Runtime;
/* -------------------------------------------------------------------- */
@@ -91,7 +98,7 @@ typedef struct SpaceLink {
char _pad0[6];
} SpaceLink;
-/* SpaceLink.link_flag */
+/** #SpaceLink.link_flag */
enum {
/**
* The space is not a regular one opened through the editor menu (for example) but spawned by an
@@ -113,7 +120,7 @@ enum {
/** \name Space Info
* \{ */
-/* Info Header */
+/** Info Header. */
typedef struct SpaceInfo {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -127,7 +134,7 @@ typedef struct SpaceInfo {
char _pad[7];
} SpaceInfo;
-/* SpaceInfo.rpt_mask */
+/** #SpaceInfo.rpt_mask */
typedef enum eSpaceInfo_RptMask {
INFO_RPT_DEBUG = (1 << 0),
INFO_RPT_INFO = (1 << 1),
@@ -142,7 +149,7 @@ typedef enum eSpaceInfo_RptMask {
/** \name Properties Editor
* \{ */
-/* Properties Editor */
+/** Properties Editor. */
typedef struct SpaceProperties {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -210,7 +217,7 @@ typedef struct SpaceProperties {
// #define BUTS_EFFECTS 14
#endif /* DNA_DEPRECATED_ALLOW */
-/* SpaceProperties.mainb new */
+/** #SpaceProperties.mainb new */
typedef enum eSpaceButtons_Context {
BCONTEXT_RENDER = 0,
BCONTEXT_SCENE = 1,
@@ -235,7 +242,7 @@ typedef enum eSpaceButtons_Context {
BCONTEXT_TOT,
} eSpaceButtons_Context;
-/* SpaceProperties.flag */
+/** #SpaceProperties.flag */
typedef enum eSpaceButtons_Flag {
/* SB_PRV_OSA = (1 << 0), */ /* UNUSED */
SB_PIN_CONTEXT = (1 << 1),
@@ -246,7 +253,7 @@ typedef enum eSpaceButtons_Flag {
SB_SHADING_CONTEXT = (1 << 4),
} eSpaceButtons_Flag;
-/* SpaceProperties.outliner_sync */
+/** #SpaceProperties.outliner_sync */
typedef enum eSpaceButtons_OutlinerSync {
PROPERTIES_SYNC_AUTO = 0,
PROPERTIES_SYNC_NEVER = 1,
@@ -259,10 +266,10 @@ typedef enum eSpaceButtons_OutlinerSync {
/** \name Outliner
* \{ */
-/* Defined in `outliner_intern.h`. */
+/** Defined in `outliner_intern.hh`. */
typedef struct SpaceOutliner_Runtime SpaceOutliner_Runtime;
-/* Outliner */
+/** Outliner */
typedef struct SpaceOutliner {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -281,7 +288,7 @@ typedef struct SpaceOutliner {
* Note that treestore may contain duplicate elements if element
* is used multiple times in outliner tree (e. g. linked objects)
* Also note that BLI_mempool can not be read/written in DNA directly,
- * therefore readfile.c/writefile.c linearize treestore into TreeStore structure
+ * therefore `readfile.c/writefile.c` linearize treestore into TreeStore structure
*/
struct BLI_mempool *treestore;
@@ -303,7 +310,7 @@ typedef struct SpaceOutliner {
SpaceOutliner_Runtime *runtime;
} SpaceOutliner;
-/* SpaceOutliner.flag */
+/** #SpaceOutliner.flag */
typedef enum eSpaceOutliner_Flag {
/* SO_TESTBLOCKS = (1 << 0), */ /* UNUSED */
/* SO_NEWSELECTED = (1 << 1), */ /* UNUSED */
@@ -314,7 +321,7 @@ typedef enum eSpaceOutliner_Flag {
SO_MODE_COLUMN = (1 << 6),
} eSpaceOutliner_Flag;
-/* SpaceOutliner.filter */
+/** #SpaceOutliner.filter */
typedef enum eSpaceOutliner_Filter {
SO_FILTER_SEARCH = (1 << 0), /* Run-time flag. */
SO_FILTER_CLEARED_1 = (1 << 1),
@@ -356,7 +363,7 @@ typedef enum eSpaceOutliner_Filter {
(SO_FILTER_NO_OB_CONTENT | SO_FILTER_NO_CHILDREN | SO_FILTER_OB_TYPE | SO_FILTER_OB_STATE | \
SO_FILTER_NO_COLLECTION | SO_FILTER_NO_VIEW_LAYERS | SO_FILTER_NO_LIB_OVERRIDE)
-/* SpaceOutliner.filter_state */
+/** #SpaceOutliner.filter_state */
typedef enum eSpaceOutliner_StateFilter {
SO_FILTER_OB_ALL = 0,
SO_FILTER_OB_VISIBLE = 1,
@@ -366,7 +373,7 @@ typedef enum eSpaceOutliner_StateFilter {
SO_FILTER_OB_SELECTABLE = 5,
} eSpaceOutliner_StateFilter;
-/* SpaceOutliner.show_restrict_flags */
+/** #SpaceOutliner.show_restrict_flags */
typedef enum eSpaceOutliner_ShowRestrictFlag {
SO_RESTRICT_ENABLE = (1 << 0),
SO_RESTRICT_SELECT = (1 << 1),
@@ -377,7 +384,7 @@ typedef enum eSpaceOutliner_ShowRestrictFlag {
SO_RESTRICT_INDIRECT_ONLY = (1 << 6),
} eSpaceOutliner_Restrict;
-/* SpaceOutliner.outlinevis */
+/** #SpaceOutliner.outlinevis */
typedef enum eSpaceOutliner_Mode {
SO_SCENES = 0,
/* SO_CUR_SCENE = 1, */ /* deprecated! */
@@ -398,7 +405,7 @@ typedef enum eSpaceOutliner_Mode {
SO_OVERRIDES_LIBRARY = 16,
} eSpaceOutliner_Mode;
-/* SpaceOutliner.storeflag */
+/** #SpaceOutliner.storeflag */
typedef enum eSpaceOutliner_StoreFlag {
/* cleanup tree */
SO_TREESTORE_CLEANUP = (1 << 0),
@@ -408,7 +415,7 @@ typedef enum eSpaceOutliner_StoreFlag {
SO_TREESTORE_REBUILD = (1 << 2),
} eSpaceOutliner_StoreFlag;
-/* outliner search flags (SpaceOutliner.search_flags) */
+/** Outliner search flags (#SpaceOutliner.search_flags) */
typedef enum eSpaceOutliner_Search_Flags {
SO_FIND_CASE_SENSITIVE = (1 << 0),
SO_FIND_COMPLETE = (1 << 1),
@@ -429,7 +436,7 @@ typedef struct SpaceGraph_Runtime {
ListBase ghost_curves;
} SpaceGraph_Runtime;
-/* 'Graph' Editor (formerly known as the IPO Editor) */
+/** 'Graph' Editor (formerly known as the IPO Editor). */
typedef struct SpaceGraph {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -467,7 +474,7 @@ typedef struct SpaceGraph {
SpaceGraph_Runtime runtime;
} SpaceGraph;
-/* SpaceGraph.flag (Graph Editor Settings) */
+/** #SpaceGraph.flag (Graph Editor Settings) */
typedef enum eGraphEdit_Flag {
/* OLD DEPRECATED SETTING */
/* SIPO_LOCK_VIEW = (1 << 0), */
@@ -504,7 +511,7 @@ typedef enum eGraphEdit_Flag {
SIPO_NO_DRAW_EXTRAPOLATION = (1 << 17),
} eGraphEdit_Flag;
-/* SpaceGraph.mode (Graph Editor Mode) */
+/** #SpaceGraph.mode (Graph Editor Mode) */
typedef enum eGraphEdit_Mode {
/* all animation curves (from all over Blender) */
SIPO_MODE_ANIMATION = 0,
@@ -532,7 +539,7 @@ typedef enum eGraphEdit_Runtime_Flag {
/** \name NLA Editor
* \{ */
-/* NLA Editor */
+/** NLA Editor */
typedef struct SpaceNla {
struct SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -552,7 +559,7 @@ typedef struct SpaceNla {
View2D v2d DNA_DEPRECATED;
} SpaceNla;
-/* SpaceNla.flag */
+/** #SpaceNla.flag */
typedef enum eSpaceNla_Flag {
SNLA_FLAG_UNUSED_0 = (1 << 0),
SNLA_FLAG_UNUSED_1 = (1 << 1),
@@ -581,8 +588,9 @@ typedef struct SequencerPreviewOverlay {
char _pad0[4];
} SequencerPreviewOverlay;
-/* SequencerPreviewOverlay.flag */
+/** #SequencerPreviewOverlay.flag */
typedef enum eSpaceSeq_SequencerPreviewOverlay_Flag {
+ SEQ_PREVIEW_SHOW_2D_CURSOR = (1 << 1),
SEQ_PREVIEW_SHOW_OUTLINE_SELECTED = (1 << 2),
SEQ_PREVIEW_SHOW_SAFE_MARGINS = (1 << 3),
SEQ_PREVIEW_SHOW_GPENCIL = (1 << 4),
@@ -595,7 +603,7 @@ typedef struct SequencerTimelineOverlay {
char _pad0[4];
} SequencerTimelineOverlay;
-/* SequencerTimelineOverlay.flag */
+/** #SequencerTimelineOverlay.flag */
typedef enum eSpaceSeq_SequencerTimelineOverlay_Flag {
SEQ_TIMELINE_SHOW_STRIP_OFFSETS = (1 << 1),
SEQ_TIMELINE_SHOW_THUMBNAILS = (1 << 2),
@@ -616,7 +624,7 @@ typedef struct SpaceSeqRuntime {
struct GHash *last_displayed_thumbnails;
} SpaceSeqRuntime;
-/* Sequencer */
+/** Sequencer. */
typedef struct SpaceSeq {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -641,12 +649,16 @@ typedef struct SpaceSeq {
/** Deprecated, handled by View2D now. */
float zoom DNA_DEPRECATED;
/** See SEQ_VIEW_* below. */
- int view;
- int overlay_type;
+ char view;
+ char overlay_frame_type;
/** Overlay an image of the editing on below the strips. */
- int draw_flag;
+ char draw_flag;
+ char gizmo_flag;
char _pad[4];
+ /** 2D cursor for transform. */
+ float cursor[2];
+
/** Grease-pencil data. */
struct bGPdata *gpd;
@@ -662,23 +674,22 @@ typedef struct SpaceSeq {
SpaceSeqRuntime runtime;
} SpaceSeq;
-/* SpaceSeq.mainb */
+/** #SpaceSeq.mainb */
typedef enum eSpaceSeq_RegionType {
- SEQ_DRAW_SEQUENCE = 0,
SEQ_DRAW_IMG_IMBUF = 1,
SEQ_DRAW_IMG_WAVEFORM = 2,
SEQ_DRAW_IMG_VECTORSCOPE = 3,
SEQ_DRAW_IMG_HISTOGRAM = 4,
} eSpaceSeq_RegionType;
-/* SpaceSeq.draw_flag */
+/** #SpaceSeq.draw_flag */
typedef enum eSpaceSeq_DrawFlag {
SEQ_DRAW_BACKDROP = (1 << 0),
SEQ_DRAW_UNUSED_1 = (1 << 1),
SEQ_DRAW_TRANSFORM_PREVIEW = (1 << 2),
} eSpaceSeq_DrawFlag;
-/* SpaceSeq.flag */
+/** #SpaceSeq.flag */
typedef enum eSpaceSeq_Flag {
SEQ_DRAWFRAMES = (1 << 0),
SEQ_MARKER_TRANS = (1 << 1),
@@ -699,14 +710,14 @@ typedef enum eSpaceSeq_Flag {
SEQ_SHOW_GRID = (1 << 18),
} eSpaceSeq_Flag;
-/* SpaceSeq.view */
+/** #SpaceSeq.view */
typedef enum eSpaceSeq_Displays {
SEQ_VIEW_SEQUENCE = 1,
SEQ_VIEW_PREVIEW = 2,
SEQ_VIEW_SEQUENCE_PREVIEW = 3,
} eSpaceSeq_Dispays;
-/* SpaceSeq.render_size */
+/** #SpaceSeq.render_size */
typedef enum eSpaceSeq_Proxy_RenderSize {
SEQ_RENDER_SIZE_NONE = -1,
SEQ_RENDER_SIZE_SCENE = 0,
@@ -727,12 +738,21 @@ typedef struct MaskSpaceInfo {
char _pad3[5];
} MaskSpaceInfo;
-/* SpaceSeq.mainb */
-typedef enum eSpaceSeq_OverlayType {
- SEQ_DRAW_OVERLAY_RECT = 0,
- SEQ_DRAW_OVERLAY_REFERENCE = 1,
- SEQ_DRAW_OVERLAY_CURRENT = 2,
-} eSpaceSeq_OverlayType;
+/** #SpaceSeq.gizmo_flag */
+enum {
+ /** All gizmos. */
+ SEQ_GIZMO_HIDE = (1 << 0),
+ SEQ_GIZMO_HIDE_NAVIGATE = (1 << 1),
+ SEQ_GIZMO_HIDE_CONTEXT = (1 << 2),
+ SEQ_GIZMO_HIDE_TOOL = (1 << 3),
+};
+
+/** #SpaceSeq.mainb */
+typedef enum eSpaceSeq_OverlayFrameType {
+ SEQ_OVERLAY_FRAME_TYPE_RECT = 0,
+ SEQ_OVERLAY_FRAME_TYPE_REFERENCE = 1,
+ SEQ_OVERLAY_FRAME_TYPE_CURRENT = 2,
+} eSpaceSeq_OverlayFrameType;
/** \} */
@@ -740,7 +760,7 @@ typedef enum eSpaceSeq_OverlayType {
/** \name File Selector
* \{ */
-/* Config and Input for File Selector */
+/** Config and Input for File Selector. */
typedef struct FileSelectParams {
/** Title, also used for the text of the execute button. */
char title[96];
@@ -760,7 +780,7 @@ typedef struct FileSelectParams {
const ID *rename_id;
void *_pad3;
- /** List of filetypes to filter (FILE_MAXFILE). */
+ /** List of file-types to filter (#FILE_MAXFILE). */
char filter_glob[256];
/** Text items name must match to be shown. */
@@ -806,9 +826,14 @@ typedef struct FileAssetSelectParams {
FileSelectParams base_params;
AssetLibraryReference asset_library_ref;
+ short asset_catalog_visibility; /* eFileSel_Params_AssetCatalogVisibility */
+ char _pad[6];
+ /** If #asset_catalog_visibility is #FILE_SHOW_ASSETS_FROM_CATALOG, this sets the ID of the
+ * catalog to show. */
+ bUUID catalog_id;
short import_type; /* eFileAssetImportType */
- char _pad[6];
+ char _pad2[6];
} FileAssetSelectParams;
typedef enum eFileAssetImportType {
@@ -839,7 +864,7 @@ typedef struct FileFolderHistory {
ListBase folders_next;
} FileFolderHistory;
-/* File Browser */
+/** File Browser. */
typedef struct SpaceFile {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -903,7 +928,7 @@ typedef struct SpaceFile {
SpaceFile_Runtime *runtime;
} SpaceFile;
-/* SpaceFile.browse_mode (File Space Browsing Mode) */
+/** #SpaceFile.browse_mode (File Space Browsing Mode). */
typedef enum eFileBrowse_Mode {
/* Regular Blender File Browser */
FILE_BROWSE_MODE_FILES = 0,
@@ -911,7 +936,7 @@ typedef enum eFileBrowse_Mode {
FILE_BROWSE_MODE_ASSETS = 1,
} eFileBrowse_Mode;
-/* FileSelectParams.display */
+/** #FileSelectParams.display */
enum eFileDisplayType {
/** Internal (not exposed to users): Keep whatever display type was used during the last File
* Browser use, or the default if no such record is found. Use this unless there's a good reason
@@ -925,7 +950,7 @@ enum eFileDisplayType {
FILE_IMGDISPLAY = 3,
};
-/* FileSelectParams.sort */
+/** #FileSelectParams.sort */
enum eFileSortType {
/** Internal (not exposed to users): Sort by whatever was sorted by during the last File Browser
* use, or the default if no such record is found. Use this unless there's a good reason to set a
@@ -940,14 +965,14 @@ enum eFileSortType {
FILE_SORT_SIZE = 4,
};
-/* SpaceFile.tags */
+/** #SpaceFile.tags */
enum eFileTags {
/** Tag the space as having to update files representing or containing main data. Must be set
* after file read and undo/redo. */
FILE_TAG_REBUILD_MAIN_FILES = (1 << 0),
};
-/* FileSelectParams.details_flags */
+/** #FileSelectParams.details_flags */
enum eFileDetails {
FILE_DETAILS_SIZE = (1 << 0),
FILE_DETAILS_DATETIME = (1 << 1),
@@ -968,7 +993,7 @@ enum eFileDetails {
*/
#define FILE_SELECT_MAX_RECURSIONS (FILE_MAX_LIBEXTRA / 2)
-/* filesel types */
+/** File selector types. */
typedef enum eFileSelectType {
FILE_LOADLIB = 1,
FILE_MAIN = 2,
@@ -982,14 +1007,14 @@ typedef enum eFileSelectType {
FILE_SPECIAL = 9,
} eFileSelectType;
-/* filesel op property -> action */
+/** File-selector op property -> action. */
typedef enum eFileSel_Action {
FILE_OPENFILE = 0,
FILE_SAVE = 1,
} eFileSel_Action;
-/* sfile->params->flag */
/**
+ * #FileSelectParams.flag / `sfile->params->flag`.
* \note short flag, also used as 16 lower bits of flags in link/append code
* (WM and BLO code area, see #eBLOLibLinkFlags in BLO_readfile.h).
*/
@@ -1004,15 +1029,25 @@ typedef enum eFileSel_Params_Flag {
FILE_DIRSEL_ONLY = (1 << 7),
FILE_FILTER = (1 << 8),
FILE_PARAMS_FLAG_UNUSED_3 = (1 << 9),
- FILE_PARAMS_FLAG_UNUSED_4 = (1 << 10),
+ FILE_PATH_TOKENS_ALLOW = (1 << 10),
FILE_SORT_INVERT = (1 << 11),
FILE_HIDE_TOOL_PROPS = (1 << 12),
FILE_CHECK_EXISTING = (1 << 13),
FILE_ASSETS_ONLY = (1 << 14),
+ /** Enables filtering by asset catalog. */
+ FILE_FILTER_ASSET_CATALOG = (1 << 15),
} eFileSel_Params_Flag;
-/* sfile->params->rename_flag */
-/* NOTE: short flag. Defined as bitflags, but currently only used as exclusive status markers... */
+typedef enum eFileSel_Params_AssetCatalogVisibility {
+ FILE_SHOW_ASSETS_ALL_CATALOGS,
+ FILE_SHOW_ASSETS_FROM_CATALOG,
+ FILE_SHOW_ASSETS_WITHOUT_CATALOG,
+} eFileSel_Params_AssetCatalogVisibility;
+
+/**
+ * #FileSelectParams.rename_flag / `sfile->params->rename_flag`.
+ * \note short flag. Defined as bit-flags, but currently only used as exclusive status markers.
+ */
typedef enum eFileSel_Params_RenameFlag {
/** Used when we only have the name of the entry we want to rename,
* but not yet access to its matching file entry. */
@@ -1058,7 +1093,7 @@ typedef enum eFileSel_File_Types {
FILE_TYPE_BLENDERLIB = (1u << 31),
} eFileSel_File_Types;
-/* Selection Flags in filesel: struct direntry, unsigned char selflag */
+/** Selection Flags in filesel: struct direntry, unsigned char selflag. */
typedef enum eDirEntry_SelectFlag {
/* FILE_SEL_ACTIVE = (1 << 1), */ /* UNUSED */
FILE_SEL_HIGHLIGHTED = (1 << 2),
@@ -1125,16 +1160,19 @@ typedef struct FileDirEntryArr {
ListBase entries;
int nbr_entries;
int nbr_entries_filtered;
- int entry_idx_start, entry_idx_end;
/** FILE_MAX. */
char root[1024];
} FileDirEntryArr;
-/* FileDirEntry.flags */
+/** #FileDirEntry.flags */
enum {
- FILE_ENTRY_INVALID_PREVIEW = 1 << 0, /* The preview for this entry could not be generated. */
+ /* The preview for this entry could not be generated. */
+ FILE_ENTRY_INVALID_PREVIEW = 1 << 0,
+ /* The entry name needs to be freed when clearing file list. */
FILE_ENTRY_NAME_FREE = 1 << 1,
+ /* The preview for this entry is being loaded on another thread. */
+ FILE_ENTRY_PREVIEW_LOADING = 1 << 2,
};
/** \} */
@@ -1185,13 +1223,10 @@ typedef struct SpaceImage {
char mode_prev;
char pin;
- char _pad1;
- /**
- * The currently active tile of the image when tile is enabled,
- * is kept in sync with the active faces tile.
- */
- short curtile;
- short lock;
+
+ char pixel_snap_mode;
+
+ char lock;
/** UV draw type. */
char dt_uv;
/** Sticky selection type. */
@@ -1199,10 +1234,9 @@ typedef struct SpaceImage {
char dt_uvstretch;
char around;
- int flag;
+ char _pad1[3];
- char pixel_snap_mode;
- char _pad2[7];
+ int flag;
float uv_opacity;
@@ -1218,7 +1252,7 @@ typedef struct SpaceImage {
SpaceImageOverlay overlay;
} SpaceImage;
-/* SpaceImage.dt_uv */
+/** #SpaceImage.dt_uv */
typedef enum eSpaceImage_UVDT {
SI_UVDT_OUTLINE = 0,
SI_UVDT_DASH = 1,
@@ -1226,20 +1260,20 @@ typedef enum eSpaceImage_UVDT {
SI_UVDT_WHITE = 3,
} eSpaceImage_UVDT;
-/* SpaceImage.dt_uvstretch */
+/** #SpaceImage.dt_uvstretch */
typedef enum eSpaceImage_UVDT_Stretch {
SI_UVDT_STRETCH_ANGLE = 0,
SI_UVDT_STRETCH_AREA = 1,
} eSpaceImage_UVDT_Stretch;
-/* SpaceImage.pixel_snap_mode */
+/** #SpaceImage.pixel_snap_mode */
typedef enum eSpaceImage_PixelSnapMode {
SI_PIXEL_SNAP_DISABLED = 0,
SI_PIXEL_SNAP_CENTER = 1,
SI_PIXEL_SNAP_CORNER = 2,
} eSpaceImage_Snap_Mode;
-/* SpaceImage.mode */
+/** #SpaceImage.mode */
typedef enum eSpaceImage_Mode {
SI_MODE_VIEW = 0,
SI_MODE_PAINT = 1,
@@ -1256,7 +1290,7 @@ typedef enum eSpaceImage_Sticky {
SI_STICKY_VERTEX = 2,
} eSpaceImage_Sticky;
-/* SpaceImage.flag */
+/** #SpaceImage.flag */
typedef enum eSpaceImage_Flag {
SI_FLAG_UNUSED_0 = (1 << 0), /* cleared */
SI_FLAG_UNUSED_1 = (1 << 1), /* cleared */
@@ -1350,7 +1384,7 @@ typedef struct SpaceText_Runtime {
} SpaceText_Runtime;
-/* Text Editor */
+/** Text Editor. */
typedef struct SpaceText {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -1400,12 +1434,12 @@ typedef struct SpaceText {
SpaceText_Runtime runtime;
} SpaceText;
-/* SpaceText flags (moved from DNA_text_types.h) */
+/** SpaceText flags (moved from DNA_text_types.h). */
typedef enum eSpaceText_Flags {
/* scrollable */
ST_SCROLL_SELECT = (1 << 0),
- ST_FLAG_UNUSED_4 = (1 << 4), /* dirty */
+ ST_FLAG_UNUSED_4 = (1 << 4), /* Cleared. */
ST_FIND_WRAP = (1 << 5),
ST_FIND_ALL = (1 << 6),
@@ -1424,7 +1458,7 @@ typedef enum eSpaceText_Flags {
/** \name Script View (Obsolete)
* \{ */
-/* Script Runtime Data - Obsolete (pre 2.5) */
+/** Script Runtime Data - Obsolete (pre 2.5). */
typedef struct Script {
ID id;
@@ -1449,7 +1483,7 @@ typedef struct Script {
_script->py_globaldict = NULL; \
_script->flags = 0
-/* Script View - Obsolete (pre 2.5) */
+/** Script View - Obsolete (pre 2.5). */
typedef struct SpaceScript {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -1488,6 +1522,18 @@ typedef struct bNodeTreePath {
char display_name[64];
} bNodeTreePath;
+typedef struct SpaceNodeOverlay {
+ /* eSpaceNodeOverlay_Flag */
+ int flag;
+} SpaceNodeOverlay;
+
+typedef enum eSpaceNodeOverlay_Flag {
+ SN_OVERLAY_SHOW_OVERLAYS = (1 << 1),
+ SN_OVERLAY_SHOW_WIRE_COLORS = (1 << 2),
+ SN_OVERLAY_SHOW_TIMINGS = (1 << 3),
+ SN_OVERLAY_SHOW_PATH = (1 << 4),
+} eSpaceNodeOverlay_Flag;
+
typedef struct SpaceNode {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -1541,10 +1587,13 @@ typedef struct SpaceNode {
/** Grease-pencil data. */
struct bGPdata *gpd;
+ SpaceNodeOverlay overlay;
+ char _pad2[4];
+
SpaceNode_Runtime *runtime;
} SpaceNode;
-/* SpaceNode.flag */
+/** #SpaceNode.flag */
typedef enum eSpaceNode_Flag {
SNODE_BACKDRAW = (1 << 1),
SNODE_SHOW_GPENCIL = (1 << 2),
@@ -1562,7 +1611,7 @@ typedef enum eSpaceNode_Flag {
SNODE_SKIP_INSOFFSET = (1 << 13),
} eSpaceNode_Flag;
-/* SpaceNode.texfrom */
+/** #SpaceNode.texfrom */
typedef enum eSpaceNode_TexFrom {
/* SNODE_TEX_OBJECT = 0, */
SNODE_TEX_WORLD = 1,
@@ -1570,14 +1619,14 @@ typedef enum eSpaceNode_TexFrom {
SNODE_TEX_LINESTYLE = 3,
} eSpaceNode_TexFrom;
-/* SpaceNode.shaderfrom */
+/** #SpaceNode.shaderfrom */
typedef enum eSpaceNode_ShaderFrom {
SNODE_SHADER_OBJECT = 0,
SNODE_SHADER_WORLD = 1,
SNODE_SHADER_LINESTYLE = 2,
} eSpaceNode_ShaderFrom;
-/* SpaceNode.insert_ofs_dir */
+/** #SpaceNode.insert_ofs_dir */
enum {
SNODE_INSERTOFS_DIR_RIGHT = 0,
SNODE_INSERTOFS_DIR_LEFT = 1,
@@ -1589,7 +1638,7 @@ enum {
/** \name Console
* \{ */
-/* Console content */
+/** Console content. */
typedef struct ConsoleLine {
struct ConsoleLine *next, *prev;
@@ -1605,7 +1654,7 @@ typedef struct ConsoleLine {
int type;
} ConsoleLine;
-/* ConsoleLine.type */
+/** #ConsoleLine.type */
typedef enum eConsoleLine_Type {
CONSOLE_LINE_OUTPUT = 0,
CONSOLE_LINE_INPUT = 1,
@@ -1613,7 +1662,7 @@ typedef enum eConsoleLine_Type {
CONSOLE_LINE_ERROR = 3,
} eConsoleLine_Type;
-/* Console View */
+/** Console View. */
typedef struct SpaceConsole {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -1667,7 +1716,7 @@ typedef struct SpaceUserPref {
/** \name Motion Tracking
* \{ */
-/* Clip Editor */
+/** Clip Editor. */
typedef struct SpaceClip {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -1713,7 +1762,7 @@ typedef struct SpaceClip {
*/
float stabmat[4][4], unistabmat[4][4];
- /* movie postprocessing */
+ /** Movie postprocessing. */
int postproc_flag;
/* grease pencil */
@@ -1730,7 +1779,7 @@ typedef struct SpaceClip {
MaskSpaceInfo mask_info;
} SpaceClip;
-/* SpaceClip.flag */
+/** #SpaceClip.flag */
typedef enum eSpaceClip_Flag {
SC_SHOW_MARKER_PATTERN = (1 << 0),
SC_SHOW_MARKER_SEARCH = (1 << 1),
@@ -1757,7 +1806,7 @@ typedef enum eSpaceClip_Flag {
SC_SHOW_METADATA = (1 << 22),
} eSpaceClip_Flag;
-/* SpaceClip.mode */
+/** #SpaceClip.mode */
typedef enum eSpaceClip_Mode {
SC_MODE_TRACKING = 0,
// SC_MODE_RECONSTRUCTION = 1, /* DEPRECATED */
@@ -1765,14 +1814,14 @@ typedef enum eSpaceClip_Mode {
SC_MODE_MASKEDIT = 3,
} eSpaceClip_Mode;
-/* SpaceClip.view */
+/** #SpaceClip.view */
typedef enum eSpaceClip_View {
SC_VIEW_CLIP = 0,
SC_VIEW_GRAPH = 1,
SC_VIEW_DOPESHEET = 2,
} eSpaceClip_View;
-/* SpaceClip.gpencil_src */
+/** #SpaceClip.gpencil_src */
typedef enum eSpaceClip_GPencil_Source {
SC_GPENCIL_SRC_CLIP = 0,
SC_GPENCIL_SRC_TRACK = 1,
@@ -1966,6 +2015,7 @@ typedef enum eSpaceSpreadsheet_ContextType {
} eSpaceSpreadsheet_ContextType;
typedef enum eSpreadsheetColumnValueType {
+ SPREADSHEET_VALUE_TYPE_UNKNOWN = -1,
SPREADSHEET_VALUE_TYPE_BOOL = 0,
SPREADSHEET_VALUE_TYPE_INT32 = 1,
SPREADSHEET_VALUE_TYPE_FLOAT = 2,
@@ -1973,6 +2023,7 @@ typedef enum eSpreadsheetColumnValueType {
SPREADSHEET_VALUE_TYPE_FLOAT3 = 4,
SPREADSHEET_VALUE_TYPE_COLOR = 5,
SPREADSHEET_VALUE_TYPE_INSTANCES = 6,
+ SPREADSHEET_VALUE_TYPE_STRING = 7,
} eSpreadsheetColumnValueType;
/**
@@ -1988,8 +2039,10 @@ typedef enum eSpreadsheetColumnValueType {
/** \name Space Defines (eSpace_Type)
* \{ */
-/* space types, moved from DNA_screen_types.h */
-/* Do NOT change order, append on end. types are hardcoded needed */
+/**
+ * Space types: #SpaceLink.spacetype & #ScrArea.spacetype.
+ * \note Do NOT change order, append on end. types are hardcoded needed.
+ */
typedef enum eSpace_Type {
SPACE_EMPTY = 0,
SPACE_VIEW3D = 1,
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index ee33e8666ec..cd19825d29f 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -98,8 +98,10 @@ typedef struct CBData {
int cur;
} CBData;
-/* 32 = MAXCOLORBAND */
-/* note that this has to remain a single struct, for UserDef */
+/**
+ * 32 = #MAXCOLORBAND
+ * \note that this has to remain a single struct, for UserDef.
+ */
typedef struct ColorBand {
short tot, cur;
char ipotype, ipotype_hue;
@@ -128,9 +130,9 @@ typedef struct PointDensity {
struct Object *object;
/** `index + 1` in ob.particlesystem, non-ID pointer not allowed */
int psys;
- /** cache points in worldspace, object space, ... ? */
+ /** cache points in world-space, object space, ... ? */
short psys_cache_space;
- /** cache points in worldspace, object space, ... ? */
+ /** cache points in world-space, object space, ... ? */
short ob_cache_space;
/** vertex attribute layer for color source, MAX_CUSTOMDATA_LAYER_NAME */
char vertex_attribute_name[64];
@@ -454,14 +456,14 @@ typedef struct ColorMapping {
/* **************** ColorBand ********************* */
-/* colormode */
+/** color-mode. */
enum {
COLBAND_BLEND_RGB = 0,
COLBAND_BLEND_HSV = 1,
COLBAND_BLEND_HSL = 2,
};
-/* interpolation */
+/** Interpolation. */
enum {
COLBAND_INTERP_LINEAR = 0,
COLBAND_INTERP_EASE = 1,
@@ -470,7 +472,7 @@ enum {
COLBAND_INTERP_CONSTANT = 4,
};
-/* color interpolation */
+/** Color interpolation. */
enum {
COLBAND_HUE_NEAR = 0,
COLBAND_HUE_FAR = 1,
@@ -509,7 +511,7 @@ enum {
/* #define TEX_PD_NOISE_AGE 2 */ /* Deprecated */
/* #define TEX_PD_NOISE_TIME 3 */ /* Deprecated */
-/* color_source */
+/** color_source. */
enum {
TEX_PD_COLOR_CONSTANT = 0,
/* color_source: particles */
diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h
index fb2d985d353..815fab59876 100644
--- a/source/blender/makesdna/DNA_tracking_types.h
+++ b/source/blender/makesdna/DNA_tracking_types.h
@@ -398,6 +398,8 @@ typedef struct MovieTrackingDopesheetChannel {
int *segments;
/** Longest segment length and total number of tracked frames. */
int max_segment, total_frames;
+ /** These numbers are valid only if tot_segment > 0. */
+ int first_not_disabled_marker_framenr, last_not_disabled_marker_framenr;
} MovieTrackingDopesheetChannel;
typedef struct MovieTrackingDopesheetCoverageSegment {
@@ -460,7 +462,7 @@ typedef struct MovieTracking {
MovieTrackingDopesheet dopesheet;
} MovieTracking;
-/* MovieTrackingCamera->distortion_model */
+/** #MovieTrackingCamera.distortion_model */
enum {
TRACKING_DISTORTION_MODEL_POLYNOMIAL = 0,
TRACKING_DISTORTION_MODEL_DIVISION = 1,
@@ -468,13 +470,13 @@ enum {
TRACKING_DISTORTION_MODEL_BROWN = 3,
};
-/* MovieTrackingCamera->units */
+/** #MovieTrackingCamera.units */
enum {
CAMERA_UNITS_PX = 0,
CAMERA_UNITS_MM = 1,
};
-/* MovieTrackingMarker->flag */
+/** #MovieTrackingMarker.flag */
enum {
MARKER_DISABLED = (1 << 0),
MARKER_TRACKED = (1 << 1),
@@ -483,7 +485,7 @@ enum {
MARKER_GRAPH_SEL = (MARKER_GRAPH_SEL_X | MARKER_GRAPH_SEL_Y),
};
-/* MovieTrackingTrack->flag */
+/** #MovieTrackingTrack.flag */
enum {
TRACK_HAS_BUNDLE = (1 << 1),
TRACK_DISABLE_RED = (1 << 2),
@@ -499,7 +501,7 @@ enum {
TRACK_USE_2D_STAB_ROT = (1 << 12),
};
-/* MovieTrackingTrack->motion_model */
+/** #MovieTrackingTrack.motion_model */
enum {
TRACK_MOTION_MODEL_TRANSLATION = 0,
TRACK_MOTION_MODEL_TRANSLATION_ROTATION = 1,
@@ -509,27 +511,27 @@ enum {
TRACK_MOTION_MODEL_HOMOGRAPHY = 5,
};
-/* MovieTrackingTrack->algorithm_flag */
+/** #MovieTrackingTrack.algorithm_flag */
enum {
TRACK_ALGORITHM_FLAG_USE_BRUTE = (1 << 0),
TRACK_ALGORITHM_FLAG_USE_NORMALIZATION = (1 << 2),
TRACK_ALGORITHM_FLAG_USE_MASK = (1 << 3),
};
-/* MovieTrackingTrack->pattern_match */
+/** #MovieTrackingTrack.pattern_match */
typedef enum eTrackFrameMatch {
TRACK_MATCH_KEYFRAME = 0,
TRACK_MATCH_PREVIOS_FRAME = 1,
} eTrackFrameMatch;
-/* MovieTrackingSettings->motion_flag */
+/** #MovieTrackingSettings.motion_flag */
enum {
TRACKING_MOTION_TRIPOD = (1 << 0),
TRACKING_MOTION_MODAL = (TRACKING_MOTION_TRIPOD),
};
-/* MovieTrackingSettings->speed */
+/** #MovieTrackingSettings.speed */
enum {
TRACKING_SPEED_FASTEST = 0,
TRACKING_SPEED_REALTIME = 1,
@@ -538,13 +540,13 @@ enum {
TRACKING_SPEED_DOUBLE = 5,
};
-/* MovieTrackingSettings->reconstruction_flag */
+/** #MovieTrackingSettings.reconstruction_flag */
enum {
/* TRACKING_USE_FALLBACK_RECONSTRUCTION = (1 << 0), */ /* DEPRECATED */
TRACKING_USE_KEYFRAME_SELECTION = (1 << 1),
};
-/* MovieTrackingSettings->refine_camera_intrinsics */
+/** #MovieTrackingSettings.refine_camera_intrinsics */
enum {
REFINE_NO_INTRINSICS = (0),
@@ -554,7 +556,7 @@ enum {
REFINE_TANGENTIAL_DISTORTION = (1 << 3),
};
-/* MovieTrackingStabilization->flag */
+/** #MovieTrackingStabilization.flag */
enum {
TRACKING_2D_STABILIZATION = (1 << 0),
TRACKING_AUTOSCALE = (1 << 1),
@@ -563,19 +565,19 @@ enum {
TRACKING_SHOW_STAB_TRACKS = (1 << 5),
};
-/* MovieTrackingStabilization->filter */
+/** #MovieTrackingStabilization.filter */
enum {
TRACKING_FILTER_NEAREST = 0,
TRACKING_FILTER_BILINEAR = 1,
TRACKING_FILTER_BICUBIC = 2,
};
-/* MovieTrackingReconstruction->flag */
+/** #MovieTrackingReconstruction.flag */
enum {
TRACKING_RECONSTRUCTED = (1 << 0),
};
-/* MovieTrackingObject->flag */
+/** #MovieTrackingObject.flag */
enum {
TRACKING_OBJECT_CAMERA = (1 << 0),
};
@@ -586,35 +588,37 @@ enum {
TRACKING_CLEAN_DELETE_SEGMENT = 2,
};
-/* MovieTrackingDopesheet->sort_method */
+/** #MovieTrackingDopesheet.sort_method */
enum {
TRACKING_DOPE_SORT_NAME = 0,
TRACKING_DOPE_SORT_LONGEST = 1,
TRACKING_DOPE_SORT_TOTAL = 2,
TRACKING_DOPE_SORT_AVERAGE_ERROR = 3,
+ TRACKING_DOPE_SORT_START = 4,
+ TRACKING_DOPE_SORT_END = 5,
};
-/* MovieTrackingDopesheet->flag */
+/** #MovieTrackingDopesheet.flag */
enum {
TRACKING_DOPE_SORT_INVERSE = (1 << 0),
TRACKING_DOPE_SELECTED_ONLY = (1 << 1),
TRACKING_DOPE_SHOW_HIDDEN = (1 << 2),
};
-/* MovieTrackingDopesheetCoverageSegment->trackness */
+/** #MovieTrackingDopesheetCoverageSegment.trackness */
enum {
TRACKING_COVERAGE_BAD = 0,
TRACKING_COVERAGE_ACCEPTABLE = 1,
TRACKING_COVERAGE_OK = 2,
};
-/* MovieTrackingPlaneMarker->flag */
+/** #MovieTrackingPlaneMarker.flag */
enum {
PLANE_MARKER_DISABLED = (1 << 0),
PLANE_MARKER_TRACKED = (1 << 1),
};
-/* MovieTrackingPlaneTrack->flag */
+/** #MovieTrackingPlaneTrack.flag */
enum {
PLANE_TRACK_HIDDEN = (1 << 1),
PLANE_TRACK_LOCKED = (1 << 2),
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 291f6de5ba2..15bb1ef920d 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -30,7 +30,8 @@
extern "C" {
#endif
-/* themes; defines in BIF_resource.h */
+/* Themes; defines in `BIF_resource.h`. */
+
struct ColorBand;
/* ************************ style definitions ******************** */
@@ -50,27 +51,29 @@ typedef enum eUIFont_ID {
/* UIFONT_CUSTOM2 = 3, */ /* UNUSED */
} eUIFont_ID;
-/* default fonts to load/initialize */
-/* first font is the default (index 0), others optional */
+/**
+ * Default fonts to load/initialize.
+ * First font is the default (index 0), others optional.
+ */
+#
+#
typedef struct uiFont {
struct uiFont *next, *prev;
/** 1024 = FILE_MAX. */
- char filename[1024];
+ char filepath[1024];
/** From blfont lib. */
short blf_id;
/** Own id (eUIFont_ID). */
short uifont_id;
- /** Fonts that read from left to right. */
- short r_to_l;
- char _pad0[2];
} uiFont;
/** This state defines appearance of text. */
typedef struct uiFontStyle {
/** Saved in file, 0 is default. */
short uifont_id;
+ char _pad1[2];
/** Actual size depends on 'global' dpi. */
- short points;
+ float points;
/** Style hint. */
short italic, bold;
/** Value is amount of pixels blur. */
@@ -82,6 +85,7 @@ typedef struct uiFontStyle {
float shadowalpha;
/** 1 value, typically white or black anyway. */
float shadowcolor;
+ char _pad2[4];
} uiFontStyle;
/* this is fed to the layout engine and widget code */
@@ -206,6 +210,9 @@ typedef struct ThemeUI {
/** Intensity of the border icons. >0 will render an border around themed
* icons. */
float icon_border_intensity;
+ float panel_roundness;
+ char _pad2[4];
+
} ThemeUI;
/* try to put them all in one, if needed a special struct can be created as well
@@ -319,6 +326,8 @@ typedef struct ThemeSpace {
unsigned char vertex_size, outline_width, obcenter_dia, facedot_size;
unsigned char noodle_curving;
unsigned char grid_levels;
+ char _pad5[3];
+ float dash_alpha;
/* syntax for textwindow and nodes */
unsigned char syntaxl[4], syntaxs[4]; /* in nodespace used for backdrop matte */
@@ -341,6 +350,7 @@ typedef struct ThemeSpace {
unsigned char active_strip[4], selected_strip[4];
/** For dopesheet - scale factor for size of keyframes (i.e. height of channels). */
+ char _pad7[1];
float keyframe_scale_fac;
unsigned char editmesh_active[4];
@@ -437,7 +447,7 @@ typedef enum eBackgroundGradientTypes {
TH_BACKGROUND_GRADIENT_RADIAL = 2,
} eBackgroundGradientTypes;
-/* set of colors for use as a custom color set for Objects/Bones wire drawing */
+/** Set of colors for use as a custom color set for Objects/Bones wire drawing. */
typedef struct ThemeWireColor {
unsigned char solid[4];
unsigned char select[4];
@@ -551,7 +561,7 @@ typedef struct bUserMenuItem_Op {
bUserMenuItem item;
char op_idname[64];
struct IDProperty *prop;
- char opcontext;
+ char opcontext; /* #wmOperatorCallContext */
char _pad0[7];
} bUserMenuItem_Op;
@@ -644,6 +654,8 @@ typedef struct UserDef_Experimental {
char no_proxy_to_override_conversion;
char use_cycles_debug;
char use_geometry_nodes_legacy;
+ char show_asset_debug_info;
+ char no_asset_indexing;
char SANITIZE_AFTER_HERE;
/* The following options are automatically sanitized (set to 0)
* when the release cycle is not alpha. */
@@ -654,7 +666,7 @@ typedef struct UserDef_Experimental {
char use_sculpt_tools_tilt;
char use_extended_asset_browser;
char use_override_templates;
- char _pad[3];
+ char _pad[1];
/** `makesdna` does not allow empty structs. */
} UserDef_Experimental;
@@ -932,7 +944,8 @@ typedef struct UserDef {
short sequencer_proxy_setup; /* eUserpref_SeqProxySetup */
float collection_instance_empty_size;
- char _pad10[2];
+ char text_flag;
+ char _pad10[1];
char file_preview_type; /* eUserpref_File_Preview_Type */
char statusbar_flag; /* eUserpref_StatusBar_Flag */
@@ -949,7 +962,7 @@ typedef struct UserDef {
UserDef_Runtime runtime;
} UserDef;
-/* from blenkernel blender.c */
+/** From blenkernel `blender.c`. */
extern UserDef U;
/* ***************** USERDEF ****************** */
@@ -1132,6 +1145,7 @@ typedef enum eUserpref_GPU_Flag {
USER_GPU_FLAG_NO_DEPT_PICK = (1 << 0),
USER_GPU_FLAG_NO_EDIT_MODE_SMOOTH_WIRE = (1 << 1),
USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE = (1 << 2),
+ USER_GPU_FLAG_SUBDIVISION_EVALUATION = (1 << 3),
} eUserpref_GPU_Flag;
/** #UserDef.tablet_api */
@@ -1242,6 +1256,9 @@ typedef enum eDupli_ID_Flags {
USER_DUP_HAIR = (1 << 14),
USER_DUP_POINTCLOUD = (1 << 15),
USER_DUP_VOLUME = (1 << 16),
+ USER_DUP_LATTICE = (1 << 17),
+ USER_DUP_CAMERA = (1 << 18),
+ USER_DUP_SPEAKER = (1 << 19),
USER_DUP_OBDATA = (~0) & ((1 << 24) - 1),
@@ -1254,6 +1271,14 @@ typedef enum eDupli_ID_Flags {
} eDupli_ID_Flags;
/**
+ * Text Editor options
+ * #UserDef.text_flag
+ */
+typedef enum eTextEdit_Flags {
+ USER_TEXT_EDIT_AUTO_CLOSE = (1 << 0),
+} eTextEdit_Flags;
+
+/**
* Text draw options
* #UserDef.text_render
*/
diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h
index f8166305fd9..6c03422963d 100644
--- a/source/blender/makesdna/DNA_view2d_types.h
+++ b/source/blender/makesdna/DNA_view2d_types.h
@@ -31,7 +31,7 @@ extern "C" {
/* ---------------------------------- */
-/* View 2D data - stored per region */
+/** View 2D data - stored per region. */
typedef struct View2D {
/** Tot - area that data can be drawn in; cur - region of tot that is visible in viewport. */
rctf tot, cur;
@@ -83,7 +83,7 @@ typedef struct View2D {
/* ---------------------------------- */
-/* view zooming restrictions, per axis (v2d->keepzoom) */
+/** View zooming restrictions, per axis (#View2D.keepzoom) */
enum {
/* zoom is clamped to lie within limits set by minzoom and maxzoom */
V2D_LIMITZOOM = (1 << 0),
@@ -97,7 +97,7 @@ enum {
V2D_LOCKZOOM_Y = (1 << 9),
};
-/* view panning restrictions, per axis (v2d->keepofs) */
+/** View panning restrictions, per axis (#View2D.keepofs). */
enum {
/* panning on x-axis is not allowed */
V2D_LOCKOFS_X = (1 << 1),
@@ -109,7 +109,7 @@ enum {
V2D_KEEPOFS_Y = (1 << 4),
};
-/* view extent restrictions (v2d->keeptot) */
+/** View extent restrictions (#View2D.keeptot). */
enum {
/** 'cur' view can be out of extents of 'tot' */
V2D_KEEPTOT_FREE = 0,
@@ -120,7 +120,7 @@ enum {
V2D_KEEPTOT_STRICT = 2,
};
-/* general refresh settings (v2d->flag) */
+/** General refresh settings (#View2D.flag). */
enum {
/* global view2d horizontal locking (for showing same time interval) */
/* TODO: this flag may be set in old files but is not accessible currently,
@@ -138,7 +138,7 @@ enum {
V2D_IS_INIT = (1 << 10),
};
-/* scroller flags for View2D (v2d->scroll) */
+/** Scroller flags for View2D (#View2D.scroll). */
enum {
/* left scrollbar */
V2D_SCROLL_LEFT = (1 << 0),
@@ -162,13 +162,15 @@ enum {
V2D_SCROLL_HORIZONTAL_FULLR = (1 << 10),
};
-/* scroll_ui, activate flag for drawing */
+/** scroll_ui, activate flag for drawing. */
enum {
V2D_SCROLL_H_ACTIVE = (1 << 0),
V2D_SCROLL_V_ACTIVE = (1 << 1),
};
-/* alignment flags for totrect, flags use 'shading-out' convention (v2d->align) */
+/**
+ * Alignment flags for `totrect`, flags use 'shading-out' convention (#View2D.align).
+ */
enum {
/* all quadrants free */
V2D_ALIGN_FREE = 0,
diff --git a/source/blender/makesdna/DNA_view3d_defaults.h b/source/blender/makesdna/DNA_view3d_defaults.h
index c4d0c83b346..870197a401c 100644
--- a/source/blender/makesdna/DNA_view3d_defaults.h
+++ b/source/blender/makesdna/DNA_view3d_defaults.h
@@ -53,6 +53,7 @@
.wireframe_threshold = 1.0f, \
.wireframe_opacity = 1.0f, \
.xray_alpha_bone = 0.5f, \
+ .bone_wire_alpha = 1.0f, \
.fade_alpha = 0.40f, \
.texture_paint_mode_opacity = 1.0f, \
.weight_paint_mode_opacity = 1.0f, \
diff --git a/source/blender/makesdna/DNA_view3d_enums.h b/source/blender/makesdna/DNA_view3d_enums.h
index aec52da1bf9..59012a0cd8d 100644
--- a/source/blender/makesdna/DNA_view3d_enums.h
+++ b/source/blender/makesdna/DNA_view3d_enums.h
@@ -30,6 +30,9 @@ typedef enum eV3DOffscreenDrawFlag {
V3D_OFSDRAW_SHOW_ANNOTATION = (1 << 0),
V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS = (1 << 1),
V3D_OFSDRAW_SHOW_GRIDFLOOR = (1 << 2),
+ V3D_OFSDRAW_SHOW_SELECTION = (1 << 3),
+ V3D_OFSDRAW_XR_SHOW_CONTROLLERS = (1 << 4),
+ V3D_OFSDRAW_XR_SHOW_CUSTOM_OVERLAYS = (1 << 5),
} eV3DOffscreenDrawFlag;
/** #View3DShading.light */
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 4d88f6f0c15..dafae6f2eb7 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -64,12 +64,14 @@ typedef struct RegionView3D {
/** User defined clipping planes. */
float clip[6][4];
- /** Clip in object space,
- * means we can test for clipping in editmode without first going into worldspace. */
+ /**
+ * Clip in object space,
+ * means we can test for clipping in edit-mode without first going into world-space.
+ */
float clip_local[6][4];
struct BoundBox *clipbb;
- /** Allocated backup of its self while in local-view. */
+ /** Allocated backup of itself while in local-view. */
struct RegionView3D *localvd;
struct RenderEngine *render_engine;
@@ -94,8 +96,8 @@ typedef struct RegionView3D {
/** Runtime only. */
float pixsize;
/**
- * View center & orbit pivot, negative of worldspace location,
- * also matches -viewinv[3][0:3] in ortho mode.
+ * View center & orbit pivot, negative of world-space location,
+ * also matches `-viewinv[3][0:3]` in orthographic mode.
*/
float ofs[3];
/** Viewport zoom on the camera frame, see BKE_screen_view3d_zoom_to_fac. */
@@ -222,6 +224,8 @@ typedef struct View3DOverlay {
/** Armature edit/pose mode settings. */
float xray_alpha_bone;
+ float bone_wire_alpha;
+ char _pad1[4];
/** Darken Inactive. */
float fade_alpha;
@@ -243,7 +247,7 @@ typedef struct View3DOverlay {
char _pad[4];
} View3DOverlay;
-/* View3DOverlay->handle_display */
+/** #View3DOverlay.handle_display */
typedef enum eHandleDisplay {
/* Display only selected points. */
CURVE_HANDLE_SELECTED = 0,
@@ -298,7 +302,7 @@ typedef struct View3D {
struct Object *camera, *ob_center;
rctf render_border;
- /** Allocated backup of its self while in local-view. */
+ /** Allocated backup of itself while in local-view. */
struct View3D *localvd;
/** Optional string for armature bone to define center, MAXBONENAME. */
@@ -373,6 +377,7 @@ typedef struct View3D {
#define V3D_HIDE_HELPLINES (1 << 2)
#define V3D_FLAG_UNUSED_2 (1 << 3) /* cleared */
#define V3D_XR_SESSION_MIRROR (1 << 4)
+#define V3D_XR_SESSION_SURFACE (1 << 5)
#define V3D_FLAG_UNUSED_10 (1 << 10) /* cleared */
#define V3D_SELECT_OUTLINE (1 << 11)
@@ -416,7 +421,7 @@ enum {
RV3D_LOCK_ANY_TRANSFORM = (RV3D_LOCK_LOCATION | RV3D_LOCK_ROTATION | RV3D_LOCK_ZOOM_AND_DOLLY),
};
-/* Bitwise OR of the regular lock-flags with runtime only lock-flags. */
+/** Bit-wise OR of the regular lock-flags with runtime only lock-flags. */
#define RV3D_LOCK_FLAGS(rv3d) ((rv3d)->viewlock | ((rv3d)->runtime_viewlock))
/** #RegionView3D.viewlock_quad */
@@ -465,6 +470,8 @@ enum {
#define V3D_FLAG2_UNUSED_13 (1 << 13) /* cleared */
#define V3D_FLAG2_UNUSED_14 (1 << 14) /* cleared */
#define V3D_FLAG2_UNUSED_15 (1 << 15) /* cleared */
+#define V3D_XR_SHOW_CONTROLLERS (1 << 16)
+#define V3D_XR_SHOW_CUSTOM_OVERLAYS (1 << 17)
/** #View3D.gp_flag (short) */
#define V3D_GP_FADE_OBJECTS (1 << 0) /* Fade all non GP objects */
@@ -497,6 +504,16 @@ enum {
V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION = (1 << 14),
};
+#define V3D_USES_SCENE_LIGHTS(v3d) \
+ ((((v3d)->shading.type == OB_MATERIAL) && ((v3d)->shading.flag & V3D_SHADING_SCENE_LIGHTS)) || \
+ (((v3d)->shading.type == OB_RENDER) && \
+ ((v3d)->shading.flag & V3D_SHADING_SCENE_LIGHTS_RENDER)))
+
+#define V3D_USES_SCENE_WORLD(v3d) \
+ ((((v3d)->shading.type == OB_MATERIAL) && ((v3d)->shading.flag & V3D_SHADING_SCENE_WORLD)) || \
+ (((v3d)->shading.type == OB_RENDER) && \
+ ((v3d)->shading.flag & V3D_SHADING_SCENE_WORLD_RENDER)))
+
/** #View3DShading.cavity_type */
enum {
V3D_SHADING_CAVITY_SSAO = 0,
diff --git a/source/blender/makesdna/DNA_volume_types.h b/source/blender/makesdna/DNA_volume_types.h
index 1344f295ea9..df5a122faaf 100644
--- a/source/blender/makesdna/DNA_volume_types.h
+++ b/source/blender/makesdna/DNA_volume_types.h
@@ -30,13 +30,13 @@ struct PackedFile;
struct VolumeGridVector;
typedef struct Volume_Runtime {
- /* OpenVDB Grids */
+ /** OpenVDB Grids. */
struct VolumeGridVector *grids;
- /* Current frame in sequence for evaluated volume */
+ /** Current frame in sequence for evaluated volume. */
int frame;
- /* Default simplify level for volume grids loaded from files. */
+ /** Default simplify level for volume grids loaded from files. */
int default_simplify_level;
} Volume_Runtime;
@@ -96,12 +96,12 @@ typedef struct Volume {
Volume_Runtime runtime;
} Volume;
-/* Volume.flag */
+/** #Volume.flag */
enum {
VO_DS_EXPAND = (1 << 0),
};
-/* Volume.sequence_mode */
+/** #Volume.sequence_mode */
typedef enum VolumeSequenceMode {
VOLUME_SEQUENCE_CLIP = 0,
VOLUME_SEQUENCE_EXTEND = 1,
@@ -109,7 +109,7 @@ typedef enum VolumeSequenceMode {
VOLUME_SEQUENCE_PING_PONG = 3,
} VolumeSequenceMode;
-/* VolumeDisplay.wireframe_type */
+/** #VolumeDisplay.wireframe_type */
typedef enum VolumeWireframeType {
VOLUME_WIREFRAME_NONE = 0,
VOLUME_WIREFRAME_BOUNDS = 1,
@@ -117,32 +117,32 @@ typedef enum VolumeWireframeType {
VOLUME_WIREFRAME_POINTS = 3,
} VolumeWireframeType;
-/* VolumeDisplay.wireframe_detail */
+/** #VolumeDisplay.wireframe_detail */
typedef enum VolumeWireframeDetail {
VOLUME_WIREFRAME_COARSE = 0,
VOLUME_WIREFRAME_FINE = 1,
} VolumeWireframeDetail;
-/* VolumeRender.space */
+/** #VolumeRender.space */
typedef enum VolumeRenderSpace {
VOLUME_SPACE_OBJECT = 0,
VOLUME_SPACE_WORLD = 1,
} VolumeRenderSpace;
-/* VolumeDisplay.interpolation_method */
+/** #VolumeDisplay.interpolation_method */
typedef enum VolumeDisplayInterpMethod {
VOLUME_DISPLAY_INTERP_LINEAR = 0,
VOLUME_DISPLAY_INTERP_CUBIC = 1,
VOLUME_DISPLAY_INTERP_CLOSEST = 2,
} VolumeDisplayInterpMethod;
-/* VolumeDisplay.axis_slice_method */
+/** #VolumeDisplay.axis_slice_method */
typedef enum AxisAlignedSlicingMethod {
VOLUME_AXIS_SLICE_FULL = 0,
VOLUME_AXIS_SLICE_SINGLE = 1,
} AxisAlignedSlicingMethod;
-/* VolumeDisplay.slice_axis */
+/** #VolumeDisplay.slice_axis */
typedef enum SliceAxis {
VOLUME_SLICE_AXIS_AUTO = 0,
VOLUME_SLICE_AXIS_X = 1,
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index a9016dd4edd..d0e4184d2a5 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -33,7 +33,8 @@
extern "C" {
#endif
-/* defined here: */
+/* Defined here: */
+
struct wmWindow;
struct wmWindowManager;
@@ -45,7 +46,8 @@ struct wmMsgBus;
struct wmOperator;
struct wmOperatorType;
-/* forwards */
+/* Forward declarations: */
+
struct PointerRNA;
struct Report;
struct ReportList;
@@ -58,8 +60,8 @@ struct wmTimer;
#define OP_MAX_TYPENAME 64
#define KMAP_MAX_NAME 64
-/* keep in sync with 'rna_enum_wm_report_items' in wm_rna.c */
-typedef enum ReportType {
+/** Keep in sync with 'rna_enum_wm_report_items' in `wm_rna.c`. */
+typedef enum eReportType {
RPT_DEBUG = (1 << 0),
RPT_INFO = (1 << 1),
RPT_OPERATOR = (1 << 2),
@@ -69,7 +71,7 @@ typedef enum ReportType {
RPT_ERROR_INVALID_INPUT = (1 << 6),
RPT_ERROR_INVALID_CONTEXT = (1 << 7),
RPT_ERROR_OUT_OF_MEMORY = (1 << 8),
-} ReportType;
+} eReportType;
#define RPT_DEBUG_ALL (RPT_DEBUG)
#define RPT_INFO_ALL (RPT_INFO)
@@ -91,7 +93,7 @@ enum ReportListFlags {
#
typedef struct Report {
struct Report *next, *prev;
- /** ReportType. */
+ /** eReportType. */
short type;
short flag;
/** `strlen(message)`, saves some time calculating the word wrap. */
@@ -100,12 +102,14 @@ typedef struct Report {
const char *message;
} Report;
-/* saved in the wm, don't remove */
+/**
+ * \note Saved in the wm, don't remove.
+ */
typedef struct ReportList {
ListBase list;
- /** ReportType. */
+ /** eReportType. */
int printlevel;
- /** ReportType. */
+ /** eReportType. */
int storelevel;
int flag;
char _pad[4];
@@ -133,12 +137,19 @@ typedef struct wmXrData {
/* reports need to be before wmWindowManager */
-/* windowmanager is saved, tag WMAN */
+/** Window-manager is saved, tag WMAN. */
typedef struct wmWindowManager {
ID id;
/** Separate active from drawable. */
- struct wmWindow *windrawable, *winactive;
+ struct wmWindow *windrawable;
+ /**
+ * \note `CTX_wm_window(C)` is usually preferred.
+ * Avoid relying on this where possible as this may become NULL during when handling
+ * events that close or replace windows (opening a file for e.g.).
+ * While this happens rarely in practice, it can cause difficult to reproduce bugs.
+ */
+ struct wmWindow *winactive;
ListBase windows;
/** Set on file read. */
@@ -197,13 +208,13 @@ typedef struct wmWindowManager {
//#endif
} wmWindowManager;
-/* wmWindowManager.initialized */
+/** #wmWindowManager.initialized */
enum {
WM_WINDOW_IS_INIT = (1 << 0),
WM_KEYCONFIG_IS_INIT = (1 << 1),
};
-/* wmWindowManager.outliner_sync_select_dirty */
+/** #wmWindowManager.outliner_sync_select_dirty */
enum {
WM_OUTLINER_SYNC_SELECT_FROM_OBJECT = (1 << 0),
WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE = (1 << 1),
@@ -224,7 +235,9 @@ enum {
# endif
#endif
-/* the saveable part, rest of data is local in ghostwinlay */
+/**
+ * The saveable part, the rest of the data is local in GHOST.
+ */
typedef struct wmWindow {
struct wmWindow *next, *prev;
@@ -345,7 +358,9 @@ typedef struct wmOperatorTypeMacro {
struct PointerRNA *ptr;
} wmOperatorTypeMacro;
-/* Partial copy of the event, for matching by event handler. */
+/**
+ * Partial copy of the event, for matching by event handler.
+ */
typedef struct wmKeyMapItem {
struct wmKeyMapItem *next, *prev;
@@ -429,7 +444,9 @@ enum {
KMI_TYPE_NDOF = 5,
};
-/* stored in WM, the actively used keymaps */
+/**
+ * Stored in WM, the actively used key-maps.
+ */
typedef struct wmKeyMap {
struct wmKeyMap *next, *prev;
diff --git a/source/blender/makesdna/DNA_workspace_types.h b/source/blender/makesdna/DNA_workspace_types.h
index a0856588a58..95530c7b0f7 100644
--- a/source/blender/makesdna/DNA_workspace_types.h
+++ b/source/blender/makesdna/DNA_workspace_types.h
@@ -60,7 +60,9 @@ typedef struct bToolRef_Runtime {
int flag;
} bToolRef_Runtime;
-/* Stored per mode. */
+/**
+ * \note Stored per mode.
+ */
typedef struct bToolRef {
struct bToolRef *next, *prev;
char idname[64];
diff --git a/source/blender/makesdna/DNA_xr_types.h b/source/blender/makesdna/DNA_xr_types.h
index a9d427777f7..f7da912f299 100644
--- a/source/blender/makesdna/DNA_xr_types.h
+++ b/source/blender/makesdna/DNA_xr_types.h
@@ -32,8 +32,8 @@ typedef struct XrSessionSettings {
/** Shading settings, struct shared with 3D-View so settings are the same. */
struct View3DShading shading;
- char _pad[7];
-
+ float base_scale;
+ char _pad[3];
char base_pose_type; /* #eXRSessionBasePoseType */
/** Object to take the location and rotation as base position from. */
Object *base_pose_object;
@@ -42,7 +42,9 @@ typedef struct XrSessionSettings {
/** View3D draw flags (V3D_OFSDRAW_NONE, V3D_OFSDRAW_SHOW_ANNOTATION, ...). */
char draw_flags;
- char _pad2[3];
+ /** Draw style for controller visualization. */
+ char controller_draw_style;
+ char _pad2[2];
/** Clipping distance. */
float clip_start, clip_end;
@@ -61,6 +63,13 @@ typedef enum eXRSessionBasePoseType {
XR_BASE_POSE_CUSTOM = 2,
} eXRSessionBasePoseType;
+typedef enum eXrSessionControllerDrawStyle {
+ XR_CONTROLLER_DRAW_DARK = 0,
+ XR_CONTROLLER_DRAW_LIGHT = 1,
+ XR_CONTROLLER_DRAW_DARK_RAY = 2,
+ XR_CONTROLLER_DRAW_LIGHT_RAY = 3,
+} eXrSessionControllerDrawStyle;
+
/** XR action type. Enum values match those in GHOST_XrActionType enum for consistency. */
typedef enum eXrActionType {
XR_BOOLEAN_INPUT = 1,
diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt
index db34cf83fa9..a3c54e91780 100644
--- a/source/blender/makesdna/intern/CMakeLists.txt
+++ b/source/blender/makesdna/intern/CMakeLists.txt
@@ -159,6 +159,7 @@ set(SRC
../DNA_pointcloud_defaults.h
../DNA_scene_defaults.h
../DNA_simulation_defaults.h
+ ../DNA_space_defaults.h
../DNA_speaker_defaults.h
../DNA_texture_defaults.h
../DNA_vec_defaults.h
diff --git a/source/blender/makesdna/intern/dna_defaults.c b/source/blender/makesdna/intern/dna_defaults.c
index 2dbbb35c3ca..5bc5de7a20b 100644
--- a/source/blender/makesdna/intern/dna_defaults.c
+++ b/source/blender/makesdna/intern/dna_defaults.c
@@ -103,6 +103,7 @@
#include "DNA_light_types.h"
#include "DNA_lightprobe_types.h"
#include "DNA_linestyle_types.h"
+#include "DNA_mask_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
@@ -144,6 +145,7 @@
#include "DNA_pointcloud_defaults.h"
#include "DNA_scene_defaults.h"
#include "DNA_simulation_defaults.h"
+#include "DNA_space_defaults.h"
#include "DNA_speaker_defaults.h"
#include "DNA_texture_defaults.h"
#include "DNA_volume_defaults.h"
@@ -208,6 +210,8 @@ SDNA_DEFAULT_DECL_STRUCT(MetaBall);
/* DNA_movieclip_defaults.h */
SDNA_DEFAULT_DECL_STRUCT(MovieClip);
+SDNA_DEFAULT_DECL_STRUCT(MovieClipUser);
+SDNA_DEFAULT_DECL_STRUCT(MovieClipScopes);
/* DNA_object_defaults.h */
SDNA_DEFAULT_DECL_STRUCT(Object);
@@ -225,6 +229,9 @@ SDNA_DEFAULT_DECL_STRUCT(ToolSettings);
/* DNA_simulation_defaults.h */
SDNA_DEFAULT_DECL_STRUCT(Simulation);
+/* DNA_space_defaults.h */
+SDNA_DEFAULT_DECL_STRUCT(SpaceClip);
+
/* DNA_speaker_defaults.h */
SDNA_DEFAULT_DECL_STRUCT(Speaker);
@@ -324,6 +331,7 @@ SDNA_DEFAULT_DECL_STRUCT(LineartGpencilModifierData);
SDNA_DEFAULT_DECL_STRUCT(LengthGpencilModifierData);
SDNA_DEFAULT_DECL_STRUCT(DashGpencilModifierData);
SDNA_DEFAULT_DECL_STRUCT(DashGpencilModifierSegment);
+SDNA_DEFAULT_DECL_STRUCT(ShrinkwrapGpencilModifierData);
#undef SDNA_DEFAULT_DECL_STRUCT
@@ -405,11 +413,18 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = {
/* DNA_mesh_defaults.h */
SDNA_DEFAULT_DECL(Mesh),
+ /* DNA_space_defaults.h */
+ SDNA_DEFAULT_DECL(SpaceClip),
+ SDNA_DEFAULT_DECL_EX(MaskSpaceInfo, SpaceClip.mask_info),
+
/* DNA_meta_defaults.h */
SDNA_DEFAULT_DECL(MetaBall),
/* DNA_movieclip_defaults.h */
SDNA_DEFAULT_DECL(MovieClip),
+ SDNA_DEFAULT_DECL(MovieClipUser),
+ SDNA_DEFAULT_DECL(MovieClipScopes),
+ SDNA_DEFAULT_DECL_EX(MovieTrackingMarker, MovieClipScopes.undist_marker),
/* DNA_object_defaults.h */
SDNA_DEFAULT_DECL(Object),
@@ -555,13 +570,16 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = {
SDNA_DEFAULT_DECL(LengthGpencilModifierData),
SDNA_DEFAULT_DECL(DashGpencilModifierData),
SDNA_DEFAULT_DECL(DashGpencilModifierSegment),
+ SDNA_DEFAULT_DECL(ShrinkwrapGpencilModifierData),
};
#undef SDNA_DEFAULT_DECL
#undef SDNA_DEFAULT_DECL_EX
-char *_DNA_struct_default_alloc_impl(const char *data_src, size_t size, const char *alloc_str)
+uint8_t *_DNA_struct_default_alloc_impl(const uint8_t *data_src,
+ size_t size,
+ const char *alloc_str)
{
- char *data_dst = MEM_mallocN(size, alloc_str);
+ uint8_t *data_dst = MEM_mallocN(size, alloc_str);
memcpy(data_dst, data_src, size);
return data_dst;
}
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c
index 24d0d39292e..6322cb459dd 100644
--- a/source/blender/makesdna/intern/dna_genfile.c
+++ b/source/blender/makesdna/intern/dna_genfile.c
@@ -177,13 +177,6 @@ static bool ispointer(const char *name)
return (name[0] == '*' || (name[0] == '(' && name[1] == '*'));
}
-/**
- * Returns the size of struct fields of the specified type and name.
- *
- * \param type: Index into sdna->types/types_size
- * \param name: Index into sdna->names,
- * needed to extract possible pointer/array information.
- */
int DNA_elem_size_nr(const SDNA *sdna, short type, short name)
{
const char *cp = sdna->names[name];
@@ -265,9 +258,6 @@ static int dna_struct_find_nr_ex_impl(
return -1;
}
-/**
- * Returns the index of the struct info for the struct with the specified name.
- */
int DNA_struct_find_nr_ex(const SDNA *sdna, const char *str, unsigned int *index_last)
{
return dna_struct_find_nr_ex_impl(
@@ -284,7 +274,6 @@ int DNA_struct_find_nr_ex(const SDNA *sdna, const char *str, unsigned int *index
index_last);
}
-/** \note requires #DNA_sdna_alias_data_ensure_structs_map to be called. */
int DNA_struct_alias_find_nr_ex(const SDNA *sdna, const char *str, unsigned int *index_last)
{
#ifdef WITH_DNA_GHASH
@@ -310,7 +299,6 @@ int DNA_struct_find_nr(const SDNA *sdna, const char *str)
return DNA_struct_find_nr_ex(sdna, str, &index_last_dummy);
}
-/** \note requires #DNA_sdna_alias_data_ensure_structs_map to be called. */
int DNA_struct_alias_find_nr(const SDNA *sdna, const char *str)
{
unsigned int index_last_dummy = UINT_MAX;
@@ -525,7 +513,7 @@ static bool init_structDNA(SDNA *sdna, bool do_endian_swap, const char **r_error
sdna->pointer_size = sdna->types_size[struct_info->type] / 2;
- if (struct_info->members_len != 2 || (sdna->pointer_size != 4 && sdna->pointer_size != 8)) {
+ if (struct_info->members_len != 2 || (!ELEM(sdna->pointer_size, 4, 8))) {
*r_error_message = "ListBase struct error! Needs it to calculate pointerize.";
/* well, at least sizeof(ListBase) is error proof! (ton) */
return false;
@@ -544,9 +532,6 @@ static bool init_structDNA(SDNA *sdna, bool do_endian_swap, const char **r_error
return true;
}
-/**
- * Constructs and returns a decoded SDNA structure from the given encoded SDNA data block.
- */
SDNA *DNA_sdna_from_data(const void *data,
const int data_len,
bool do_endian_swap,
@@ -691,10 +676,6 @@ static void set_compare_flags_for_struct(const SDNA *oldsdna,
compare_flags[old_struct_index] = SDNA_CMP_EQUAL;
}
-/**
- * Constructs and returns an array of byte flags with one element for each struct in oldsdna,
- * indicating how it compares to newsdna.
- */
const char *DNA_struct_get_compareflags(const SDNA *oldsdna, const SDNA *newsdna)
{
if (oldsdna->structs_len == 0) {
@@ -1018,13 +999,6 @@ static int get_member_size_in_bytes(const SDNA *sdna, const SDNA_StructMember *m
return type_size * array_length;
}
-/**
- * Does endian swapping on the fields of a struct value.
- *
- * \param sdna: SDNA of the struct_nr belongs to
- * \param struct_nr: Index of struct info within sdna
- * \param data: Struct data that is to be converted
- */
void DNA_struct_switch_endian(const SDNA *sdna, int struct_nr, char *data)
{
if (struct_nr == -1) {
@@ -1153,7 +1127,7 @@ static void reconstruct_structs(const DNA_ReconstructInfo *reconstruct_info,
*
* \param reconstruct_info: Preprocessed reconstruct information generated by
* #DNA_reconstruct_info_create.
- * \param new_struct_nr: Index in newsdna->structs of the struct that is being reconstructed.
+ * \param new_struct_nr: Index in `newsdna->structs` of the struct that is being reconstructed.
* \param old_block: Memory buffer containing the old struct.
* \param new_block: Where to put converted struct contents.
*/
@@ -1230,13 +1204,6 @@ static void reconstruct_structs(const DNA_ReconstructInfo *reconstruct_info,
}
}
-/**
- * \param reconstruct_info: Information preprocessed by #DNA_reconstruct_info_create.
- * \param old_struct_nr: Index of struct info within oldsdna.
- * \param blocks: The number of array elements.
- * \param old_blocks: Array of struct data.
- * \return An allocated reconstructed struct.
- */
void *DNA_struct_reconstruct(const DNA_ReconstructInfo *reconstruct_info,
int old_struct_nr,
int blocks,
@@ -1534,10 +1501,6 @@ static int compress_reconstruct_steps(ReconstructStep *steps, const int old_step
return new_step_count;
}
-/**
- * Pre-process information about how structs in \a newsdna can be reconstructed from structs in
- * \a oldsdna. This information is then used to speedup #DNA_struct_reconstruct.
- */
DNA_ReconstructInfo *DNA_reconstruct_info_create(const SDNA *oldsdna,
const SDNA *newsdna,
const char *compare_flags)
@@ -1546,9 +1509,9 @@ DNA_ReconstructInfo *DNA_reconstruct_info_create(const SDNA *oldsdna,
reconstruct_info->oldsdna = oldsdna;
reconstruct_info->newsdna = newsdna;
reconstruct_info->compare_flags = compare_flags;
- reconstruct_info->step_counts = MEM_malloc_arrayN(sizeof(int), newsdna->structs_len, __func__);
+ reconstruct_info->step_counts = MEM_malloc_arrayN(newsdna->structs_len, sizeof(int), __func__);
reconstruct_info->steps = MEM_malloc_arrayN(
- sizeof(ReconstructStep *), newsdna->structs_len, __func__);
+ newsdna->structs_len, sizeof(ReconstructStep *), __func__);
/* Generate reconstruct steps for all structs. */
for (int new_struct_nr = 0; new_struct_nr < newsdna->structs_len; new_struct_nr++) {
@@ -1597,10 +1560,6 @@ void DNA_reconstruct_info_free(DNA_ReconstructInfo *reconstruct_info)
MEM_freeN(reconstruct_info);
}
-/**
- * Returns the offset of the field with the specified name and type within the specified
- * struct type in #SDNA, -1 on failure.
- */
int DNA_elem_offset(SDNA *sdna, const char *stype, const char *vartype, const char *name)
{
const int SDNAnr = DNA_struct_find_nr(sdna, stype);
@@ -1632,7 +1591,6 @@ bool DNA_struct_elem_find(const SDNA *sdna,
return false;
}
-/** \note requires #DNA_sdna_alias_data_ensure_structs_map to be called. */
bool DNA_struct_alias_elem_find(const SDNA *sdna,
const char *stype,
const char *vartype,
@@ -1651,9 +1609,6 @@ bool DNA_struct_alias_elem_find(const SDNA *sdna,
return false;
}
-/**
- * Returns the size in bytes of a primitive type.
- */
int DNA_elem_type_size(const eSDNA_Type elem_nr)
{
/* should contain all enum types */
@@ -1696,9 +1651,6 @@ static bool DNA_sdna_patch_struct_nr(SDNA *sdna,
sdna->types[struct_info->type] = struct_name_new;
return true;
}
-/**
- * Rename a struct
- */
bool DNA_sdna_patch_struct(SDNA *sdna, const char *struct_name_old, const char *struct_name_new)
{
const int struct_name_old_nr = DNA_struct_find_nr(sdna, struct_name_old);
@@ -1756,11 +1708,6 @@ static bool DNA_sdna_patch_struct_member_nr(SDNA *sdna,
}
return false;
}
-/**
- * Replace \a elem_old with \a elem_new for struct \a struct_name
- * handles search & replace, maintaining surrounding non-identifier characters
- * such as pointer & array size.
- */
bool DNA_sdna_patch_struct_member(SDNA *sdna,
const char *struct_name,
const char *elem_old,
@@ -1800,7 +1747,7 @@ static void sdna_expand_names(SDNA *sdna)
int names_expand_index = 0;
for (int struct_nr = 0; struct_nr < sdna->structs_len; struct_nr++) {
- /* We can't edit this memory 'sdna->structs' points to (readonly datatoc file). */
+ /* We can't edit this memory 'sdna->structs' points to (read-only `datatoc` file). */
const SDNA_Struct *struct_old = sdna->structs[struct_nr];
const int array_size = sizeof(short) * 2 + sizeof(SDNA_StructMember) * struct_old->members_len;
@@ -1909,10 +1856,6 @@ void DNA_sdna_alias_data_ensure(SDNA *sdna)
BLI_ghash_free(elem_map_alias_from_static, MEM_freeN, NULL);
}
-/**
- * Separated from #DNA_sdna_alias_data_ensure because it's not needed
- * unless we want to lookup aliased struct names (#DNA_struct_alias_find_nr and friends).
- */
void DNA_sdna_alias_data_ensure_structs_map(SDNA *sdna)
{
DNA_sdna_alias_data_ensure(sdna);
diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h
index 2feebbfd4f4..cb8052856a7 100644
--- a/source/blender/makesdna/intern/dna_rename_defs.h
+++ b/source/blender/makesdna/intern/dna_rename_defs.h
@@ -50,7 +50,9 @@
/* No include guard (intentional). */
-/* Match RNA names where possible, keep sorted. */
+/* Match RNA names where possible. */
+
+/* NOTE: Keep sorted! */
DNA_STRUCT_RENAME(Lamp, Light)
DNA_STRUCT_RENAME(SpaceButs, SpaceProperties)
@@ -63,16 +65,24 @@ DNA_STRUCT_RENAME_ELEM(Bone, curveInY, curve_in_z)
DNA_STRUCT_RENAME_ELEM(Bone, curveOutX, curve_out_x)
DNA_STRUCT_RENAME_ELEM(Bone, curveOutY, curve_out_z)
DNA_STRUCT_RENAME_ELEM(Bone, scaleIn, scale_in_x)
-DNA_STRUCT_RENAME_ELEM(Bone, scale_in_y, scale_in_z)
DNA_STRUCT_RENAME_ELEM(Bone, scaleOut, scale_out_x)
+DNA_STRUCT_RENAME_ELEM(Bone, scale_in_y, scale_in_z)
DNA_STRUCT_RENAME_ELEM(Bone, scale_out_y, scale_out_z)
DNA_STRUCT_RENAME_ELEM(BrushGpencilSettings, gradient_f, hardeness)
DNA_STRUCT_RENAME_ELEM(BrushGpencilSettings, gradient_s, aspect_ratio)
DNA_STRUCT_RENAME_ELEM(Camera, YF_dofdist, dof_distance)
-DNA_STRUCT_RENAME_ELEM(Curve, len_wchar, len_char32)
DNA_STRUCT_RENAME_ELEM(Camera, clipend, clip_end)
DNA_STRUCT_RENAME_ELEM(Camera, clipsta, clip_start)
DNA_STRUCT_RENAME_ELEM(Collection, dupli_ofs, instance_offset)
+DNA_STRUCT_RENAME_ELEM(Curve, ext1, extrude)
+DNA_STRUCT_RENAME_ELEM(Curve, ext2, bevel_radius)
+DNA_STRUCT_RENAME_ELEM(Curve, len_wchar, len_char32)
+DNA_STRUCT_RENAME_ELEM(Curve, width, offset)
+DNA_STRUCT_RENAME_ELEM(Editing, over_border, overlay_frame_rect)
+DNA_STRUCT_RENAME_ELEM(Editing, over_cfra, overlay_frame_abs)
+DNA_STRUCT_RENAME_ELEM(Editing, over_flag, overlay_frame_flag)
+DNA_STRUCT_RENAME_ELEM(Editing, over_ofs, overlay_frame_ofs)
+DNA_STRUCT_RENAME_ELEM(FileGlobal, filename, filepath)
DNA_STRUCT_RENAME_ELEM(FluidDomainSettings, cache_frame_pause_guiding, cache_frame_pause_guide)
DNA_STRUCT_RENAME_ELEM(FluidDomainSettings, guiding_alpha, guide_alpha)
DNA_STRUCT_RENAME_ELEM(FluidDomainSettings, guiding_beta, guide_beta)
@@ -82,16 +92,24 @@ 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(LineartGpencilModifierData, line_types, edge_types)
+DNA_STRUCT_RENAME_ELEM(LineartGpencilModifierData, transparency_flags, mask_switches)
+DNA_STRUCT_RENAME_ELEM(LineartGpencilModifierData, transparency_mask, material_mask_bits)
DNA_STRUCT_RENAME_ELEM(MaskLayer, restrictflag, visibility_flag)
+DNA_STRUCT_RENAME_ELEM(MaterialLineArt, transparency_mask, material_mask_bits)
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)
-DNA_STRUCT_RENAME_ELEM(Object, size, scale)
DNA_STRUCT_RENAME_ELEM(Object, restrictflag, visibility_flag)
+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(RigidBodyWorld, steps_per_second, substeps_per_frame)
+DNA_STRUCT_RENAME_ELEM(RenderData, bake_filter, bake_margin)
+DNA_STRUCT_RENAME_ELEM(SpaceSeq, overlay_type, overlay_frame_type)
+DNA_STRUCT_RENAME_ELEM(SurfaceDeformModifierData, numverts, num_bind_verts)
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)
@@ -109,8 +127,8 @@ DNA_STRUCT_RENAME_ELEM(bPoseChannel, curveInY, curve_in_z)
DNA_STRUCT_RENAME_ELEM(bPoseChannel, curveOutX, curve_out_x)
DNA_STRUCT_RENAME_ELEM(bPoseChannel, curveOutY, curve_out_z)
DNA_STRUCT_RENAME_ELEM(bPoseChannel, scaleIn, scale_in_x)
-DNA_STRUCT_RENAME_ELEM(bPoseChannel, scale_in_y, scale_in_z)
DNA_STRUCT_RENAME_ELEM(bPoseChannel, scaleOut, scale_out_x)
+DNA_STRUCT_RENAME_ELEM(bPoseChannel, scale_in_y, scale_in_z)
DNA_STRUCT_RENAME_ELEM(bPoseChannel, scale_out_y, scale_out_z)
DNA_STRUCT_RENAME_ELEM(bSameVolumeConstraint, flag, free_axis)
DNA_STRUCT_RENAME_ELEM(bSound, name, filepath)
@@ -131,12 +149,8 @@ DNA_STRUCT_RENAME_ELEM(bTheme, tstatusbar, space_statusbar)
DNA_STRUCT_RENAME_ELEM(bTheme, ttopbar, space_topbar)
DNA_STRUCT_RENAME_ELEM(bTheme, tuserpref, space_preferences)
DNA_STRUCT_RENAME_ELEM(bTheme, tv3d, space_view3d)
-DNA_STRUCT_RENAME_ELEM(RigidBodyWorld, steps_per_second, substeps_per_frame)
/* Write with a different name, old Blender versions crash loading files with non-NULL
* global_areas. See D9442. */
DNA_STRUCT_RENAME_ELEM(wmWindow, global_area_map, global_areas)
-DNA_STRUCT_RENAME_ELEM(LineartGpencilModifierData, line_types, edge_types)
-DNA_STRUCT_RENAME_ELEM(LineartGpencilModifierData, transparency_flags, mask_switches)
-DNA_STRUCT_RENAME_ELEM(LineartGpencilModifierData, transparency_mask, material_mask_bits)
-DNA_STRUCT_RENAME_ELEM(SurfaceDeformModifierData, numverts, num_bind_verts)
-DNA_STRUCT_RENAME_ELEM(MaterialLineArt, transparency_mask, material_mask_bits)
+
+/* NOTE: Keep sorted! */
diff --git a/source/blender/makesdna/intern/dna_utils.c b/source/blender/makesdna/intern/dna_utils.c
index f050934b5b3..b2e2e263ea3 100644
--- a/source/blender/makesdna/intern/dna_utils.c
+++ b/source/blender/makesdna/intern/dna_utils.c
@@ -39,10 +39,6 @@
/** \name Struct Member Evaluation
* \{ */
-/**
- * Parses the `[n1][n2]...` on the end of an array name
- * and returns the number of array elements `n1 * n2 ...`.
- */
int DNA_elem_array_size(const char *str)
{
int result = 1;
@@ -106,9 +102,6 @@ uint DNA_elem_id_offset_end(const char *elem_full)
return elem_full_offset;
}
-/**
- * \a elem_dst must be at least the size of \a elem_src.
- */
uint DNA_elem_id_strip_copy(char *elem_dst, const char *elem_src)
{
const uint elem_src_offset = DNA_elem_id_offset_start(elem_src);
@@ -129,10 +122,6 @@ uint DNA_elem_id_strip(char *elem)
return elem_trim_len;
}
-/**
- * Check if 'var' matches '*var[3]' for eg,
- * return true if it does, with start/end offsets.
- */
bool DNA_elem_id_match(const char *elem_search,
const int elem_search_len,
const char *elem_full,
@@ -151,9 +140,6 @@ bool DNA_elem_id_match(const char *elem_search,
return false;
}
-/**
- * Return a renamed dna name, allocated from \a mem_arena.
- */
char *DNA_elem_id_rename(struct MemArena *mem_arena,
const char *elem_src,
const int elem_src_len,
@@ -297,19 +283,15 @@ void DNA_alias_maps(enum eDNA_RenameDir version_dir, GHash **r_struct_map, GHash
/** \name Struct Name Legacy Hack
* \{ */
-/**
- * DNA Compatibility Hack
- * ======================
- *
- * Only keep this for compatibility: **NEVER ADD NEW STRINGS HERE**.
- *
- * The renaming here isn't complete, references to the old struct names
- * are still included in DNA, now fixing these struct names properly
- * breaks forward compatibility. Leave these as-is, but don't add to them!
- * See D4342#98780
- */
const char *DNA_struct_rename_legacy_hack_static_from_alias(const char *name)
{
+ /* Only keep this for compatibility: *NEVER ADD NEW STRINGS HERE*.
+ *
+ * The renaming here isn't complete, references to the old struct names
+ * are still included in DNA, now fixing these struct names properly
+ * breaks forward compatibility. Leave these as-is, but don't add to them!
+ * See D4342#98780. */
+
/* 'bScreen' replaces the old IrisGL 'Screen' struct */
if (STREQ("bScreen", name)) {
return "Screen";
diff --git a/source/blender/makesdna/intern/dna_utils.h b/source/blender/makesdna/intern/dna_utils.h
index f711056c575..e161e317c42 100644
--- a/source/blender/makesdna/intern/dna_utils.h
+++ b/source/blender/makesdna/intern/dna_utils.h
@@ -27,26 +27,42 @@ extern "C" {
struct GHash;
struct MemArena;
+/**
+ * Parses the `[n1][n2]...` on the end of an array name
+ * and returns the number of array elements `n1 * n2 ...`.
+ */
int DNA_elem_array_size(const char *str);
uint DNA_elem_id_offset_start(const char *elem_full);
uint DNA_elem_id_offset_end(const char *elem_full);
+/**
+ * \a elem_dst must be at least the size of \a elem_src.
+ */
uint DNA_elem_id_strip_copy(char *elem_dst, const char *elem_src);
uint DNA_elem_id_strip(char *elem);
+/**
+ * Check if 'var' matches '*var[3]' for eg,
+ * return true if it does, with start/end offsets.
+ */
bool DNA_elem_id_match(const char *elem_search,
- const int elem_search_len,
+ int elem_search_len,
const char *elem_full,
uint *r_elem_full_offset);
+/**
+ * Return a renamed dna name, allocated from \a mem_arena.
+ */
char *DNA_elem_id_rename(struct MemArena *mem_arena,
const char *elem_src,
- const int elem_src_len,
+ int elem_src_len,
const char *elem_dst,
- const int elem_dst_len,
+ int elem_dst_len,
const char *elem_src_full,
- const int elem_src_full_len,
- const uint elem_src_full_offset_len);
+ int elem_src_full_len,
+ uint elem_src_full_offset_len);
-/* When requesting version info, support both directions. */
+/**
+ * When requesting version info, support both directions.
+ */
enum eDNA_RenameDir {
DNA_RENAME_STATIC_FROM_ALIAS = -1,
DNA_RENAME_ALIAS_FROM_STATIC = 1,
@@ -56,6 +72,9 @@ void DNA_alias_maps(enum eDNA_RenameDir version_dir,
struct GHash **r_elem_map);
const char *DNA_struct_rename_legacy_hack_alias_from_static(const char *name);
+/**
+ * DNA Compatibility Hack.
+ */
const char *DNA_struct_rename_legacy_hack_static_from_alias(const char *name);
#ifdef __cplusplus
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 9957808b63d..114c0b40407 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -23,10 +23,8 @@
* \brief Struct muncher for making SDNA.
*
* \section aboutmakesdnac About makesdna tool
- * Originally by Ton, some mods by Frank, and some cleaning and
- * extension by Nzc.
*
- * Makesdna creates a .c file with a long string of numbers that
+ * `makesdna` creates a .c file with a long string of numbers that
* encode the Blender file format. It is fast, because it is basically
* a binary dump. There are some details to mind when reconstructing
* the file (endianness and byte-alignment).
@@ -36,9 +34,9 @@
* how much memory (on disk or in ram) is needed to store that struct,
* and the offsets for reaching a particular one.
*
- * There is a facility to get verbose output from sdna. Search for
- * \ref debugSDNA. This int can be set to 0 (no output) to some int. Higher
- * numbers give more output.
+ * There is a facility to get verbose output from `sdna`. Search for
+ * \ref debugSDNA. This int can be set to 0 (no output) to some int.
+ * Higher numbers give more output.
*/
#define DNA_DEPRECATED_ALLOW