Textures publishing - tweaked validator

Look for resources (secondary workfiles) only for main workfile.
This commit is contained in:
Petr Kalis 2021-07-27 11:30:12 +02:00
parent abda7f9afa
commit c2ffeb8953

View file

@ -14,8 +14,16 @@ class ValidateTextureBatchWorkfiles(pyblish.api.InstancePlugin):
families = ["workfile"]
optional = True
# from presets
main_workfile_extensions = ['mra']
def process(self, instance):
if instance.data["family"] == "workfile":
msg = "No resources for workfile {}".\
ext = instance.data["representations"][0]["ext"]
if ext not in self.main_workfile_extensions:
self.log.warning("Only secondary workfile present!")
return
msg = "No secondary workfiles present for workfile {}".\
format(instance.data["name"])
assert instance.data.get("resources"), msg