bevy/assets
andriyDev 2ea8f779c3
Prevent AnimationGraph from serializing AssetIds. (#19615)
# Objective

- A step towards #19024.
- `AnimationGraph` can serialize raw `AssetId`s. However for normal
handles, this is a runtime ID. This means it is unlikely that the
`AssetId` will correspond to the same asset after deserializing -
effectively breaking the graph.

## Solution

- Stop allowing `AssetId` to be serialized by `AnimationGraph`.
Serializing a handle with no path is now an error.
- Add `MigrationSerializedAnimationClip`. This is an untagged enum for
serde, meaning that it will take the first variant that deserializes. So
it will first try the "modern" version, then it will fallback to the
legacy version.
- Add some logging/error messages to explain what users should do.

Note: one limitation here is that this removes the ability to serialize
and deserialize UUIDs. In theory, someone could be using this to have a
"default" animation. If someone inserts an empty `AnimationClip` into
the `Handle::default()`, this **might** produce a T-pose. It might also
do nothing though. Unclear! I think this is worth the risk for
simplicity as it seems unlikely that people are sticking UUIDs in here
(or that you want a default animation in **any** AnimationGraph).

## Testing

- Ran `cargo r --example animation_graph -- --save` on main, then ran
`cargo r --example animation_graph` on this PR. The PR was able to load
the old data (after #19631).
2025-06-30 22:26:05 +00:00
..
android-res/mipmap-mdpi
animation_graphs Prevent AnimationGraph from serializing AssetIds. (#19615) 2025-06-30 22:26:05 +00:00
branding Initial raytraced lighting progress (bevy_solari) (#19058) 2025-06-12 21:26:10 +00:00
cursors/kenney_crosshairPack
data
docs
environment_maps
external
fonts
irradiance_volumes
lightmaps Light Textures (#18031) 2025-06-30 21:56:17 +00:00
models Light Textures (#18031) 2025-06-30 21:56:17 +00:00
pixel
scenes Make entity::index non max (#18704) 2025-05-07 18:20:30 +00:00
shaders Type erased materials (#19667) 2025-06-27 22:57:24 +00:00
sounds
textures New cooldown example (#19234) 2025-05-26 19:44:17 +00:00
volumes