diff options
Diffstat (limited to 'source/blender/makesdna')
42 files changed, 529 insertions, 386 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index d64b3d361cf..edd70e0f9d7 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -471,7 +471,7 @@ typedef struct Library { */ char filepath_abs[1024]; - /** Set for indirectly linked libs, used in the outliner and while reading. */ + /** Set for indirectly linked libraries, used in the outliner and while reading. */ struct Library *parent; struct PackedFile *packedfile; diff --git a/source/blender/makesdna/DNA_asset_types.h b/source/blender/makesdna/DNA_asset_types.h index a4e092ff7b1..b5371011ddc 100644 --- a/source/blender/makesdna/DNA_asset_types.h +++ b/source/blender/makesdna/DNA_asset_types.h @@ -42,6 +42,10 @@ typedef struct AssetFilterSettings { * more than that from the file. So pointers to other IDs or ID data are strictly forbidden. */ typedef struct AssetMetaData { +#ifdef __cplusplus + ~AssetMetaData(); +#endif + /** Runtime type, to reference event callbacks. Only valid for local assets. */ struct AssetTypeInfo *local_type_info; @@ -114,6 +118,8 @@ typedef struct AssetLibraryReference { } AssetLibraryReference; /** + * To be replaced by #AssetRepresentation! + * * Not part of the core design, we should try to get rid of it. Only needed to wrap FileDirEntry * into a type with PropertyGroup as base, so we can have an RNA collection of #AssetHandle's to * pass to the UI. diff --git a/source/blender/makesdna/DNA_brush_defaults.h b/source/blender/makesdna/DNA_brush_defaults.h index 530c056b584..6e88275672a 100644 --- a/source/blender/makesdna/DNA_brush_defaults.h +++ b/source/blender/makesdna/DNA_brush_defaults.h @@ -91,6 +91,8 @@ .pose_ik_segments = 1, \ .hardness = 0.0f, \ .automasking_boundary_edges_propagation_steps = 1, \ + .automasking_cavity_blur_steps = 0,\ + .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 988853e6694..72357ea6734 100644 --- a/source/blender/makesdna/DNA_brush_enums.h +++ b/source/blender/makesdna/DNA_brush_enums.h @@ -89,6 +89,8 @@ typedef enum eGPDbrush_Flag { GP_BRUSH_TRIM_STROKE = (1 << 16), /* Post process convert to outline stroke */ GP_BRUSH_OUTLINE_STROKE = (1 << 17), + /* Collide with stroke. */ + GP_BRUSH_FILL_STROKE_COLLIDE = (1 << 18), } eGPDbrush_Flag; typedef enum eGPDbrush_Flag2 { @@ -118,13 +120,19 @@ typedef enum eGPDbrush_Flag2 { GP_BRUSH_USE_UV_RAND_PRESS = (1 << 11), } eGPDbrush_Flag2; -/* BrushGpencilSettings->gp_fill_draw_mode */ +/* BrushGpencilSettings->fill_draw_mode */ typedef enum eGP_FillDrawModes { GP_FILL_DMODE_BOTH = 0, GP_FILL_DMODE_STROKE = 1, GP_FILL_DMODE_CONTROL = 2, } eGP_FillDrawModes; +/* BrushGpencilSettings->fill_extend_mode */ +typedef enum eGP_FillExtendModes { + GP_FILL_EMODE_EXTEND = 0, + GP_FILL_EMODE_RADIUS = 1, +} eGP_FillExtendModes; + /* BrushGpencilSettings->fill_layer_mode */ typedef enum eGP_FillLayerModes { GP_FILL_GPLMODE_VISIBLE = 0, @@ -307,12 +315,6 @@ typedef enum eGP_Sculpt_Mode_Flag { GP_SCULPT_FLAGMODE_APPLY_THICKNESS = (1 << 2), /* apply brush to uv data */ GP_SCULPT_FLAGMODE_APPLY_UV = (1 << 3), - /* Stroke Auto-Masking for sculpt. */ - GP_SCULPT_FLAGMODE_AUTOMASK_STROKE = (1 << 4), - /* Layer Auto-Masking for sculpt. */ - GP_SCULPT_FLAGMODE_AUTOMASK_LAYER = (1 << 5), - /* Material Auto-Masking for sculpt. */ - GP_SCULPT_FLAGMODE_AUTOMASK_MATERIAL = (1 << 6), } eGP_Sculpt_Mode_Flag; typedef enum eAutomasking_flag { @@ -320,6 +322,17 @@ typedef enum eAutomasking_flag { BRUSH_AUTOMASKING_FACE_SETS = (1 << 1), BRUSH_AUTOMASKING_BOUNDARY_EDGES = (1 << 2), 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. */ + BRUSH_AUTOMASKING_CAVITY_INVERTED = (1 << 5), + BRUSH_AUTOMASKING_CAVITY_ALL = (1 << 4) | (1 << 5), + BRUSH_AUTOMASKING_CAVITY_USE_CURVE = (1 << 6), + /* (1 << 7) - unused. */ + BRUSH_AUTOMASKING_BRUSH_NORMAL = (1 << 8), + BRUSH_AUTOMASKING_VIEW_NORMAL = (1 << 9), + BRUSH_AUTOMASKING_VIEW_OCCLUSION = (1 << 10), } eAutomasking_flag; typedef enum ePaintBrush_flag { diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 33f5d8eea12..a415122579e 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -58,11 +58,10 @@ typedef struct BrushGpencilSettings { /** Factor for transparency. */ float fill_threshold; - /** Number of pixel to consider the leak is too small (x 2). */ - short fill_leak; + char _pad2[2]; /* Type of caps: eGPDstroke_Caps. */ int8_t caps_type; - char _pad; + char _pad[5]; int flag2; @@ -70,6 +69,8 @@ typedef struct BrushGpencilSettings { int fill_simplylvl; /** Type of control lines drawing mode. */ int fill_draw_mode; + /** Type of gap filling extension to use. */ + int fill_extend_mode; /** Icon identifier. */ int icon_id; @@ -387,6 +388,11 @@ typedef struct Brush { struct BrushGpencilSettings *gpencil_settings; struct BrushCurvesSculptSettings *curves_sculpt_settings; + + int automasking_cavity_blur_steps; + float automasking_cavity_factor; + + struct CurveMapping *automasking_cavity_curve; } Brush; /* Struct to hold palette colors for sorting. */ diff --git a/source/blender/makesdna/DNA_collection_types.h b/source/blender/makesdna/DNA_collection_types.h index a3e5eb4e944..75bfc2575a5 100644 --- a/source/blender/makesdna/DNA_collection_types.h +++ b/source/blender/makesdna/DNA_collection_types.h @@ -36,6 +36,7 @@ enum eCollectionLineArt_Usage { COLLECTION_LRT_EXCLUDE = (1 << 1), COLLECTION_LRT_INTERSECTION_ONLY = (1 << 2), COLLECTION_LRT_NO_INTERSECTION = (1 << 3), + COLLECTION_LRT_FORCE_INTERSECTION = (1 << 4), }; enum eCollectionLineArt_Flags { diff --git a/source/blender/makesdna/DNA_color_types.h b/source/blender/makesdna/DNA_color_types.h index 623d1dd6440..4eb64290032 100644 --- a/source/blender/makesdna/DNA_color_types.h +++ b/source/blender/makesdna/DNA_color_types.h @@ -21,6 +21,9 @@ extern "C" { #define CM_TOT 4 +#define GPU_SKY_WIDTH 512 +#define GPU_SKY_HEIGHT 128 + typedef struct CurveMapPoint { float x, y; /** Shorty for result lookup. */ diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 8e0ce68f71a..04887f1223c 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -181,7 +181,7 @@ typedef struct bKinematicConstraint { float orientweight; /** CopyPose: for target-less IK. */ float grabtarget[3]; - /** Subtype of IK constraint: eConstraint_IK_Type. */ + /** Sub-type of IK constraint: #eConstraint_IK_Type. */ short type; /** Distance: how to limit in relation to clamping sphere: LIMITDIST_... */ short mode; diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index f51b1c790b0..0355ed3febe 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -116,7 +116,7 @@ typedef enum eCustomDataType { CD_PROP_BYTE_COLOR = 17, CD_TANGENT = 18, CD_MDISPS = 19, - CD_PREVIEW_MCOL = 20, /* for displaying weightpaint colors */ + CD_PREVIEW_MCOL = 20, /* For displaying weight-paint colors. */ /* CD_ID_MCOL = 21, */ /* CD_TEXTURE_MLOOPCOL = 22, */ /* UNUSED */ CD_CLOTH_ORCO = 23, @@ -127,12 +127,7 @@ typedef enum eCustomDataType { 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. - */ + /** Subdivision sharpness data per edge or per vertex. */ CD_CREASE = 30, CD_ORIGSPACE_MLOOP = 31, CD_PREVIEW_MLOOPCOL = 32, @@ -206,7 +201,6 @@ typedef enum eCustomDataType { #define CD_MASK_MLOOPTANGENT (1LL << CD_MLOOPTANGENT) #define CD_MASK_TESSLOOPNORMAL (1LL << CD_TESSLOOPNORMAL) #define CD_MASK_CUSTOMLOOPNORMAL (1LL << CD_CUSTOMLOOPNORMAL) -#define CD_MASK_SCULPT_FACE_SETS (1LL << CD_SCULPT_FACE_SETS) #define CD_MASK_PROP_COLOR (1ULL << CD_PROP_COLOR) #define CD_MASK_PROP_FLOAT3 (1ULL << CD_PROP_FLOAT3) #define CD_MASK_PROP_FLOAT2 (1ULL << CD_PROP_FLOAT2) @@ -215,7 +209,7 @@ typedef enum eCustomDataType { #define CD_MASK_HAIRLENGTH (1ULL << CD_HAIRLENGTH) -/** Multires loop data. */ +/** Multi-resolution loop data. */ #define CD_MASK_MULTIRES_GRIDS (CD_MASK_MDISPS | CD_GRID_PAINT_MASK) /* All data layers. */ diff --git a/source/blender/makesdna/DNA_fileglobal_types.h b/source/blender/makesdna/DNA_fileglobal_types.h index 0fcf232cdaa..58b8504430a 100644 --- a/source/blender/makesdna/DNA_fileglobal_types.h +++ b/source/blender/makesdna/DNA_fileglobal_types.h @@ -29,9 +29,9 @@ typedef struct FileGlobal { int fileflags; int globalf; - /** Commit timestamp from buildinfo. */ + /** Commit timestamp from `buildinfo`. */ uint64_t build_commit_timestamp; - /** Hash from buildinfo. */ + /** Hash from `buildinfo`. */ char build_hash[16]; /** File path where this was saved, for recover (1024 = FILE_MAX). */ char filepath[1024]; diff --git a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h index 324252ca369..8078283df7a 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h @@ -172,6 +172,19 @@ .curve_intensity = NULL, \ } +#define _DNA_DEFAULT_OutlineGpencilModifierData \ + { \ + .material = NULL, \ + .layername = "", \ + .pass_index = 0, \ + .flag = GP_OUTLINE_KEEP_SHAPE, \ + .thickness = 1, \ + .sample_length = 0.0f, \ + .subdiv = 3, \ + .layer_pass = 0, \ + .outline_material = NULL, \ + } + #define _DNA_DEFAULT_SimplifyGpencilModifierData \ { \ .material = NULL, \ @@ -249,6 +262,18 @@ .mode = 0, \ .sfra = 1, \ .efra = 250, \ + .segments = NULL, \ + .segments_len = 1, \ + .segment_active_index = 0, \ + } + + #define _DNA_DEFAULT_TimeGpencilModifierSegment \ + { \ + .name = "", \ + .seg_start = 1, \ + .seg_end = 2, \ + .seg_mode = 0, \ + .seg_repeat = 1, \ } #define _DNA_DEFAULT_TintGpencilModifierData \ diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index ca1eac0bde8..0932b7107bb 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -47,6 +47,7 @@ typedef enum GpencilModifierType { eGpencilModifierType_WeightAngle = 23, eGpencilModifierType_Shrinkwrap = 24, eGpencilModifierType_Envelope = 25, + eGpencilModifierType_Outline = 26, /* Keep last. */ NUM_GREASEPENCIL_MODIFIER_TYPES, } GpencilModifierType; @@ -201,8 +202,18 @@ typedef enum eThickGpencil_Flag { GP_THICK_WEIGHT_FACTOR = (1 << 7), } eThickGpencil_Flag; +typedef struct TimeGpencilModifierSegment { + char name[64]; + /* For path reference. */ + struct TimeGpencilModifierData *gpmd; + int seg_start; + int seg_end; + int seg_mode; + int seg_repeat; +} TimeGpencilModifierSegment; typedef struct TimeGpencilModifierData { GpencilModifierData modifier; + struct Material *material; /** Layer name. */ char layername[64]; /** Custom index for passes. */ @@ -215,7 +226,13 @@ typedef struct TimeGpencilModifierData { int mode; /** Start and end frame for custom range. */ int sfra, efra; + char _pad[4]; + + TimeGpencilModifierSegment *segments; + int segments_len; + int segment_active_index; + } TimeGpencilModifierData; typedef enum eTimeGpencil_Flag { @@ -230,8 +247,15 @@ typedef enum eTimeGpencil_Mode { GP_TIME_MODE_REVERSE = 1, GP_TIME_MODE_FIX = 2, GP_TIME_MODE_PINGPONG = 3, + GP_TIME_MODE_CHAIN = 4, } eTimeGpencil_Mode; +typedef enum eTimeGpencil_Seg_Mode { + GP_TIME_SEG_MODE_NORMAL = 0, + GP_TIME_SEG_MODE_REVERSE = 1, + GP_TIME_SEG_MODE_PINGPONG = 2, +} eTimeGpencil_Seg_Mode; + typedef enum eModifyColorGpencil_Flag { GP_MODIFY_COLOR_BOTH = 0, GP_MODIFY_COLOR_STROKE = 1, @@ -313,6 +337,38 @@ typedef enum eOpacityGpencil_Flag { GP_OPACITY_WEIGHT_FACTOR = (1 << 8), } eOpacityGpencil_Flag; +typedef struct OutlineGpencilModifierData { + GpencilModifierData modifier; + /** Target stroke origin. */ + struct Object *object; + /** Material for filtering. */ + struct Material *material; + /** Layer name. */ + char layername[64]; + /** Custom index for passes. */ + int pass_index; + /** Flags. */ + int flag; + /** Thickness. */ + int thickness; + /** Sample Length. */ + float sample_length; + /** Subdivisions. */ + int subdiv; + /** Custom index for passes. */ + int layer_pass; + /** Material for outline. */ + struct Material *outline_material; +} OutlineGpencilModifierData; + +typedef enum eOutlineGpencil_Flag { + GP_OUTLINE_INVERT_LAYER = (1 << 0), + GP_OUTLINE_INVERT_PASS = (1 << 1), + GP_OUTLINE_INVERT_LAYERPASS = (1 << 2), + GP_OUTLINE_INVERT_MATERIAL = (1 << 3), + GP_OUTLINE_KEEP_SHAPE = (1 << 4), +} eOutlineGpencil_Flag; + typedef struct ArrayGpencilModifierData { GpencilModifierData modifier; struct Object *object; diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 6a2f25f3975..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; @@ -347,6 +350,10 @@ typedef enum eGPDstroke_Flag { /* Flag to indicated that the editcurve has been changed and the stroke needs to be updated with * the curve data */ GP_STROKE_NEEDS_CURVE_UPDATE = (1 << 9), + /* Flag to indicate that a stroke is used only for help, and will not affect rendering or fill */ + GP_STROKE_HELP = (1 << 10), + /* Flag to indicate that a extend stroke collide (fill tool) */ + GP_STROKE_COLLIDE = (1 << 11), /* only for use with stroke-buffer (while drawing arrows) */ GP_STROKE_USE_ARROW_START = (1 << 12), /* only for use with stroke-buffer (while drawing arrows) */ @@ -609,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_layer_types.h b/source/blender/makesdna/DNA_layer_types.h index b9aadcaf183..6ea35dfb770 100644 --- a/source/blender/makesdna/DNA_layer_types.h +++ b/source/blender/makesdna/DNA_layer_types.h @@ -35,8 +35,8 @@ typedef enum eViewLayerEEVEEPassType { EEVEE_RENDER_PASS_BLOOM = (1 << 14), EEVEE_RENDER_PASS_AOV = (1 << 15), /* - * TODO(jbakker): Clean up confliting bits after EEVEE has been removed. - * EEVEE_RENDER_PASS_CRYPTOMATTE is for EEVEE, EEVEE_RENDER_PASS_CRYTPOMATTE_* are for + * TODO(@jbakker): Clean up conflicting bits after EEVEE has been removed. + * #EEVEE_RENDER_PASS_CRYPTOMATTE is for EEVEE, `EEVEE_RENDER_PASS_CRYTPOMATTE_*` are for * EEVEE-Next. */ EEVEE_RENDER_PASS_CRYPTOMATTE = (1 << 16), @@ -71,27 +71,23 @@ typedef enum eViewLayerCryptomatteFlags { typedef struct Base { struct Base *next, *prev; - /* Flags which are based on the collections flags evaluation, does not - * include flags from object's restrictions. */ - short flag_from_collection; + struct Object *object; + + /* Pointer to an original base. Is initialized for evaluated view layer. + * NOTE: Only allowed to be accessed from within active dependency graph. */ + struct Base *base_orig; + unsigned int lay DNA_DEPRECATED; /* Final flags, including both accumulated collection flags and object's * restriction flags. */ short flag; - + /* Flags which are based on the collections flags evaluation, does not + * include flags from object's restrictions. */ + short flag_from_collection; + short flag_legacy; unsigned short local_view_bits; - short sx, sy; - char _pad1[6]; - struct Object *object; - unsigned int lay DNA_DEPRECATED; - int flag_legacy; unsigned short local_collections_bits; - short _pad2[3]; - - /* Pointer to an original base. Is initialized for evaluated view layer. - * NOTE: Only allowed to be accessed from within active dependency graph. */ - struct Base *base_orig; - void *_pad; + char _pad1[2]; } Base; typedef struct ViewLayerEngineData { @@ -138,13 +134,13 @@ typedef struct ViewLayerAOV { typedef struct ViewLayerLightgroup { struct ViewLayerLightgroup *next, *prev; - /* Name of the Lightgroup */ + /* Name of the Light-group. */ char name[64]; } ViewLayerLightgroup; -/* Lightgroup membership information. */ +/* Light-group membership information. */ typedef struct LightgroupMembership { - /* Name of the Lightgroup */ + /* Name of the Light-group. */ char name[64]; } LightgroupMembership; @@ -273,6 +269,7 @@ enum { VIEW_LAYER_RENDER = (1 << 0), /* VIEW_LAYER_DEPRECATED = (1 << 1), */ VIEW_LAYER_FREESTYLE = (1 << 2), + VIEW_LAYER_OUT_OF_SYNC = (1 << 3), }; /****************************** Deprecated ******************************/ diff --git a/source/blender/makesdna/DNA_lightprobe_types.h b/source/blender/makesdna/DNA_lightprobe_types.h index d6afaf33052..5b5bc4c7392 100644 --- a/source/blender/makesdna/DNA_lightprobe_types.h +++ b/source/blender/makesdna/DNA_lightprobe_types.h @@ -64,7 +64,6 @@ typedef struct LightProbe { /* Runtime display data */ float distfalloff, distgridinf; - char _pad[8]; } LightProbe; /* Probe->type */ diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index d335b36950c..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) @@ -254,24 +139,23 @@ typedef struct Mesh { float smoothresh; /** - * 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; - - /** * 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; - /** Choice between different remesh methods in the UI. */ char remesh_mode; + /** The length of the #mat array. */ + short totcol; + + /** + * Deprecated flag for choosing whether to store specific custom data that was built into #Mesh + * structs in edit mode. Replaced by separating that data to separate layers. Kept for forward + * and backwards compatibility. + */ + char cd_flag DNA_DEPRECATED; char subdiv DNA_DEPRECATED; char subdivr DNA_DEPRECATED; char subsurftype DNA_DEPRECATED; @@ -285,7 +169,7 @@ typedef struct Mesh { struct MVert *mvert DNA_DEPRECATED; /** Deprecated array of mesh edges, kept for reading old files, now stored in #CustomData. */ struct MEdge *medge DNA_DEPRECATED; - /** Deprecated "Vertex group" data. Kept for reading old files, now stored in #CustomData.*/ + /** Deprecated "Vertex group" data. Kept for reading old files, now stored in #CustomData. */ struct MDeformVert *dvert DNA_DEPRECATED; /** Deprecated runtime data for tessellation face UVs and texture, kept for reading old files. */ struct MTFace *mtface DNA_DEPRECATED; @@ -317,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 @@ -361,6 +249,10 @@ typedef struct Mesh { /** Write access to vertex group data. */ blender::MutableSpan<MDeformVert> deform_verts_for_write(); + /** + * Cached triangulation of the mesh. + */ + blender::Span<MLoopTri> looptris() const; #endif } Mesh; @@ -380,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, @@ -438,15 +320,15 @@ enum { ME_REMESH_REPROJECT_SCULPT_FACE_SETS = 1 << 15, }; +#ifdef DNA_DEPRECATED_ALLOW /** #Mesh.cd_flag */ enum { -#ifdef DNA_DEPRECATED_ALLOW ME_CDFLAG_VERT_BWEIGHT = 1 << 0, ME_CDFLAG_EDGE_BWEIGHT = 1 << 1, -#endif ME_CDFLAG_EDGE_CREASE = 1 << 2, ME_CDFLAG_VERT_CREASE = 1 << 3, }; +#endif /** #Mesh.remesh_mode */ enum { diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index e621343b818..f1c2dcaae68 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -21,15 +21,19 @@ extern "C" { /** * Mesh Vertices. * - * Typically accessed from #Mesh.mvert + * Typically accessed from #Mesh.verts() */ typedef struct MVert { float co[3]; - char flag; + /** + * Deprecated flag for storing hide status and selection, which are now stored in separate + * generic attributes. Kept for file read and write. + */ + char flag_legacy; /** * Deprecated bevel weight storage, now located in #CD_BWEIGHT, except for file read and write. */ - char bweight DNA_DEPRECATED; + char bweight_legacy; char _pad[2]; } MVert; @@ -37,6 +41,7 @@ typedef struct MVert { #ifdef DNA_DEPRECATED_ALLOW enum { + /** Deprecated selection status. Now stored in ".select_vert" attribute. */ /* SELECT = (1 << 0), */ /** Deprecated hide status. Now stored in ".hide_vert" attribute. */ ME_HIDE = (1 << 4), @@ -46,36 +51,37 @@ enum { /** * Mesh Edges. * - * Typically accessed from #Mesh.medge + * Typically accessed with #Mesh.edges() */ typedef struct MEdge { /** Un-ordered vertex indices (cannot match). */ unsigned int v1, v2; - char crease; + /** Deprecated edge crease, now located in #CD_CREASE, except for file read and write. */ + char crease_legacy; /** * Deprecated bevel weight storage, now located in #CD_BWEIGHT, except for file read and write. */ - char bweight DNA_DEPRECATED; + char bweight_legacy; short flag; } MEdge; /** #MEdge.flag */ enum { + /** Deprecated selection status. Now stored in ".select_edge" attribute. */ /* SELECT = (1 << 0), */ ME_EDGEDRAW = (1 << 1), ME_SEAM = (1 << 2), /** Deprecated hide status. Now stored in ".hide_edge" attribute. */ /* ME_HIDE = (1 << 4), */ - ME_EDGERENDER = (1 << 5), ME_LOOSEEDGE = (1 << 7), ME_SHARP = (1 << 9), /* only reason this flag remains a 'short' */ }; /** - * Mesh Faces + * Mesh Faces. * This only stores the polygon size & flags, the vertex & edge indices are stored in the #MLoop. * - * Typically accessed from #Mesh.mpoly. + * Typically accessed with #Mesh.polys(). */ typedef struct MPoly { /** Offset into loop array and number of loops in the face. */ @@ -83,14 +89,17 @@ typedef struct MPoly { /** Keep signed since we need to subtract when getting the previous loop. */ int totloop; /** Deprecated material index. Now stored in the "material_index" attribute, but kept for IO. */ - short mat_nr DNA_DEPRECATED; + short mat_nr_legacy; char flag, _pad; } MPoly; /** #MPoly.flag */ enum { ME_SMOOTH = (1 << 0), +#ifdef DNA_DEPRECATED_ALLOW + /** Deprecated selection status. Now stored in ".select_poly" attribute. */ ME_FACE_SEL = (1 << 1), +#endif /** Deprecated hide status. Now stored in ".hide_poly" attribute. */ /* ME_HIDE = (1 << 4), */ }; @@ -99,7 +108,7 @@ enum { * Mesh Face Corners. * "Loop" is an internal name for the corner of a polygon (#MPoly). * - * Typically accessed from #Mesh.mloop. + * Typically accessed with #Mesh.loops(). */ typedef struct MLoop { /** Vertex index into an #MVert array. */ @@ -366,7 +375,7 @@ typedef struct MDisps { /** * Used for hiding parts of a multires mesh. - * Essentially the multires equivalent of the mesh ".hide_vert" boolean layer. + * Essentially the multires equivalent of the mesh ".hide_vert" boolean attribute. * * \note This is a bitmap, keep in sync with type used in BLI_bitmap.h */ diff --git a/source/blender/makesdna/DNA_meta_types.h b/source/blender/makesdna/DNA_meta_types.h index d0c09a0d6ab..b4a66a46efe 100644 --- a/source/blender/makesdna/DNA_meta_types.h +++ b/source/blender/makesdna/DNA_meta_types.h @@ -42,7 +42,7 @@ typedef struct MetaElem { float rad2; /** Stiffness, how much of the element to fill. */ float s; - /** Old, only used for backwards compat. use dimensions now. */ + /** Old, only used for backwards compatibility. use dimensions now. */ float len; /** Matrix and inverted matrix. */ @@ -63,7 +63,7 @@ typedef struct MetaBall { /* material of the mother ball will define the material used of all others */ struct Material **mat; - /** Flag is enum for updates, flag2 is bitflags for settings. */ + /** Flag is enum for updates, flag2 is bit-flags for settings. */ char flag, flag2; short totcol; /** Used to store MB_AUTOSPACE. */ diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 787f52f9891..c4180071352 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -195,7 +195,7 @@ typedef struct LatticeModifierData { ModifierData modifier; struct Object *object; - /** Optional vertexgroup name, MAX_VGROUP_NAME. */ + /** Optional vertex-group name, #MAX_VGROUP_NAME. */ char name[64]; float strength; short flag; @@ -212,7 +212,7 @@ typedef struct CurveModifierData { ModifierData modifier; struct Object *object; - /** Optional vertexgroup name, MAX_VGROUP_NAME. */ + /** Optional vertex-group name, #MAX_VGROUP_NAME. */ char name[64]; /** Axis along which curve deforms. */ short defaxis; @@ -262,7 +262,7 @@ typedef struct MaskModifierData { /** Armature to use to in place of hardcoded vgroup. */ struct Object *ob_arm; - /** Name of vertex group to use to mask, MAX_VGROUP_NAME. */ + /** Name of vertex group to use to mask, #MAX_VGROUP_NAME. */ char vgroup[64]; /** Using armature or hardcoded vgroup. */ @@ -447,7 +447,7 @@ typedef struct BevelModifierData { float bevel_angle; float spread; /** if the MOD_BEVEL_VWEIGHT option is set, - * this will be the name of the vert group, MAX_VGROUP_NAME */ + * this will be the name of the vert group, #MAX_VGROUP_NAME */ char defgrp_name[64]; char _pad1[4]; @@ -565,7 +565,7 @@ typedef struct DisplaceModifierData { float strength; int direction; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char defgrp_name[64]; float midlevel; int space; @@ -635,7 +635,7 @@ typedef struct DecimateModifierData { /** (mode == MOD_DECIM_MODE_DISSOLVE). */ float angle; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char defgrp_name[64]; float defgrp_factor; short flag, mode; @@ -663,7 +663,7 @@ enum { typedef struct SmoothModifierData { ModifierData modifier; float fac; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char defgrp_name[64]; short flag, repeat; @@ -684,7 +684,7 @@ typedef struct CastModifierData { float fac; float radius; float size; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char defgrp_name[64]; short flag; /** Cast modifier projection type. */ @@ -725,7 +725,7 @@ typedef struct WaveModifierData { /* End MappingInfoModifierData. */ struct Object *objectcenter; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char defgrp_name[64]; short flag; @@ -760,7 +760,7 @@ typedef struct ArmatureModifierData { struct Object *object; /** Stored input of previous modifier, for vertex-group blending. */ float (*vert_coords_prev)[3]; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char defgrp_name[64]; } ArmatureModifierData; @@ -803,11 +803,11 @@ typedef struct HookModifierData { struct CurveMapping *curfalloff; - /** If NULL, it's using vertexgroup. */ + /** If NULL, it's using vertex-group. */ int *indexar; int indexar_num; float force; - /** Optional vertexgroup name, MAX_VGROUP_NAME. */ + /** Optional vertex-group name, #MAX_VGROUP_NAME. */ char name[64]; void *_pad1; } HookModifierData; @@ -946,7 +946,7 @@ typedef struct MeshDeformModifierData { /** Mesh object. */ struct Object *object; - /** Optional vertexgroup name, MAX_VGROUP_NAME. */ + /** Optional vertex-group name, #MAX_VGROUP_NAME. */ char defgrp_name[64]; short gridsize, flag; @@ -1124,7 +1124,7 @@ typedef struct ShrinkwrapModifierData { struct Object *target; /** Additional shrink target. */ struct Object *auxTarget; - /** Optional vertexgroup name, MAX_VGROUP_NAME. */ + /** Optional vertex-group name, #MAX_VGROUP_NAME. */ char vgroup_name[64]; /** Distance offset to keep from mesh/projection point. */ float keepDist; @@ -1171,9 +1171,9 @@ enum { /** #ShrinkwrapModifierData.shrinkOpts */ enum { - /** allow shrinkwrap to move the vertex in the positive direction of axis */ + /** Allow shrink-wrap to move the vertex in the positive direction of axis. */ MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR = (1 << 0), - /** allow shrinkwrap to move the vertex in the negative direction of axis */ + /** Allow shrink-wrap to move the vertex in the negative direction of axis. */ MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR = (1 << 1), /** ignore vertex moves if a vertex ends projected on a front face of the target */ @@ -1207,7 +1207,7 @@ typedef struct SimpleDeformModifierData { /** Object to control the origin of modifier space coordinates. */ struct Object *origin; - /** Optional vertexgroup name, MAX_VGROUP_NAME. */ + /** Optional vertex-group name, #MAX_VGROUP_NAME. */ char vgroup_name[64]; /** Factors to control simple deforms. */ float factor; @@ -1250,7 +1250,7 @@ typedef struct ShapeKeyModifierData { typedef struct SolidifyModifierData { ModifierData modifier; - /** Name of vertex group to use, MAX_VGROUP_NAME. */ + /** Name of vertex group to use, #MAX_VGROUP_NAME. */ char defgrp_name[64]; char shell_defgrp_name[64]; char rim_defgrp_name[64]; @@ -1451,7 +1451,7 @@ typedef struct WarpModifierData { char bone_to[64]; struct CurveMapping *curfalloff; - /** Optional vertexgroup name, MAX_VGROUP_NAME. */ + /** Optional vertex-group name, #MAX_VGROUP_NAME. */ char defgrp_name[64]; float strength; float falloff_radius; @@ -1484,7 +1484,7 @@ typedef enum { typedef struct WeightVGEditModifierData { ModifierData modifier; - /** Name of vertex group to edit. MAX_VGROUP_NAME. */ + /** Name of vertex group to edit. #MAX_VGROUP_NAME. */ char defgrp_name[64]; /** Using MOD_WVG_EDIT_* flags. */ @@ -1504,7 +1504,7 @@ typedef struct WeightVGEditModifierData { /* Masking options. */ /** The global "influence", if no vgroup nor tex is used as mask. */ float mask_constant; - /** Name of mask vertex group from which to get weight factors. MAX_VGROUP_NAME. */ + /** Name of mask vertex group from which to get weight factors. #MAX_VGROUP_NAME. */ char mask_defgrp_name[64]; /* Texture masking. */ @@ -1540,9 +1540,9 @@ enum { typedef struct WeightVGMixModifierData { ModifierData modifier; - /** Name of vertex group to modify/weight. MAX_VGROUP_NAME. */ + /** Name of vertex group to modify/weight. #MAX_VGROUP_NAME. */ char defgrp_name_a[64]; - /** Name of other vertex group to mix in. MAX_VGROUP_NAME. */ + /** Name of other vertex group to mix in. #MAX_VGROUP_NAME. */ char defgrp_name_b[64]; /** Default weight value for first vgroup. */ float default_weight_a; @@ -1558,7 +1558,7 @@ typedef struct WeightVGMixModifierData { /* Masking options. */ /** The global "influence", if no vgroup nor tex is used as mask. */ float mask_constant; - /** Name of mask vertex group from which to get weight factors. MAX_VGROUP_NAME. */ + /** Name of mask vertex group from which to get weight factors. #MAX_VGROUP_NAME. */ char mask_defgrp_name[64]; /* Texture masking. */ @@ -1628,7 +1628,7 @@ enum { typedef struct WeightVGProximityModifierData { ModifierData modifier; - /** Name of vertex group to modify/weight. MAX_VGROUP_NAME. */ + /** Name of vertex group to modify/weight. #MAX_VGROUP_NAME. */ char defgrp_name[64]; /* Mapping stuff. */ @@ -1646,7 +1646,7 @@ typedef struct WeightVGProximityModifierData { /* Masking options. */ /** The global "influence", if no vgroup nor tex is used as mask. */ float mask_constant; - /** Name of mask vertex group from which to get weight factors. MAX_VGROUP_NAME. */ + /** Name of mask vertex group from which to get weight factors. #MAX_VGROUP_NAME. */ char mask_defgrp_name[64]; /* Texture masking. */ @@ -1840,7 +1840,7 @@ typedef struct LaplacianSmoothModifierData { float lambda, lambda_border; char _pad1[4]; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char defgrp_name[64]; short flag, repeat; } LaplacianSmoothModifierData; @@ -1856,9 +1856,13 @@ enum { }; typedef struct CorrectiveSmoothDeltaCache { - /* delta's between the original positions and the smoothed positions */ + /** + * Delta's between the original positions and the smoothed positions, + * calculated loop-tangent and which is accumulated into the vertex it uses. + * (run-time only). + */ float (*deltas)[3]; - unsigned int totverts; + unsigned int deltas_num; /* Value of settings when creating the cache. * These are used to check if the cache should be recomputed. */ @@ -1883,7 +1887,7 @@ typedef struct CorrectiveSmoothModifierData { char smooth_type, rest_source; char _pad[6]; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char defgrp_name[64]; /* runtime-only cache */ @@ -1928,7 +1932,7 @@ typedef struct UVWarpModifierData { /** Optional name of bone target, MAX_ID_NAME-2. */ char bone_dst[64]; - /** Optional vertexgroup name, MAX_VGROUP_NAME. */ + /** Optional vertex-group name, #MAX_VGROUP_NAME. */ char vgroup_name[64]; /** MAX_CUSTOMDATA_LAYER_NAME. */ char uvlayer_name[64]; @@ -2009,7 +2013,7 @@ enum { typedef struct LaplacianDeformModifierData { ModifierData modifier; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char anchor_grp_name[64]; int verts_num, repeat; float *vertexco; @@ -2031,7 +2035,7 @@ enum { */ typedef struct WireframeModifierData { ModifierData modifier; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char defgrp_name[64]; float offset; float offset_fac; @@ -2055,7 +2059,7 @@ typedef struct WeldModifierData { /* The limit below which to merge vertices. */ float merge_dist; - /* Name of vertex group to use to mask, MAX_VGROUP_NAME. */ + /** Name of vertex group to use to mask, #MAX_VGROUP_NAME. */ char defgrp_name[64]; char mode; @@ -2103,7 +2107,7 @@ typedef struct DataTransferModifierData { /** See CDT_MIX_ enum in BKE_customdata.h. */ int mix_mode; float mix_factor; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char defgrp_name[64]; int flags; @@ -2126,7 +2130,7 @@ enum { /** Set Split Normals modifier. */ typedef struct NormalEditModifierData { ModifierData modifier; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char defgrp_name[64]; /** Source of normals, or center of ellipsoid. */ struct Object *target; @@ -2249,7 +2253,7 @@ enum { typedef struct WeightedNormalModifierData { ModifierData modifier; - /** MAX_VGROUP_NAME. */ + /** #MAX_VGROUP_NAME. */ char defgrp_name[64]; char mode, flag; short weight; diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 735f5c7b20a..3161238dc2e 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; @@ -505,6 +502,7 @@ typedef struct bNodeLink { #ifdef __cplusplus bool is_muted() const; + bool is_available() const; #endif } bNodeLink; @@ -615,7 +613,7 @@ typedef struct bNodeTree { void (*progress)(void *, float progress); /** \warning may be called by different threads */ void (*stats_draw)(void *, const char *str); - int (*test_break)(void *); + bool (*test_break)(void *); void (*update_draw)(void *); void *tbh, *prh, *sdh, *udh; @@ -655,12 +653,12 @@ typedef struct bNodeTree { /** * Cached toposort of all nodes. If there are cycles, the returned array is not actually a * toposort. However, if a connected component does not contain a cycle, this component is sorted - * correctly. Use #has_link_cycle to check for cycles. + * correctly. Use #has_available_link_cycle to check for cycles. */ blender::Span<const bNode *> toposort_left_to_right() const; blender::Span<const bNode *> toposort_right_to_left() const; /** True when there are any cycles in the node tree. */ - bool has_link_cycle() const; + bool has_available_link_cycle() const; /** * True when there are nodes or sockets in the node tree that don't use a known type. This can * happen when nodes don't exist in the current Blender version that existed in the version where @@ -933,7 +931,7 @@ typedef struct NodeImageMultiFileSocket { char path[1024]; ImageFormatData format; - /* multilayer output */ + /* Multi-layer output. */ /** EXR_TOT_MAXNAME-2 ('.' and channel char are appended). */ char layer[30]; char _pad2[2]; @@ -992,7 +990,7 @@ typedef struct NodeGlare { char _pad1[4]; } NodeGlare; -/** Tonemap node. */ +/** Tone-map node. */ typedef struct NodeTonemap { float key, offset, gamma; float f, m, a, c; @@ -1275,7 +1273,7 @@ typedef struct CryptomatteLayer { typedef struct NodeCryptomatte_Runtime { /* Contains `CryptomatteLayer`. */ ListBase layers; - /* Temp storage for the cryptomatte picker. */ + /* Temp storage for the crypto-matte picker. */ float add[3]; float remove[3]; } NodeCryptomatte_Runtime; @@ -1499,6 +1497,10 @@ typedef struct NodeGeometryCurveToPoints { typedef struct NodeGeometryCurveSample { /* GeometryNodeCurveSampleMode. */ uint8_t mode; + int8_t use_all_curves; + /* eCustomDataType. */ + int8_t data_type; + char _pad[1]; } NodeGeometryCurveSample; typedef struct NodeGeometryTransferAttribute { @@ -1511,6 +1513,15 @@ typedef struct NodeGeometryTransferAttribute { char _pad[1]; } NodeGeometryTransferAttribute; +typedef struct NodeGeometrySampleIndex { + /* eCustomDataType. */ + int8_t data_type; + /* eAttrDomain. */ + int8_t domain; + int8_t clamp; + char _pad[1]; +} NodeGeometrySampleIndex; + typedef struct NodeGeometryRaycast { /* GeometryNodeRaycastMapMode. */ uint8_t mapping; @@ -1588,6 +1599,8 @@ typedef struct NodeGeometryImageTexture { typedef struct NodeGeometryViewer { /* eCustomDataType. */ int8_t data_type; + /* eAttrDomain. */ + int8_t domain; } NodeGeometryViewer; typedef struct NodeGeometryUVUnwrap { @@ -1595,6 +1608,11 @@ typedef struct NodeGeometryUVUnwrap { uint8_t method; } NodeGeometryUVUnwrap; +typedef struct NodeGeometryDistributePointsInVolume { + /* GeometryNodePointDistributeVolumeMode. */ + uint8_t mode; +} NodeGeometryDistributePointsInVolume; + typedef struct NodeFunctionCompare { /* NodeCompareOperation */ int8_t operation; @@ -1669,6 +1687,7 @@ enum { SHD_ATTRIBUTE_GEOMETRY = 0, SHD_ATTRIBUTE_OBJECT = 1, SHD_ATTRIBUTE_INSTANCER = 2, + SHD_ATTRIBUTE_VIEW_LAYER = 3, }; /* toon modes */ @@ -2059,6 +2078,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 { @@ -2176,6 +2210,11 @@ typedef enum GeometryNodeTriangulateQuads { GEO_NODE_TRIANGULATE_QUAD_LONGEDGE = 4, } GeometryNodeTriangulateQuads; +typedef enum GeometryNodeDistributePointsInVolumeMode { + GEO_NODE_DISTRIBUTE_POINTS_IN_VOLUME_DENSITY_RANDOM = 0, + GEO_NODE_DISTRIBUTE_POINTS_IN_VOLUME_DENSITY_GRID = 1, +} GeometryNodeDistributePointsInVolumeMode; + typedef enum GeometryNodeDistributePointsOnFacesMode { GEO_NODE_POINT_DISTRIBUTE_POINTS_ON_FACES_RANDOM = 0, GEO_NODE_POINT_DISTRIBUTE_POINTS_ON_FACES_POISSON = 1, diff --git a/source/blender/makesdna/DNA_object_defaults.h b/source/blender/makesdna/DNA_object_defaults.h index 14683869bc4..2a5796d2aea 100644 --- a/source/blender/makesdna/DNA_object_defaults.h +++ b/source/blender/makesdna/DNA_object_defaults.h @@ -23,7 +23,7 @@ \ .constinv = _DNA_DEFAULT_UNIT_M4, \ .parentinv = _DNA_DEFAULT_UNIT_M4, \ - .obmat = _DNA_DEFAULT_UNIT_M4, \ + .object_to_world = _DNA_DEFAULT_UNIT_M4, \ \ .scale = {1, 1, 1}, \ .dscale = {1, 1, 1}, \ diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index add11d61db8..494295f7bb9 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -231,6 +231,7 @@ enum eObjectLineArt_Usage { OBJECT_LRT_EXCLUDE = (1 << 2), OBJECT_LRT_INTERSECTION_ONLY = (1 << 3), OBJECT_LRT_NO_INTERSECTION = (1 << 4), + OBJECT_LRT_FORCE_INTERSECTION = (1 << 5), }; enum eObjectLineArt_Flags { @@ -321,20 +322,14 @@ typedef struct Object { float rotAxis[3], drotAxis[3]; /** Axis angle rotation - angle part. */ float rotAngle, drotAngle; - /** Final world-space matrix with constraints & animsys applied. */ - float obmat[4][4]; + /** Final transformation matrices with constraints & animsys applied. */ + float object_to_world[4][4]; + float world_to_object[4][4]; /** Inverse result of parent, so that object doesn't 'stick' to parent. */ float parentinv[4][4]; /** Inverse result of constraints. * doesn't include effect of parent or object local transform. */ float constinv[4][4]; - /** - * 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)` - */ - float imat[4][4]; /** Copy of Base's layer in the scene. */ unsigned int lay DNA_DEPRECATED; diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 268e1412eef..c4f11905e10 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -159,7 +159,7 @@ typedef struct SPHFluidSettings { char _pad[6]; } SPHFluidSettings; -/* fluid->flag */ +/** #SPHFluidSettings.flag */ #define SPH_VISCOELASTIC_SPRINGS 1 #define SPH_CURRENT_REST_LENGTH 2 #define SPH_FAC_REPULSION 4 @@ -168,7 +168,7 @@ typedef struct SPHFluidSettings { #define SPH_FAC_VISCOSITY 32 #define SPH_FAC_REST_LENGTH 64 -/* fluid->solver (numerical ID field, not bitfield) */ +/** #SPHFluidSettings.solver (numerical ID field, not bit-field). */ #define SPH_SOLVER_DDR 0 #define SPH_SOLVER_CLASSICAL 1 @@ -279,7 +279,7 @@ typedef struct ParticleSettings { struct PartDeflect *pd; struct PartDeflect *pd2; - /* modified dm support */ + /* Evaluated mesh support. */ short use_modifier_stack; char _pad5[2]; @@ -465,7 +465,7 @@ enum { #define PART_REACT_MULTIPLE 2 //#define PART_LOOP 4 /* not used anymore */ -/* for dopesheet */ +/* For dope-sheet. */ #define PART_DS_EXPAND 8 #define PART_HAIR_REGROW 16 /* regrow hair for each frame */ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index f184460cba4..8d02b274c65 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -12,8 +12,10 @@ /* XXX(@campbellbarton): temp feature. */ #define DURIAN_CAMERA_SWITCH -/* check for cyclic set-scene, - * libs can cause this case which is normally prevented, see (T#####) */ +/** + * Check for cyclic set-scene. + * Libraries can cause this case which is normally prevented, see (T42009). + */ #define USE_SETSCENE_CHECK #include "DNA_ID.h" @@ -401,12 +403,12 @@ typedef struct ImageFormatData { /** R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA. */ char planes; - /** Generic options for all image types, alpha zbuffer. */ + /** Generic options for all image types, alpha Z-buffer. */ char flag; - /** (0 - 100), eg: jpeg quality. */ + /** (0 - 100), eg: JPEG quality. */ char quality; - /** (0 - 100), eg: png compression. */ + /** (0 - 100), eg: PNG compression. */ char compress; /* --- format specific --- */ @@ -470,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 @@ -557,7 +560,8 @@ typedef struct BakeData { char target; char save_mode; char margin_type; - char _pad[5]; + char view_from; + char _pad[4]; struct Object *cage_object; } BakeData; @@ -590,6 +594,12 @@ typedef enum eBakeSaveMode { R_BAKE_SAVE_EXTERNAL = 1, } eBakeSaveMode; +/** #BakeData.view_from (char) */ +typedef enum eBakeViewFrom { + R_BAKE_VIEW_FROM_ABOVE_SURFACE = 0, + R_BAKE_VIEW_FROM_ACTIVE_CAMERA = 1, +} eBakeViewFrom; + /** #BakeData.pass_filter */ typedef enum eBakePassFilter { R_BAKE_PASS_FILTER_NONE = 0, @@ -1019,8 +1029,15 @@ typedef struct Sculpt { float constant_detail; float detail_percent; + int automasking_cavity_blur_steps; + float automasking_cavity_factor; char _pad[4]; + float automasking_start_normal_limit, automasking_start_normal_falloff; + float automasking_view_normal_limit, automasking_view_normal_falloff; + + struct CurveMapping *automasking_cavity_curve; + struct CurveMapping *automasking_cavity_curve_op; /* For use by operators */ struct Object *gravity_object; } Sculpt; @@ -1138,6 +1155,16 @@ typedef enum eGP_Sculpt_SettingsFlag { GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE = (1 << 1), /** Scale thickness. */ GP_SCULPT_SETT_FLAG_SCALE_THICKNESS = (1 << 3), + /* Stroke Auto-Masking for sculpt. */ + GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE = (1 << 4), + /* Stroke Layer Auto-Masking for sculpt. */ + GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE = (1 << 5), + /* Stroke Material Auto-Masking for sculpt. */ + GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE = (1 << 6), + /* Active Layer Auto-Masking for sculpt. */ + GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_ACTIVE = (1 << 7), + /* Active Material Auto-Masking for sculpt. */ + GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE = (1 << 8), } eGP_Sculpt_SettingsFlag; /** #GP_Sculpt_Settings.gpencil_selectmode_sculpt */ @@ -1500,12 +1527,12 @@ typedef struct ToolSettings { /* Transform */ char transform_pivot_point; char transform_flag; - /** Snap elements (per spacetype), #eSnapMode. */ + /** Snap elements (per space-type), #eSnapMode. */ char _pad1[1]; short snap_mode; char snap_node_mode; char snap_uv_mode; - /** Generic flags (per spacetype), #eSnapFlag. */ + /** Generic flags (per space-type), #eSnapFlag. */ short snap_flag; short snap_flag_node; short snap_flag_seq; @@ -1745,6 +1772,8 @@ typedef struct Scene { ID id; /** Animation data (must be immediately after id for utilities to use it). */ struct AnimData *adt; + /* runtime (must be immediately after id for utilities to use it). */ + DrawDataList drawdata; struct Object *camera; struct World *world; diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 9b999e4426f..4d4bd9ef775 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -437,7 +437,7 @@ typedef struct ARegion_Runtime { * Lazy initialize, zero'd when unset, relative to #ARegion.winrct x/y min. */ rcti visible_rect; - /* The offset needed to not overlap with window scrollbars. Only used by HUD regions for now. */ + /* The offset needed to not overlap with window scroll-bars. Only used by HUD regions for now. */ int offset_x, offset_y; /* Maps uiBlock->name to uiBlock for faster lookups. */ @@ -477,7 +477,7 @@ typedef struct ARegion { short do_draw_paintcursor; /** Private, set for indicate drawing overlapped. */ short overlap; - /** Temporary copy of flag settings for clean fullscreen. */ + /** Temporary copy of flag settings for clean full-screen. */ short flagfullscreen; /** Callbacks for this region type. */ diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index c0f92010c22..d8005b83383 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -184,7 +184,7 @@ typedef struct Sequence { /** Old animation system, deprecated for 2.5. */ struct Ipo *ipo DNA_DEPRECATED; - /** these ID vars should never be NULL but can be when linked libs fail to load, + /** these ID vars should never be NULL but can be when linked libraries fail to load, * so check on access */ struct Scene *scene; /** Override scene camera. */ diff --git a/source/blender/makesdna/DNA_sound_types.h b/source/blender/makesdna/DNA_sound_types.h index ba926f0f4fa..65d62b68561 100644 --- a/source/blender/makesdna/DNA_sound_types.h +++ b/source/blender/makesdna/DNA_sound_types.h @@ -78,7 +78,7 @@ typedef struct bSound { /* XXX unused currently (SOUND_TYPE_LIMITER) */ /* float start, end; */ - /* Description of Audio channels, as of eSoundChannels*/ + /* Description of Audio channels, as of #eSoundChannels. */ int audio_channels; int samplerate; diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 6e05dd395ba..8dce71fd33e 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -22,6 +22,7 @@ #include "DNA_vec_types.h" /* Hum ... Not really nice... but needed for spacebuts. */ #include "DNA_view2d_types.h" +#include "DNA_viewer_path_types.h" #ifdef __cplusplus extern "C" { @@ -666,7 +667,7 @@ typedef struct SpaceSeq { struct SequencerPreviewOverlay preview_overlay; struct SequencerTimelineOverlay timeline_overlay; - /** Multiview current eye - for internal use. */ + /** Multi-view current eye - for internal use. */ char multiview_eye; char _pad2[7]; @@ -1080,6 +1081,7 @@ typedef enum eFileSel_File_Types { FILE_TYPE_DIR = (1 << 30), FILE_TYPE_BLENDERLIB = (1u << 31), } eFileSel_File_Types; +ENUM_OPERATORS(eFileSel_File_Types, FILE_TYPE_BLENDERLIB); /** Selection Flags in filesel: struct direntry, unsigned char selflag. */ typedef enum eDirEntry_SelectFlag { @@ -1099,7 +1101,7 @@ typedef struct FileDirEntry { uint32_t uid; /* FileUID */ /* Name needs freeing if FILE_ENTRY_NAME_FREE is set. Otherwise this is a direct pointer to a * name buffer. */ - char *name; + const char *name; uint64_t size; int64_t time; @@ -1126,7 +1128,7 @@ typedef struct FileDirEntry { /** If this file represents an asset, its asset data is here. Note that we may show assets of * external files in which case this is set but not the id above. * Note comment for FileListInternEntry.local_data, the same applies here! */ - struct AssetMetaData *asset_data; + struct AssetRepresentation *asset; /* The icon_id for the preview image. */ int preview_icon_id; @@ -1161,6 +1163,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, }; /** \} */ @@ -1176,6 +1182,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. */ @@ -1212,7 +1224,7 @@ typedef struct SpaceImage { char pin; - char pixel_snap_mode; + char pixel_round_mode; char lock; /** UV draw type. */ @@ -1222,7 +1234,9 @@ typedef struct SpaceImage { char around; char gizmo_flag; - char _pad1[3]; + + char grid_shape_source; + char _pad1[2]; int flag; @@ -1230,11 +1244,10 @@ typedef struct SpaceImage { int tile_grid_shape[2]; /** - * UV editor custom-grid. Value of `N` will produce `NxN` grid. - * Use when #SI_CUSTOM_GRID is set. + * UV editor custom-grid. Value of `{M,N}` will produce `MxN` grid. + * Use when `custom_grid_shape == SI_GRID_SHAPE_FIXED`. */ - int custom_grid_subdiv; - char _pad3[4]; + int custom_grid_subdiv[2]; MaskSpaceInfo mask_info; SpaceImageOverlay overlay; @@ -1254,12 +1267,12 @@ typedef enum eSpaceImage_UVDT_Stretch { SI_UVDT_STRETCH_AREA = 1, } eSpaceImage_UVDT_Stretch; -/** #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.pixel_round_mode */ +typedef enum eSpaceImage_PixelRoundMode { + SI_PIXEL_ROUND_DISABLED = 0, + SI_PIXEL_ROUND_CENTER = 1, + SI_PIXEL_ROUND_CORNER = 2, +} eSpaceImage_PixelRoundMode; /** #SpaceImage.mode */ typedef enum eSpaceImage_Mode { @@ -1293,7 +1306,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, @@ -1313,6 +1326,8 @@ typedef enum eSpaceImage_Flag { SI_SHOW_R = (1 << 27), SI_SHOW_G = (1 << 28), SI_SHOW_B = (1 << 29), + + SI_GRID_OVER_IMAGE = (1 << 30), } eSpaceImage_Flag; typedef enum eSpaceImageOverlay_Flag { @@ -1630,7 +1645,7 @@ enum { typedef struct ConsoleLine { struct ConsoleLine *next, *prev; - /* keep these 3 vars so as to share free, realloc funcs */ + /* Keep these 3 vars so as to share free, realloc functions. */ /** Allocated length. */ int len_alloc; /** Real len - strlen(). */ @@ -1880,32 +1895,6 @@ typedef struct SpreadsheetColumn { char *display_name; } SpreadsheetColumn; -/** - * An item in SpaceSpreadsheet.context_path. - * This is a bases struct for the structs below. - */ -typedef struct SpreadsheetContext { - struct SpreadsheetContext *next, *prev; - /* eSpaceSpreadsheet_ContextType. */ - int type; - char _pad[4]; -} SpreadsheetContext; - -typedef struct SpreadsheetContextObject { - SpreadsheetContext base; - struct Object *object; -} SpreadsheetContextObject; - -typedef struct SpreadsheetContextModifier { - SpreadsheetContext base; - char *modifier_name; -} SpreadsheetContextModifier; - -typedef struct SpreadsheetContextNode { - SpreadsheetContext base; - char *node_name; -} SpreadsheetContextNode; - typedef struct SpaceSpreadsheet { SpaceLink *next, *prev; /** Storage of regions for inactive spaces. */ @@ -1922,12 +1911,11 @@ typedef struct SpaceSpreadsheet { ListBase row_filters; /** - * List of #SpreadsheetContext. - * This is a path to the data that is displayed in the spreadsheet. - * It can be set explicitly by an action of the user (e.g. clicking the preview icon in a - * geometry node) or it can be derived from context automatically based on some heuristic. + * Context that is currently displayed in the editor. This is usually a either a single object + * (in original/evaluated mode) or path to a viewer node. This is retrieved from the workspace + * but can be pinned so that it stays constant even when the active node changes. */ - ListBase context_path; + ViewerPath viewer_path; /* eSpaceSpreadsheet_FilterFlag. */ uint8_t filter_flag; diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index e32d9dbe300..c7d49db130e 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -115,7 +115,7 @@ typedef struct PointDensity { /** for 'Object' or 'Particle system' type - source object */ struct Object *object; - /** `index + 1` in ob.particlesystem, non-ID pointer not allowed */ + /** `index + 1` in ob.particle-system, non-ID pointer not allowed. */ int psys; /** cache points in world-space, object space, ... ? */ short psys_cache_space; 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_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 8c2c9a0665b..e0804052b45 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -582,7 +582,6 @@ typedef struct bUserAssetLibrary { typedef struct SolidLight { int flag; float smooth; - char _pad0[8]; float col[4], spec[4], vec[4]; } SolidLight; @@ -1077,7 +1076,7 @@ typedef enum eWalkNavigation_Flag { /** #UserDef.uiflag */ typedef enum eUserpref_UI_Flag { - USER_UIFLAG_UNUSED_0 = (1 << 0), /* cleared */ + USER_NO_MULTITOUCH_GESTURES = (1 << 0), USER_UIFLAG_UNUSED_1 = (1 << 1), /* cleared */ USER_WHEELZOOMDIR = (1 << 2), USER_FILTERFILEEXTS = (1 << 3), diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h index d08865cefb5..7e53c1e4d37 100644 --- a/source/blender/makesdna/DNA_view2d_types.h +++ b/source/blender/makesdna/DNA_view2d_types.h @@ -19,9 +19,9 @@ extern "C" { typedef struct View2D { /** Tot - area that data can be drawn in; cur - region of tot that is visible in viewport. */ rctf tot, cur; - /** Vert - vertical scrollbar region; hor - horizontal scrollbar region. */ + /** Vert - vertical scroll-bar region; hor - horizontal scroll-bar region. */ rcti vert, hor; - /** Mask - region (in screenspace) within which 'cur' can be viewed. */ + /** Mask - region (in screen-space) within which 'cur' can be viewed. */ rcti mask; /** Min/max sizes of 'cur' rect (only when keepzoom not set). */ @@ -29,7 +29,7 @@ typedef struct View2D { /** Allowable zoom factor range (only when (keepzoom & V2D_LIMITZOOM)) is set. */ float minzoom, maxzoom; - /** Scroll - scrollbars to display (bit-flag). */ + /** Scroll - scroll-bars to display (bit-flag). */ short scroll; /** Scroll_ui - temp settings used for UI drawing of scrollers. */ short scroll_ui; @@ -56,7 +56,7 @@ typedef struct View2D { short around; /* Usually set externally (as in, not in view2d files). */ - /** Alpha of vertical and horizontal scrollbars (range is [0, 255]). */ + /** Alpha of vertical and horizontal scroll-bars (range is [0, 255]). */ char alpha_vert, alpha_hor; char _pad[6]; @@ -124,11 +124,11 @@ enum { /** Scroller flags for View2D (#View2D.scroll). */ enum { - /* left scrollbar */ + /* Left scroll-bar. */ V2D_SCROLL_LEFT = (1 << 0), V2D_SCROLL_RIGHT = (1 << 1), V2D_SCROLL_VERTICAL = (V2D_SCROLL_LEFT | V2D_SCROLL_RIGHT), - /* horizontal scrollbar */ + /* Horizontal scroll-bar. */ V2D_SCROLL_TOP = (1 << 2), V2D_SCROLL_BOTTOM = (1 << 3), /* UNUSED = (1 << 4), */ @@ -137,11 +137,11 @@ enum { V2D_SCROLL_VERTICAL_HANDLES = (1 << 5), /* display horizontal scale handles */ V2D_SCROLL_HORIZONTAL_HANDLES = (1 << 6), - /* induce hiding of scrollbars - set by region drawing in response to size of region */ + /* Induce hiding of scroll-bar - set by region drawing in response to size of region. */ V2D_SCROLL_VERTICAL_HIDE = (1 << 7), V2D_SCROLL_HORIZONTAL_HIDE = (1 << 8), - /* scrollbar extends beyond its available window - - * set when calculating scrollbars for drawing */ + /* Scroll-bar extends beyond its available window - + * set when calculating scroll-bar for drawing */ V2D_SCROLL_VERTICAL_FULLR = (1 << 9), V2D_SCROLL_HORIZONTAL_FULLR = (1 << 10), }; diff --git a/source/blender/makesdna/DNA_view3d_defaults.h b/source/blender/makesdna/DNA_view3d_defaults.h index b2d17b0ea22..f124bdd5d94 100644 --- a/source/blender/makesdna/DNA_view3d_defaults.h +++ b/source/blender/makesdna/DNA_view3d_defaults.h @@ -36,8 +36,10 @@ #define _DNA_DEFAULT_View3DOverlay \ { \ + .flag = V3D_OVERLAY_VIEWER_ATTRIBUTE, \ .wireframe_threshold = 1.0f, \ .wireframe_opacity = 1.0f, \ + .viewer_attribute_opacity = 1.0f, \ .xray_alpha_bone = 0.5f, \ .bone_wire_alpha = 1.0f, \ .fade_alpha = 0.40f, \ @@ -81,7 +83,7 @@ .gridflag = V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_FLOOR | V3D_SHOW_ORTHO_GRID, \ \ .flag = V3D_SELECT_OUTLINE, \ - .flag2 = V3D_SHOW_RECONSTRUCTION | V3D_SHOW_ANNOTATION, \ + .flag2 = V3D_SHOW_RECONSTRUCTION | V3D_SHOW_ANNOTATION | V3D_SHOW_VIEWER, \ \ .lens = 50.0f, \ .clip_start = 0.01f, \ diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 1ba057d9c40..f3e56ba7039 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -22,6 +22,7 @@ struct wmTimer; #include "DNA_movieclip_types.h" #include "DNA_object_types.h" #include "DNA_view3d_enums.h" +#include "DNA_viewer_path_types.h" #ifdef __cplusplus extern "C" { @@ -205,6 +206,7 @@ typedef struct View3DOverlay { float weight_paint_mode_opacity; float sculpt_mode_mask_opacity; float sculpt_mode_face_sets_opacity; + float viewer_attribute_opacity; /** Armature edit/pose mode settings. */ float xray_alpha_bone; @@ -227,8 +229,6 @@ typedef struct View3DOverlay { float gpencil_vertex_paint_opacity; /** Handles display type for curves. */ int handle_display; - - char _pad[4]; } View3DOverlay; /** #View3DOverlay.handle_display */ @@ -348,6 +348,9 @@ typedef struct View3D { View3DShading shading; View3DOverlay overlay; + /** Path to the viewer node that is currently previewed. This is retrieved from the workspace. */ + ViewerPath viewer_path; + /** Runtime evaluation data (keep last). */ View3D_Runtime runtime; } View3D; @@ -391,7 +394,7 @@ enum { #define RV3D_PAINTING (1 << 5) /*#define RV3D_IS_GAME_ENGINE (1 << 5) */ /* UNUSED */ /** - * Disable zbuffer offset, skip calls to #ED_view3d_polygon_offset. + * Disable Z-buffer offset, skip calls to #ED_view3d_polygon_offset. * Use when precise surface depth is needed and picking bias isn't, see T45434). */ #define RV3D_ZOFFSET_DISABLED 64 @@ -443,7 +446,7 @@ enum { /** #View3D.flag2 (int) */ #define V3D_HIDE_OVERLAYS (1 << 2) -#define V3D_FLAG2_UNUSED_3 (1 << 3) /* cleared */ +#define V3D_SHOW_VIEWER (1 << 3) #define V3D_SHOW_ANNOTATION (1 << 4) #define V3D_LOCK_CAMERA (1 << 5) #define V3D_FLAG2_UNUSED_6 (1 << 6) /* cleared */ @@ -528,6 +531,7 @@ enum { V3D_OVERLAY_HIDE_OBJECT_ORIGINS = (1 << 10), V3D_OVERLAY_STATS = (1 << 11), V3D_OVERLAY_FADE_INACTIVE = (1 << 12), + V3D_OVERLAY_VIEWER_ATTRIBUTE = (1 << 13), }; /** #View3DOverlay.edit_flag */ diff --git a/source/blender/makesdna/DNA_viewer_path_types.h b/source/blender/makesdna/DNA_viewer_path_types.h new file mode 100644 index 00000000000..8f470b66ca0 --- /dev/null +++ b/source/blender/makesdna/DNA_viewer_path_types.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#include "BLI_listbase.h" +#include "BLI_utildefines.h" + +struct ID; + +typedef enum ViewerPathElemType { + VIEWER_PATH_ELEM_TYPE_ID = 0, + VIEWER_PATH_ELEM_TYPE_MODIFIER = 1, + VIEWER_PATH_ELEM_TYPE_NODE = 2, +} ViewerPathElemType; + +typedef struct ViewerPathElem { + struct ViewerPathElem *next, *prev; + int type; + char _pad[4]; +} ViewerPathElem; + +typedef struct IDViewerPathElem { + ViewerPathElem base; + struct ID *id; +} IDViewerPathElem; + +typedef struct ModifierViewerPathElem { + ViewerPathElem base; + char *modifier_name; +} ModifierViewerPathElem; + +typedef struct NodeViewerPathElem { + ViewerPathElem base; + char *node_name; +} NodeViewerPathElem; + +typedef struct ViewerPath { + /** List of #ViewerPathElem. */ + ListBase path; +} ViewerPath; diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 47b7aee54d1..7231a995f10 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -70,6 +70,8 @@ enum ReportListFlags { RPT_STORE = (1 << 1), RPT_FREE = (1 << 2), RPT_OP_HOLD = (1 << 3), /* don't move them into the operator global list (caller will use) */ + /** Don't print (the owner of the #ReportList will handle printing to the `stdout`). */ + RPT_PRINT_HANDLED_BY_OWNER = (1 << 4), }; /* These two Lines with # tell makesdna this struct can be excluded. */ @@ -87,13 +89,13 @@ typedef struct Report { } Report; /** - * \note Saved in the wm, don't remove. + * \note Saved in the #wmWindowManager, don't remove. */ typedef struct ReportList { ListBase list; - /** eReportType. */ + /** #eReportType. */ int printlevel; - /** eReportType. */ + /** #eReportType. */ int storelevel; int flag; char _pad[4]; @@ -305,7 +307,22 @@ typedef struct wmWindow { */ short pie_event_type_last; - /** Storage for event system. */ + /** + * Storage for event system. + * + * For the most part this is storage for `wmEvent.xy` & `wmEvent.modifiers`. + * newly added key/button events copy the cursor location and modifier state stored here. + * + * It's also convenient at times to be able to pass this as if it's a regular event. + * + * - This is not simply the current event being handled. + * The type and value is always set to the last press/release events + * otherwise cursor motion would always clear these values. + * + * - The value of `eventstate->modifiers` is set from the last pressed/released modifier key. + * This has the down side that the modifier value will be incorrect if users hold both + * left/right modifiers then release one. See note in #wm_event_add_ghostevent for details. + */ struct wmEvent *eventstate; /** Keep the last handled event in `event_queue` here (owned and must be freed). */ struct wmEvent *event_last_handled; @@ -347,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; @@ -534,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/DNA_workspace_types.h b/source/blender/makesdna/DNA_workspace_types.h index a72689badb1..0cd1144b30d 100644 --- a/source/blender/makesdna/DNA_workspace_types.h +++ b/source/blender/makesdna/DNA_workspace_types.h @@ -10,6 +10,7 @@ #include "DNA_ID.h" #include "DNA_asset_types.h" +#include "DNA_viewer_path_types.h" #ifdef __cplusplus extern "C" { @@ -59,7 +60,7 @@ typedef struct bToolRef { /** Use to avoid initializing the same tool multiple times. */ short tag; - /** #bToolKey (spacetype, mode), used in 'WM_api.h' */ + /** #bToolKey (space-type, mode), used in 'WM_api.h' */ short space_type; /** * Value depends on the 'space_type', object mode for 3D view, image editor has own mode too. @@ -143,6 +144,13 @@ typedef struct WorkSpace { /** Workspace-wide active asset library, for asset UIs to use (e.g. asset view UI template). The * Asset Browser has its own and doesn't use this. */ AssetLibraryReference asset_library_ref; + + /** + * Ground truth for the currently active viewer node. When a viewer node is activated its path is + * set here. Editors can check here for which node is active (currently the node editor, + * spreadsheet and viewport do this). + */ + ViewerPath viewer_path; } WorkSpace; /** @@ -191,8 +199,10 @@ typedef struct WorkSpaceInstanceHook { WorkSpace *active; struct WorkSpaceLayout *act_layout; - /** Needed because we can't change workspaces/layouts in running handler loop, - * it would break context. */ + /** + * Needed because we can't change work-spaces/layouts in running handler loop, + * it would break context. + */ WorkSpace *temp_workspace_store; struct WorkSpaceLayout *temp_layout_store; } WorkSpaceInstanceHook; diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt index 97198117a83..50fd51e88a1 100644 --- a/source/blender/makesdna/intern/CMakeLists.txt +++ b/source/blender/makesdna/intern/CMakeLists.txt @@ -3,6 +3,22 @@ # message(STATUS "Configuring makesdna") +set(INC + .. + ../../blenlib + ../../imbuf + ../../../../intern/atomic + ../../../../intern/guardedalloc + ${CMAKE_CURRENT_BINARY_DIR} +) + +set(INC_SYS + +) + +set(LIB +) + add_definitions(-DWITH_DNA_GHASH) # Needed for `mallocn.c`. @@ -10,14 +26,6 @@ if(HAVE_MALLOC_STATS_H) add_definitions(-DHAVE_MALLOC_STATS_H) endif() -blender_include_dirs( - ../../../../intern/atomic - ../../../../intern/guardedalloc - ../../blenlib - ../../imbuf - .. -) - set(dna_header_include_file "${CMAKE_CURRENT_BINARY_DIR}/dna_includes_all.h") set(dna_header_string_file "${CMAKE_CURRENT_BINARY_DIR}/dna_includes_as_strings.h") @@ -57,6 +65,8 @@ add_cc_flags_custom_test(makesdna) add_executable(makesdna ${SRC} ${SRC_DNA_INC}) setup_platform_linker_flags(makesdna) +blender_target_include_dirs(makesdna ${INC}) +blender_target_include_dirs_sys(makesdna ${INC_SYS}) if(WIN32 AND NOT UNIX) target_link_libraries(makesdna ${PTHREADS_LIBRARIES}) @@ -80,14 +90,6 @@ add_custom_command( # ----------------------------------------------------------------------------- # Build bf_dna library -set(INC - ${CMAKE_CURRENT_BINARY_DIR} -) - -set(INC_SYS - -) - set(SRC dna_defaults.c dna_genfile.c @@ -101,9 +103,6 @@ set(SRC dna_utils.h ) -set(LIB -) - set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h @@ -117,7 +116,10 @@ blender_add_lib(bf_dna "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") # ----------------------------------------------------------------------------- # Build bf_dna_blenlib library set(INC - + .. + ../../blenlib + ../../../../intern/atomic + ../../../../intern/guardedalloc ) set(INC_SYS diff --git a/source/blender/makesdna/intern/dna_defaults.c b/source/blender/makesdna/intern/dna_defaults.c index 197a863db72..309756ff2da 100644 --- a/source/blender/makesdna/intern/dna_defaults.c +++ b/source/blender/makesdna/intern/dna_defaults.c @@ -302,12 +302,14 @@ SDNA_DEFAULT_DECL_STRUCT(MultiplyGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(NoiseGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(OffsetGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(OpacityGpencilModifierData); +SDNA_DEFAULT_DECL_STRUCT(OutlineGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(SimplifyGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(SmoothGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(SubdivGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(TextureGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(ThickGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(TimeGpencilModifierData); +SDNA_DEFAULT_DECL_STRUCT(TimeGpencilModifierSegment); SDNA_DEFAULT_DECL_STRUCT(TintGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(WeightProxGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(WeightAngleGpencilModifierData); @@ -542,6 +544,7 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = { SDNA_DEFAULT_DECL(NoiseGpencilModifierData), SDNA_DEFAULT_DECL(OffsetGpencilModifierData), SDNA_DEFAULT_DECL(OpacityGpencilModifierData), + SDNA_DEFAULT_DECL(OutlineGpencilModifierData), SDNA_DEFAULT_DECL(SimplifyGpencilModifierData), SDNA_DEFAULT_DECL(SmoothGpencilModifierData), SDNA_DEFAULT_DECL(SubdivGpencilModifierData), @@ -549,6 +552,7 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = { SDNA_DEFAULT_DECL(ThickGpencilModifierData), SDNA_DEFAULT_DECL(TimeGpencilModifierData), SDNA_DEFAULT_DECL(TintGpencilModifierData), + SDNA_DEFAULT_DECL(TimeGpencilModifierSegment), SDNA_DEFAULT_DECL(WeightAngleGpencilModifierData), SDNA_DEFAULT_DECL(WeightProxGpencilModifierData), SDNA_DEFAULT_DECL(LineartGpencilModifierData), diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 1b424756b0a..b75bf5383de 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -210,7 +210,7 @@ static int dna_struct_find_nr_ex_impl( #endif /* Regular args. */ const char *str, - unsigned int *index_last) + uint *index_last) { if (*index_last < structs_len) { const SDNA_Struct *struct_info = structs[*index_last]; @@ -242,7 +242,7 @@ static int dna_struct_find_nr_ex_impl( return -1; } -int DNA_struct_find_nr_ex(const SDNA *sdna, const char *str, unsigned int *index_last) +int DNA_struct_find_nr_ex(const SDNA *sdna, const char *str, uint *index_last) { return dna_struct_find_nr_ex_impl( /* Expand SDNA. */ @@ -258,7 +258,7 @@ int DNA_struct_find_nr_ex(const SDNA *sdna, const char *str, unsigned int *index index_last); } -int DNA_struct_alias_find_nr_ex(const SDNA *sdna, const char *str, unsigned int *index_last) +int DNA_struct_alias_find_nr_ex(const SDNA *sdna, const char *str, uint *index_last) { #ifdef WITH_DNA_GHASH BLI_assert(sdna->alias.structs_map != NULL); @@ -279,13 +279,13 @@ int DNA_struct_alias_find_nr_ex(const SDNA *sdna, const char *str, unsigned int int DNA_struct_find_nr(const SDNA *sdna, const char *str) { - unsigned int index_last_dummy = UINT_MAX; + uint index_last_dummy = UINT_MAX; return DNA_struct_find_nr_ex(sdna, str, &index_last_dummy); } int DNA_struct_alias_find_nr(const SDNA *sdna, const char *str) { - unsigned int index_last_dummy = UINT_MAX; + uint index_last_dummy = UINT_MAX; return DNA_struct_alias_find_nr_ex(sdna, str, &index_last_dummy); } @@ -497,7 +497,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 || (!ELEM(sdna->pointer_size, 4, 8))) { + if (struct_info->members_len != 2 || !ELEM(sdna->pointer_size, 4, 8)) { *r_error_message = "ListBase struct error! Needs it to calculate pointer-size."; /* Well, at least `sizeof(ListBase)` is error proof! (ton). */ return false; @@ -741,7 +741,7 @@ static void cast_primitive_type(const eSDNA_Type old_type, break; } case SDNA_TYPE_USHORT: { - const ushort value = *((unsigned short *)old_data); + const ushort value = *((ushort *)old_data); old_value_i = value; old_value_f = (double)value; break; @@ -790,13 +790,13 @@ static void cast_primitive_type(const eSDNA_Type old_type, *new_data = (char)old_value_i; break; case SDNA_TYPE_UCHAR: - *((unsigned char *)new_data) = (unsigned char)old_value_i; + *((uchar *)new_data) = (uchar)old_value_i; break; case SDNA_TYPE_SHORT: *((short *)new_data) = (short)old_value_i; break; case SDNA_TYPE_USHORT: - *((unsigned short *)new_data) = (unsigned short)old_value_i; + *((ushort *)new_data) = (ushort)old_value_i; break; case SDNA_TYPE_INT: *((int *)new_data) = (int)old_value_i; diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h index f25ff5fbbb8..afc907b7780 100644 --- a/source/blender/makesdna/intern/dna_rename_defs.h +++ b/source/blender/makesdna/intern/dna_rename_defs.h @@ -96,7 +96,14 @@ DNA_STRUCT_RENAME_ELEM(Object, dup_group, instance_collection) DNA_STRUCT_RENAME_ELEM(Object, dupfacesca, instance_faces_scale) DNA_STRUCT_RENAME_ELEM(Object, restrictflag, visibility_flag) DNA_STRUCT_RENAME_ELEM(Object, size, scale) +DNA_STRUCT_RENAME_ELEM(Object, obmat, object_to_world) +DNA_STRUCT_RENAME_ELEM(Object, imat, world_to_object) DNA_STRUCT_RENAME_ELEM(Object_Runtime, crazyspace_num_verts, crazyspace_verts_num) +DNA_STRUCT_RENAME_ELEM(MEdge, bweight, bweight_legacy) +DNA_STRUCT_RENAME_ELEM(MEdge, crease, crease_legacy) +DNA_STRUCT_RENAME_ELEM(MPoly, mat_nr, mat_nr_legacy) +DNA_STRUCT_RENAME_ELEM(MVert, bweight, bweight_legacy) +DNA_STRUCT_RENAME_ELEM(MVert, flag, flag_legacy) DNA_STRUCT_RENAME_ELEM(ParticleSettings, child_nbr, child_percent) DNA_STRUCT_RENAME_ELEM(ParticleSettings, dup_group, instance_collection) DNA_STRUCT_RENAME_ELEM(ParticleSettings, dup_ob, instance_object) @@ -106,6 +113,7 @@ DNA_STRUCT_RENAME_ELEM(RenderData, bake_filter, bake_margin) DNA_STRUCT_RENAME_ELEM(RigidBodyWorld, steps_per_second, substeps_per_frame) DNA_STRUCT_RENAME_ELEM(SDefBind, numverts, verts_num) DNA_STRUCT_RENAME_ELEM(SDefVert, numbinds, binds_num) +DNA_STRUCT_RENAME_ELEM(SpaceImage, pixel_snap_mode, pixel_round_mode) DNA_STRUCT_RENAME_ELEM(SpaceSeq, overlay_type, overlay_frame_type) DNA_STRUCT_RENAME_ELEM(SurfaceDeformModifierData, num_mesh_verts, mesh_verts_num) DNA_STRUCT_RENAME_ELEM(SurfaceDeformModifierData, numpoly, target_polys_num) diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 7b893078b22..0728f69b449 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -431,7 +431,7 @@ static int add_name(const char *str) */ buf[i] = 0; DEBUG_PRINTF(3, "Name before chomping: %s\n", buf); - if ((strncmp(buf, "(*headdraw", 10) == 0) || (strncmp(buf, "(*windraw", 9) == 0)) { + if ((strncmp(buf, "(*headdraw", 10) == 0) || strncmp(buf, "(*windraw", 9) == 0) { buf[i] = ')'; buf[i + 1] = '('; buf[i + 2] = 'v'; |