| 20 | } |
| 21 | |
| 22 | Asset::LoadResult AnimationGraphFunction::load() |
| 23 | { |
| 24 | PROFILE_MEM(AnimationsData); |
| 25 | |
| 26 | // Get graph data from chunk |
| 27 | const auto surfaceChunk = GetChunk(0); |
| 28 | if (!surfaceChunk || !surfaceChunk->IsLoaded()) |
| 29 | return LoadResult::MissingDataChunk; |
| 30 | GraphData.Swap(surfaceChunk->Data); |
| 31 | |
| 32 | // Load graph |
| 33 | MemoryReadStream stream(GraphData.Get(), GraphData.Length()); |
| 34 | AnimGraph graph(this, true); |
| 35 | if (graph.Load(&stream, false)) |
| 36 | return LoadResult::Failed; |
| 37 | |
| 38 | // Load function signature |
| 39 | // Note: search also the nested state machines graphs (state output and transition rule) |
| 40 | ProcessGraphForSignature(&graph, true); |
| 41 | if (Inputs.Count() >= 16 || Outputs.Count() >= 16) |
| 42 | { |
| 43 | LOG(Error, "Too many function inputs/outputs in '{0}'. The limit is max 16 inputs and max 16 outputs.", ToString()); |
| 44 | } |
| 45 | |
| 46 | return LoadResult::Ok; |
| 47 | } |
| 48 | |
| 49 | void AnimationGraphFunction::unload(bool isReloading) |
| 50 | { |