Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blender Three.js export tool giving bizarre results #4660

Closed
viclib opened this issue Apr 9, 2014 · 6 comments
Closed

Blender Three.js export tool giving bizarre results #4660

viclib opened this issue Apr 9, 2014 · 6 comments
Labels

Comments

@viclib
Copy link

viclib commented Apr 9, 2014

I've been for a time trying to export animations to Three.js, but it only produces bizarre results. Code:

var jsonLoader = new THREE.JSONLoader();
jsonLoader.load("walkcycle/walkingCycle.js",function(geometry,materials){
    chr = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial(materials));
    /*THREE.AnimationHandler.add(geometry.animations[1]);*/
    /*for (var i=0,l=materials.length; i<l; ++i)*/
        /*materials[0].skinning = true;*/
    /*animation = new THREE.Animation( chr, "Walking" );*/
    /*animation.play(0.05);*/
    /*chr.scale.set(5,5,5);*/
    scene.add(chr);
});

Original mesh on Blender:

mesh

Result on Three.js:

result

Link for the .blend

I'm using Blender 2.7 and the latest exporter on Three.js's master branch. What could be going on?

@mrdoob
Copy link
Owner

mrdoob commented Apr 9, 2014

Any ideas @insominx?

@mrdoob mrdoob added Bug and removed Enhancement labels Apr 9, 2014
@insominx
Copy link
Contributor

insominx commented Apr 9, 2014

The first thing that sticks out to me is that you're using Mesh instead of SkinnedMesh. Other than that there's a host of other issues that you can run into with Blender export. Here's some guidelines from the artist I'm working with @phfatmonkey :

  1. You will need keyframes on every bone you want to export.
  2. Make sure only one Armature is in the scene.
  3. The mesh needs to be in the T-pose. Here are two ways to do this:
    a. Have a T-pose action. This action needs a frame where all bones have transforms cleared. This should be the current frame when the exporter is selected.
    b. Delete the Armature modifier from the mesh immediately before export. After the file is exported, undo the last action to get the modifier back.
  4. Export the scene to ThreeJS by going to File > Export > ThreeJS. Make sure to select ‘All Animations’ in the exporter options.

@grgr
Copy link

grgr commented Sep 1, 2014

Hey @viclib have you solved the problem?
Is the mesh properly displayed if you delete all none bone related vertexgroups?
Your .blend file is not there any more, so I could not check if this has been the error.

@JohnHardy
Copy link

I could only get this working when I kept the Armature modifier, but disabled both vertex groups and bone envelops (then re-enabled after export). In my case, deleting the modifier didn't help.

@JohnHardy
Copy link

To assist reproducibility, I was working with the mesh linked too from this video: https://www.youtube.com/watch?v=oLRpnS2HvTs (direct: https://docs.google.com/file/d/0B4LfJyJoYqQXRFZSS3BpT3ZXRGs/edit?usp=sharing)

@repsac
Copy link
Contributor

repsac commented Aug 2, 2015

Just downloaded the model so I will have to get a scene setup first before I can test exports. In the meantime look over this ticket. #6050

There seems, tho I am not crazy about it, a need to have 2 different export options. One for REST and one for POSE. You need to ensure your armature pose position (Rest or Pose) matches the Skeletal animations option. Also see if the older r69 exporter works. Migrating the animation code from the old exporter to the new one has not been smooth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants