MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / GetInfo

Method GetInfo

Source/Engine/Content/Assets/Animation.cpp:44–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42#endif
43
44Animation::InfoData Animation::GetInfo() const
45{
46 ScopeLock lock(Locker);
47 InfoData info;
48 info.MemoryUsage = sizeof(Animation);
49 if (IsLoaded())
50 {
51 info.Length = Data.GetLength();
52 info.FramesCount = (int32)Data.Duration;
53 info.ChannelsCount = Data.Channels.Count();
54 info.KeyframesCount = Data.GetKeyframesCount();
55 info.MemoryUsage += Data.Channels.Capacity() * sizeof(NodeAnimationData);
56 for (auto& e : Data.Channels)
57 {
58 info.MemoryUsage += (e.NodeName.Length() + 1) * sizeof(Char);
59 info.MemoryUsage += e.Position.GetKeyframes().Capacity() * sizeof(LinearCurveKeyframe<Float3>);
60 info.MemoryUsage += e.Rotation.GetKeyframes().Capacity() * sizeof(LinearCurveKeyframe<Quaternion>);
61 info.MemoryUsage += e.Scale.GetKeyframes().Capacity() * sizeof(LinearCurveKeyframe<Float3>);
62 }
63 }
64 else
65 {
66 info.Length = 0.0f;
67 info.FramesCount = 0;
68 info.ChannelsCount = 0;
69 info.KeyframesCount = 0;
70 }
71 info.MemoryUsage += Events.Capacity() * sizeof(Pair<String, StepCurve<AnimEventData>>);
72 info.MemoryUsage += NestedAnims.Capacity() * sizeof(Pair<String, NestedAnimData>);
73 for (auto& e : Events)
74 info.MemoryUsage += e.Second.GetKeyframes().Capacity() * sizeof(StepCurve<AnimEventData>);
75 return info;
76}
77
78#if USE_EDITOR
79

Callers 2

Material.cppFile · 0.45

Calls 7

GetKeyframesCountMethod · 0.80
IsLoadedFunction · 0.50
GetLengthMethod · 0.45
CountMethod · 0.45
CapacityMethod · 0.45
LengthMethod · 0.45
GetKeyframesMethod · 0.45

Tested by

no test coverage detected