From a7c1caa098a7e623956023420366687a44a3c2f6 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 20 Aug 2024 19:01:46 +0300 Subject: [PATCH] support separated AOVs in arnold render --- .../plugins/publish/collect_arnold_rop.py | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/client/ayon_houdini/plugins/publish/collect_arnold_rop.py b/client/ayon_houdini/plugins/publish/collect_arnold_rop.py index 10c6d91d26..64b60aabd4 100644 --- a/client/ayon_houdini/plugins/publish/collect_arnold_rop.py +++ b/client/ayon_houdini/plugins/publish/collect_arnold_rop.py @@ -70,11 +70,15 @@ def process(self, instance): multipartExr = True num_aovs = rop.evalParm("ar_aovs") - # TODO: Check the following logic. - # as it always assumes that all AOV are not merged. + for index in range(1, num_aovs + 1): - # Skip disabled AOVs - if not rop.evalParm("ar_enable_aov{}".format(index)): + + aov_enabled = rop.evalParm("ar_enable_aov{}".format(index)) + aov_sep = rop.evalParm("ar_aov_separate{}".format(index)) + aov_path = rop.evalParm("ar_aov_separate_file{}".format(index)) + + # Skip disabled AOVs or AOVs with no separate aov file path + if not all((aov_enabled, aov_path, aov_sep)): continue if rop.evalParm("ar_aov_exr_enable_layer_name{}".format(index)): @@ -82,8 +86,15 @@ def process(self, instance): else: label = evalParmNoFrame(rop, "ar_aov_label{}".format(index)) - aov_product = self.get_render_product_name(default_prefix, - suffix=label) + # NOTE: + # we don't collect the actual AOV path but rather assume + # the user has used the default beauty path (collected above) + # with the AOV name before the extension. + # Also, Note that Ayon Publishing does not require a specific file name, + # as it will be renamed according to the naming conventions set in the publish template. + aov_product = self.get_render_product_name( + prefix=default_prefix, suffix=label + ) render_products.append(aov_product) files_by_aov[label] = self.generate_expected_files(instance, aov_product)