GLTFLoader fails to load my animation

I use https://github.com/facebookincubator/FBX2glTF to convert fbx file to gltf, which I learn from post [resolved]About the multi-animation model,

My fbx contains three animation, when the converted glft file was loaded, the animations.length is equals 3,
but when I play the one , the error occurs:

THREE.PropertyBinding: Trying to update property for track: Obj_JN0_1.scale but it wasn't found. {scene: Scene, scenes: Array(1), cameras: Array(0), animations: Array(3), asset: {…}, …}animations: Array(3)0: AnimationClip {name: "press", tracks: Array(14), duration: 0.6666666865348816, uuid: "4CBF394D-F39C-47C5-B5C1-AB6AE7BEC011"}1: AnimationClip {name: "jump", tracks: Array(24), duration: 0.5, uuid: "C2D0A338-19B4-4693-ACB7-4D333AE022FD"}2: AnimationClip {name: "down", tracks: Array(24), duration: 0.8333333134651184, uuid: "2545F035-701A-41EA-9F49-878377F43690"}length: 3__proto__: Array(0)asset: {generator: "FBX2glTF", version: "2.0"}cameras: []mixer: AnimationMixerstats: {actions: {…}, bindings: {…}, controlInterpolants: {…}}time: 238.95787500000048timeScale: 1_accuIndex: 0_actions: [AnimationAction]_actionsByClip: {4CBF394D-F39C-47C5-B5C1-AB6AE7BEC011: {…}}4CBF394D-F39C-47C5-B5C1-AB6AE7BEC011: {knownActions: Array(1), actionByRoot: {…}}__proto__: Object_bindings: (14) [PropertyMixer, PropertyMixer, PropertyMixer, PropertyMixer, PropertyMixer, PropertyMixer, PropertyMixer, PropertyMixer, PropertyMixer, PropertyMixer, PropertyMixer, PropertyMixer, PropertyMixer, PropertyMixer]0: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}1: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}2: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}3: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}4: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}5: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}6: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}7: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}8: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}9: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}10: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}11: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}12: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}13: PropertyMixer {binding: PropertyBinding, valueSize: 3, buffer: Float64Array(12), _mixBufferRegion: ƒ, cumulativeWeight: 0, …}length: 14__proto__: Array(0)_bindingsByRootAndName: {undefined: {…}}_controlInterpolants: []_nActiveActions: 1_nActiveBindings: 14_nActiveControlInterpolants: 0_root: {scene: Scene, scenes: Array(1), cameras: Array(0), animations: Array(3), asset: {…}, …}animations: (3) [AnimationClip, AnimationClip, AnimationClip]asset: {generator: "FBX2glTF", version: "2.0"}cameras: []mixer: AnimationMixer {_root: {…}, _actions: Array(1), _nActiveActions: 1, _actionsByClip: {…}, _bindings: Array(14), …}scene: Scene {uuid: "65485803-0B3D-4087-B9E2-A7F6842A592B", name: "Root Scene", type: "Scene", parent: Scene, children: Array(1), …}scenes: [Scene]__proto__: Object__proto__: EventDispatcherscene: Scene {uuid: "65485803-0B3D-4087-B9E2-A7F6842A592B", name: "Root Scene", type: "Scene", parent: Scene, children: Array(1), …}scenes: [Scene]__proto__: Object
bind @ three.js:39708
getValue_unbound @ three.js:39569
saveOriginalState @ three.js:39061
_activateAction @ three.js:41009
play @ three.js:40304
(anonymous) @ webgl_loader_gltf.html:117
(anonymous) @ GLTFLoader.js:176
(anonymous) @ GLTFLoader.js:1435
Promise resolved (async)
THREE.GLTFLoader.GLTFParser.parse @ GLTFLoader.js:1427
parse @ GLTFLoader.js:166
(anonymous) @ GLTFLoader.js:38
(anonymous) @ three.js:30754
XMLHttpRequest.send (async)
load @ three.js:30834
load @ GLTFLoader.js:34
init @ webgl_loader_gltf.html:89
(anonymous) @ webgl_loader_gltf.html:55

I don’t know whether @calrk encounter the same issue
So what’s the approach you guys use multiple animations ?

Are you able to post your model or an example of your code running so I can take a look? I haven’t run into an error like that before…

			var loader = new THREE.GLTFLoader();
			// loader.load( 'models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf', function ( gltf ) {
			loader.load( '5.3.gltf', function ( gltf ) {

				gltf.scene.traverse( function ( child ) {

					if ( child.isMesh ) {

						child.material.envMap = envMap;

					}

				} );

				scene.add( gltf.scene );
				console.log("loaded")
				console.log(gltf.animations.length)
				// var animation = gltf.animations[0]
				// animation.play();

				gltf.mixer = new THREE.AnimationMixer( gltf );
				mixers.push( gltf.mixer );

				var action = gltf.mixer.clipAction( gltf.animations[ 0 ] );
				console.log("action.time")
				console.log(action.time)
				var clip = action.getClip();
				console.log("clip.time")
				console.log(clip.duration)
				action.setLoop(THREE.LoopOnce);
				action.play();


			} );

This is my code

Quickest thing I can see is in mine I use the following:
gltf.mixer = new THREE.AnimationMixer( gltf.scene );

3 Likes

aha, that’s it, thanks :slight_smile:

I was having the same kind of error.

My problem was that the exported animations were not direct children of imported model, my temporary solution was to move the animations to the parent object:

// load gltf model ...
gltf.scene.animations = gltf.animations
mixer = new THREE.AnimationMixer(gltf.scene)

I should figure out how to export the animations properly and skip this step.