🎉 WIN a Snapmaker U1 Printer! Enter FREE now

--metadata-value

"v1;v2"
Metadata Embedding Orca SlicerBambu Studio 1.9.7+

Embed the value half of a parallel name-value injection into the exported 3MF's top-level metadata as a semicolon-delimited list that must have exactly as many entries as --metadata-name; injected values containing special XML characters will appear double-encoded in the output because the export path applies XML escaping twice.

Details

--metadata-value "v1;v2" supplies the values half of a paired injection: the slicer zips each entry from this flag positionally with its counterpart from --metadata-name and writes the resulting key-value pairs as <metadata> elements inside the top-level <model> block of the exported 3MF, between the opening model tag and the <resources> element. The flag has no effect unless --export-3mf is also in use; on any invocation that does not include that export flag the injection path is never reached.

The argument is a C-style semicolon-delimited list. Each semicolon separates one value entry from the next. When the first character of an entry is a double-quote the entry is parsed in quoted mode, which reads until the matching closing double-quote; inside a quoted entry \\ and \" produce a literal backslash or double-quote respectively, and \r / \n produce carriage return or newline. Any entry whose first character is not a double-quote is parsed in unquoted mode and read literally, character by character, until the next semicolon or the end of input — spaces, tabs, backslashes, and newlines in that position are stored verbatim without any special treatment. A trailing semicolon produces one additional empty-string entry, so a;b; yields three entries not two.

At export time the slicer merges the injected pairs into the same map that already holds built-in fields such as the model name, designer, application version, and creation date. Injection happens after those built-in assignments, so supplying a key that matches a built-in field name silently overwrites that built-in value in the output 3MF.

Injected values are XML-escaped when placed into the internal metadata map and then XML-escaped a second time when each map entry is written to the XML stream. As a result, any injected value that contains special XML characters such as <, >, &, ", or ' will appear double-encoded in the output 3MF rather than round-tripping cleanly; such characters in values should be avoided unless the downstream consumer accounts for the double-encoding.

Examples

C-style inner quoting required when an entry value contains a semicolon
order-12345;"order;with;semicolons"

Watch out for

  • Count mismatch with `--metadata-name` causes an immediate exit with a parameter-error code before any model loading or slicing begins — the flag counts must be identical.
  • An individual value that itself contains a semicolon must be C-style quoted within the semicolon list (first character must be `"`) or the parser will split it into two entries, shifting all subsequent pairs out of alignment.
  • Keys colliding with built-in 3MF fields (application tag, creation date, model name, etc.) are silently overwritten by the injected value because the injection runs after the built-in assignments.

Sign up for free today

No credit card required. Connect unlimited printers and get production automation running in minutes.