nuke: capture exception so popup is not rised

This commit is contained in:
Jakub Jezek 2023-04-05 14:34:26 +02:00
parent 0019ff6f7d
commit 105e03344c
No known key found for this signature in database
GPG key ID: 730D7C02726179A7

View file

@ -23,6 +23,9 @@ from openpype.client import (
from openpype.host import HostDirmap
from openpype.tools.utils import host_tools
from openpype.pipeline.workfile.workfile_template_builder import (
TemplateProfileNotFound
)
from openpype.lib import (
env_value_to_bool,
Logger,
@ -2684,7 +2687,10 @@ def start_workfile_template_builder():
# to avoid looping of the callback, remove it!
log.info("Starting workfile template builder...")
build_workfile_template(workfile_creation_enabled=True)
try:
build_workfile_template(workfile_creation_enabled=True)
except TemplateProfileNotFound:
log.warning("Template profile not found. Skipping...")
# remove callback since it would be duplicating the workfile
nuke.removeOnCreate(start_workfile_template_builder, nodeClass="Root")