Jump to content

Increment value by one on every frame


Sourabh

Recommended Posts

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 by Sourabh
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 .

 

Link to comment
Share on other sites

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 by Atom
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...