From 2409a3b319d4514c2d7ba2257cc877564ef5dd50 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 1 Aug 2024 17:18:48 +0200 Subject: [PATCH] Add loader category colors to constants and update lib usage. - Added loader category colors to constants file. - Updated lib file to use the new loader category colors constant. --- client/ayon_nuke/api/constants.py | 6 ++++++ client/ayon_nuke/api/lib.py | 16 ++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/client/ayon_nuke/api/constants.py b/client/ayon_nuke/api/constants.py index 1101997..fa39626 100644 --- a/client/ayon_nuke/api/constants.py +++ b/client/ayon_nuke/api/constants.py @@ -2,3 +2,9 @@ ASSIST = bool(os.getenv("NUKEASSIST")) +LOADER_CATEGORY_COLORS = { + "latest": "0x4ecd25ff", + "outdated": "0xd84f20ff", + "invalid": "0xff0000ff", + "not_found": "0xffff00ff", +} diff --git a/client/ayon_nuke/api/lib.py b/client/ayon_nuke/api/lib.py index e43e035..d15a7dd 100644 --- a/client/ayon_nuke/api/lib.py +++ b/client/ayon_nuke/api/lib.py @@ -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 @@ -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)