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

◆ save_mesh_snapshot()

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

Save a ComputeMeshBuffer with a millisecond epoch timestamp spliced into the path, queued asynchronously.

The timestamp is computed on the worker thread at the moment the readback actually runs, not at the moment this call returns, so repeated presses in quick succession still each land in their own file rather than racing on a single path computed up front.

Definition at line 1035 of file IOManager.cpp.

1039{
1040 if (!buffer) {
1042 "save_mesh_snapshot: null buffer");
1043 return false;
1044 }
1045
1046 track_save_task(std::async(std::launch::async,
1047 [buffer, path_pattern, options]() -> bool {
1048 return Detail::execute_mesh_snapshot(buffer, path_pattern, options);
1049 }));
1050
1051 return true;
1052}
#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 execute_mesh_snapshot(const std::shared_ptr< Buffers::ComputeMeshBuffer > &buffer, const std::string &path_pattern, const ModelWriteOptions &options)
@ FileIO
Filesystem I/O operations.
@ API
MayaFlux/API Wrapper and convenience functions.

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

+ Here is the call graph for this function: