logix1390 Posted July 22, 2018 Share Posted July 22, 2018 Hello, I am trying to do a very simple if statement where I delete a point after a certain frame. I have a point, i put down a timeshift to get the frame I want to delete after, and then put a wrangle like this: if(@Frame<chi("FrameNumber")){ removepoint(0,@ptnum); } What I thought this was saying was "if the current frame number is greater than this value then delete the points coming from the first input ?? But this does not work . Can I anyone explain whats going on here? I will attach my scene file for anyone that wants to take a look. Thank you. simple_if_statement_deleting.hip Quote Link to comment Share on other sites More sharing options...
bonsak Posted July 22, 2018 Share Posted July 22, 2018 Not sure what you need the Timeshift node for, but if you dont reference it and instead type 21 in the FrameNumber parm on the wrangle, then all you have to do is reverse the comparison for it to work: if(@Frame>chi("FrameNumber")){ removepoint(0,@ptnum); } -b Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted July 22, 2018 Share Posted July 22, 2018 (edited) Hi Mike, Change chi("FrameNumber") to chi("Frame_Number") or chi("frame_number") or chi("framenumber"). I presume that Houdini don't like when capital letter is in the middle of an attribute's name. P.S. Don't forget press button "Create spare parameter" when change the name of attribute Edited July 22, 2018 by vicvvsh Quote Link to comment Share on other sites More sharing options...
Noobini Posted July 22, 2018 Share Posted July 22, 2018 Camel case works...ie. FrameNumber is fine. But your logic is screwed. First, you have if(@Frame<chi("FrameNumber")){ removepoint(0,@ptnum); } and you said "if the current frame number is greater than this value then delete the points coming from the first input ?? Well, no...if LESS than, then remove...so are you sure whatever logic is right here ? Second, the timeshift is a moving target...ie. $F+20....so it's ALWAYS moving...you'll never hit it....(ie. whether you use greater than or less than, it'll always be true or false....but never hit a tipping point where it CHANGES true to false or false to true) If you explicitly set in timeshift frame to say 20, then the tipping point will be at frame 20. Quote Link to comment Share on other sites More sharing options...
logix1390 Posted July 23, 2018 Author Share Posted July 23, 2018 your absolutely right. can't believe I forgot to break the expression on the time shift. It was always moving..thanks guys. Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted July 23, 2018 Share Posted July 23, 2018 Yes, may mistake. I have overlooked that in parameter "FrameNumber" there is an expression that refer to frameshift. In my case I just typed number manually when I examined your scene. I'm sorry if I misled you. 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.