Is there an existing issue for this?
Description
Current Behavior
Every time I change the version of a loaded container in Scene Inventory (up or down), a hidden knob called avalon:node gets added to the node — or if it already exists, it gets bigger. After two version changes it's about twice the size it was after one. This bloats the .nk file and any scene submitted to the farm.
Expected Behavior
The avalon:node knob shouldn't exist at all. All the container info is already saved in the other avalon:* knobs (avalon:representation, avalon:version, etc.). Nothing in the codebase reads avalon:node, so it seems like it's being created by accident.
Steps To Reproduce:
- Load any product in Nuke via the AYON Loader (e.g. a render EXR sequence).
- Open Scene Inventory and switch to an older version.
- Switch back to the original version.
- Run this in the Script Editor:
import nuke
for n in nuke.allNodes(recurseGroups=True):
if "avalon:node" in n.knobs():
print(f"{n.name()}: avalon:node length = {len(n['avalon:node'].value())}")
- Repeat steps 2–4 and run the snippet again. The number keeps doubling each time.
Additional context:
I think the issue is in update_container in api/pipeline.py. It reads the container data using parse_container, but that function also adds some extra fields to the dict — including "node", which is the actual Nuke node object. When that dict gets written back to the node's knobs, Nuke converts the node object to a string containing all of the node's current state. That string ends up saved as the avalon:node knob, and it includes a copy of itself from the previous update, so it keeps nesting.
Version
- ayon-nuke: bug introduced in commit
978ec89f (November 2023)
What platform were you running when you found the bug?
Windows
MacOS
Relevant log output:
Knob size on a single Read node across version changes:
| State |
avalon:node length |
| After initial load |
NOT PRESENT |
| After first version change |
1 437 chars |
| After second version change |
2 985 chars |
[
{
"step": "load v3",
"node": "LoadClip_exr1",
"avalon:representation": "aaa...aaa",
"avalon:version": 3,
"file": "P:/studio/.../product/v003/...v003.%04d.exr",
"avalon:node": null
},
{
"step": "v3 -> v1",
"node": "LoadClip_exr1",
"avalon:representation": "bbb...bbb",
"avalon:version": 1,
"file": "P:/studio/.../product/v001/...v001.%04d.exr",
"avalon:node": {
"length": 1437,
"avalon:representation": "bbb...bbb",
"avalon:version": 1,
"file": "P:/studio/.../product/v001/...v001.1010.exr",
"avalon:node": null
}
},
{
"step": "v1 -> v3",
"node": "LoadClip_exr1",
"avalon:representation": "aaa...aaa",
"avalon:version": 3,
"file": "P:/studio/.../product/v003/...v003.%04d.exr",
"avalon:node": {
"length": 2985,
"avalon:representation": "bbb...bbb",
"avalon:version": 1,
"file": "P:/studio/.../product/v003/...v003.1010.exr",
"avalon:node": {
"avalon:representation": "bbb...bbb",
"avalon:version": 1,
"file": "P:/studio/.../product/v001/...v001.1010.exr",
"avalon:node": null
}
}
}
]
Is there an existing issue for this?
Description
Current Behavior
Every time I change the version of a loaded container in Scene Inventory (up or down), a hidden knob called
avalon:nodegets added to the node — or if it already exists, it gets bigger. After two version changes it's about twice the size it was after one. This bloats the.nkfile and any scene submitted to the farm.Expected Behavior
The
avalon:nodeknob shouldn't exist at all. All the container info is already saved in the otheravalon:*knobs (avalon:representation,avalon:version, etc.). Nothing in the codebase readsavalon:node, so it seems like it's being created by accident.Steps To Reproduce:
Additional context:
I think the issue is in
update_containerinapi/pipeline.py. It reads the container data usingparse_container, but that function also adds some extra fields to the dict — including"node", which is the actual Nuke node object. When that dict gets written back to the node's knobs, Nuke converts the node object to a string containing all of the node's current state. That string ends up saved as theavalon:nodeknob, and it includes a copy of itself from the previous update, so it keeps nesting.Version
978ec89f(November 2023)What platform were you running when you found the bug?
Windows
MacOS
Relevant log output:
Knob size on a single Read node across version changes:
avalon:nodelength[ { "step": "load v3", "node": "LoadClip_exr1", "avalon:representation": "aaa...aaa", "avalon:version": 3, "file": "P:/studio/.../product/v003/...v003.%04d.exr", "avalon:node": null }, { "step": "v3 -> v1", "node": "LoadClip_exr1", "avalon:representation": "bbb...bbb", "avalon:version": 1, "file": "P:/studio/.../product/v001/...v001.%04d.exr", "avalon:node": { "length": 1437, "avalon:representation": "bbb...bbb", "avalon:version": 1, "file": "P:/studio/.../product/v001/...v001.1010.exr", "avalon:node": null } }, { "step": "v1 -> v3", "node": "LoadClip_exr1", "avalon:representation": "aaa...aaa", "avalon:version": 3, "file": "P:/studio/.../product/v003/...v003.%04d.exr", "avalon:node": { "length": 2985, "avalon:representation": "bbb...bbb", "avalon:version": 1, "file": "P:/studio/.../product/v003/...v003.1010.exr", "avalon:node": { "avalon:representation": "bbb...bbb", "avalon:version": 1, "file": "P:/studio/.../product/v001/...v001.1010.exr", "avalon:node": null } } } ]