Jump to content

Attach Hscript To A Node


Dries

Recommended Posts

Hi,

How do I attach a piece of hscript to a node. That script should be executed when the node is cooked.

I would like an hscript to change a parameter of another node and then recook. Can I do that?

I've looked at digital assets, but none of the events listed there are something like "On Cooked".

Link to comment
Share on other sites

If you put your hscript in the "Pre" or "Post" render script of your ROP, you can speicfy when and where you want things to cook.

Or if its in an HDA then depending what you are trying to do, you can use it in the "callback" parameter, (I dont have Houdini in front of me at the moment, but I think its called "callback")

Edited by SpencerL
Link to comment
Share on other sites

I know you could do it in a callback script in a digital asset, but I don't want to push a button. I want it to happen in the main houdini cook loop.

I was trying to mimic an interactive renderer by using the render COP. I would start to render on say 16px x 16px, and when it it rendered I wanted to trigger a hscript that changes the parameters gradually to say 256x256 and up step by step.

I tried putting the script in the output operator that the render COP is referencing, but that doesn't seem to get executed in such a particular case. You would set a min and a max iteration to avoid staying in the loop.

I've started to look at the IPR, an my first attempt didn't make me happy. As I'm learning about it, it's kind of okay, but I'm disappointed to see that moving the camera doesn't update the ipr accordingly. I was expecting that when the "lock camera to view" is on and that camera is selected in the renderer used by the ipr, you would see an update. Am I missing something?

Control clicking an object to get its shader is awesome. Can we assign Ctrl+Shift+Click to display displacement shader properties?

D.

Link to comment
Share on other sites

  • 4 weeks later...

Try this in a unix SOP:

tee /dev/null; hcommand `run("openport -a -q")` <one_hscript_cmd> &

Couple of caveats, the output of hcommand might get in the way of the data flowing in and out of the unix SOP via stdout/stdin if it's not sent to stderr. The ampersand is critical to avoid a race condition: the hcommand won't return until the command has been run, but the command won't run until the hcommand completes! So backgrounding the hcommand allows Houdini to continue, and then the hcommand exits nice and quietly.

-- Antoine

Edited by antoinedurr
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...