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

Reflect-based node deserialization #70

Open
wants to merge 43 commits into
base: master
Choose a base branch
from

Conversation

aecsocket
Copy link
Contributor

Replaces the AnimationNodeType enum and friends with a bevy_reflect based approach, including dynamic deserialization of nodes based on their type path.

This is an absolute monster PR, and includes:

  • removal of AnimationNodeType, AnimationNodeTypeSerial
  • AnimationNodeType replaced with Box<dyn NodeLike>, along with ReflectNodeLike impl
  • custom impl Reflect for AnimationNode (because it stores a Box<dyn NodeLike>)
  • big changes to AnimationGraphLoader
  • a custom version of bevy::reflect::serde that we need for automatically loading Handle<T>s from nodes via reflection
  • Assets::get_typed instead of Assets::get because the above process (loading Handle<T>s) is actually somewhat broken (see the comment in crate::utils::asset)

Everything seems to work, the only thing broken (as of writing this PR) is the editor.

@aecsocket aecsocket marked this pull request as ready for review October 1, 2024 21:28
@mbrea-c
Copy link
Owner

mbrea-c commented Oct 5, 2024

Documenting what we discussed on Discord:

Currently nodes that store a Handle<T> do no work with the editor, since due to missing API in Bevy (fixed here) we can only load Handle<LoadedUntypedAsset>. This breaks the asset picker UI, and results the selected handle not being recognized by the editor.

We decided to hold off on merging this until after migrating to the Bevy 0.15 release candidate, as it will contain the necessary fix and should come out this week (as of time of writing).

@mbrea-c
Copy link
Owner

mbrea-c commented Nov 10, 2024

The library crate seems to be working now, and pretty much ready to merge (save for some clippy fixes).
Remaining work is in the editor crate, pending migrations to 0.15 in two of our dependencies:

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

Successfully merging this pull request may close these issues.

2 participants