diff --git a/Changes.md b/Changes.md index 45a5eb4..6e8fd00 100644 --- a/Changes.md +++ b/Changes.md @@ -4,6 +4,8 @@ - Removed support for Gaffer versions `1.2.1.0` and `1.2.6.0` - Added support for Gaffer versions `1.3.7.0` and `1.2.10.5` - Added support for Arnold progress updates in the Deadline plugin. +- Update Deadline Plugin to use Python 3. +- Update Deadline Plugin to be compatible with Python 3.10. # 0.57.1.0 diff --git a/custom/Gaffer/Gaffer.py b/custom/Gaffer/Gaffer.py index 5395cab..d10da3b 100644 --- a/custom/Gaffer/Gaffer.py +++ b/custom/Gaffer/Gaffer.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 ########################################################################## # # Copyright (c) 2019, Hypothetical Inc. All rights reserved. @@ -68,6 +69,8 @@ class GafferPlugin(DeadlinePlugin): CurrFrame = 0 def __init__(self): + super().__init__() + self.InitializeProcessCallback += self.InitializeProcess # self.RenderTasksCallback += self.RenderTasks self.RenderExecutableCallback += self.GetRenderExecutable @@ -126,10 +129,10 @@ def PreRenderTasks(self): tempSceneDirectory = self.CreateTempDirectory("thread" + str(self.GetThreadNumber())) tempSceneFilename = Path.Combine(tempSceneDirectory, Path.GetFileName(localScript)) - with open(localScript, "r") as inFile, open(tempSceneFilename, "w") as outFile: + with open(localScript, "r", encoding="utf-8") as inFile, open(tempSceneFilename, "w", encoding="utf-8") as outFile: for line in inFile: - newLine = RepositoryUtils.CheckPathMapping(line.decode("utf-8")) - outFile.write(newLine.encode("utf-8")) + newLine = RepositoryUtils.CheckPathMapping(line) + outFile.write(newLine) self._gafferScript = tempSceneFilename