from weSkel.src.core.props.svd import SVDSnapshotRun in Maya with weSkel available. om.* types refer to maya.api.OpenMaya.
Collection of SVD entries associated with a node.
SVDSnapshot associates a node name with a dictionary of SVDPlug entries. node.snapshot_svd(attrs) captures explicitly requested attributes.
objectSVDSnapshotfrom weSkel.src.core.props.svd import SVDSnapshotRun in Maya with weSkel available. om.* types refer to maya.api.OpenMaya.
| Item | Value |
|---|---|
| Class | SVDSnapshot |
| Module | weSkel.src.core.props.svd |
| Direct parent | object |
| Kind | dataclass; frozen=False |
| Spec properties | None. |
This reference documents members defined by this class. Standard Python mechanisms and native inherited members are outside its member counts.
SVDSnapshot(node: str, data: Dict[str, SVDPlug] = {}) → SVDSnapshot
| Parameter | Type | Default |
|---|---|---|
node |
str |
required |
data |
Dict[str, SVDPlug] |
{} |
node is a recorded name, not a Maya lookup. Without data, the dictionary starts empty. To capture data, call node.snapshot_svd(("scaleX", "visibility")) on a live wrapper with existing attributes.
Own members. R = read only; R/W = read and write.
| Field | Return type | Access | Purpose |
|---|---|---|---|
node |
str |
R/W | Node name recorded during capture. |
data |
Dict[str, SVDPlug] |
R/W | Dictionary mapping attribute names to SVDPlug entries. |
| Return type | Contract |
|---|---|
str |
Node name recorded during capture. |
| Return type | Contract |
|---|---|
Dict[str, SVDPlug] |
Dictionary mapping attribute names to SVDPlug entries. |
Own methods.
| Method | Return type | Purpose |
|---|---|---|
add |
None |
Add or replace an entry under the svd_plug.attr key. |
attrs |
Iterable[str] (dict_keys) |
Return the key view of the data dictionary. |
| Parameter | Type | Default |
|---|---|---|
svd_plug |
SVDPlug |
required |
| Returns | Contract |
|---|---|
None |
Add or replace an entry under the svd_plug.attr key. |
Only changes data. No attribute is created or applied in Maya. An entry with the same name replaces the previous one.
| Returns | Contract |
|---|---|
Iterable[str] (dict_keys) |
Return the key view of the data dictionary. |
Concrete type: dict_keys, a dynamic view. Use list(snapshot.attrs()) to freeze the list of names.
The container is mutable; add() can replace an entry. It stores a name, not persistent node identity. Each instance created without data receives its own dictionary.
Keys are captured long paths: scale.scaleX for scaleX, for example.
This type is not the dictionary returned by node.snapshot(). Do not pass it directly to finalize(snapshot=...). It has no automatic save, scene reconstruction or replay method.
from uuid import uuid4from weSkel.src.core.node.dag.transform.lib import Transformfrom weSkel.src.core.props.svd import SVDSnapshot, svd_from_plug
node = Transform("sdk_snapshot_" + uuid4().hex[:8])try: node.create() node.plugs["scaleX"].value = 2.0 snapshot = node.snapshot_svd(("scaleX", "visibility")) assert isinstance(snapshot, SVDSnapshot) names = snapshot.attrs() node.plugs["scaleX"].value = 6.0 assert snapshot.data["scale.scaleX"].value == 2.0 snapshot.add(svd_from_plug(node.plugs["scaleY"])) assert "scale.scaleY" in names assert snapshot.node == node.name print("SVDSnapshot: PASS")finally: node.delete(snapshot=False)Expected result: SVDSnapshot: PASS. Temporary nodes are removed in finally.