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

◆ save_mesh() [4/5]

bool MayaFlux::IO::save_mesh ( const std::shared_ptr< Nodes::GpuSync::MeshWriterNode > &  node,
const std::string &  filepath,
const ModelWriteOptions options = {} 
)

Save a bare MeshWriterNode's current vertices/indices to disk.

For geometry driven directly through GeometryBuffer rather than wrapped in a MeshBuffer. No world transform is applied: a bare node has none of its own, unlike a MeshNetwork slot.

Parameters
nodeSource node. Must have both vertices and indices set.
filepathDestination path with extension.
optionsFormat-specific writer options.
Returns
True on success. Failure is logged.

Definition at line 270 of file ModelExport.cpp.

274{
275 if (!node) {
276 MF_ERROR(Journal::Component::IO, Journal::Context::FileIO, "save_mesh: null node");
277 return false;
278 }
279
280 auto packed = pack_node(node, glm::mat4(1.0F), "mesh");
281 if (!packed) {
282 MF_ERROR(Journal::Component::IO, Journal::Context::FileIO,
283 "save_mesh: node has no vertices/indices yet");
284 return false;
285 }
286
287 return write_via_registry(filepath, { *packed }, options);
288}
#define MF_ERROR(comp, ctx,...)

References MayaFlux::Journal::FileIO, MayaFlux::Journal::IO, and MF_ERROR.