FormatMetadata

class PyOpenColorIO.FormatMetadata

The FormatMetadata class is intended to be a generic container to hold metadata from various file formats.

This class provides a hierarchical metadata container. A metadata object is similar to an element in XML. The top level element is named “ROOT” and can’t be renamed. Several transforms have a FormatMetadata. The root element and all of the sub-elements may contain: - A name string (e.g. “ROOT”, “Description”…). Name can’t be empty. - A value string (e.g. “updated viewing LUT”). Value can be empty. - A list of attributes (name, value) string pairs (e.g. “version”, “1.5”). There are helper functions to get and set “id” and “name” attributes. Attribute names are unique. - And a list of child sub-elements, which are also objects implementing FormatMetadata. There can be several sub-elements with the same name.

name: str in self bool
self[name: str] str

Get the value of a attribute (”” if attribute does not exist).

FormatMetadata(*args, **kwargs)
iter(self) PyOpenColorIO.FormatMetadata.AttributeNameIterator
len(self) int
self[name: str] = value: str None

Add an attribute with a given name and value. If an attribute with the same name already exists, its value is replaced. Throw if name is NULL or empty.

addChildElement(name: str, value: str) None

Add a child element with a given name and value.

Name has to be non-empty. Value may be empty, particularly if this element will have children. Element is added after all existing children. Use getChildElement(getNumChildrenElements()-1) to access the added element.

clear() None

Remove all children, all attributes and the value.

getAttributes() PyOpenColorIO.FormatMetadata.AttributeIterator
getChildElements() PyOpenColorIO.FormatMetadata.ChildElementIterator
getElementName() str
getElementValue() str
getID() str

Convenience method to easily get/set the ‘id’ attribute. This corresponds to the ProcessNode id attribute from a CLF/CTF file or the ColorCorrection id attribute from a CC/CCC/CDL file.

getName() str

Convenience method to easily get/set the ‘name’ attribute. This corresponds to the ProcessNode name attribute from a CLF / CTF file or the name key of a transform in the config YAML.

setElementName(name: str) None

Name has to be a non-empty string. Top-level element can’t be renamed. ‘ROOT’ is reserved.

setElementValue(value: str) None
setID(id: str) None
setName(name: str) None
class PyOpenColorIO.FormatMetadata.AttributeNameIterator
self[arg0: int] str
iter(self) PyOpenColorIO.FormatMetadata.AttributeNameIterator
len(self) int
next(self) str
class PyOpenColorIO.FormatMetadata.AttributeIterator
self[arg0: int] tuple
iter(self) PyOpenColorIO.FormatMetadata.AttributeIterator
len(self) int
next(self) tuple
class PyOpenColorIO.FormatMetadata.ConstChildElementIterator
self[arg0: int] PyOpenColorIO.FormatMetadata
iter(self) PyOpenColorIO.FormatMetadata.ConstChildElementIterator
len(self) int
next(self) PyOpenColorIO.FormatMetadata
class PyOpenColorIO.FormatMetadata.ChildElementIterator
self[arg0: int] PyOpenColorIO.FormatMetadata
iter(self) PyOpenColorIO.FormatMetadata.ChildElementIterator
len(self) int
next(self) PyOpenColorIO.FormatMetadata

Constants: FormatMetadata