Jump to content
AnthonyVFX

Translating expressions from v14 to v16.5

Recommended Posts

 

Hi there. 

 

I’m having some trouble translating two parameter expressions in this tutorial using Houdini 14 to Houdini 16.5:

https://player.vimeo.com/video/130386299

 

The first expression is for the Value parameter in a attribute create node (given the name “WIDTH”). It is meant to tapper the octopus tentacle geometry. The attribute was created as a Ramp Float (given the name “cross”), in a null node named “Cross_RAMP.” The expression looks like this: 

 

chramp(“../Cross_RAMP/cross”,$PT/$NPT,0)

 

The second expression is meant to help centralize control for the Scale parameter in a sweep node. The expression look like this:

 

point(“../WIDTH”,$PT,”width”,0)

 

So the null where the ramp was created is being tapped in the attribute create node, which is being tapped by the sweep node. 

 

But it is not working. 

 

The errors I get for these offer some leads, but I’m too new to code expressions to sort it out on my own. Wading through the online documentation and trial and error has not yet proven fruitful. I could use some help.

 

Would someone tell me the proper expression to write, either with a VEX snippet, or other such replacement code?

 

Thanks in advance for time and efforts.

 

 

Share this post


Link to post
Share on other sites

Perhaps these photos of the suggested replacement code may help others point me in the right direction. Thanks.

 5b12959cea27e_1Valueparameterinnullnodefloatchrampreplacedby.png.c9e5e3918fa7bfbb1db2833476ef3b48.png5b1295b2434af_2scaleparameterinsweepnode.png.cb07e62dd022217f76e5818d127f4761.png

Share this post


Link to post
Share on other sites
Posted (edited)

first of all please format your post next time to make it easy on the eyes. That font size is insane.

Houdini shifted away from using variables prefixed with $ to the VEX style using @ symbol
so chramp(“../Cross_RAMP/cross”,$PT/$NPT,0) becomes chramp('../Cross_RAMP/cross', @ptnum/npoints(0), 0)

instead of npoints(input) which gives you the total number of points in the input you might try using @numpt (a variable that VEX understands). but my guess is that it's not gonna work in expressions, can't test it right now though

in the second expression replace $PT aswell

Edited by 3dome
  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, 3dome said:

first of all please format your post next time to make it easy on the eyes. That font size is insane.

Houdini shifted away from using variables prefixed with $ to the VEX style using @ symbol
so chramp(“../Cross_RAMP/cross”,$PT/$NPT,0) becomes chramp('../Cross_RAMP/cross', @ptnum/npoints(0), 0)

instead of npoints(input) which gives you the total number of points in the input you might try using @numpt (a variable that VEX understands). but my guess is that it's not gonna work in expressions, can't test it right now though

in the second expression replace $PT aswell

That font is insane. All apologies.  I cut, pasted, and posted the text from notes on my phone; and as it was my first post I did not recognize it as enormous.

Otherwise, thanks so much for venturing the suggestions. I will give them a shot. 

 

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

×