Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuke behavior more resilient #36

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions client/ayon_nuke/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,13 @@ def compat_prefixed(knob_name):
if not knob_name:
# Ignore unnamed knob
continue

knob_type = nuke.knob(knob.fullyQualifiedName(), type=True)
value = knob.value()

try:
knob_type = nuke.knob(knob.fullyQualifiedName(), type=True)
value = knob.value()
except Exception:
log.debug(
f"Error in knob {knob_name}, node {node['name'].value()}")
continue
jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved
if (
knob_type not in EXCLUDED_KNOB_TYPE_ON_READ or
# For compating read-only string data that imprinted
Expand Down Expand Up @@ -815,18 +818,21 @@ def check_inventory_versions():
This will group containers by their version to outdated, not found,
invalid or latest and colorize the nodes based on the category.
"""
host = registered_host()
containers = host.get_containers()
project_name = get_current_project_name()
try:
host = registered_host()
containers = host.get_containers()
project_name = get_current_project_name()

filtered_containers = filter_containers(containers, project_name)
for category, containers in filtered_containers._asdict().items():
if category not in LOADER_CATEGORY_COLORS:
continue
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)
filtered_containers = filter_containers(containers, project_name)
for category, containers in filtered_containers._asdict().items():
if category not in LOADER_CATEGORY_COLORS:
continue
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)
except Exception as error:
log.warning(error)


def writes_version_sync():
Expand Down