Skip to content

Commit

Permalink
Add loader category colors to constants and update lib usage.
Browse files Browse the repository at this point in the history
- Added loader category colors to constants file.
- Updated lib file to use the new loader category colors constant.
  • Loading branch information
jakubjezek001 committed Aug 1, 2024
1 parent b5e4b6e commit 2409a3b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
6 changes: 6 additions & 0 deletions client/ayon_nuke/api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@


ASSIST = bool(os.getenv("NUKEASSIST"))
LOADER_CATEGORY_COLORS = {
"latest": "0x4ecd25ff",
"outdated": "0xd84f20ff",
"invalid": "0xff0000ff",
"not_found": "0xffff00ff",
}
16 changes: 6 additions & 10 deletions client/ayon_nuke/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
)
from ayon_core.pipeline.workfile import BuildWorkfile
from . import gizmo_menu
from .constants import ASSIST
from .constants import (
ASSIST,
LOADER_CATEGORY_COLORS,
)

from .workio import save_file
from .utils import get_node_outputs
Expand Down Expand Up @@ -813,18 +816,11 @@ def check_inventory_versions():
containers = host.get_containers()
project_name = get_current_project_name()

category_colors = {
"latest": "0x4ecd25ff",
"outdated": "0xd84f20ff",
"invalid": "0xff0000ff",
"not_found": "0xffff00ff",
}

filtered_containers = filter_containers(containers, project_name)
for category, containers in filtered_containers._asdict().items():
if category not in category_colors:
if category not in LOADER_CATEGORY_COLORS:
continue
color = category_colors[category]
color = LOADER_CATEGORY_COLORS[category]
color = int(color, 16) # convert hex to nuke tile color int
for container in containers:
container["node"]["tile_color"].setValue(color)
Expand Down

0 comments on commit 2409a3b

Please sign in to comment.