Skip to content

Commit

Permalink
Merge pull request #61 from ericmehl/python3Part2
Browse files Browse the repository at this point in the history
Python3 Part 2
  • Loading branch information
ericmehl authored Nov 20, 2023
2 parents 4ea17ed + 70b88a9 commit 170408e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 6 additions & 3 deletions custom/Gaffer/Gaffer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
##########################################################################
#
# Copyright (c) 2019, Hypothetical Inc. All rights reserved.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 170408e

Please sign in to comment.