Open COCPORN opened 6 years ago
You mean something like seconds()
which will return the number of seconds since the expression was rooted?
Something like that. It would make it easy to make continuous animations of scrollview position, waves by putting it through the sin/cos-expressions, etc. I did post this to the wrong issue tracker, however, but it might be of general interest.
Also After Effects wiggle expression would be nice.
There are things like <Cycle />
and <Spin />
, can that do the trick?
It is very limited compared. But disregard the issue, I will implement it on my own.
I've wanted this feature as well. I thought I entered an issue for myself, but I can't find it anymore.
We have to be careful with naming here. Something like seconds()
would be ambiguous enough to not need strict guarantees as to what we mean. Seconds since when, can it restart, etc.
Hmm, I'm actually uncertain of this now. I think it might be open to abuse quite a bit. It's very rare that you'd want something to animate all the time. You'd usually want to animate within a WhileVisible
or WhileActive
trigger, in which case Cycle
makes more sense.
Perhaps a Timer
type would make this less error-prone. This is a behaviour that can be placed inside a trigger. It exposes a Value
that updates while rooted. It'd also allow for extended options, like updating things once per second instead.
A timer-object that somehow allows people to read it's time from an expression sounds neat. I agree that a general-purpose "time since whenever" seems a bit scary. Or maybe we could add a function to read out the progress of an animator or something like that instead of adding something new?
The progress of triggers can be read {Property myTrigger.Progress}
. I suppose we could also add a value to Cycle
that can be read (relatively cheap). Combined with a generic behavior of Timer
this should cover all use-cases without any odd-semantics.
So that you can express things as a function of time, automatic scrollers, etc.