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

Method LoadSurface

Source/Engine/Content/Assets/AnimationGraph.cpp:136–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136BytesContainer AnimationGraph::LoadSurface() const
137{
138 if (!IsVirtual() && WaitForLoaded())
139 return BytesContainer();
140 ScopeLock lock(Locker);
141
142 if (IsVirtual())
143 {
144 // Serialize runtime graph
145 MemoryWriteStream stream(512);
146 if (!Graph.Save(&stream, USE_EDITOR))
147 {
148 BytesContainer result;
149 result.Copy(ToSpan(stream));
150 return result;
151 }
152 }
153
154 // Load data from asset
155 if (!LoadChunks(GET_CHUNK_FLAG(0)))
156 {
157 const auto data = GetChunk(0);
158 BytesContainer result;
159 result.Copy(data->Data);
160 return result;
161 }
162
163 LOG(Warning, "Animation Graph \'{0}\' surface data is missing.", ToString());
164 return BytesContainer();
165}
166
167#if USE_EDITOR
168

Callers

nothing calls this directly

Calls 6

IsVirtualFunction · 0.85
GetChunkFunction · 0.85
ToSpanFunction · 0.50
ToStringFunction · 0.50
SaveMethod · 0.45
CopyMethod · 0.45

Tested by

no test coverage detected