With flame 2027 we’ve got support for metadata in, amongst other places, batch write file nodes.
The docs here imply there are methods in the python api to allow maniuplating metadata, however the actual api docs don’t seem to come up with anything.
I was expecting something like a method on pywritefile node’s like set_metadata(key, value)
There don’t appear to be any relevant attributes to manipulate either, none of these do anything useful;
This question is coming from a pipeline dev perspective, so the ability to modify metadata is fairly integral to making this useful to us as a studio.
Also, question about ‘Custom Values’ as the basic metadata setting. What does this actually do? It allows us to modify e.g. node.source_timecodebut that’s about it. Custom metadata added manually in the metadata menu is still preserved; and as mentioned in the demo videos, things like timecode are passed through as normal metadata key/value pairs now anyway. I’m not sure I understand the point of this setting.
They do exist. They just aren’t on PyWriteFileNode directly. In 2027 the class tree is PyNode → PyRenderNode → PyWriteFileNode, and the setters live on PyRenderNode, so help(flame.PyWriteFileNode) lists them under “inherited from PyRenderNode”, which is easy to scroll past.
Writing (from PyRenderNode, so Write File and Render nodes both have it):
set_metadata_value adds the key if it doesn’t exist, or edits it if it does. Passing value=None puts the key back to its original value.
is_dynamic=True makes Flame resolve tokens in the value at render time instead of storing it as a literal string. This is probably the most useful one for pipeline work: per-frame and per-shot values without baking them in.
set_metadata_key(..., name=None) puts a renamed key back to its original name.
Reading (from PyNode, so every Batch node has it):
node.get_metadata(socket_name='Default', key='', frame=None) # leave key empty to get every key
node.get_tokenized_metadata(socket_name='Default', key='', frame=None)
node.output_channel_as_metadata_key(channel_name, enable=True) # publish an animatable channel as a metadata key
PyClipNode and PyMetadataNode have the same set_metadata_value, set_metadata_key and set_metadata_discarded methods, but without is_dynamic.
PyMetadataNode.load_node_setup(file, edited_keys=, discarded_keys=, added_keys=, replaced_keys=, update_tokens=) lets you build a studio-standard metadata setup once and apply it with a script.
PyMetadataTimelineFX has the same set of methods, minus socket_name, for timeline work. Its frame argument counts from 1, so frame 1 is the first exposed frame.
PyClip.get_metadata(key='', time=None) reads metadata on the clip side.
Some values come back as PyMetadataValue objects, which have .type, .get_value() and .set_value(), so check what you get before treating it as a string.