leota90 Posted July 11, 2020 Share Posted July 11, 2020 Hi there, 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! Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted July 22, 2020 Share Posted July 22, 2020 This is not possible in Hython same as it's not possible to load load 2 different hip files into a single Houdini session. You have to spawn a new Hython process per hip file, but communicating between them is not trivial at all. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.