Load fbx file with textures (including images)

Thanks @donmccurdy so much. It works now. However, I want to display my fbx file.
I will research further.

Dear sir,
Could you help me to open my fbx file with textures?

@nxhoang the file is an old version of the format - FBX 2013 (6100). We don’t fully support that version. Some models may work, some may not.

The best thing to do is to re-export the model in a newer version of the FBX format, or convert it into a different format such as glTF.

Thanks @looeee for replying, are there a way to convert my fbx file to another extension by javascripts then load it by three.js?

Dear all,
I tried another fbx file github.com/nxhoang/Three.js-Fxb-and-Textures/blob/master/models/fbx/Test.fbx
And show me another error: ReferenceError: Zlib is not defined.
I can open both fbx files in viewer.autodesk.com/designviews
So I guess there are another way to open my fbx files by Three.js.

You need to include the Inflate.min.js script.
See the FBX example for details on how to include that file.

Dear @looeee,
I included Inflate.min.js script then it shows me another error image

I haven’t been able to track down the error on this so far. Again, I suspect it’s due to an incompatible file - the version number is now fine on this, but the creator shows as “FBX SDK 2011”.

What program are you exporting this from?

If I import to 3ds max and then re-export the model loads fine by the way.

1 Like

Dear @looeee,
I used “Paint 3D” that’s MS’s application in Win 10 to re-export the file.

Interesting, never noticed that you could save as FBX from Paint 3D.

I’ve tested saving a couple simpler models that way, and they work fine.

However, FBX files I save from Paint 3D are version 7400, and FBX SDK 2017.

Can you make sure that you have the latest version of Paint 3D? Mine is version 4.1804

I tried re-exporting by Paint 3D (Mine is also version 4.1804). It’s working fine now.
My task is opening FBX files were created by Optitex 3D (ver 15.3). Unfortunately, I can’t ask users using Paint 3D to convert the files. However, Optitex 3D (ver 15.3) is able to save as .obj format. How is about loading .obj by three.js, does it support all of versions? I’ve never tried that. I’m planning to do this next week?

How is about loading .obj by three.js, does it support all of versions?

Hopefully, but it’s very hard to support files from all these different applications since so often the files they output are either incorrect, or they interpret the spec differently. The only way to find out is to try it!

Doesn’t Paint 3D let you export .gltf or .glb? If not available yet it is coming soon… those would probably be much easier in this case, with THREE.GLTFLoader.

Dear @donmccurdy,
We can export .glb by Paint 3D.

Oh, ok well then that is another option — you can load .glb files with THREE.GLTFLoader.

@donmccurdy I’m still wondering about this. As I said, my task is opening some fbx files that were design by Optitex 3D (ver 15.3). Users will upload them to my site then view. I can’t require users to convert the files before uploading. The best way may be asking users use Optitex 3D to save the files as obj format. Then I will try to load obj file in my site.

Dear @looeee,
Could you tell me how to check version of FBX file?

It’s in the browser console log whenever you load an FBX file, as in your screenshot above: FBX binary version 7100

If you want to see the FBX SDK version, uncomment this line in FBXLoader.js:

console.log( FBXTree )

Then find the Creator section in the FBXTree that gets logged to the console.

Dear @looeee,
I read your comment at https://github.com/mrdoob/three.js/issues/9860.
Thanks you for your replying.
I uncomment the line that you told me. Nothing is wrote at console.
May I do anything wrongly?

There’s really no way I can know what’s wrong without seeing your code.

In any case, you don’t really need to do that since you already have FBX binary version XXXX logged to the console, and you know that if XXXX < 6100 then the file is probably not going to work.

The next step is to upgrade the file or convert to a different format. There are lots of suggestions for how to do that already in this thread.