Animation Job Time [SOLVED]

Hi!
I have a silly question that bugs me a lot.

I’m implementing a series of cartoony constraints and it is working wonderfully so far!

But I hacked my way around disability to get Time.time in the job by adding stream deltas to a hidden property on a jobdata.

Is there a nicer/proper way to get some global time in the animation job? It is absolutely needed for some sine wave stuff.

You can retrieve the delta time from the stream using AnimationStream.deltaTime. The damped transform is using this inside DampedTransformJob.cs. I hope this helps :slight_smile:

Thanks, but that is what I’m doing now.
What I need is a global time like milliseconds from the start of a program or something like that.

Currently, I’m adding up all those delta times to a
public FloatProperty totalTime;

and it works but feels hacky af. So I’m interested if there is a better or proper solution?

Oh sorry - I misunderstood your original message. There is the AnimationJobCache that you could use to store the global time value. The ChainIKConstraintJob is an example that uses this to store the tolerance and max iterations.

2 Likes

Works like a charm, thank you!

1 Like