I'm using hython.exe as my shell (I couldn't import hou/hapi/anything-Houdini after adding 'C:\Program Files\Side Effects Software\Houdini 19.5.569\houdini\python3.7libs' to my Windows environment path, I get "import _hou: ImportError: DLL load failed: The specified module could not be found" error). I've been following this Getting Started tutorial in https://www.sidefx.com/docs/houdini/hapi/ [www.sidefx.com]
Error:
Traceback (most recent call last):
File "<console>", line 1, in <module>
hapi.InvalidArgumentError: Invalid argument given: Invalid id.
Can anyone explain what goes in this 'Sop/MyType' part?:
# Assuming we have a loaded an asset which defines a SOP type `MyType` node_id = hapi.createNode(session, -1, 'Sop/MyType')
Here's my code:
import hapi options=hapi.ThriftServerOptions() process_id = hapi.startThriftSocketServer(options, 9090, log_file="C:\\Users\\m.zaras\\Desktop\\headless_houdini\\log_file.txt") session=hapi.createThriftSocketSession('localhost',9090) cook_options=hapi.CookOptions() hapi.initialize(session,cook_options) hda_bytes=open('C:\\Users\\m.zaras\\Desktop\\headless_houdini\\mydigitalasset.hdalc','rb').read()lib_id=hapi.loadAssetLibraryFromMemory(session,hda_bytes,len(hda_bytes),True) [b]node_id=hapi.createNode(session,-1,'Sop/MyType')[/b] node_info=hapi.getNodeInfo(session,node_id)
Is using hapi the easiest/only way to work on a HOudini file without the UI/headless?