Three.js: Problems with ColladaLoader2

Created on 23 Jun 2017  路  6Comments  路  Source: mrdoob/three.js

Description of the problem

Hello @Mugen87

Now I use the ColladaLoader2 to load my model and play the animations but I get errors and display problems :

  • the model does not display correctly, see by yourself. With the ColladaLoadermy model displaying well.

431847maria

  • the updating of the mixer for animations generate this error on the console :
    can not bind to bones as node does not have a skeleton PropertyBinding {path: ".skeleton.bones[Hips].position", ...
    For each error corresponding a warning during the loading like :
    ColladaLoader2.js:2276 THREE.ColladaLoader: Missing data for bone: Hips.
    However you can see the skeleton on the picture I linked.

The model come from mixamo : https://www.mixamo.com/ , which gives quality models.

Considering this code :

loader.load(source, function(collada) 
{
    const obj = collada.scene;
    const animations = collada.animations;

    obj.traverse(function(child)
    {
        child.castShadow = true;
        child.receiveShadow = true;

                if ( child instanceof THREE.SkinnedMesh ) 
                {
                       this.skeleton = new THREE.SkeletonHelper(child);
                       this.skeleton.material.linewidth = 3;
                       this.skeleton.visible = this.skeletonIsShowed;
                       this.environment.scene.add(this.skeleton);
                }
        }.bind(this));

        this.mixer = new THREE.AnimationMixer(obj);
        this.clip = animations[0];
        this.mixer.clipAction(this.clip).play();

}.bind(this));

Thanks for reading.

Three.js version
  • [ ] Dev
  • [x] r86
  • [ ] ...
Browser
  • [x] All of them
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [x] All of them
  • [ ] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Hardware Requirements (graphics card, VR Device, ...)
Bug

Most helpful comment

I'm not sure if the animation data of this object are valid. As far as i can see, the file only contains two keyframes per bone. Besides, the time values are very strange (0.000000 and 0.033333). So the total length of the parsed animation clip is 0.033333 seconds. Well, it's no problem to change the duration for playback but still these data seems strange to me. Currently i was not able to playback the animation (ColladaLoader didn't work either).

BTW: I've imported the model in sketchfab and no animations were parsed at all, too.

@SebastienFPRousseau Can you please verify if the animation data of your model are correct?

All 6 comments

Is it possible that you share the model? I need to debug this in order to see what's going wrong...

Thanks for the file! I will look into it...

11606 fixes the first bunch of problems. The texture of the lady should now be displayed correctly.

image

I'll investigate the animation problem within a separate PR.

I'm not sure if the animation data of this object are valid. As far as i can see, the file only contains two keyframes per bone. Besides, the time values are very strange (0.000000 and 0.033333). So the total length of the parsed animation clip is 0.033333 seconds. Well, it's no problem to change the duration for playback but still these data seems strange to me. Currently i was not able to playback the animation (ColladaLoader didn't work either).

BTW: I've imported the model in sketchfab and no animations were parsed at all, too.

@SebastienFPRousseau Can you please verify if the animation data of your model are correct?

It's weird... I suspected something like that. I will try another model. Thanks for the texture correction, waiting for the release. Animations mustn't be valid.

Was this page helpful?
0 / 5 - 0 ratings