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

◆ save_mesh() [4/5]

MAYAFLUX_API 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 259 of file ModelExport.cpp.

263{
264 if (!node) {
265 MF_ERROR(Journal::Component::IO, Journal::Context::FileIO, "save_mesh: null node");
266 return false;
267 }
268
269 auto packed = pack_node(node, glm::mat4(1.0F), "mesh");
270 if (!packed) {
271 MF_ERROR(Journal::Component::IO, Journal::Context::FileIO,
272 "save_mesh: node has no vertices/indices yet");
273 return false;
274 }
275
276 return write_via_registry(filepath, { *packed }, options);
277}
#define MF_ERROR(comp, ctx,...)

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