diff --git a/pype/plugins/global/publish/extract_burnin.py b/pype/plugins/global/publish/extract_burnin.py index 81d96a09da..856238d00f 100644 --- a/pype/plugins/global/publish/extract_burnin.py +++ b/pype/plugins/global/publish/extract_burnin.py @@ -2,6 +2,7 @@ import os import re import json import copy +import tempfile import pype.api import pyblish @@ -222,12 +223,30 @@ class ExtractBurnin(pype.api.Extractor): # Dump data to string dumped_script_data = json.dumps(script_data) + # Store dumped json to temporary file + temporary_json_file = tempfile.NamedTemporaryFile( + mode="w", suffix=".json", delete=False + ) + temporary_json_file.write(dumped_script_data) + temporary_json_file.close() + temporary_json_filepath = temporary_json_file.name.replace( + "\\", "/" + ) + # Prepare subprocess arguments - args = [executable, scriptpath, dumped_script_data] - self.log.debug("Executing: {}".format(args)) + args = [ + "\"{}\"".format(executable), + "\"{}\"".format(scriptpath), + "\"{}\"".format(temporary_json_filepath) + ] + subprcs_cmd = " ".join(args) + self.log.debug("Executing: {}".format(subprcs_cmd)) # Run burnin script - pype.api.subprocess(args, shell=True, logger=self.log) + pype.api.subprocess(subprcs_cmd, shell=True, logger=self.log) + + # Remove the temporary json + os.remove(temporary_json_filepath) for filepath in temp_data["full_input_paths"]: filepath = filepath.replace("\\", "/") diff --git a/pype/scripts/otio_burnin.py b/pype/scripts/otio_burnin.py index ef09661f6e..a2a4147821 100644 --- a/pype/scripts/otio_burnin.py +++ b/pype/scripts/otio_burnin.py @@ -578,7 +578,10 @@ def burnins_from_data( if __name__ == "__main__": print("* Burnin script started") - in_data = json.loads(sys.argv[-1]) + in_data_json_path = sys.argv[-1] + with open(in_data_json_path, "r") as file_stream: + in_data = json.load(file_stream) + burnins_from_data( in_data["input"], in_data["output"],