Jump to content

Play instance/copies animation


Recommended Posts

Hello,

 

I was wondering. What is the general workflow for say ... example:

 

Connect an object to a COPY node, let the template be drawn up, say from a Curve and an animated Carve SOP.

 

How would it be possible that each copy object scales up from zero animated, when the carve reaches a new point?

Say, I would like to control the easing of the scaling of these objects as they appear.

 

Can each copy have their own timeline that you can trigger when an attribute equals 1, true or false thing?

 

Screen%20Recording%202015-01-23%20at%200

Link to comment
Share on other sites

if you sort the points so the first created will always be number 0 you can then lay down a solverSOP and inside create a pointWrangler with this VEX code :

@startframe = point(@OpInput2, "startframe", @ptnum); 
i@trigger = point(@OpInput2, "trigger", @ptnum); //trigger to store the startframe only once
i@previous = point(@OpInput2, "total", 0); //previous number of points
i@total = @numpt; //number of points in the line

if (@numpt > @previous) {
    // We want to store the startframe on the "totalNumberOfPoints - 1" point
    // since number start from 0 we want to store on "totalNumberOfPoint - 2" : @numpt-2
    float trig = point(@OpInput2, "trigger", @numpt-2); 
    if (trig == 0) {
       setpointattrib(geoself(), "startframe", @numpt-2, @Frame, "set");
       setpointattrib(geoself(), "trigger", @numpt-2, 1, "set");
    }
}

Make sure to connect Input1 as the first input and prevFrame as the second.

 

This code will store the frame at which the point had been discovered by the carveSOP in the attribute "startframe"

you can now subtract it from the current frame and fit/clamp the result to drive your growing animation.

Link to comment
Share on other sites

Thank you iamyog! :-)

 

But that is a bit too complex for what I was seeking.

I have figured out a solution now. Just had to sit down and write it out in text first (and after hours of not thinking right).

 

Like this:

 

192 trees are to be animated out over a course of 650 frames. Every tree have an animation that takes 20 frames each.

With the help of a TimeWarp and a Copy SOP, I just have to figure out when they should start and stop and stamp it, making each unique with the $PT's of the copy template.

 

start $RFEND/$NPT*$PT

stop $RFEND/$NPT*($PT+20)

 

timewarp_copy_stamp.jpg

 

tree_path.gif

Edited by Fake Pilot
Link to comment
Share on other sites

  • 3 weeks later...

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