Converting FBX to three.js

converters, fbx, python, three.js

Solution

You need to copy some of the contents out of the Autodesk Python SDK into a directory that is in your PYTHONPATH environment variable (or update your PYTHONPATH to include the Autodesk SDK).

ex. Mac OS X (Yosemite)

In the case of OS X Yosemite, neither `/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages` or `/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages` were actually in my PYTHONPATH. So I added the following to my ~/.bash_profile:

# Python 2.7
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

and copied the contents of `/Applications/Autodesk/FBX\ Python\ SDK/2015.1/lib/Python27` (FbxCommon.py, fbx.so, fbxsip.so) into `/usr/local/lib/python2.7/site-packages`.

Windows etc.

The same logic used on Mac OS X can be applied on other platforms i.e. copy `FbxCommon.py` (and any other files in the same directory - DLLs etc.) into a directory in your PYTHONPATH.

Problem

I am trying to use the FBX converter tool, located in the utils/converters/fbx/ folder, of the three.js project located here: https://github.com/mrdoob/three.js/ I have installed the FBX SDK Python 2013.3 bindings (at least I think I did that part correctly) And I have Python 2.6 installed to C:\Python26 I copied the "FBX SDK" folder into C:\Pythons26\Lib\site-packages from C:\Program Files\Autodesk\FBX But when I run the following command: converty_to_threejs.py my_fbx_file.fbx test_output_file.js I get the following error: Could not locate the python FBX SDK! You need to copy the FBX SDK into your python install folder such as "Python26/Lib/site-packages" folder. I also made sure that C:\Python26 was added to my PATH system variable. Does anyone have any idea why it wouldn't be able to find the FBX SDK folder? I put it exactly where it wants it, but it won't find it. Thanks in advance!

Original source