|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
| std::shared_ptr< Buffers::VolumeGridBuffer > MayaFlux::IO::IOManager::load_volume | ( | const std::string & | filepath, |
| const IO::VolumeReadOptions & | options = {} |
||
| ) |
Load a volume file into a newly constructed VolumeGridBuffer.
Opens the file via IO::VolumeReader, reads every selected grid into VolumeData, constructs a VolumeGridBuffer with one FieldDecl per field — name and semantics from the file, stride sizeof(float) for a scalar field or sizeof(glm::vec4) for a vector one, the GPU layout every vector field uses regardless of what VolumeData stores — over the file's own lattice, and seeds it via IO::upload_volume. Mirrors load_mesh: construction and GPU registration only, nothing about processing chain or rendering.
setup_processors() and any simulation wiring via setup_flow() are left to the caller, as VolumeGridBuffer's own usage example assumes. Nothing about an imported file says whether the caller wants to keep simulating what it loaded, run it once as a mask, or read it once and discard the buffer — so nothing here decides that for them.
The returned buffer is retained for the lifetime of IOManager; see get_loaded_volumes().
| filepath | Path to the volume file (.vdb). |
| options | Grid selection, forwarded to VolumeReader::load(). |
Definition at line 1278 of file IOManager.cpp.
References MayaFlux::Journal::API, buffer, MayaFlux::IO::VolumeReader::can_read(), MayaFlux::IO::Detail::create_volume_grid_buffer(), MayaFlux::Journal::FileIO, MayaFlux::IO::VolumeReader::get_last_error(), MayaFlux::IO::VolumeReader::load(), m_buffer_manager, m_loaded_volumes, MF_ERROR, and MF_INFO.
Here is the call graph for this function: