Jump to content

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

Link to comment
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
Link to comment
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

 

Link to comment
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
Link to comment
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 ?

Link to comment
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.

Link to comment
Share on other sites

  • 1 year later...

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.

Link to comment
Share on other sites

  • 1 year later...
On 8/28/2019 at 3:19 AM, oblong said:

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.

@oblongdid you solve the problem of setting a switch node index upstream?

 

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