Scene
Scene
¶
A Maya scene file (.mb or .ma).
Attributes¶
nested_references
¶
References made by referenced files, as recorded in this file.
Methods:¶
dependencies
¶
dependencies(
extra: ExtraAttributes | None = None,
) -> list[Dependency]
Every file path the scene stores: references at every depth, file attributes, then file attributes set on referenced nodes.
See file_attributes for extra; for reference edits its attribute
names apply to every node type, since the edited node's type is not
stored in this file.
file_attributes
¶
Stored string values of the attributes that hold file paths.
extra adds attributes per node type, as stored short names (for
example {"transform": ["icon_path"]}); subtypes inherit them.
reference_edits
¶
reference_edits() -> list[tuple[Attribute, ReferenceEdits]]
The edits each reference node records, with the attribute holding them.
remap_paths
¶
Replace every stored file path p with remap(p); return how many changed.
Covers everything dependencies lists. remap returns the new path,
or None (or p) to keep it; it sees paths exactly as stored, with no
normalisation. See dependencies for extra.
replace_strings
¶
Put the names and strings the file stores through replace, like a
text replace over the whole file; return how many changed. .mb only.
Covered: node names and parents, the nodes named by connections,
relationships, instances and reference edits, the values set by
reference edits, string attribute values (paths, notes, expression
and script MEL), references (path, namespace, reference node, cached
options), fileInfo, and the externalContentTable (CRCs recomputed).
Attribute names, node types, plugins and default nodes are left
alone, everywhere: a match in an attribute name changes nothing.
Names stay consistent when replace changes a name the same way
wherever it appears: on its own, in a DAG path (|grp|name), after
a namespace (ns:name).
save
¶
Save to a new file; refuses to overwrite one (FileExistsError).
The write is atomic: bytes go to a temporary sibling file which then replaces the target. The format stays the one the scene was parsed from.
save_in_place
¶
Overwrite the file this scene was parsed from or last saved to.