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

Method SaveSurface

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

Source from the content-addressed store, hash-verified

167#if USE_EDITOR
168
169bool AnimationGraph::SaveSurface(const BytesContainer& data)
170{
171 if (OnCheckSave())
172 return true;
173 ScopeLock lock(Locker);
174
175 if (IsVirtual())
176 {
177 MemoryReadStream readStream(data.Get(), data.Length());
178 return Graph.Load(&readStream, USE_EDITOR);
179 }
180
181 // Release all chunks
182 for (int32 i = 0; i < ASSET_FILE_DATA_CHUNKS; i++)
183 ReleaseChunk(i);
184
185 // Set Visject Surface data
186 auto visjectSurfaceChunk = GetOrCreateChunk(0);
187 ASSERT(visjectSurfaceChunk != nullptr);
188 visjectSurfaceChunk->Data.Copy(data);
189
190 // Save
191 AssetInitData assetData;
192 assetData.SerializedVersion = 1;
193 if (SaveAsset(assetData))
194 {
195 LOG(Error, "Cannot save \'{0}\'", ToString());
196 return true;
197 }
198
199 return false;
200}
201
202void AnimationGraph::FindDependencies(AnimGraphBase* graph)
203{

Callers

nothing calls this directly

Calls 6

IsVirtualFunction · 0.85
ToStringFunction · 0.50
GetMethod · 0.45
LengthMethod · 0.45
LoadMethod · 0.45
CopyMethod · 0.45

Tested by

no test coverage detected