|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API std::optional< MeshAccess > MayaFlux::Kakshya::as_mesh_access | ( | const DataVariant & | vertex_variant, |
| const DataVariant & | index_variant, | ||
| const VertexLayout & | layout, | ||
| std::optional< RegionGroup > | submeshes = std::nullopt |
||
| ) |
Construct a MeshAccess from two DataVariant instances.
vertex_variant must hold vector<uint8_t> (canonical interleaved bytes). index_variant must hold vector<uint32_t>. layout must have stride_bytes > 0 and at least one attribute. submeshes is forwarded as-is; pass std::nullopt for single-mesh data.
Returns std::nullopt and logs an error for any type mismatch.
The RegionGroup convention: a single RegionGroup named "submeshes" holds one Region per submesh. Each Region carries coordinates [index_start, index_start + index_count) in the index dimension, with attributes "name", "material_name", and "vertex_offset". This mirrors the audio/video pattern where e.g. "transients" is the group and each onset event is a Region inside it.
Definition at line 29 of file MeshAccess.cpp.
References MayaFlux::Kakshya::VertexLayout::attributes, MayaFlux::Kakshya::MeshAccess::index_count, MayaFlux::Kakshya::MeshAccess::index_ptr, MayaFlux::Journal::Kakshya, MayaFlux::Kakshya::MeshAccess::layout, MF_ERROR, MayaFlux::Journal::Runtime, MayaFlux::Kakshya::VertexLayout::stride_bytes, MayaFlux::Kakshya::MeshAccess::submeshes, MayaFlux::Kakshya::MeshAccess::vertex_bytes, MayaFlux::Kakshya::VertexLayout::vertex_count, and MayaFlux::Kakshya::MeshAccess::vertex_ptr.
Referenced by MayaFlux::Kakshya::MeshData::access(), and MayaFlux::Kakshya::MeshInsertion::build().
Here is the caller graph for this function: