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

Maya: aov filtering #4083

Merged
merged 11 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 14 additions & 5 deletions openpype/hosts/maya/api/lib_renderproducts.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ def _get_aov_render_products(self, aov, cameras=None):

products = []
aov_name = self._get_attr(aov, "name")
multipart = False
multilayer = bool(self._get_attr("defaultArnoldDriver.multipart"))
merge_AOVs = bool(self._get_attr("defaultArnoldDriver.mergeAOVs"))
if multilayer or merge_AOVs:
multipart = True
ai_drivers = cmds.listConnections("{}.outputs".format(aov),
source=True,
destination=False,
Expand Down Expand Up @@ -589,6 +594,7 @@ def _get_aov_render_products(self, aov, cameras=None):
ext=ext,
aov=aov_name,
driver=ai_driver,
multipart=multipart,
camera=camera)
products.append(product)

Expand Down Expand Up @@ -1016,7 +1022,11 @@ def get_render_products(self):
# due to some AOVs still being written into separate files,
# like Cryptomatte.
# AOVs are merged in multi-channel file
multipart = bool(self._get_attr("redshiftOptions.exrForceMultilayer"))
multipart = False
force_layer = bool(self._get_attr("redshiftOptions.exrForceMultilayer")) # noqa
exMultipart = bool(self._get_attr("redshiftOptions.exrMultipart"))
if exMultipart or force_layer:
multipart = True

# Get Redshift Extension from image format
image_format = self._get_attr("redshiftOptions.imageFormat") # integer
Expand Down Expand Up @@ -1044,7 +1054,6 @@ def get_render_products(self):

# Any AOVs that still get processed, like Cryptomatte
# by themselves are not multipart files.
aov_multipart = not multipart

# Redshift skips rendering of masterlayer without AOV suffix
# when a Beauty AOV is rendered. It overrides the main layer.
Expand Down Expand Up @@ -1075,7 +1084,7 @@ def get_render_products(self):
productName=aov_light_group_name,
aov=aov_name,
ext=ext,
multipart=aov_multipart,
multipart=multipart,
camera=camera)
products.append(product)

Expand All @@ -1089,7 +1098,7 @@ def get_render_products(self):
product = RenderProduct(productName=aov_name,
aov=aov_name,
ext=ext,
multipart=aov_multipart,
multipart=multipart,
camera=camera)
products.append(product)

Expand All @@ -1100,7 +1109,7 @@ def get_render_products(self):
if light_groups_enabled:
return products

beauty_name = "Beauty_other" if has_beauty_aov else ""
beauty_name = "BeautyAux" if has_beauty_aov else ""
for camera in cameras:
products.insert(0,
RenderProduct(productName=beauty_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,12 +494,13 @@ def _create_instances_for_aov(self, instance_data, exp_files):
else:
render_file_name = os.path.basename(col)
aov_patterns = self.aov_filter
preview = match_aov_pattern(app, aov_patterns, render_file_name)

preview = match_aov_pattern(app, aov_patterns, render_file_name)
# toggle preview on if multipart is on

if instance_data.get("multipartExr"):
preview = True

self.log.debug("preview:{}".format(preview))
new_instance = deepcopy(instance_data)
new_instance["subset"] = subset_name
new_instance["subsetGroup"] = group_name
Expand Down Expand Up @@ -542,7 +543,7 @@ def _create_instances_for_aov(self, instance_data, exp_files):
if new_instance.get("extendFrames", False):
self._copy_extend_frames(new_instance, rep)
instances.append(new_instance)

self.log.debug("instances:{}".format(instances))
return instances

def _get_representations(self, instance, exp_files):
Expand Down