@@ -29,7 +29,6 @@ use ron::de::SpannedError;
29
29
use serde:: { Deserialize , Serialize } ;
30
30
use smallvec:: SmallVec ;
31
31
use thiserror:: Error ;
32
- use tracing:: warn;
33
32
34
33
use crate :: { AnimationClip , AnimationTargetId } ;
35
34
@@ -408,42 +407,13 @@ pub struct SerializedAnimationGraphNode {
408
407
#[ derive( Serialize , Deserialize ) ]
409
408
pub enum SerializedAnimationNodeType {
410
409
/// Corresponds to [`AnimationNodeType::Clip`].
411
- Clip ( MigrationSerializedAnimationClip ) ,
410
+ Clip ( AssetPath < ' static > ) ,
412
411
/// Corresponds to [`AnimationNodeType::Blend`].
413
412
Blend ,
414
413
/// Corresponds to [`AnimationNodeType::Add`].
415
414
Add ,
416
415
}
417
416
418
- /// A type to facilitate migration from the legacy format of [`SerializedAnimationGraph`] to the
419
- /// new format.
420
- ///
421
- /// By using untagged serde deserialization, we can try to deserialize the modern form, then
422
- /// fallback to the legacy form. Users must migrate to the modern form by Bevy 0.18.
423
- // TODO: Delete this after Bevy 0.17.
424
- #[ derive( Serialize , Deserialize ) ]
425
- #[ serde( untagged) ]
426
- pub enum MigrationSerializedAnimationClip {
427
- /// This is the new type of this field.
428
- Modern ( AssetPath < ' static > ) ,
429
- /// This is the legacy type of this field. Users must migrate away from this.
430
- #[ serde( skip_serializing) ]
431
- Legacy ( SerializedAnimationClip ) ,
432
- }
433
-
434
- /// The legacy form of serialized animation clips. This allows raw asset IDs to be deserialized.
435
- // TODO: Delete this after Bevy 0.17.
436
- #[ derive( Deserialize ) ]
437
- pub enum SerializedAnimationClip {
438
- /// Records an asset path.
439
- AssetPath ( AssetPath < ' static > ) ,
440
- /// The fallback that records an asset ID.
441
- ///
442
- /// Because asset IDs can change, this should not be relied upon. Prefer to
443
- /// use asset paths where possible.
444
- AssetId ( AssetId < AnimationClip > ) ,
445
- }
446
-
447
417
/// The type of an animation mask bitfield.
448
418
///
449
419
/// Bit N corresponds to mask group N.
@@ -801,35 +771,12 @@ impl AssetLoader for AnimationGraphAssetLoader {
801
771
serialized_animation_graph. graph . edge_count ( ) ,
802
772
) ;
803
773
804
- let mut already_warned = false ;
805
774
for serialized_node in serialized_animation_graph. graph . node_weights ( ) {
806
775
animation_graph. add_node ( AnimationGraphNode {
807
776
node_type : match serialized_node. node_type {
808
- SerializedAnimationNodeType :: Clip ( ref clip) => match clip {
809
- MigrationSerializedAnimationClip :: Modern ( path) => {
810
- AnimationNodeType :: Clip ( load_context. load ( path. clone ( ) ) )
811
- }
812
- MigrationSerializedAnimationClip :: Legacy (
813
- SerializedAnimationClip :: AssetPath ( path) ,
814
- ) => {
815
- if !already_warned {
816
- let path = load_context. asset_path ( ) ;
817
- warn ! (
818
- "Loaded an AnimationGraph asset at \" {path}\" which contains a \
819
- legacy-style SerializedAnimationClip. Please re-save the asset \
820
- using AnimationGraph::save to automatically migrate to the new \
821
- format"
822
- ) ;
823
- already_warned = true ;
824
- }
825
- AnimationNodeType :: Clip ( load_context. load ( path. clone ( ) ) )
826
- }
827
- MigrationSerializedAnimationClip :: Legacy (
828
- SerializedAnimationClip :: AssetId ( _) ,
829
- ) => {
830
- return Err ( AnimationGraphLoadError :: GraphContainsLegacyAssetId ) ;
831
- }
832
- } ,
777
+ SerializedAnimationNodeType :: Clip ( ref path) => {
778
+ AnimationNodeType :: Clip ( load_context. load ( path. clone ( ) ) )
779
+ }
833
780
SerializedAnimationNodeType :: Blend => AnimationNodeType :: Blend ,
834
781
SerializedAnimationNodeType :: Add => AnimationNodeType :: Add ,
835
782
} ,
@@ -870,9 +817,7 @@ impl TryFrom<AnimationGraph> for SerializedAnimationGraph {
870
817
mask : node. mask ,
871
818
node_type : match node. node_type {
872
819
AnimationNodeType :: Clip ( ref clip) => match clip. path ( ) {
873
- Some ( path) => SerializedAnimationNodeType :: Clip (
874
- MigrationSerializedAnimationClip :: Modern ( path. clone ( ) ) ,
875
- ) ,
820
+ Some ( path) => SerializedAnimationNodeType :: Clip ( path. clone ( ) ) ,
876
821
None => return Err ( NonPathHandleError ) ,
877
822
} ,
878
823
AnimationNodeType :: Blend => SerializedAnimationNodeType :: Blend ,
0 commit comments