Sourabh Posted December 25, 2016 Share Posted December 25, 2016 (edited) Hello I want to increment value by one on every frame after frame no, x (for example 50 frame no.). I tried doing this in wrangle its not working. it stay at one after frame 50.. Its like houdini is reading this script independent on every frame. Its working in solver node actually but i want to know any other way on sop level. i tried this .. if(@Frame>50) i@a+=1; Please share with me if you have any way out. Thank you Edited December 25, 2016 by Sourabh Quote Link to comment Share on other sites More sharing options...
shawn_kearney Posted December 25, 2016 Share Posted December 25, 2016 (edited) int n = 50 ; //start counting from frame# i@a = (int)max(0,@Frame-n) ; Edited December 25, 2016 by shawn_kearney Quote Link to comment Share on other sites More sharing options...
Sepu Posted December 26, 2016 Share Posted December 26, 2016 Here is another way int myFrame = chi("startframe"); if(@Frame >= myFrame){ i@a = floor(@Frame - myFrame); } Quote Link to comment Share on other sites More sharing options...
edward Posted December 26, 2016 Share Posted December 26, 2016 On 12/24/2016 at 8:00 PM, Sourabh said: Its like houdini is reading this script independent on every frame. Exactly. You need some sort of simulation context (DOPs, SOP Solver, etc.) if you want to keep data from one frame to the next. But really, a lot of things don't need a simulation context, and then you gain the advantage that you can render your frames out of order. Quote Link to comment Share on other sites More sharing options...
Sourabh Posted December 30, 2016 Author Share Posted December 30, 2016 Thanks all for reply Both ways are working but my situation was different that i didn't describe properly.I want to increment by one on every frame but for different point number on different frame. Like if random points are turning red on different frame number so increment should start from that frame number for that particular point. I solve this using wrangle in solver node. I want to know any other way also . Quote Link to comment Share on other sites More sharing options...
Atom Posted December 30, 2016 Share Posted December 30, 2016 (edited) What if you use your points to initialize particles then @age would be the value you want. When a particle is born, it's age is 0.0 then it increments over time from it's random starting time. Edited December 30, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
edward Posted December 31, 2016 Share Posted December 31, 2016 On 12/30/2016 at 2:24 AM, Sourabh said: I want to increment by one on every frame but for different point number on different frame. Like if random points are turning red on different frame number so increment should start from that frame number for that particular point. This still doesn't require a solver context. Your start frame for the given point just becomes a rand() expression (based on the point number) which you then use as an offset on the current frame number. 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.