You need to log in to create posts and topics.

Houdini import state path as parameter

Hi Richard.


I had a little idea for houdini import, right now, importing a state using prism create a Import_ node at the root of the scene, it is usefull when you quickly want to setup a scene.

however, I was wondering if it would be possible to import a state without create any node, but rather get a 'parameter' in the clipboard that you can paste on a custom hda, parameter that will automatically catche any version update from the prism import state.

for exemple, say I have an hda that handle importing alembic/rs that process thing automatically (add shader automaticaly, scale to a custom size, etc), the only thing needed for this HDA would be the path to the file, when importing a prism state, you get in the clipboard an houdini parameter that will translate to the actual path to the file (maybe something like chs("prism/importState/1").

the point is to avoid having to copy the parameter from the automatically created Import_ node, and have a quick access to the path through the state manager (maybe a simple 'copy path parameter to clipboard') would even be enough. I know there is already a 'copy path', but it won't take care of updating a new version.


Thanks !

I don't think it's possible to use the Houdini channel reference expression to refer to anything else than a parameter on a Houdini node. What I could do is to copy a python expression to the clipboard, which refers to the import state like this:

import PrismInit

But you can't use the context menu to paste it into a Houdini node parameter. You would need to use strg+v, then set a keyframe on that parameter and switch the language of that parameter to python.

That might be not an ideal solution, but it's to only way, which comes to my mind to copy paste a reference to the State Manager imports.

I see, maybe a quick utility button that copy the parameter from the created import node then ?

Oh yeah, that sounds like a simple solution. I only have to find out how to mimic the "Copy parameter" behavior.  I could copy the parameter reference to the clipboard, but that wouldn't give you the "Paste parameter" option in the context menu. Seems like Houdini doesn't use the system clipboard for copying parameters.


Edit: Found it: hou.Parm.copyToParmClipboard()