Skip to content

avalon:node knob keeps growing bigger on every version update in Scene Inventory #252

@semx2a

Description

@semx2a

Is there an existing issue for this?

  • I have searched the existing issues and added correct labels.

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:

  1. Load any product in Nuke via the AYON Loader (e.g. a render EXR sequence).
  2. Open Scene Inventory and switch to an older version.
  3. Switch back to the original version.
  4. 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())}")
  5. 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
      }
    }
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions