Skip to content

Reuse check inventory versions for loader colors YN - #364

Open
jakubjezek001 wants to merge 20 commits into
developfrom
reuse_check_inventory_versions_for_loader_colors_yn
Open

Reuse check inventory versions for loader colors YN#364
jakubjezek001 wants to merge 20 commits into
developfrom
reuse_check_inventory_versions_for_loader_colors_yn

Conversation

@jakubjezek001

Copy link
Copy Markdown
Member

adoption of #278

Changelog Description

refactor the tile_color logic to be shared between loaders. Updated the check_inventory_versions to use the same logic as the loader for consistent color coding

Additional review information

before:

  • each Loader re-implements the is_latest checks to update the node colors
  • check_inventory_versions runs on scriptSave and uses its own logic and own color values to update the node colors
  • loading an older version of a product incorrectly used the latest color

after:

  • plugin.NukeLoader.get_node_colors returns a map of "container_status/categories" to colors
    • those values can be overwritten either by setting the respective node_color_<status> variables on the LoaderClass
    • or by overwriting get_node_colors and return different values
  • plugin.NukeLoader.update_node_color(self, node) a helper method to update the tile color for a given node. Loaders should use this on load and update
  • check_inventory_versions now uses the colors defined by each containers get_node_colors

Todo:

  • so far I've only updated the LoadClip and LoadImage loaders as examples. If the general approach is approved I'm happy to roll out the updates to other loaders too.

Testing notes:

  1. import a product using the LoadClip or LoadImage loader
  2. => confirm that the correct color (latest) was used
  3. change the version to an older one
  4. => confirm that the correct color was used (outdated color)
  5. change it back to latest
  6. => confirm that the correct color (latest) was used
  7. load a outdated version of a product
  8. => confirm that the correct color was used (outdated color)
  9. save the workfile (this should trigger the onScriptSave callback: check_inventory_versions
  10. confirm that all nodes have the correct colors

@jakubjezek001 jakubjezek001 self-assigned this Sep 1, 2026
@jakubjezek001
jakubjezek001 requested a review from BigRoy September 1, 2026 13:48
@jakubjezek001 jakubjezek001 added the type: enhancement Improvement of existing functionality or minor addition label Sep 1, 2026
@BigRoy

BigRoy commented Sep 1, 2026

Copy link
Copy Markdown
Member

Something went wrong here? This has a massive diff and conflicts that it shouldn't have?

@jakubjezek001

Copy link
Copy Markdown
Member Author

Something went wrong here? This has a massive diff and conflicts that it shouldn't have?

working on it

@jakubjezek001

Copy link
Copy Markdown
Member Author

@copilot fix linking and make sure code changes will be minimal required

Co-authored-by: jakubjezek001 <40640033+jakubjezek001@users.noreply.github.com>

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@copilot fix linking and make sure code changes will be minimal required

Fixed in 04b1a72: the merge had left load_backdrop.py with duplicated/reordered imports (ruff F811), unrelated to this feature. Reverted that file to develop's state, which brings the diff down to only the 12 files actually needed for the tile_color refactor. ruff check now passes on all changed files.

@jakubjezek001

Copy link
Copy Markdown
Member Author

@BigRoy would you agree, this is better?

@BigRoy

BigRoy commented Sep 1, 2026

Copy link
Copy Markdown
Member

@BigRoy would you agree, this is better?

Can you describe what you did different than the source PR? Just so I can focus my attention on that.

@jakubjezek001

Copy link
Copy Markdown
Member Author

@BigRoy would you agree, this is better?

Can you describe what you did different than the source PR? Just so I can focus my attention on that.

My intention were resolve the merge conflicts only. The code had been chenged a lot after the #279 in plugins so there were lot of conflicts.

Comment on lines +224 to +228
# Set all workfile settings.'
nuke.addOnCreate(on_root_create, nodeClass="Root")
# set checker for last versions on loaded containers
nuke.addOnScriptLoad(check_inventory_versions)
# fix ffmpeg settings on script

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines are duplicated.

@moonyuet moonyuet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the code and it is working as it is intended. I only have a comment above and it's good to go for approval after it is resolved. Should we support the changes of the color from addon settings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants