logix1390 Posted November 29, 2018 Share Posted November 29, 2018 hello, I am trying to write an if statement with a fit function inside a scatter sop. Basally I want to gradually decrease points over time after a certain frame. I got the fit to work so that it gradually decreases over time : fit($F, 1, 10, 14, 0) So this scatters 14 points and decreases over 10 frames.I got that... now I want to be able to specify when the scatter starts if($F>50,fit($F, 1, 10, 14, 0), 0) Quote Link to comment Share on other sites More sharing options...
logix1390 Posted November 29, 2018 Author Share Posted November 29, 2018 oops, i accidently sent that with out finishing... So that if statement does not work...am i doing something wrong with the syntax? Quote Link to comment Share on other sites More sharing options...
logix1390 Posted November 29, 2018 Author Share Posted November 29, 2018 never mind i think i got it Quote Link to comment Share on other sites More sharing options...
MitchFields Posted December 22, 2018 Share Posted December 22, 2018 Hi logix1390, Perhaps a better way to go about this, with more control, is to have a point wrangle after your scatter sop. Deleting the points based on time, frame like you're already doing, or an attribute that you set, would be faster because vex uses your gpu! So one way to go about this, would be to check if @Time is = to the point number, and then either give it an attribute or use the removepoint function. int juice = fit(@Frame, 0,10,14,0); if (@ptnum == juice) { removepoint(0,@ptnum); } or within the same if statement do > i@group_deleteme = 1; and use a blast or delete node running over the group or attribute you created within your if statement after your wrangle. This method is better in my opinion because typing everything out in one line inside of a channel box in h script can be a headache for me sometimes. Once you step outside of the scatter node into the wrangle, you can delete your points on a plethora of things now, like position or color as well as the point number or frame, possibly adding more depth to the effect you're trying to achieve. Yes you were using the if statement correctly, and if you're doing a one liner if statement it looks like this > if (condition,true value, false value) Good luck, hope I helped. 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.