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

◆ write_metadata()

bool MayaFlux::IO::SpatialCache::write_metadata ( const std::string &  stream_name,
const std::unordered_map< std::string, std::string > &  tags 
)

Queue object-level metadata tags for a named stream.

Must be called before that stream_name's first write() call: Alembic MetaData is fixed at object creation and cannot be changed afterward. A call arriving after the stream's object already exists is logged and has no effect.

Parameters
stream_nameStream these tags apply to.
tagsKey-value pairs, e.g. run parameters (gravity, bounds, rule shader name).
Returns
True if queued. False only if the stream's object was already created before this call.

Definition at line 374 of file SpatialCache.cpp.

377{
378 std::lock_guard lock(m_impl->mutex);
379
380 if (m_impl->vertex_streams.contains(stream_name) || m_impl->curves_streams.contains(stream_name)) {
381 set_error("write_metadata: stream '" + stream_name
382 + "' already created; call write_metadata before its first write() call");
384 return false;
385 }
386
387 auto& md = m_impl->pending_metadata[stream_name];
388 for (const auto& [key, value] : tags) {
389 md.set(key, value);
390 }
391 return true;
392}
#define MF_ERROR(comp, ctx,...)
glm::vec3 value
std::unique_ptr< Impl > m_impl
std::string get_last_error() const
void set_error(std::string msg) const
@ FileIO
Filesystem I/O operations.
@ IO
Networking, file handling, streaming.

References MayaFlux::Journal::FileIO, get_last_error(), MayaFlux::Journal::IO, m_impl, MF_ERROR, set_error(), and value.

+ Here is the call graph for this function: