Jump to content

Instance Time offset


Recommended Posts

If someone would help me with this I would greatly appreciate it:

1. I have a SOP with animation on it. 

2. It is instanced via the point instance technique

Question: 

How would I offset and randomize the animation timing on each instance? Copy sop is too memory intensive and the geometry is heavy as it is.  

Link to comment
Share on other sites

string model_1 = "$HIP/geo/StrandModel.1."; // here you load the path to your sequence
string model_2 = "$HIP/geo/StrandModel.2."; //they can be as many as you need

int Fr = @Frame - @frmn - @randFrame; // with this you create the frame number
// @frmn and @randFrame are attributes created previously. @Frame is the current frame
string frames = itoa(Fr); //transform the frame number variable into a string
string suffix = ".bgeo.sc"; //this is the extension of the sequence

//the following is to build the instance path string  attribute  wich will be load by the Instancer
//the @split is an integer attribute to make "clustering" of this instances
//so you can vary the models sequences, this 
if (@split==0) { 
s@instancepath = model_1 + frames + suffix;
} 
if (@split==1){ 
s@instancepath = mode_2 + frames + suffix;
} 


I had this same question not so long ago , 
I realize the trick is to create an instancepath variable wich loads the model sequence with a frame offset,
that code is exactly what you need to do this string variable,
you then play with the @frmn and @randframe to offset them (it could be just one att, I used 2 just because) 

..by the way, the guys here say that packed geometry is as fast as instancing , check that on the docs.
follow the Sepu link... this code I took it from those places , it's not mine, but I wrote the comments..hope they help.

odforce.jpg

Edited by jmquintela
Link to comment
Share on other sites

Tom recently commented on a related question I had on this topic. He suggested don't use sequences. Instead write out your animated sequence as a single animated Alembic file then you can just do time stamp offsets on a single object. Or instead of stamping simply write out a random attribute time offset, in a wrangle, and then have the time node use that attribute value instead of @Time. or $F.

Edited by Atom
Link to comment
Share on other sites

  • 4 months later...
On 2017/2/15 at 10:49 PM, Atom said:

Tom recently commented on a related question I had on this topic. He suggested don't use sequences. Instead write out your animated sequence as a single animated Alembic file then you can just do time stamp offsets on a single object. Or instead of stamping simply write out a random attribute time offset, in a wrangle, and then have the time node use that attribute value instead of @Time. or $F.

How to do time stamp on instances(not copy)

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...