Jump to content
Sign in to follow this  
suesssebastian

unique ids in a continuous vellum simulation

Recommended Posts

Hi. 

I'm new to vex and have a problem i can't get my head around. 

I created a little simulation where paper gets blown away every 6th frame.
Now i want to give every page an unique id, but counting upwards. 

so my code is: 

f@idpage;

if(@Frame%6 == 1){

   @idpage+=1;

}

I@ know its not counting because every frame, the attrib is set back to 0.
But how can i count my IDs in dops or on a global level?

Paper_Wind_02.hiplc

Share this post


Link to post
Share on other sites

SOPs re-evaluates the node tree every frame so there is no history, just whatever the nodes evaluate to at that frame.  Check out the Solver SOP for accumulating values ( https://www.tokeru.com/cgwiki/index.php?title=The_solver_sop  is a great resource).

In this particular case, if you just need a unique name you can use the "patchname" attribute already output by vellum with a slight tweak to the name you had set in geo1_vellum

patchname.thumb.jpg.b12c4a809a4d3c4291051fe4cfd9294b.jpg

  • Like 1

Share this post


Link to post
Share on other sites

Thx, now i can use some math to calculate which paper is which iteration.
My idea is that i assign every sheet a specific book page starting from one.

I'll post the result when i'm done.

Share this post


Link to post
Share on other sites

Found another way.

I added a solver i the geo node and put the counter in there, now i don't have to convert strings and do math and stuff (; 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×