I'm importing the hou module into a custom python script and I would like to have multiple scenes opened at the same time. This is how it is implemented:
import sys from importlib import reload sys.path.append(HOUDINI_PATH) try: import hou except ImportError: print('houdini.py: There was a problem loading the hou module') box_hip = hou.hipFile box_scene = box_hip.load(path/to/box_scene.hipnc) print(box_hip.name()) # ==> box_scene.hipnc CORRECT reload(hou) sphere_hip = hou.hipFile sphere_scene = sphere_hip.load(path/to/sphere_scene.hipnc) print(sphere_hip.name()) # ==> sphere_scene.hipnc CORRECT # Let's print the name of box_hip again print(box_hip.name()) # ==> sphere_scene.hipnc WRONG
As you can see, even though I've reloaded the hou module, it's still using the same hou instance for both hip files and therefore always returning the data of the latest loaded scene.
Is there a way to have different instances of the hou module so I can load and work on multiple different hip files in the same script? I've also tried to assign hou to different variables with no luck.
Any help would be highly appreciated, thanks in advance!