Jump to content

Tapping into a Live Houdini Session, is it possible?


Recommended Posts

Well i finally got my path issues sorted out, but now i am rather surprised to find that i cannot seem to interact with Houdini.

With that said, when you import the hou module into python, does that create a link to a live Houdini session? Or does it just give you access to Houdinis tools, etc (To say, make a model and save it to a file).

With this basic code (from a 3dbuzz tutorial), i am finding no interaction with Houdini:

		print 'Hou Dir?%s' % hou.pwd()
		hou.cd('/obj')
		print 'Hou Dir?%s' % hou.pwd()
		node = hou.pwd()
		ball = node.createNode('geo', 'ball', run_init_scripts=False)
		print 'all done.'

Although, if memory serves right, the houdini tutorial (on sidefx.com) gave an option to connect to houdini via tcp, is this required to interact with a live Houdini session?

Thanks,

Lee

Note that i am aware you can run scripts within Houdini, but i prefer the development workflow of not needing to run into the 3d app for all testing, and would rather tapp into houdini externally when needed.

Link to comment
Share on other sites

When you import hou into a python session, that basically transforms that python session into a hython session. No interactivity with a live Houdini session. The python equivalent to openport is houxmlrpc. This gives you a way to remotely connect to a session, either hython or a real Houdini session running the xmlrpc server. For example, you can open a Houdini session, run the houxmlrpc in that session, then open another Houdini or hython, connect to the xmlrpc and control your scene from that.

Link to comment
Share on other sites

When you import hou into a python session, that basically transforms that python session into a hython session. No interactivity with a live Houdini session. The python equivalent to openport is houxmlrpc. This gives you a way to remotely connect to a session, either hython or a real Houdini session running the xmlrpc server. For example, you can open a Houdini session, run the houxmlrpc in that session, then open another Houdini or hython, connect to the xmlrpc and control your scene from that.

K thanks guys, i'll try that soon.

IIRC connecting via a port is covered by the sidefx tutorial (as mentioned) so that will also help. I just wasn't clear if it was needed :)

Link to comment
Share on other sites

There are a couple of pages on the OdWiki Python page

On a side note, anyone know how to check if the connection exists? I am having trouble finding docs on houxmlrpc.

I need to check because if you use the hou module given from houxmlrpc, after Houdini has closed (or the session has ended), you end up throwing an exception. Now i realize i could try-except this but that is not a friendly way to interact with it. Rather i am wrapping the connection and giving access to hou, but this brings up the issue then of not being able to catch errors caused by the lost hou connection.

Thoughts? Perhaps there is a _fast_ and harmless way to use hou and have it throw an exception from within the connection wrapper?

Link to comment
Share on other sites

Also, what exactly is it considered when you use the hou module without connecting to Houdini via RPC? I mean.. it seems to be a full houdini api, if im seeing my early tests right.. so what the heck is it.. and what can it be used for?

Can you actually model and rig in the imported hou module, and then perhaps save that to a file? So you would actually be able to fully model, rig, and heck even animate a character without ever opening Houdini (Assuming you save the file, ofcourse)? Not that you'd want to, but purely for the sake of understanding this.

As it is, i am designing my framework to use Houdini RPC if it is available, and if not it'll import houdini (which if opened from houdini, also works i imagine), but this provides interesting workflows and potentials if i am understanding this all.

Edited by Leefmc
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...