Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.get() returns null in between points #2

Open
brunoimbrizi opened this issue Feb 15, 2017 · 2 comments
Open

.get() returns null in between points #2

brunoimbrizi opened this issue Feb 15, 2017 · 2 comments

Comments

@brunoimbrizi
Copy link

Consider the following example:

"x": [
   "0 cut to 0",
   "2 ease to 10",
   "4 cut to -5"
]

At t = 0, x is 0.
At t = 1, x is some value between 0 and 10.
At t = 2, x is 10.
At t = 3, x is null.
At t = 4, x is -5.

I would expect x to hold its value until the next point. In this example, to stay at 10 for 2 seconds and then cut to -5.

@spite
Copy link
Owner

spite commented Feb 16, 2017

You've got a point there. It's not ideal, but I did it like that so I could have gaps in the timeline. In your example, if you wanted to have a constant value between 2 and 4, add a "4 linear to 10". It might make more sense to not have gaps and have a separate storyline for "on/off" values. I don't really mind either way. Thoughts?

@brunoimbrizi
Copy link
Author

I thought about it and asked these questions: What does it mean to have a gap in the timeline? Or what does an 'off' value mean? For me it means to stay at the current value until there is a new instruction.

I think the issue is that there is a difference between cut and ease or linear.
"4 cut to -5" means wait until t = 4 then cut to -5.
"4 linear to -5" means start interpolating from the previous t until t = 4.

In other words cut is at, while ease or linear are from / to.

I don't think there is anything wrong with this. My suggestion here is to make them all equivalent by giving cut a from / to behaviour, where from would be the previous value and to would be an immediate change to the new value at t.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants