emnrdl Posted July 5, 2020 Share Posted July 5, 2020 I am trying to render 2 hda simultaneously and I decide to using python threading it works on the houduni's python shell but it don't work on hyton. What is the problem here? How can I solve this? PythonShell hyton Code import hou import time import threading def nodeRender(nodeName,path,fileName,nodeCnt): start_node_time = time.time() node = hou.node("/obj") sp_name = "{}{}".format(nodeName, nodeCnt) file_save_name = "{}{}.png".format(fileName, nodeCnt) node.createNode(nodeName, sp_name) nodepic = hou.node("/obj/{}".format(sp_name)) nodepic.parm("output").set("{}/{}".format(path, file_save_name)) nodepic.parm("render").pressButton() nodepic.destroy() ex_time = '{:.2f}'.format((time.time() - start_node_time)) print("--- %s seconds ---" % ex_time) def renderThread(): start_time = time.time() t1 = threading.Thread(target = nodeRender, args=["Masa", "C:/Users/emnrdl/Desktop/New Folder (13)", "MasaTest" , "1"]) t2 = threading.Thread(target = nodeRender, args=["Masa", "C:/Users/emnrdl/Desktop/New Folder (13)", "MasaTest" , "2"]) t1.start() t2.start() t1.join() t2.join() total_ex_time = '{:.2f}'.format((time.time() - start_time)) print("--- Total execution time: %s seconds ---" % total_ex_time) 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.