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

◆ save_mesh() [1/5]

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

Save a ComputeMeshBuffer's current live geometry to disk.

Wraps download_compute_mesh() and write_via_registry() in one call. See download_compute_mesh's own doc for the one-shot readback this performs.

Definition at line 285 of file ModelExport.cpp.

289{
290 auto mesh_data = IO::download_compute_mesh(buffer);
291 if (!mesh_data) {
292 return false;
293 }
294
295 if (buffer->has_diffuse_texture()) {
296 const auto image_path = pack_diffuse_texture(buffer->get_diffuse_texture(), filepath, "");
297 if (!image_path.empty()) {
298 ensure_submesh_region(*mesh_data, "mesh");
299 mesh_data->submeshes->regions.front().set_attribute("diffuse_path", image_path);
300 }
301 }
302
303 return write_via_registry(filepath, { *mesh_data }, options);
304}
std::shared_ptr< NetworkGeometryBuffer > buffer

References buffer, and download_compute_mesh().

+ Here is the call graph for this function: