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_brush_defaults.h2
-rw-r--r--source/blender/makesdna/DNA_brush_enums.h5
-rw-r--r--source/blender/makesdna/DNA_gpencil_types.h10
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h143
-rw-r--r--source/blender/makesdna/DNA_node_types.h26
-rw-r--r--source/blender/makesdna/DNA_scene_types.h1
-rw-r--r--source/blender/makesdna/DNA_space_types.h20
-rw-r--r--source/blender/makesdna/DNA_userdef_enums.h1
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h4
-rw-r--r--source/blender/makesdna/intern/CMakeLists.txt2
10 files changed, 61 insertions, 153 deletions
diff --git a/source/blender/makesdna/DNA_brush_defaults.h b/source/blender/makesdna/DNA_brush_defaults.h
index 348e8f4e098..6e88275672a 100644
--- a/source/blender/makesdna/DNA_brush_defaults.h
+++ b/source/blender/makesdna/DNA_brush_defaults.h
@@ -92,7 +92,7 @@
.hardness = 0.0f, \
.automasking_boundary_edges_propagation_steps = 1, \
.automasking_cavity_blur_steps = 0,\
- .automasking_cavity_factor = 0.5f,\
+ .automasking_cavity_factor = 1.0f,\
\
/* A kernel radius of 1 has almost no effect (T63233). */ \
.blur_kernel_radius = 2, \
diff --git a/source/blender/makesdna/DNA_brush_enums.h b/source/blender/makesdna/DNA_brush_enums.h
index 570b569a4dd..8b889e17762 100644
--- a/source/blender/makesdna/DNA_brush_enums.h
+++ b/source/blender/makesdna/DNA_brush_enums.h
@@ -330,9 +330,8 @@ typedef enum eAutomasking_flag {
BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS = (1 << 3),
BRUSH_AUTOMASKING_CAVITY_NORMAL = (1 << 4),
- /* Note: normal and inverted are mutually exclusive,
- * inverted has priority if both bits are set.
- */
+ /* NOTE: normal and inverted are mutually exclusive,
+ * inverted has priority if both bits are set. */
BRUSH_AUTOMASKING_CAVITY_INVERTED = (1 << 5),
BRUSH_AUTOMASKING_CAVITY_ALL = (1 << 4) | (1 << 5),
BRUSH_AUTOMASKING_CAVITY_USE_CURVE = (1 << 6),
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 26dbb544f52..8b3f4956cfe 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -243,12 +243,15 @@ typedef struct bGPDstroke_Runtime {
/** Runtime falloff factor (only for transform). */
float multi_frame_falloff;
- /** Vertex offset in the VBO where this stroke starts. */
+ /** Triangle offset in the IBO where this stroke starts. */
int stroke_start;
/** Triangle offset in the IBO where this fill starts. */
int fill_start;
+ /** Vertex offset in the VBO where this stroke starts. */
+ int vertex_start;
/** Curve Handles offset in the IBO where this handle starts. */
int curve_start;
+ int _pad0;
/** Original stroke (used to dereference evaluated data) */
struct bGPDstroke *gps_orig;
@@ -613,8 +616,9 @@ typedef struct bGPdata_Runtime {
/** Stroke buffer. */
void *sbuffer;
/** Temp batches cleared after drawing. */
- struct GPUBatch *sbuffer_stroke_batch;
- struct GPUBatch *sbuffer_fill_batch;
+ struct GPUVertBuf *sbuffer_position_buf;
+ struct GPUVertBuf *sbuffer_color_buf;
+ struct GPUBatch *sbuffer_batch;
/** Temp stroke used for drawing. */
struct bGPDstroke *sbuffer_gps;
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 2a17dbab8b3..3f951583741 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -19,10 +19,14 @@ namespace blender {
template<typename T> class Span;
template<typename T> class MutableSpan;
namespace bke {
+struct MeshRuntime;
class AttributeAccessor;
class MutableAttributeAccessor;
} // namespace bke
} // namespace blender
+using MeshRuntimeHandle = blender::bke::MeshRuntime;
+#else
+typedef struct MeshRuntimeHandle MeshRuntimeHandle;
#endif
#ifdef __cplusplus
@@ -30,133 +34,14 @@ extern "C" {
#endif
struct AnimData;
-struct BVHCache;
struct Ipo;
struct Key;
struct MCol;
struct MEdge;
struct MFace;
-struct MLoopCol;
struct MLoopTri;
struct MVert;
struct Material;
-struct Mesh;
-struct SubdivCCG;
-struct SubsurfRuntimeData;
-
-#
-#
-typedef struct EditMeshData {
- /** when set, \a vertexNos, polyNos are lazy initialized */
- const float (*vertexCos)[3];
-
- /** lazy initialize (when \a vertexCos is set) */
- float const (*vertexNos)[3];
- float const (*polyNos)[3];
- /** also lazy init but don't depend on \a vertexCos */
- const float (*polyCos)[3];
-} EditMeshData;
-
-/**
- * \warning Typical access is done via
- * #BKE_mesh_runtime_looptri_ensure, #BKE_mesh_runtime_looptri_len.
- */
-struct MLoopTri_Store {
- DNA_DEFINE_CXX_METHODS(MLoopTri_Store)
-
- /* WARNING! swapping between array (ready-to-be-used data) and array_wip
- * (where data is actually computed)
- * shall always be protected by same lock as one used for looptris computing. */
- struct MLoopTri *array, *array_wip;
- int len;
- int len_alloc;
-};
-
-/** Runtime data, not saved in files. */
-typedef struct Mesh_Runtime {
- DNA_DEFINE_CXX_METHODS(Mesh_Runtime)
-
- /* Evaluated mesh for objects which do not have effective modifiers.
- * This mesh is used as a result of modifier stack evaluation.
- * Since modifier stack evaluation is threaded on object level we need some synchronization. */
- struct Mesh *mesh_eval;
- void *eval_mutex;
-
- /* A separate mutex is needed for normal calculation, because sometimes
- * the normals are needed while #eval_mutex is already locked. */
- void *normals_mutex;
-
- /** Needed to ensure some thread-safety during render data pre-processing. */
- void *render_mutex;
-
- /** 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.cc`.
- */
- void *batch_cache;
-
- /** Cache for derived triangulation of the mesh. */
- struct MLoopTri_Store looptris;
-
- /** Cache for BVH trees generated for the mesh. Defined in 'BKE_bvhutil.c' */
- struct BVHCache *bvh_cache;
-
- /** 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;
- /**
- * Copied from edit-mesh (hint, draw with edit-mesh data when true).
- *
- * Modifiers that edit the mesh data in-place must set this to false
- * (most #eModifierTypeType_NonGeometrical modifiers). Otherwise the edit-mesh
- * data will be used for drawing, missing changes from modifiers. See T79517.
- */
- char is_original_bmesh;
-
- /** #eMeshWrapperType and others. */
- char wrapper_type;
- /**
- * A type mask from wrapper_type,
- * in case there are differences in finalizing logic between types.
- */
- char wrapper_type_finalize;
-
- /**
- * Settings for lazily evaluating the subdivision on the CPU if needed. These are
- * set in the modifier when GPU subdivision can be performed, and owned by the by
- * the modifier in the object.
- */
- struct SubsurfRuntimeData *subsurf_runtime_data;
- void *_pad1;
-
- /**
- * Caches for lazily computed vertex and polygon normals. These are stored here rather than in
- * #CustomData because they can be calculated on a const mesh, and adding custom data layers on a
- * const mesh is not thread-safe.
- */
- char _pad2[6];
- char vert_normals_dirty;
- char poly_normals_dirty;
- float (*vert_normals)[3];
- float (*poly_normals)[3];
-
- /**
- * A #BLI_bitmap containing tags for the center vertices of subdivided polygons, set by the
- * subdivision surface modifier and used by drawing code instead of polygon center face dots.
- */
- uint32_t *subsurf_face_dot_tags;
-} Mesh_Runtime;
typedef struct Mesh {
DNA_DEFINE_CXX_METHODS(Mesh)
@@ -316,9 +201,13 @@ typedef struct Mesh {
char _pad1[4];
- void *_pad2;
-
- Mesh_Runtime runtime;
+ /**
+ * Data that isn't saved in files, including caches of derived data, temporary data to improve
+ * the editing experience, etc. Runtime data is created when reading files and can be accessed
+ * without null checks, with the exception of some temporary meshes which should allocate and
+ * free the data if they are passed to functions that expect run-time data.
+ */
+ MeshRuntimeHandle *runtime;
#ifdef __cplusplus
/**
* Array of vertex positions (and various other data). Edges and faces are defined by indices
@@ -383,16 +272,6 @@ typedef struct TFace {
/* **************** MESH ********************* */
-/** #Mesh_Runtime.wrapper_type */
-typedef enum eMeshWrapperType {
- /** Use mesh data (#Mesh.mvert, #Mesh.medge, #Mesh.mloop, #Mesh.mpoly). */
- ME_WRAPPER_TYPE_MDATA = 0,
- /** Use edit-mesh data (#Mesh.edit_mesh, #Mesh_Runtime.edit_data). */
- ME_WRAPPER_TYPE_BMESH = 1,
- /** Use subdivision mesh data (#Mesh_Runtime.mesh_eval). */
- ME_WRAPPER_TYPE_SUBD = 2,
-} eMeshWrapperType;
-
/** #Mesh.texflag */
enum {
ME_AUTOSPACE = 1,
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 9cd056e5a0c..748033cb015 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -135,16 +135,16 @@ typedef struct bNodeSocket {
/** Default input value used for unlinked sockets. */
void *default_value;
- /* execution data */
- /** Local stack index. */
+ /** Local stack index for "node_exec". */
short stack_index;
- /* XXX deprecated, kept for forward compatibility */
- short stack_type DNA_DEPRECATED;
char display_shape;
/* #eAttrDomain used when the geometry nodes modifier creates an attribute for a group
* output. */
char attribute_domain;
+
+ char _pad[2];
+
/* Runtime-only cache of the number of input links, for multi-input sockets. */
short total_inputs;
@@ -170,9 +170,6 @@ typedef struct bNodeSocket {
int own_index DNA_DEPRECATED;
/* XXX deprecated, only used for restoring old group node links */
int to_index DNA_DEPRECATED;
- /* XXX deprecated, still forward compatible since verification
- * restores pointer from matching own_index. */
- struct bNodeSocket *groupsock DNA_DEPRECATED;
/** A link pointer, set in #BKE_ntree_update_main. */
struct bNodeLink *link;
@@ -2082,6 +2079,21 @@ typedef enum CMPNodeFilterMethod {
CMP_NODE_FILTER_SHARP_DIAMOND = 7,
} CMPNodeFilterMethod;
+/* Levels Node. Stored in custom1. */
+typedef enum CMPNodeLevelsChannel {
+ CMP_NODE_LEVLES_LUMINANCE = 1,
+ CMP_NODE_LEVLES_RED = 2,
+ CMP_NODE_LEVLES_GREEN = 3,
+ CMP_NODE_LEVLES_BLUE = 4,
+ CMP_NODE_LEVLES_LUMINANCE_BT709 = 5,
+} CMPNodeLevelsChannel;
+
+/* Tone Map Node. Stored in NodeTonemap.type. */
+typedef enum CMPNodeToneMapType {
+ CMP_NODE_TONE_MAP_SIMPLE = 0,
+ CMP_NODE_TONE_MAP_PHOTORECEPTOR = 1,
+} CMPNodeToneMapType;
+
/* Plane track deform node. */
enum {
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 5fa5d4c7787..28359038be5 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -472,6 +472,7 @@ typedef struct ImageFormatData {
#define R_IMF_IMTYPE_THEORA 33
#define R_IMF_IMTYPE_PSD 34
#define R_IMF_IMTYPE_WEBP 35
+#define R_IMF_IMTYPE_AV1 36
#define R_IMF_IMTYPE_INVALID 255
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 7f0dd2f9be6..d2d20bcde78 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -1169,6 +1169,10 @@ enum {
FILE_ENTRY_NAME_FREE = 1 << 1,
/* The preview for this entry is being loaded on another thread. */
FILE_ENTRY_PREVIEW_LOADING = 1 << 2,
+ /** For #FILE_TYPE_BLENDERLIB only: Denotes that the ID is known to not have a preview (none was
+ * found in the .blend). Stored so we don't keep trying to find non-existent previews every time
+ * we reload previews. When dealing with heavy files this can have quite an impact. */
+ FILE_ENTRY_BLENDERLIB_NO_PREVIEW = 1 << 3,
};
/** \} */
@@ -1184,6 +1188,12 @@ typedef struct SpaceImageOverlay {
char _pad[4];
} SpaceImageOverlay;
+typedef enum eSpaceImage_GridShapeSource {
+ SI_GRID_SHAPE_DYNAMIC = 0,
+ SI_GRID_SHAPE_FIXED = 1,
+ SI_GRID_SHAPE_PIXEL = 2,
+} eSpaceImage_GridShapeSource;
+
typedef struct SpaceImage {
SpaceLink *next, *prev;
/** Storage of regions for inactive spaces. */
@@ -1230,7 +1240,9 @@ typedef struct SpaceImage {
char around;
char gizmo_flag;
- char _pad1[3];
+
+ char grid_shape_source;
+ char _pad1[2];
int flag;
@@ -1239,7 +1251,7 @@ typedef struct SpaceImage {
int tile_grid_shape[2];
/**
* UV editor custom-grid. Value of `{M,N}` will produce `MxN` grid.
- * Use when #SI_CUSTOM_GRID is set.
+ * Use when `custom_grid_shape == SI_GRID_SHAPE_FIXED`.
*/
int custom_grid_subdiv[2];
@@ -1266,7 +1278,7 @@ typedef enum eSpaceImage_PixelRoundMode {
SI_PIXEL_ROUND_DISABLED = 0,
SI_PIXEL_ROUND_CENTER = 1,
SI_PIXEL_ROUND_CORNER = 2,
-} eSpaceImage_Round_Mode;
+} eSpaceImage_PixelRoundMode;
/** #SpaceImage.mode */
typedef enum eSpaceImage_Mode {
@@ -1300,7 +1312,7 @@ typedef enum eSpaceImage_Flag {
SI_FULLWINDOW = (1 << 16),
SI_FLAG_UNUSED_17 = (1 << 17),
- SI_CUSTOM_GRID = (1 << 18),
+ SI_FLAG_UNUSED_18 = (1 << 18),
/**
* This means that the image is drawn until it reaches the view edge,
diff --git a/source/blender/makesdna/DNA_userdef_enums.h b/source/blender/makesdna/DNA_userdef_enums.h
index e90aa0e0f07..dc368819ab0 100644
--- a/source/blender/makesdna/DNA_userdef_enums.h
+++ b/source/blender/makesdna/DNA_userdef_enums.h
@@ -39,6 +39,7 @@ typedef enum eDupli_ID_Flags {
USER_DUP_LATTICE = (1 << 17),
USER_DUP_CAMERA = (1 << 18),
USER_DUP_SPEAKER = (1 << 19),
+ USER_DUP_NTREE = (1 << 20),
USER_DUP_OBDATA = (~0) & ((1 << 24) - 1),
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index d57cca0b055..9b235fac049 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -364,7 +364,7 @@ typedef struct wmOperatorTypeMacro {
struct wmOperatorTypeMacro *next, *prev;
/* operator id */
- char idname[64];
+ char idname[64]; /* OP_MAX_TYPENAME */
/* rna pointer to access properties, like keymap */
/** Operator properties, assigned to ptr->data and can be written to a file. */
struct IDProperty *properties;
@@ -551,7 +551,7 @@ typedef struct wmOperator {
/* saved */
/** Used to retrieve type pointer. */
- char idname[64];
+ char idname[64]; /* OP_MAX_TYPENAME */
/** Saved, user-settable properties. */
IDProperty *properties;
diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt
index 0d04d7df067..50fd51e88a1 100644
--- a/source/blender/makesdna/intern/CMakeLists.txt
+++ b/source/blender/makesdna/intern/CMakeLists.txt
@@ -116,8 +116,8 @@ blender_add_lib(bf_dna "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
# -----------------------------------------------------------------------------
# Build bf_dna_blenlib library
set(INC
+ ..
../../blenlib
- ../../makesdna
../../../../intern/atomic
../../../../intern/guardedalloc
)