Skip to content

Commit

Permalink
SG-13296 Python 3 Houdini port (#88)
Browse files Browse the repository at this point in the history
Updated the Houdini hooks to work in Python 3.
  • Loading branch information
pscadding authored Apr 2, 2020
1 parent d403078 commit 35c2293
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hooks/scene_operation_tk-houdini.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

import sgtk

from tank_vendor import six

HookClass = sgtk.get_hook_baseclass()


Expand Down Expand Up @@ -70,13 +72,13 @@ def execute(
elif operation == "open":
# give houdini forward slashes
file_path = file_path.replace(os.path.sep, "/")
hou.hipFile.load(file_path.encode("utf-8"))
hou.hipFile.load(six.ensure_str(file_path))
elif operation == "save":
hou.hipFile.save()
elif operation == "save_as":
# give houdini forward slashes
file_path = file_path.replace(os.path.sep, "/")
hou.hipFile.save(str(file_path.encode("utf-8")))
hou.hipFile.save(six.ensure_str(file_path))
elif operation == "reset":
hou.hipFile.clear()
return True

0 comments on commit 35c2293

Please sign in to comment.