Skip to content

Conversation

@Muller-Castro
Copy link
Contributor

Add Error Animation::resize_tracks(int p_size) similar to array resize.

New tracks are of type Animation::TrackType::TYPE_VALUE.

@Muller-Castro Muller-Castro requested review from a team as code owners March 24, 2025 21:38
@fire
Copy link
Member

fire commented Mar 24, 2025

Not at computer but isn’t resize done by set track count?

@Muller-Castro
Copy link
Contributor Author

Apparently there are only methods for adding and removing

@fire
Copy link
Member

fire commented Mar 24, 2025

the idiom is get track or find track and then add track or remove track. The integer is like a hidden handle that is hidden from the user.

@fire
Copy link
Member

fire commented Mar 24, 2025

Can you write the proposal form? It is confusing why you want this.

@Calinou Calinou added this to the 4.x milestone Mar 25, 2025
@TokageItLab TokageItLab changed the title Add Animation resize tracks Add resize() function for Animation's track count Apr 22, 2025
@TokageItLab
Copy link
Member

TokageItLab commented May 31, 2025

I urge that this API should not be made public easily, as it is very unsafe. This method causes animations to have duplicate tracks with the same path (empty path) of the same track type, but the current animation playback API has no safety measures for this case. It should be noted that animation tracks generate hashes from paths and track cache types and internally store them as unique paths.

It works similar to array resize. It may not be the best solution to the problem above but it makes up for it with the benefit, of the array resize algorithm itself, of calling the method only once and setting the tracks afterwards.

This comment in the proposal description is correct. The correct approach would be to implement APIs that allow safer manipulation of arrays than resize(), such as sort(), concat() or other methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Pending, No consensus

Development

Successfully merging this pull request may close these issues.

4 participants