Jump to content

Setting An Op Parm To A Variable


Guest xionmark

Recommended Posts

Guest xionmark

Hi,

I have dozens of noise nodes that I need to change the values of the noise for but want to use a variable instead of hard coding the values and also use hscript to set them (instead of doing it manually).

Essentially I want to do something like this:

opparm subnet1/noise4d1 amp ($noise_x $noise_y $noise_z)

But of course the variable value gets evaluated in this form but I want to insert the string (i.e. "$noise_x") into the fields but can't figure out the correct syntax. I've tried various forms using single and double qoutes, no luck.

Any suggestions?

Thanks!

--Mark

Link to comment
Share on other sites

Hey Mark,

If you want the parameter to be an expression or function then you'll need a channel. So I think you may want to try something like this:

chadd -t 0 0 my_op ampx ampy ampz
chkey -t 0 -v 0 -m 0 -A 0 -F '$noise_x' my_op/ampx
chkey -t 0 -v 0 -m 0 -A 0 -F '$noise_y' my_op/ampy
chkey -t 0 -v 0 -m 0 -A 0 -F '$noise_z' my_op/ampz

opparm my_op amp ( ampx ampy ampz )

... or similar... you get the idea.

Cheers.

Link to comment
Share on other sites

Guest xionmark
If you want the parameter to be an expression or function then you'll need a channel. So I think you may want to try something like this:

chadd -t 0 0 my_op ampx ampy ampz
chkey -t 0 -v 0 -m 0 -A 0 -F '$noise_x' my_op/ampx
chkey -t 0 -v 0 -m 0 -A 0 -F '$noise_y' my_op/ampy
chkey -t 0 -v 0 -m 0 -A 0 -F '$noise_z' my_op/ampz

opparm my_op amp ( ampx ampy ampz )

... or similar... you get the idea.

Cheers.

26627[/snapback]

Hi Mario!

Gosh, I thought I had done something exactly like that, will try again soon, got meetings to go to. Thanks for the tip, I'm sure I missed something very obvious, will check again.

--Mark

Link to comment
Share on other sites

Guest xionmark

Hey there Mario,

Your tip worked great. For some reason the channel wasn't being created, I brought up a new Houdini session and then it all worked OK. Weird. I didn't get the syntax correct initially but even after trying your suggestion channels were created. After restarting Houdini channels were created, parms being assigned, it's all groovy again.

Take care!

--Mark

Link to comment
Share on other sites

Guest xionmark

Very odd. I have this same problem (not being able to create channels from hscript) happening again, not sure why, seems very random and hard to reproduce.

Perhaps upgrading to H8.0.474 wil help? Currently at H8.0.383.

Anyone else ever have problems creating channels from hscript? This is all being done in DOPs, not that it should matter, but you never know I guess.

--Mark

Link to comment
Share on other sites

Guest xionmark
i was helping someone do this before and the biggest problem was making sure that you had a key on the frame.

i know it sounds obvious.. but it is the small things :)

-k

26884[/snapback]

Good point. I was working rather quickly and could have very likely missed that.

Thanks!

--Mark

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...