Jump to content
BlackPariah

Channel parameter from a variable

Recommended Posts

Hello!

I'm trying to create a channel parameter but with the exception that I want it's input or it's value to be driven by a variable & not a user input/slider.

Am I even going about it the right way? I just want to get my variable (it's just a float) out of the vex wrangle and on to the UI at the bottom. So basically the opposite of pumping a value into a wrangle. Is this even doable? 

Channel_Parameter_from_variable.hipnc

Share this post


Link to post
Share on other sites

I don't think VEX can write to channel parameters yet. It can read from them. However, python can. If that is your goal, alter your code to use python instead.

n = hou.node("/obj/my_node")
n.parm("my_display_parm").set(my_value)

 

Edited by Atom
  • Thanks 1

Share this post


Link to post
Share on other sites

That's a bummer :| I was planning on using the output to drive parameters on other nodes (copy/paste relative reference etc..)

I don't know anything about python... just learning vex is daunting enough for a non-programmer lol. But it's good to know that the functionality is missing at the moment.

Does SESI have any plans to add it? Something like:   ochf("parametername", myvariable);      to output a float channel would be nice :s

 

Share this post


Link to post
Share on other sites

Anything you want to do by "setting a parameter" can be done with attributes. You could store your value as a detail attribute then fetch that value using a detail expression. It would basically be the same as fetching a value using a relative reference expression.

  • Like 1

Share this post


Link to post
Share on other sites

@AtomIs this the same as putting a expression variable inside a string expression which the user can then enter some text (string of characters) ? For example, suppose you have a expression variable $SuperDuper when using that expression variable, the user is then prompt for some text, and so the text entered by the user, replaces the expression variable ?

Share this post


Link to post
Share on other sites

No, it's not like that. Detail is just a global storage area on a node. So it is not point based, vertex based or primitive based. If you want to store a value associated with a node, you can place it in the Details attribute context of the node.

Share this post


Link to post
Share on other sites

ok this is a year late, however  I have issues trying to set a param value on a switch sop higher up the chain. For some reason it does not obey the set value. Same applies for an attribute. You cannot set the attribute to update earlier in the chain ( for eg driving a switch ).  Not sure how to automate this.

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

×