-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Array Curve container #1678
Comments
@heinezen can I take this |
Sure, I think there's currently nothing blocking this feature. |
So will this be an array of KeyframeContainers , essentially? |
Yeah that's basically it. |
Should I use something other than KeyframeContainers, queue and map don't seem to use it. |
For the array curve, |
So for the iterator, do we iterate over keyframes with the closest time less than or equal to t? |
Yes, when iterating over the array at time So the result should be the same as calling all the indices individually for the same time: |
No erase method? |
The array would have a fixed size from the start for the duration of its lifetime, so removing elements wouldn't make sense. |
What about removing elements from keyframecontainers? |
Is there a specific example where removing keyframes would be necessary? It's not used by any other curve. If we need it in the future, we could always add it, but I don't think it belongs to the public API of a curve array. |
|
@jere8184 Hmm... I think we could add it then. Certainly wouldn't hurt! |
How should the iterator handle KeyframeContainers that contain multiple keyframes for a given time? currently, we just iterate over a single valid keyframe for each container. |
@jere8184 In that case, the last frame that was inserted (as in: by insertion order) for that time should be used. |
So I've implemented the array curve using
I'm just making sure I understand correctly before updating the curve documentation file. Where does the idea that we shouldn't erase |
I think that's more a misunderstanding. My point was that elements shouldn't be erased for arrays (in comparison to maps/quues), since the array always has a fixed size. Removing keyframes from specific containers is okay, it's just not a very common operation. |
We should add a
curve::Array
type to our curve container classes to record changes to a fixed size sequence over time. In comparison to #1677 we can probably optimize a lot more since the size doesn't change over time (i.e. no inserts or erasures).The new array type should implement these methods:
Read
get(t, i)
i
at timet
get(t)
t
size()
frame(t, i)
i
before or att
next_frame(t, i)
i
aftert
There should also be an iterator type to iterate over the array at time
t
.Modify
set_insert(t, i, value)
t
at indexi
set_last(t, i, value)
t
; delete all keyframes after timet
at indexi
set_replace(t, i, value)
t
at indexi
; remove all other keyframes with timet
at indexi
Copy
sync(Curve, t)
t
with keyframes from sourceCurve
after timet
The text was updated successfully, but these errors were encountered: