| 14 | } |
| 15 | |
| 16 | void* SSkelGltfImporter::Import(skr_io_ram_service_t*, SCookContext* context) |
| 17 | { |
| 18 | using namespace ozz::animation::offline; |
| 19 | GltfImporter impl; |
| 20 | ozz::animation::offline::OzzImporter& impoter = impl; |
| 21 | OzzImporter::NodeType types = {}; |
| 22 | types.skeleton = true; |
| 23 | auto path = context->AddFileDependency(assetPath.c_str()); |
| 24 | auto fullAssetPath = context->GetAssetRecord()->project->GetAssetPath() / path; |
| 25 | if(!impoter.Load(fullAssetPath.string().c_str())) |
| 26 | { |
| 27 | SKR_LOG_ERROR(u8"Failed to load gltf file %s for asset %s.", assetPath.c_str(), context->GetAssetPath().c_str()); |
| 28 | return nullptr; |
| 29 | } |
| 30 | RawSkeleton* rawSkeleton = SkrNew<RawSkeleton>(); |
| 31 | impoter.Import(rawSkeleton, types); |
| 32 | return rawSkeleton; |
| 33 | } |
| 34 | } // namespace skd::asset |
nothing calls this directly
no test coverage detected