MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ save_mesh() [2/4]

bool MayaFlux::IO::IOManager::save_mesh ( const std::shared_ptr< Buffers::MeshBuffer > &  mesh_buffer,
const std::string &  filepath,
const IO::ModelWriteOptions &  options = {} 
)

Save a MeshBuffer's mesh data to disk asynchronously.

MeshData is always CPU-authoritative for MeshBuffer, so there is no download to wait on, but the write itself (AssimpModelWriter -> Assimp::Exporter -> disk) is still blocking I/O; queuing it here keeps that off the caller's thread, the same reason save_image/save_volume do. Returns once the task is queued; write failure is logged from the task and does not surface here.

Parameters
mesh_bufferSource mesh. Must have valid MeshData.
filepathDestination path with extension.
optionsFormat-specific writer options.
Returns
True once the task is queued.

Definition at line 977 of file IOManager.cpp.

981{
982 track_save_task(std::async(std::launch::async,
983 [mesh_buffer, filepath, options]() -> bool {
984 return IO::save_mesh(mesh_buffer, filepath, options);
985 }));
986
987 return true;
988}
void track_save_task(std::future< bool > fut)
Retain a save task in m_save_tasks and opportunistically reclaim finished ones.
bool save_mesh(const std::shared_ptr< Buffers::MeshBuffer > &buffer, const std::string &filepath, const ModelWriteOptions &options)
Save a MeshBuffer's current mesh data to disk via ModelWriterRegistry.

References MayaFlux::IO::save_mesh(), and track_save_task().

+ Here is the call graph for this function: