MaxMcGookin Posted June 18 Share Posted June 18 (edited) 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) RBL_WEEK08_Cloud_01.hip Edited June 18 by MaxMcGookin Quote Link to comment Share on other sites More sharing options...
animatrix Posted June 19 Share Posted June 19 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. 1 Quote Link to comment Share on other sites More sharing options...
MaxMcGookin Posted June 23 Author Share Posted June 23 Amazing thank you so much for the help! I have it working now the way it should, much appreciated. Cheers Max 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.