Skip to content

Commit

Permalink
fix for Cinema 4D R23 which comes with Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRosenstein committed Feb 18, 2021
1 parent 517ddd5 commit 37911cb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pvrenderqueue2.pyp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from __future__ import print_function
from importlib import reload

DEBUG = True

#######################################################################
Expand Down Expand Up @@ -204,7 +207,7 @@ def run_script(filename):
'__name__': '__main__',
'__file__': filename}
try:
exec compile(code, filename, 'exec') in scope
exec(compile(code, filename, 'exec'), scope)
except BaseException:
traceback.print_exc()

Expand Down Expand Up @@ -464,7 +467,7 @@ class RQDialog(c4d.gui.GeDialog):
return False

def error_callback(kind, data):
print '[PV Render Queue 2]: LoadCache:', kind, data
print('[PV Render Queue 2]: LoadCache:', kind, data)

try:
nodes = pvrq2.read_nodes(hf, error_callback)
Expand Down Expand Up @@ -539,7 +542,7 @@ class RQDialog(c4d.gui.GeDialog):
try:
filename = self.scripts[index]
except IndexError:
print "[PV Render Queue 2]: Script index out of range.", index
print("[PV Render Queue 2]: Script index out of range.", index)
else:
run_script(filename)
self.SaveCache()
Expand Down Expand Up @@ -642,7 +645,7 @@ class RQMessageData(c4d.plugins.MessageData):
except BaseException:
node.status = pvrq2.STATUS_FAILED
node.error_message = traceback.format_exc()
print >> sys.stderr, node.error_message
print(node.error_message, file=sys.stderr)
else:
if next_up is None:
node.status = pvrq2.STATUS_FAILED
Expand Down

0 comments on commit 37911cb

Please sign in to comment.