MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / Import

Method Import

modules/tools/animation_tool/src/gltf/skeleton_asset.cpp:16–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16void* 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

Callers

nothing calls this directly

Calls 6

AddFileDependencyMethod · 0.80
GetAssetPathMethod · 0.80
c_strMethod · 0.45
GetAssetRecordMethod · 0.45
LoadMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected