holycause Posted December 28, 2015 Share Posted December 28, 2015 question, has anyone tried to run muiltiple instances of hou.hipFile.load() in individual threads, outside houdini? Whatever I do, it shares the same hipFile accross all my threads cheers Quote Link to comment Share on other sites More sharing options...
edward Posted December 30, 2015 Share Posted December 30, 2015 What do you mean by that? If you have multiple processes, then each process has its own separate copy of the scene. Quote Link to comment Share on other sites More sharing options...
holycause Posted December 31, 2015 Author Share Posted December 31, 2015 I have my thread Class that loads a hipfile class GetNodesThread(QtCore.QThread): send_node = QtCore.pyqtSignal(object) def __init__(self, file, parent, v): self.m_file = file ..... def run(self): hou.hipFile.load(self.m_file) and then in my main script create 1 thread for each file #Thread 1 thread1 = HThreads.GetNodesThread(self.m_file1, self, 1) #thread1.send_node.connect(lambda x: self.getObjLists(1, x)) self.m_threads.append(thread1) #Thread 2 thread2 = HThreads.GetNodesThread(self.m_file2, self, 2) #thread2.send_node.connect(lambda y: self.getObjLists(2, y)) self.m_threads.append(thread2) #Start threads for thread in self.m_threads: thread.start() I have some additional debugging code writing out information regarding the loaded files and this is what happens /path/to/the/hipfile - loaded_hipefile Thread 1: Pre load Z:/devel/python/hipfile_diff_check/hip/sphere_v1.hip - untitled.hip Loaded Z:/devel/python/hipfile_diff_check/hip/sphere_v1.hip - sphere_v2.hip Wrong file Thread 2: Pre load Z:/devel/python/hipfile_diff_check/hip/sphere_v2.hip - untitled.hip Loaded Z:/devel/python/hipfile_diff_check/hip/sphere_v2.hip - sphere_v2.hip Correct file 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.