fix: animation-only FBX assets loadable; clip data viewer

Pure-animation FBX (no meshes, skeleton clips only) was rejected at
the cache layer: ParsedModel::Valid() required non-empty meshes, so
Model::FromParsed/LoadModel returned null and the asset never made it
into the cache. Animation assets are now first-class:

- ParsedModel::Valid() = meshes or clips non-empty; parse failures
  (both empty) still rejected. Empty-mesh consumers already guarded
  (rendering skips empty mesh loop, mesh collider falls back to Box)
- ParseFromDisk: fix null-deref when assimp returns a null scene
- AssetCache::Find(path) + AssetManager::GetModelByPath for panels
- Asset Browser hover card shows meshes/bones/clips for loaded models
- Inspector model line flags "animation-only" when meshes == 0
- Animation section: collapsible clip data table (name/duration/
  channel count) to verify bone-name matching of attached clips
This commit is contained in:
2026-10-04 02:31:30 +08:00
parent 2577809ee4
commit 175ce35def
6 changed files with 97 additions and 9 deletions
+3 -2
View File
@@ -140,8 +140,9 @@ namespace Engine::Assets {
return res;
}
}
// 纯 CPU 解析:动画容器只要 nodes + clips,不建 GPU 资产
//(meshes 空的文件过不了 Model 构建,也不需要构建)
// 纯 CPU 解析:动画容器只要 nodes + clips。不复用缓存里可能已
// 预热的同名 Model——缓存实例的 clips nodeIdx 按它自己的 node 表
// 编号,attach 需要按目标模型的 node 表重映射,必须独立解析
ParsedModel src = Model::ParseFromDisk(animPath);
if (src.clips.empty()) {
ENGINE_WARN("AttachAnimationClips: no clips in '{}'", animPath);