euv-core 0.51.0

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
use super::*;

/// Decoded 64-byte `.euv3d` package header metadata.
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct Euv3dHeader {
    /// Format version (`EUV3D_FORMAT_VERSION`).
    #[get(type(copy))]
    pub(crate) version: u32,
    /// Bitmask describing optional pre-baked sections (`BVH4`, `Meshlets`, `LODs`).
    #[get(type(copy))]
    pub(crate) flags: u32,
    /// Number of entries stored in the section directory.
    #[get(type(copy))]
    pub(crate) section_count: u32,
    /// Byte offset of the section directory table (typically `64`).
    #[get(type(copy))]
    pub(crate) table_offset: u64,
    /// CRC32 checksum computed over payload bytes `[64..total_bytes]`.
    #[get(type(copy))]
    pub(crate) content_crc32: u32,
    /// Total file size in bytes.
    #[get(type(copy))]
    pub(crate) total_bytes: u64,
    /// 64-bit FNV-1a content digest for deterministic asset cache keying.
    #[get(type(copy))]
    pub(crate) digest_fnv1a: u64,
}

/// Single 32-byte section directory entry inside an `.euv3d` package.
#[derive(Clone, Copy, Data, Debug, Eq, Hash, PartialEq)]
pub struct Euv3dSectionEntry {
    /// Semantic payload type of this section.
    #[get(type(copy))]
    pub(crate) kind: Euv3dSectionKind,
    /// 64-byte-aligned starting byte offset inside the `.euv3d` buffer.
    #[get(type(copy))]
    pub(crate) offset: u64,
    /// Exact payload length in bytes (excluding trailing alignment padding).
    #[get(type(copy))]
    pub(crate) byte_length: u64,
    /// Number of logical elements stored inside this section.
    #[get(type(copy))]
    pub(crate) element_count: u32,
    /// Section-specific bit flags.
    #[get(type(copy))]
    pub(crate) flags: u32,
}

/// Configuration controlling Garland-Heckbert QEM LOD generation, spatial meshlets, and BVH4 baking.
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct Euv3dBakeConfig {
    /// Target number of LOD levels (`1..=4`, default `4`).
    #[get(type(copy))]
    pub(crate) lod_levels: usize,
    /// Whether to cluster triangles into spatially coherent vertex-cache-friendly meshlets.
    #[get(type(copy))]
    pub(crate) build_meshlets: bool,
    /// Whether to pre-bake per-mesh SIMD BVH4 acceleration structures into the package.
    #[get(type(copy))]
    pub(crate) bake_bvh4: bool,
    /// Whether to preserve/generate full texture mipmap chains before serializing.
    #[get(type(copy))]
    pub(crate) generate_mipmaps: bool,
}

/// Zero-copy validated view over a 64-byte-aligned `.euv3d` binary buffer.
#[derive(Clone, Data, Debug)]
pub struct Euv3dPackageView<'a> {
    /// Borrowed backing `.euv3d` byte slice.
    pub(crate) raw_bytes: &'a [u8],
    /// Parsed and CRC-verified 64-byte file header.
    #[get(type(copy))]
    pub(crate) header: Euv3dHeader,
    /// Validated 64-byte-aligned section directory entries.
    pub(crate) sections: Vec<Euv3dSectionEntry>,
}

/// Decoded `.euv3d` asset bundle containing the full scene, QEM LOD chains, and zero-rebuild BVH4 trees.
#[derive(Clone, Data, Debug, Default)]
pub struct BakedAssetBundle3D {
    /// Restored Blender/glTF scene with hierarchy, materials, textures, rigs, animations, cameras, and lights.
    pub(crate) scene: ImportedScene3D,
    /// Pre-baked Garland-Heckbert QEM LOD chains aligned 1:1 with `scene.meshes`.
    pub(crate) lod_chains: Vec<MeshLodChain>,
    /// Pre-baked local-space SIMD BVH4 acceleration trees aligned 1:1 with `scene.meshes` (zero SAH build on load).
    pub(crate) local_bvhs: Vec<Bvh3D>,
    /// Total number of sections stored in the source `.euv3d` archive.
    #[get(type(copy))]
    pub(crate) section_count: usize,
    /// Total byte size of the source `.euv3d` archive.
    #[get(type(copy))]
    pub(crate) total_bytes: usize,
    /// Deterministic 64-bit FNV-1a digest of the archive contents.
    #[get(type(copy))]
    pub(crate) digest_fnv1a: u64,
}

/// Stateless serializer and zero-copy loader for `.euv3d` 64-byte-aligned binary 3D asset packages.
#[derive(Clone, Copy, Debug, Default)]
pub struct Euv3dPackage {}

/// Symmetric 4x4 error quadric matrix stored as 10 upper-triangular `f64` coefficients for QEM simplification.
#[derive(Clone, Copy, Debug, Default)]
pub(crate) struct QemMatrix {
    /// Upper-triangular entries `[a00, a01, a02, a03, a11, a12, a13, a22, a23, a33]`.
    pub(crate) coeffs: [f64; 10],
}

/// Candidate undirected edge collapse entry queued in the QEM binary min-heap.
#[derive(Clone, Copy, Debug)]
pub(crate) struct QemEdgeCandidate {
    /// Quadric error cost `v^T Q v` (smaller collapses first).
    pub(crate) cost: f64,
    /// First vertex index.
    pub(crate) vert_a: usize,
    /// Second vertex index.
    pub(crate) vert_b: usize,
    /// Revision stamp of `vert_a` when queued (for lazy invalidation).
    pub(crate) ver_a: u32,
    /// Revision stamp of `vert_b` when queued (for lazy invalidation).
    pub(crate) ver_b: u32,
    /// Optimal contracted 3D position.
    pub(crate) target_pos: [f64; 3],
    /// Normalized interpolation factor in `[0.0, 1.0]` along `vert_a -> vert_b`.
    pub(crate) interp_t: f32,
}

/// Serializable metadata record describing one baked LOD level inside the shared binary geometry buffers.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dLodRecord {
    /// Starting vertex index inside the `Vertices` section.
    pub(crate) first_vertex: u32,
    /// Number of vertices in this LOD level.
    pub(crate) vertex_count: u32,
    /// Starting triangle index inside the `Indices` section.
    pub(crate) first_tri: u32,
    /// Number of triangles in this LOD level.
    pub(crate) tri_count: u32,
    /// Starting meshlet index inside the `Meshlets` section.
    pub(crate) first_meshlet: u32,
    /// Number of meshlets belonging to this LOD level.
    pub(crate) meshlet_count: u32,
    /// Local bounding box minimum corner.
    pub(crate) bounds_min: [f32; 3],
    /// Local bounding box maximum corner.
    pub(crate) bounds_max: [f32; 3],
}

/// Serializable metadata record describing one morph target inside the `MorphDeltas` section.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dMorphRecord {
    /// Shape key / morph target name.
    pub(crate) name: String,
    /// Starting `[f32; 3]` element index for position deltas.
    pub(crate) first_pos: u32,
    /// Count of position deltas.
    pub(crate) pos_count: u32,
    /// Starting `[f32; 3]` element index for normal deltas.
    pub(crate) first_norm: u32,
    /// Count of normal deltas.
    pub(crate) norm_count: u32,
    /// Starting `[f32; 3]` element index for tangent deltas.
    pub(crate) first_tan: u32,
    /// Count of tangent deltas.
    pub(crate) tan_count: u32,
}

/// Serializable PBR material payload matching `PbrMaterial` for `.euv3d` legacy material slots.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dLegacyPbrRecord {
    /// Base linear albedo RGB.
    pub(crate) base_color: [f32; 3],
    /// Metallic factor.
    pub(crate) metallic: f32,
    /// Roughness factor.
    pub(crate) roughness: f32,
    /// Emissive HDR RGB.
    pub(crate) emissive: [f32; 3],
    /// Reflectivity factor.
    pub(crate) reflectivity: f32,
    /// Encoded `SurfaceDetailMode` discriminant.
    pub(crate) surface_detail: u8,
}

/// Serializable mesh record storing LOD slices, material links, skin sidecar slice, and morph targets.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dMeshRecord {
    /// Mesh asset name.
    pub(crate) name: String,
    /// Default fallback `PbrMaterial`.
    pub(crate) material: Euv3dLegacyPbrRecord,
    /// Sub-material table.
    pub(crate) sub_materials: Vec<Euv3dLegacyPbrRecord>,
    /// Per-triangle sub-material slot indices for `LOD0`.
    pub(crate) tri_materials: Vec<u16>,
    /// Optional index into the scene `PrincipledMaterial3D` table.
    pub(crate) material_index: Option<u32>,
    /// Whether this mesh is a closed solid volume.
    pub(crate) is_closed: bool,
    /// Ordered LOD level records (`LOD0` first).
    pub(crate) lods: Vec<Euv3dLodRecord>,
    /// Starting index inside `SkinInfluences` for `LOD0`.
    pub(crate) first_skin: u32,
    /// Number of `MeshSkinInfluence3D` records for `LOD0`.
    pub(crate) skin_count: u32,
    /// Morph targets belonging to `LOD0`.
    pub(crate) morphs: Vec<Euv3dMorphRecord>,
}

/// Serializable metadata record describing one pre-baked local BVH4 tree inside the BVH sections.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dBvhRecord {
    /// First `Bvh4Node` index inside `Bvh4Nodes`.
    pub(crate) first_node: u32,
    /// Number of `Bvh4Node` entries.
    pub(crate) node_count: u32,
    /// First `BvhTri4` packet index inside `BvhTri4Packets`.
    pub(crate) first_packet: u32,
    /// Number of `BvhTri4` packets.
    pub(crate) packet_count: u32,
    /// First `BvhTriangle` index inside `BvhTriangles`.
    pub(crate) first_tri: u32,
    /// Number of `BvhTriangle` records.
    pub(crate) tri_count: u32,
    /// Cached root bounding box minimum corner.
    pub(crate) root_min: [f32; 3],
    /// Cached root bounding box maximum corner.
    pub(crate) root_max: [f32; 3],
    /// Baseline SAH build cost.
    pub(crate) build_sah_cost: f32,
}

/// Serializable `TextureSlot3D` record for `PrincipledMaterial3D`.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dTextureSlotRecord {
    /// Index into scene texture array.
    pub(crate) texture_index: u32,
    /// UV set index (`0` or `1`).
    pub(crate) tex_coord: u8,
    /// UV offset.
    pub(crate) offset: [f32; 2],
    /// UV rotation in radians.
    pub(crate) rotation: f32,
    /// UV scale.
    pub(crate) uv_scale: [f32; 2],
}

/// Serializable `PrincipledMaterial3D` record preserving every Blender Principled BSDF and KHR extension parameter.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dMaterialRecord {
    /// Material name.
    pub(crate) name: String,
    /// Base color RGBA.
    pub(crate) base_color_factor: [f32; 4],
    /// Metallic factor.
    pub(crate) metallic_factor: f32,
    /// Roughness factor.
    pub(crate) roughness_factor: f32,
    /// Normal map scale.
    pub(crate) normal_scale: f32,
    /// Occlusion strength.
    pub(crate) occlusion_strength: f32,
    /// Emissive factor RGB.
    pub(crate) emissive_factor: [f32; 3],
    /// Emissive strength multiplier.
    pub(crate) emissive_strength: f32,
    /// Index of refraction.
    pub(crate) ior: f32,
    /// Specular factor.
    pub(crate) specular_factor: f32,
    /// Specular color tint.
    pub(crate) specular_color_factor: [f32; 3],
    /// Clearcoat weight.
    pub(crate) clearcoat_factor: f32,
    /// Clearcoat roughness.
    pub(crate) clearcoat_roughness_factor: f32,
    /// Transmission weight.
    pub(crate) transmission_factor: f32,
    /// Volume thickness.
    pub(crate) thickness_factor: f32,
    /// Volume attenuation distance.
    pub(crate) attenuation_distance: f32,
    /// Volume attenuation color.
    pub(crate) attenuation_color: [f32; 3],
    /// Sheen color factor.
    pub(crate) sheen_color_factor: [f32; 3],
    /// Sheen roughness.
    pub(crate) sheen_roughness_factor: f32,
    /// Unlit flag.
    pub(crate) unlit: bool,
    /// Alpha mode discriminant (`0=Opaque`, `1=Mask`, `2=Blend`).
    pub(crate) alpha_mode: u8,
    /// Alpha cutoff threshold.
    pub(crate) alpha_cutoff: f32,
    /// Double-sided flag.
    pub(crate) double_sided: bool,
    /// Base color texture slot.
    pub(crate) base_color_texture: Option<Euv3dTextureSlotRecord>,
    /// Metallic-roughness texture slot.
    pub(crate) metallic_roughness_texture: Option<Euv3dTextureSlotRecord>,
    /// Normal map texture slot.
    pub(crate) normal_texture: Option<Euv3dTextureSlotRecord>,
    /// Occlusion texture slot.
    pub(crate) occlusion_texture: Option<Euv3dTextureSlotRecord>,
    /// Emissive texture slot.
    pub(crate) emissive_texture: Option<Euv3dTextureSlotRecord>,
    /// Specular factor texture slot.
    pub(crate) specular_texture: Option<Euv3dTextureSlotRecord>,
    /// Specular color texture slot.
    pub(crate) specular_color_texture: Option<Euv3dTextureSlotRecord>,
    /// Clearcoat texture slot.
    pub(crate) clearcoat_texture: Option<Euv3dTextureSlotRecord>,
    /// Clearcoat roughness texture slot.
    pub(crate) clearcoat_roughness_texture: Option<Euv3dTextureSlotRecord>,
    /// Clearcoat normal texture slot.
    pub(crate) clearcoat_normal_texture: Option<Euv3dTextureSlotRecord>,
    /// Transmission texture slot.
    pub(crate) transmission_texture: Option<Euv3dTextureSlotRecord>,
    /// Sheen color texture slot.
    pub(crate) sheen_color_texture: Option<Euv3dTextureSlotRecord>,
    /// Sheen roughness texture slot.
    pub(crate) sheen_roughness_texture: Option<Euv3dTextureSlotRecord>,
}

/// Serializable texture mip level byte range inside `TexturesBlob`.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dTexMipRecord {
    /// Mip width in pixels.
    pub(crate) width: u32,
    /// Mip height in pixels.
    pub(crate) height: u32,
    /// Byte offset inside `TexturesBlob`.
    pub(crate) byte_offset: u64,
    /// Byte length inside `TexturesBlob`.
    pub(crate) byte_length: u64,
}

/// Serializable texture descriptor referencing RGBA8 mip slices inside `TexturesBlob`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dTextureRecord {
    /// Texture name.
    pub(crate) name: String,
    /// Color space (`0=Srgb`, `1=Linear`, `2=NormalTangent`).
    pub(crate) color_space: u8,
    /// Min filter (`0=Nearest`, `1=Linear`).
    pub(crate) min_filter: u8,
    /// Mag filter (`0=Nearest`, `1=Linear`).
    pub(crate) mag_filter: u8,
    /// Wrap S (`0=Repeat`, `1=MirroredRepeat`, `2=ClampToEdge`).
    pub(crate) wrap_s: u8,
    /// Wrap T (`0=Repeat`, `1=MirroredRepeat`, `2=ClampToEdge`).
    pub(crate) wrap_t: u8,
    /// Encoded mip levels.
    pub(crate) mips: Vec<Euv3dTexMipRecord>,
}

/// Serializable scene node descriptor matching `SceneNode3D`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dNodeRecord {
    /// Node name.
    pub(crate) name: String,
    /// Parent index.
    pub(crate) parent: Option<u32>,
    /// Local translation.
    pub(crate) translation: [f32; 3],
    /// Local rotation quaternion `[x, y, z, w]`.
    pub(crate) rotation: [f32; 4],
    /// Local scale.
    pub(crate) scale: [f32; 3],
    /// Optional mesh reference.
    pub(crate) mesh_id: Option<u32>,
    /// Optional skin reference.
    pub(crate) skin_id: Option<u32>,
    /// Optional camera reference.
    pub(crate) camera_id: Option<u32>,
    /// Optional light reference.
    pub(crate) light_id: Option<u32>,
    /// Collection membership bitmask.
    pub(crate) collection_mask: u64,
    /// Node visibility flag.
    pub(crate) visible: bool,
    /// Initial morph weights.
    pub(crate) morph_weights: Vec<f32>,
    /// `extras.euv` collider kind (`0=None, 1=Box, 2=Sphere, 3=ConvexHull, 4=Mesh`).
    pub(crate) collider_shape: u8,
    /// Fluid buoyancy density ratio.
    pub(crate) buoyancy_density: f32,
    /// Trigger volume flag.
    pub(crate) is_trigger: bool,
    /// Cast shadow flag.
    pub(crate) cast_shadows: bool,
    /// Raw custom JSON payload.
    pub(crate) custom_json: Option<String>,
}

/// Serializable collection entry matching `CollectionEntry3D`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dCollectionRecord {
    /// Collection name.
    pub(crate) name: String,
    /// Bit index (`0..64`).
    pub(crate) bit_index: u8,
    /// Viewport visibility flag.
    pub(crate) visible_viewport: bool,
    /// Render visibility flag.
    pub(crate) visible_render: bool,
}

/// Serializable armature skin record matching `ImportedSkin3D`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dSkinRecord {
    /// Skin name.
    pub(crate) name: String,
    /// Joint node indices.
    pub(crate) joints: Vec<u32>,
    /// Optional skeleton root node index.
    pub(crate) skeleton_root: Option<u32>,
    /// Flattened column-major inverse bind matrices (`16` floats each).
    pub(crate) inverse_bind_matrices: Vec<[f32; 16]>,
}

/// Serializable animation sampler record referencing `f32` ranges inside `AnimationsBlob`.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dAnimSamplerRecord {
    /// Starting `f32` element index for timestamps inside `AnimationsBlob`.
    pub(crate) first_time: u32,
    /// Count of keyframe timestamps.
    pub(crate) time_count: u32,
    /// Starting `f32` element index for values inside `AnimationsBlob`.
    pub(crate) first_value: u32,
    /// Count of flattened value floats.
    pub(crate) value_count: u32,
    /// Float stride per keyframe.
    pub(crate) value_stride: u32,
    /// Interpolation mode (`0=Step`, `1=Linear`, `2=CubicSpline`).
    pub(crate) interpolation: u8,
}

/// Serializable animation channel record.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dAnimChannelRecord {
    /// Target node index.
    pub(crate) target_node: u32,
    /// Animated property (`0=Translation`, `1=Rotation`, `2=Scale`, `3=MorphWeights`).
    pub(crate) path: u8,
    /// Sampler index within the owning clip.
    pub(crate) sampler_index: u32,
}

/// Serializable animation clip record.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dAnimClipRecord {
    /// Clip name.
    pub(crate) name: String,
    /// Total duration in seconds.
    pub(crate) duration_secs: f32,
    /// Samplers belonging to this clip.
    pub(crate) samplers: Vec<Euv3dAnimSamplerRecord>,
    /// Channels belonging to this clip.
    pub(crate) channels: Vec<Euv3dAnimChannelRecord>,
}

/// Serializable camera record matching `ImportedCamera3D`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dCameraRecord {
    /// Camera label.
    pub(crate) name: String,
    /// `true` for perspective, `false` for orthographic.
    pub(crate) is_perspective: bool,
    /// Vertical FOV (perspective) or X magnification (orthographic).
    pub(crate) param_a: f32,
    /// Aspect ratio (perspective, optional encoded via `> 0.0`) or Y magnification (orthographic).
    pub(crate) param_b: f32,
    /// Near clipping plane.
    pub(crate) znear: f32,
    /// Optional far clipping plane.
    pub(crate) zfar: Option<f32>,
}

/// Serializable light record matching `ImportedLight3D`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dLightRecord {
    /// Light label.
    pub(crate) name: String,
    /// Linear RGB color.
    pub(crate) color: [f32; 3],
    /// Intensity scalar.
    pub(crate) intensity: f32,
    /// Kind tag (`0=Directional`, `1=Point`, `2=Spot`, `3=Area`).
    pub(crate) kind: u8,
    /// Optional attenuation range (Point/Spot).
    pub(crate) range: Option<f32>,
    /// Inner cone angle (Spot) or Width (Area).
    pub(crate) param_a: f32,
    /// Outer cone angle (Spot) or Height (Area).
    pub(crate) param_b: f32,
}

/// Top-level JSON metadata structure stored in the `.euv3d` `SceneMetadataJson` section.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Euv3dSceneMetadata {
    /// Scene name.
    pub(crate) name: String,
    /// Source generator string.
    pub(crate) generator: String,
    /// Scene collections.
    pub(crate) collections: Vec<Euv3dCollectionRecord>,
    /// Scene graph nodes.
    pub(crate) nodes: Vec<Euv3dNodeRecord>,
    /// Baked meshes and LOD chains.
    pub(crate) meshes: Vec<Euv3dMeshRecord>,
    /// Pre-baked local BVH4 tree records aligned with `meshes`.
    pub(crate) bvhs: Vec<Euv3dBvhRecord>,
    /// Principled BSDF materials.
    pub(crate) materials: Vec<Euv3dMaterialRecord>,
    /// Mipmapped textures.
    pub(crate) textures: Vec<Euv3dTextureRecord>,
    /// Armature skins.
    pub(crate) skins: Vec<Euv3dSkinRecord>,
    /// Animation clips.
    pub(crate) animations: Vec<Euv3dAnimClipRecord>,
    /// Cameras.
    pub(crate) cameras: Vec<Euv3dCameraRecord>,
    /// Punctual & area lights.
    pub(crate) lights: Vec<Euv3dLightRecord>,
}