Converting Houdini binary to text through script

   858   0   0
User Avatar
Member
1 posts
Joined: Nov. 2019
Offline
Hello everyone,

I am currently trying to make a small script the will open a binary hip file and save them as ASCII. This is the code I currently have.

import hou

def run():
hou.hipFile.load(file_name=“D:/test/test_scene.hip”)
hou.hipFile.setSaveMode(hou.saveMode.Text)
hou.hipFile.save(file_name=“D:/test/test_scene_text.hip”)


if __name__ == ‘__main__’:
run()

At the moment, this code fails to save as text and instead remains binary and also is smaller in size compared to the original. (138KB to 119KB)

I've used hou.hipFile.saveMode() to confirm that it is properly set to saveMode.Text.

This is code is run externally on Windows 10 using PyCharm 2019.1

Thanks,
  • Quick Links