3

I get a problem when I export my model from Maya to JSON threeJS

A lot of vertices look to be in a wrong position :

enter image description here

You can download

When I export the options are : uv face vertex normale

I don't think it come from my code because it work perfectly with suzanne.js etc.. but here is it :

        loader = new THREE.JSONLoader()
    loader.load( "./3d/130227_kyaryTRI_001.js", @createScene )

    return

createScene:( geometry ) =>

    geometry.computeCentroids()
    geometry.computeFaceNormals()
    geometry.computeVertexNormals()
    geometry.computeMorphNormals()
    geometry.computeTangents()

    # Lambert
    material = new THREE.MeshLambertMaterial(
        map:THREE.ImageUtils.loadTexture( "./3d/Text_Kyary001.png" )
    )
    mesh = new THREE.Mesh( geometry, material )
    mesh.scale.set(6, 6, 6)
    @scene.add( mesh )

    # Phong 
    material = new THREE.MeshPhongMaterial({color:0x00FF00})
    mesh = new THREE.Mesh( geometry, material )
    mesh.scale.set(6, 6, 6)
    mesh.position.set(-300,-0,0)
    @scene.add( mesh )

    # Normal
    material = new THREE.MeshNormalMaterial()
    mesh = new THREE.Mesh( geometry, material )
    mesh.scale.set(6, 6, 6)
    mesh.position.set(-0,-240,0)
    @scene.add( mesh )

    # Wireframe 
    material = new THREE.MeshBasicMaterial({wireframe:true, color:0})
    mesh = new THREE.Mesh( geometry, material )
    mesh.scale.set(6, 6, 6)
    mesh.position.set(0,240,0)
    @scene.add( mesh )

    return

I use threejs version 56

I use maya 2013 64bits, also try on maya 2012

Thanks by advance for any help.

EDIT : the .OBJ work as expected ( Load with the OBJLoader from threejs ) EDIT2 : the bug was coming from the exporter script with the new maya version, they fix it.

Makio64
  • 123
  • 1
  • 9

1 Answers1

3

I suggest using the Maya to THREE exporter that comes with the THREE.js source code. It exports directly to the .JS format without an intermediate step. If you download the repository from GitHub you can find the exporter files in utils/exporters/maya.

The exporter that you would find in the THREE.js official repository only supports static models. I have created an updated version that also supports exporting rigged and animated models. We have a pull request to integrate the updated exporter with the THREE trunk, but if you want to get the new and improved exporter immediately you can get it from this repository: https://github.com/BlackTowerEntertainment/three.js/tree/maya_animation_exporter.

Hope this helps.

datmorrison
  • 128
  • 9