Jump to content

H19 to H21 - VEX change?


MaxMcGookin

Recommended Posts

Hey, hopefully someone can help me or give me some advice for an issue I am having while following a tutorial. 

While following they use this script in a point wrangle.

--------

float rand = rand(@copynum);
float weight = chramp('curveu', f@curveu + rand + (@Time * fit01(rand, .1, 1) * chf('speed'))%1);

@anim = weight;

--------

However when I recreated this my version was very different (see attached screenshot). But when I tried the exact same script in H19 and it works perfectly (I included a screenshot for this too).

 

Does anyone know what has changed between these versions to cause this effect? Or have any advice on how I could recreate it in Houdini 21?

(I had a similar problem before with @Alpha not working and @alpha working instead, could it be a simple change like that? I've tried several changes like that to no avail)

Cloud_Script.jpg

H19_ver.jpg

H21_ver.jpg

RBL_WEEK08_Cloud_01.hip

Edited by MaxMcGookin
Link to comment
Share on other sites

This is caused by a change in chramp() behavior.

Older Houdini versions allowed chramp() to cycle/repeat when the input value went outside the 0 to 1 range. Around Houdini 19.5, this changed, and chramp() now clamps out-of-range values instead.

In your expression, the % 1 is only applied to the animated time part:

( @Time * fit01 ( rand, .1, 1 ) * chf ( "speed" ) ) % 1

But f@curveu + rand is still added outside that modulo, so the final value passed into chramp() can still go above 1. In older Houdini this worked because chramp() repeated. In newer Houdini it clamps, so the result changes.

Wrap the entire ramp lookup value before passing it to chramp():

float r = rand ( @copynum );
float u = f@curveu + r + @Time * fit01 ( r, .1, 1 ) * chf ( "speed" );

float weight = chramp ( "curveu", u % 1.0 );

@anim = weight;

That should match the old Houdini behavior.
 

  • Thanks 1
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...