[英]How to get the names of animation clips from a GLB 3D object on A-Frame?
動畫引用保存在gltf-model
組件屬性中: model.animations
( source )。 就像 KostasX 在他的評論中寫的那樣,你可以簡單地獲取屬性:
// better to check the glft-model, as it is responsible for loading the model
document.getElementById("GLB3D614").components['gltf-model'].model.animations
為確保屬性不是undefined
,您應該等到model-loaded
事件發出:
// custom component of the entity with the gltf-model
this.el.addEventListener('model-loaded', e => {
console.log(this.el.components['gltf-model'].model.animations
})
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.