Jump to content
Marcomeeuwse

Parameter Editor - custom default channels values/expressions

Recommended Posts

Hi Odforce,
I was wondering if anyone has knowledge about how to enter your own default values of a created channel within the parameter editor.

I want to use a mulitparm block(list), created from a folder type, and add parameters according to the amount of nprims. I want the parameters within this folder multiparm block (list) to have default values/expressions.
The idea is to link each channel to an asset with a random so the parameters (see picture) are for each asset different.

Not sure if this is good idea or if it could be achieved easier, im open for other ideas.

Thanks in advance!

screenshot01.png

Share this post


Link to post
Share on other sites

Okay, i did something else, I put the assets through a forloop and gave it an ID nr and used that as a randnr. But im still curious if there is a way to create your own custom default values/expressions for a channel, within the parameter editor

Share this post


Link to post
Share on other sites

I doesn't look like you can have an expression for the default, just an integer. You can use an OnCreated script in an hda to copy the expression on to that value once that node is created though. Probably a good RFE if you wanted to submit it.

multiparmdefault.thumb.png.5502e029e7a51ac96f0b233ed36b3554.png

something like this below in the OnCreated, make sure you change the language to python if you choose that language.

kwargs["node"].parm('folder0').setExpression(opdigits("."))

 

Share this post


Link to post
Share on other sites

Hey LaidlawFX,

Thanks for the reply :)
I tried to copy your setup and added your script on the "label", but I'm afraid I don't know how to get it to work. Also, I looked up in the houdini hou python reference to understand what your script does. but Im lacking knowledge on this too.
Could you clarify it?

Share this post


Link to post
Share on other sites

So in the attached hda, check out the Script Section in the Type Properties dialog, in there is a OnCreated Script set to python. The code line reads like this:

kwargs["node"].parm('fd').setExpression('opdigits(".")')

kwargs["node"] is the node at the time of creation, parm('fd') is the multiparm blocklist, setExpression() is placing down the expression opdigits(".") which is the number at the end of the node in hscript. You can replace opdigits(".") with any hscript expression you want. In this case when you copy and paste the hda, and another parameter in the block list will show itself. Not in and of itself useful except for demonstration of what you are looking for.

multiparmBlocklistDefault.hda

Share this post


Link to post
Share on other sites

Cool! It should be placed over there. Well, it might not have a function right now but maybe i'll find something usefull for it. Thank you :)

Share this post


Link to post
Share on other sites

Your welcome, it's a hack for that specific node, probably should make an RFE for it. 

 

Edited by LaidlawFX
I submitted the RFE

Share this post


Link to post
Share on other sites

What do you mean by: making an RFE. I'm not a native english speaker. Do you mean Reference For Evidence? and wheredid you submitted it to?

Share this post


Link to post
Share on other sites

No worries :) RFE is a Request for Feature Enhancement

If you don't have paid SideFX support you can submit from the below link. If you do have paid support just contact your customer representative they'll put you through the correct channels.

https://www.sidefx.com/bugs/submit/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×