charly Posted February 11, 2018 Share Posted February 11, 2018 Hi, I'm trying to increment a point attibute value over time in vex. A basic exemple would be to animate a group node to increment a counter each time it select points. Then, emitt particles if the points have been selected 3 times, or be able to know if a point has already been selected before. So I tryed to do a setpointattrib to a node that is not time dependent, but it doesn't seem to work. Is there a way to do it in vex ? Thanks, Charles Quote Link to comment Share on other sites More sharing options...
Atom Posted February 11, 2018 Share Posted February 11, 2018 You don't need to use setpointattrib inside a point wrangle. Just assign your value directly to the attribute. The attribute wrangle acts as an implied for/loop which loops over all the points automatically. f@my_float = 1.0; i@my_int = 1; s@my_string = "Hello World"; f@my_frame = @Frame; f@mytime = @Time; Quote Link to comment Share on other sites More sharing options...
charly Posted February 11, 2018 Author Share Posted February 11, 2018 I find out how to increment the value the way I want using the sop solver. But I'm still interested in a clener way to do it, like using an array for the selected points. Because the Wrangle get generate each frame, the best solution to keep an array seems to be with Python. Charles increment_value_new_selection.hiplc Quote Link to comment Share on other sites More sharing options...
charly Posted February 11, 2018 Author Share Posted February 11, 2018 Hi Atom, thanks for your answer, My issue was to increment only on time when it's selected and not every frames. Then increment again only if the bounding box leaves and come back. Charles Quote Link to comment Share on other sites More sharing options...
f1480187 Posted February 11, 2018 Share Posted February 11, 2018 Shorter version ("trigger_grp" renamed to "trigger"): i@count = i@opinput1_count + (i@group_trigger && !i@opinput1_group_trigger); Solver is a cleanest way to do something over time, I think. Everything after animated Group node will be time dependent and cook every frame. 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.