the animation is not triggered automaticly and console prints out the bones, don’t know why:
i think the first example uses older revision of three js master. how can i export my dae accordingly so it will also playback in the newest version? i would like to stick with dae since my whole code is working except for triggering an animation from the dae.
Is there a special reason for using Collada? Because of the complex specification of this 3D format, ColladaLoader only supports a subset of the actual features.
I suggest you use the more modern glTF which is the recommended 3D format of three.js. If possible, directly export to glTF from your DCC tool. Otherwise try to convert existing DAE files with the following CLI tool:
there is no other reason to use dae, besides i know how to export them, they used to work in my three js projects so far, and that gltf doesnt preview in macOS so i never know if i exported it correctly. Is there a simple example available or tutorial on how to export and import animated gltf?
loader.load(
// resource URL
'gltf/head.glb',
// called when the resource is loaded
function ( gltf ) {
scene.add( gltf.scene );
gltf.animations; // Array<THREE.AnimationClip>
//gltf.scene; // THREE.Group
//gltf.scenes; // Array<THREE.Group>
//gltf.cameras; // Array<THREE.Camera>
//gltf.asset; // Object
},
// called while loading is progressing
function ( xhr ) {
console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
},
// called when loading has errors
function ( error ) {
console.log( 'An error happened' );
}
);
it doesnt show and i dont know how to acces the object, for example for scaling.
i think i lack the understanding of how glft works, cause the the object is added to scene in the load function and i dont know what that object is called now, and how to acces it.
this seems rather complicated to me but i am not a professioal programmer, though did several projects with three.js before that seemed very straight forward with loading json or collada.
could someone do me a favor and look at this code, cause the animation is not starting. though shows log that there is the animation named Action1 inside the glft scene, and it also plays in the viewer online:
Instead of assigning a new instance of MeshStandardMaterial, it’s better to modify the existing one. Otherwise you overwrite properties like skinning which controls wether the object is influenced by skeletal animation or not. Change your code to:
ok! but how about when i want to acces the parameters from outside the loader loop. say i want to add an envMap to tthe material that i created after the function?