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

◆ save_mesh() [1/4]

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

Save a ComputeMeshBuffer's current live geometry to disk asynchronously.

ComputeMeshBuffer's geometry lives GPU-only, so this queues a real device-to-host transfer (IO::download_compute_mesh) on top of the disk write every overload above also queues. Returns once the task is queued; readback or write failure is logged from the task and does not surface here.

Parameters
bufferSource buffer. setup_processors() must have run.
filepathDestination path with extension.
optionsFormat-specific writer options.
Returns
True once the task is queued.

Definition at line 1016 of file IOManager.cpp.

1020{
1021 if (!buffer) {
1023 "save_mesh: null buffer");
1024 return false;
1025 }
1026
1027 track_save_task(std::async(std::launch::async,
1028 [buffer, filepath, options]() -> bool {
1029 return IO::save_mesh(buffer, filepath, options);
1030 }));
1031
1032 return true;
1033}
#define MF_ERROR(comp, ctx,...)
std::shared_ptr< NetworkGeometryBuffer > buffer
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.
@ FileIO
Filesystem I/O operations.
@ API
MayaFlux/API Wrapper and convenience functions.

References MayaFlux::Journal::API, buffer, MayaFlux::Journal::FileIO, MF_ERROR, MayaFlux::IO::save_mesh(), and track_save_task().

+ Here is the call graph for this function: