Doum Posted January 18, 2013 Share Posted January 18, 2013 Hey guys, I'm following this tutorial Beginners - Houdini Expressions Tutorial and trying to push it a bit further. I want to make a condition for the uniform scale of my copy and set a limit if the number of copy is greater than 100 stop to cumulate the scale transform . I tried something like that if($NCY<100,ch("../scale2"),???) and if it false I want to use the uniform scale of the last copy before 100 and stay with that value until the end of the frame range. Someone can help me with that? Thx Doum Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted January 18, 2013 Share Posted January 18, 2013 I'd put the scale channel into a clamp expression which will limit the number to the given range. if($NCY<100, ch("../scale2"), clamp(ch("../scale2"), 0, 100))[/CODE]Replace the 0 and 100 arguments for the clamp with whatever you want. If you want those values to be determined automatically it might require more than just expressions, like a for loop (like the For SOP) that keeps track of the values as it goes. Quote Link to comment Share on other sites More sharing options...
kgoossens Posted January 18, 2013 Share Posted January 18, 2013 You should make sure to use the proper Variable. $NCY returns you the total nr of iterations $CY returns you the current iteration. so if($CY<10,0.8,1) is if the iteration is smaller then 10 then scale with 0.8 else use 1 meaning don't scale down any further. Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted January 18, 2013 Share Posted January 18, 2013 You should make sure to use the proper Variable. $NCY returns you the total nr of iterations $CY returns you the current iteration. so if($CY<10,0.8,1) is if the iteration is smaller then 10 then scale with 0.8 else use 1 meaning don't scale down any further. Nice, that's a lot cleaner than what I suggested. Quote Link to comment Share on other sites More sharing options...
Doum Posted January 18, 2013 Author Share Posted January 18, 2013 You were right Kgoossens, I wasn't using the proper variable. if(($CY)<100,ch("../scale2"),1) that way it gives me the desire result. I'll try to keep it to the basic and check this for loop thing later thx luke for the input. Thanks guys for the helps, SpiralExpression.hipnc Quote Link to comment Share on other sites More sharing options...
Doum Posted January 18, 2013 Author Share Posted January 18, 2013 Btw is there a way to show in the viewport some variable like the $CY or the ID of each copy ? 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.