add changes needed for Maya

This commit is contained in:
Ondrej Samohel 2021-11-30 14:01:11 +01:00
parent 76cd4207d0
commit d8ce82b916
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
3 changed files with 19 additions and 3 deletions

View file

@ -192,7 +192,10 @@ class CollectMayaRender(pyblish.api.ContextPlugin):
render_products = layer_render_products.layer_data.products
assert render_products, "no render products generated"
exp_files = []
multipart = False
for product in render_products:
if product.multipart:
multipart = True
product_name = product.productName
if product.camera and layer_render_products.has_camera_token():
product_name = "{}{}".format(
@ -205,7 +208,7 @@ class CollectMayaRender(pyblish.api.ContextPlugin):
})
self.log.info("multipart: {}".format(
layer_render_products.multipart))
multipart))
assert exp_files, "no file names were generated, this is bug"
self.log.info(exp_files)
@ -300,7 +303,7 @@ class CollectMayaRender(pyblish.api.ContextPlugin):
"subset": expected_layer_name,
"attachTo": attach_to,
"setMembers": layer_name,
"multipartExr": layer_render_products.multipart,
"multipartExr": multipart,
"review": render_instance.data.get("review") or False,
"publish": True,

View file

@ -445,9 +445,14 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
preview = True
break
if instance_data.get("multipartExr"):
preview = True
new_instance = copy(instance_data)
new_instance["subset"] = subset_name
new_instance["subsetGroup"] = group_name
if preview:
new_instance["review"] = True
# create represenation
if isinstance(col, (list, tuple)):
@ -527,6 +532,10 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
if bake_renders:
preview = False
# toggle preview on if multipart is on
if instance.get("multipartExr", False):
preview = True
staging = os.path.dirname(list(collection)[0])
success, rootless_staging_dir = (
self.anatomy.find_root_template_from_path(staging)

View file

@ -32,11 +32,15 @@ class ExtractJpegEXR(pyblish.api.InstancePlugin):
def process(self, instance):
self.log.info("subset {}".format(instance.data['subset']))
# skip crypto passes.
if 'crypto' in instance.data['subset']:
self.log.info("Skipping crypto passes.")
return
# Skip review when requested.
# Skip if review not set.
if not instance.data.get("review", True):
self.log.info("Skipping - no review set on instance.")
return
filtered_repres = self._get_filtered_repres(instance)