简体   繁体   中英

Three.js Maya export error

I'm trying to use this Three.js exporter for Maya .

However, when I try to load the threeJsFileTranslator.py plug-in from my plug-ins manager in Maya, it gives me an error in the Script Editor:

// Error: line 1: invalid syntax // 
// Warning: line 1: Failed to run file: D:/Maya/Maya2016/bin/plug-ins/threeJsFileTranslator.py // 
// Error: line 1:  (threeJsFileTranslator) //

I've tested this on both Maya 2016 and 2017 with no luck. No idea what causes this, and any help is appreciated.

I had a similar issue with the Maya three.js exporter. My solution was to use the three.js collada loader, A .dae file which retains all information about the model, storing it in an array which you can access by sifting through the array hierarchy. Everything is accessible, all elements—lights, shaders, shadows, except cameras. I preferred this method over the JSON method three.js uses. You can find the code example here:

https://threejs.org/examples/webgl_loader_collada.html

Exporting the model is relatively easy. Clean up your model by removing faces and irregular vertices. This will remove any issues you might run into in the future. You also need to make sure nothing has been grouped rather has to be combined . You can do this by opening the Outliner (Windows> Outliner) and select objects and organize them by name and whether they are within a group or not. Otherwise, this causes difficulties when using a for loop to loop through the array/model when assigning shadows or any other bits of content

To Export Model: Open your Maya Model. You can either export by selection or the entire file. In this instance, go under File > Export All. Maya has the plugin (not loaded) built in.

In the export panel, change the default export option that is set for you, to DAE_FBX export (Name may vary)

Once the export is complete, the model will be ready to link to your script.

The model can range from as little as 3MB to 50MB in size—and for the web that's big, but regardless you should always have a preloading screen available, just in case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM