Jump to content

How to keyframe @frame outputs


marcoF

Recommended Posts

Hello community!

Is there a way to control the @Frame value with a slider? 
Let's say I am moving a box in x with:

@P.x += @Frame*chf("Speed"); 

I would like to control the Position of the box with an animated chf function to make the box slower and slower over time until it stops at a certain point. This progression would be nice to animate with a slider.
But with the code above I only reset the cube to position 0 if i animate "Speed" to 0.
Maybe there is something else than the @frame attrib to create some sort of time dependent counter? 
I also can't use solvers, need to stay in sop context. 

Would be awesome if somebody could give me a hint 

 

Cheers, Marco

Link to comment
Share on other sites

  • 2 weeks later...

Heyo.
First thing that comes to mind is if you are able to set that start and endpoint you could use the lerp function to animate the cube and have it stop. You could even procedurally set up the cubes animation using a channel ramp and a fit01 function into a time range.
The main reason the thing above does not work (and apologies if I am overexplaining here) is that while it might look like the box is taking one small step forward each frame, progressively making its way forward, it is actually going back to world 0 at every frame and then gets moved in the x axis alittle further than the last frame. So when you multiply the frame down it eventually just goes all the way back to world 0 without storing its "progress" because in reality there never was any "progress". By default Sops only care about the current frame, it is not designed to deal with progressive updates, that is what solvers are for.

However, if you could be persuaded to give the sop solver a try then something pretty similar to what you've got should be usable. Something like this:
v@P.x = point(1, 'P', @ptnum) + chf('Step_Size'); //Add this to a wrangle where the first input is "Input 1" inside the sop solver and the second input is the "Prev Frame" node inside the solver.

Hopefully, some of that can be useful.

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