Merge pull request #3010 from pypeclub/bugfix/tray_publisher_fix

Tray publisher: Fixes after code movement
This commit is contained in:
Jakub Trllo 2022-04-05 16:49:04 +02:00 committed by GitHub
commit e17db670e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 8 deletions

View file

@ -7,7 +7,7 @@ from avalon import io
import avalon.api
import pyblish.api
from openpype.pipeline import BaseCreator
from openpype.pipeline import register_creator_plugin_path
ROOT_DIR = os.path.dirname(os.path.dirname(
os.path.abspath(__file__)
@ -169,7 +169,7 @@ def install():
pyblish.api.register_host("traypublisher")
pyblish.api.register_plugin_path(PUBLISH_PATH)
avalon.api.register_plugin_path(BaseCreator, CREATE_PATH)
register_creator_plugin_path(CREATE_PATH)
def set_project_name(project_name):

View file

@ -14,11 +14,22 @@ class ValidateWorkfilePath(pyblish.api.InstancePlugin):
def process(self, instance):
filepath = instance.data["sourceFilepath"]
if not filepath:
raise PublishValidationError((
"Filepath of 'workfile' instance \"{}\" is not set"
).format(instance.data["name"]))
raise PublishValidationError(
(
"Filepath of 'workfile' instance \"{}\" is not set"
).format(instance.data["name"]),
"File not filled",
"## Missing file\nYou are supposed to fill the path."
)
if not os.path.exists(filepath):
raise PublishValidationError((
"Filepath of 'workfile' instance \"{}\" does not exist: {}"
).format(instance.data["name"], filepath))
raise PublishValidationError(
(
"Filepath of 'workfile' instance \"{}\" does not exist: {}"
).format(instance.data["name"], filepath),
"File not found",
(
"## File was not found\nFile \"{}\" was not found."
" Check if the path is still available."
).format(filepath)
)