| 190 | #if USE_EDITOR |
| 191 | |
| 192 | bool AnimationGraphFunction::Save(const StringView& path) |
| 193 | { |
| 194 | if (OnCheckSave(path)) |
| 195 | return true; |
| 196 | ScopeLock lock(Locker); |
| 197 | AnimGraph graph(const_cast<AnimationGraphFunction*>(this), true); |
| 198 | MemoryReadStream readStream(GraphData.Get(), GraphData.Length()); |
| 199 | if (graph.Load(&readStream, true)) |
| 200 | return true; |
| 201 | MemoryWriteStream writeStream; |
| 202 | if (graph.Save(&writeStream, true)) |
| 203 | return true; |
| 204 | BytesContainer data; |
| 205 | data.Link(ToSpan(writeStream)); |
| 206 | return SaveSurface(data); |
| 207 | } |
| 208 | |
| 209 | #endif |