4 using System.Collections.Generic;
6 using SiliconStudio.Core;
7 using SiliconStudio.Core.Extensions;
8 using SiliconStudio.Core.Mathematics;
9 using SiliconStudio.Core.Serialization;
10 using SiliconStudio.Core.Serialization.Contents;
11 using SiliconStudio.Core.Serialization.Converters;
12 using SiliconStudio.Core.Storage;
13 using SiliconStudio.Paradox.Effects;
15 namespace SiliconStudio.
Paradox.DataModel
21 [ContentSerializer(typeof(DataContentSerializer<AnimationClip>))]
34 public TimeSpan Duration {
get; set; }
47 public Dictionary<string, Channel> Channels =
new Dictionary<string, Channel>();
50 public List<AnimationCurve> Curves =
new List<AnimationCurve>();
64 throw new InvalidOperationException(
"This AnimationClip is frozen");
67 Channels.Add(propertyName,
new Channel
69 NodeName = MeshAnimationUpdater.GetNodeName(propertyName),
71 CurveIndex = Curves.Count,
72 ElementType = curve.ElementType,
73 ElementSize = curve.ElementSize,
85 OptimizedCurvesFloat = CreateOptimizedData<float>();
86 OptimizedCurvesVector3 = CreateOptimizedData<Vector3>();
87 OptimizedCurvesQuaternion = CreateOptimizedData<Quaternion>();
94 .Where(x => x.Value.CurveIndex != -1 && x.Value.ElementType == typeof(T))
98 foreach (var curve
in curves)
100 var channel = Channels[curve.Key];
103 if (channel.CurveIndex != -1)
105 Curves[channel.CurveIndex] = null;
106 channel.CurveIndex = -1;
109 Channels[curve.Key] = channel;
112 return AnimationData<T>.FromAnimationChannels(curves);
115 internal void Freeze()
AnimationData< float > OptimizedCurvesFloat
void AddCurve(string propertyName, AnimationCurve curve)
Adds a named curve.
Base class for converters to/from a data type.
Applies animation from a AnimationClip to a ModelViewHierarchyUpdater.
AnimationData< Vector3 > OptimizedCurvesVector3
void Optimize()
Optimizes data from multiple curves to a single linear data stream.
An aggregation of AnimationCurve with their channel names.
AnimationRepeatMode
Enumeration describing how an animation should be repeated.
Untyped base class for animation curves.
AnimationData< Quaternion > OptimizedCurvesQuaternion
Typed class for animation curves.
MeshAnimationUpdater.ChannelType Type