OpenPort and communicate via Python (Socket)

   2747   1   0
User Avatar
Member
33 posts
Joined: May 2015
Offline
Hey guys,

I saw there is a hscript command ‘openport’, but I didn't find example on how to communicate with houdini via python.

Here's what I need to do:

1-Open a port, from localHost, within houdini session.
2-From an external python interpreter, execute houdini python commands, using local port.
IE: hou.node('/obj').createNode('geo')


Here's how I do it in maya:

1-cmds.commandPort(name='localhost:7555')
2-
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(('127.0.0.1', 7555))
c = ‘python(“cmds.polySphere()”);’
client.send©

Does anyone know if it's possible to this in houdini?

Anyone has some examples?

Thanks
Jonathan
User Avatar
Member
33 posts
Joined: March 2017
Offline
I know this is a very old thread but I figured I'd post the answer as I was looking for the same thing myself.

https://www.sidefx.com/docs/houdini/hom/rpc.html [www.sidefx.com]
  • Quick Links