Storyline.js
Storyline.js copied to clipboard
.get() returns null in between points
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.
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?
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.