| 25 | } |
| 26 | |
| 27 | Asset::LoadResult AnimationGraph::load() |
| 28 | { |
| 29 | PROFILE_MEM(AnimationsData); |
| 30 | |
| 31 | // Get stream with graph data |
| 32 | const auto surfaceChunk = GetChunk(0); |
| 33 | if (surfaceChunk == nullptr) |
| 34 | return LoadResult::MissingDataChunk; |
| 35 | MemoryReadStream stream(surfaceChunk->Get(), surfaceChunk->Size()); |
| 36 | |
| 37 | // Load graph |
| 38 | if (Graph.Load(&stream, USE_EDITOR)) |
| 39 | { |
| 40 | LOG(Warning, "Failed to load animation graph \'{0}\'", ToString()); |
| 41 | return LoadResult::Failed; |
| 42 | } |
| 43 | |
| 44 | #if USE_EDITOR |
| 45 | // Find asset dependencies to nested anim graph functions |
| 46 | ClearDependencies(); |
| 47 | FindDependencies(&Graph); |
| 48 | #endif |
| 49 | |
| 50 | return LoadResult::Ok; |
| 51 | } |
| 52 | |
| 53 | void AnimationGraph::unload(bool isReloading) |
| 54 | { |