From acc0a6c7fc56ae3d3714b7faa5d7ca4eddeeb8bf Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 27 Aug 2024 14:15:14 +0200 Subject: [PATCH] Fix `beginSave` arguments for Houdini 20.5.182+ with added `stage_variables` argument to `OutputProcessor.beginSave` method --- .../outputprocessors/remap_to_publish.py | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/client/ayon_houdini/startup/husdplugins/outputprocessors/remap_to_publish.py b/client/ayon_houdini/startup/husdplugins/outputprocessors/remap_to_publish.py index 52e02f4160..1b4ded0bb0 100644 --- a/client/ayon_houdini/startup/husdplugins/outputprocessors/remap_to_publish.py +++ b/client/ayon_houdini/startup/husdplugins/outputprocessors/remap_to_publish.py @@ -5,6 +5,9 @@ from husd.outputprocessor import OutputProcessor +_COMPATIBILITY_PLACEHOLDER = object() + + class AYONRemapPaths(OutputProcessor): """Remap paths based on a mapping dict on rop node.""" @@ -38,11 +41,18 @@ def parameters(): return group.asDialogScript() - def beginSave(self, config_node, config_overrides, lop_node, t): - super(AYONRemapPaths, self).beginSave(config_node, - config_overrides, - lop_node, - t) + def beginSave(self, + config_node, + config_overrides, + lop_node, + t, + # Added in Houdini 20.5.182 + stage_variables=_COMPATIBILITY_PLACEHOLDER): + + args = [config_node, config_overrides, lop_node, t] + if stage_variables is not _COMPATIBILITY_PLACEHOLDER: + args.append(stage_variables) + super(AYONRemapPaths, self).beginSave(*args) value = config_node.evalParm("ayon_remap_paths_remap_json") mapping = json.loads(value)