question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FBXLoader: fails to load file

See original GitHub issue
Description of the problem

Hello,

the FBXLoader is not loading the file (folder scene1 in attached ZIP) the fbx file verion is binary and higher than 7.0

in 3dMax it works - looks like this: 2018-04-06_13-58-31

After loading it with FBXLoader I get this error:

THREE.FBXLoader: FBX binary version: 7400
TypeError: GetData[infoObject.mappingType][infoObject.referenceType] is not a function
    at getData (FBXLoader.js:1402)
    at FBXLoader.js:949
    at Array.forEach (<anonymous>)
    at FBXLoader.js:947
    at Array.forEach (<anonymous>)
    at genGeometry (FBXLoader.js:829)
    at parseMeshGeometry (FBXLoader.js:743)
    at parseGeometry (FBXLoader.js:680)
    at parseGeometries (FBXLoader.js:662)
    at THREE.FBXLoader.parse (FBXLoader.js:107)

it seems like it is trying to load function GetData[‘ByVertice’][‘IndexToDirect’] that is not there (I don’t know if it should)

After saving it with 3dMax and loading to THREEJS it works and looking good (folder scene1_max in attached ZIP):

2018-04-06_14-07-57

I’m not sure why it is not working with original file. I would like to keep it in original as it is generated by software that I use and I want to pass it automatically to THREEJS without manual opening and saving in external programs like 3dMax.

I was trying to change some things in FBXLoader library (not knowing exactly what I’m doing - by switching off things that were causing problems) just to open original file somehow but what I only achieved is this view (no textures or correct mapping and visible triangles on objects):

2018-04-06_14-01-51

FILES (folder “scene1” contains original file that doesn’t work, “scene1_max” contains file saved in max that works): scene.zip

PS: I’m new here so I hope I’m writing about this issue in correct place (if not let me know where should I put it)

Three.js version
  • Dev
  • r91
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
NicekDevcommented, Apr 12, 2018

Beautiful! Works like a charm 😃

The model loads correctly and I checked also on other generated files - bigger and more complex and everything is working.

Only issue that I found left is that there are some textures that use .tga image files so those textures are not loaded (object appears all white) but it’s a detail as those textures are used not so often and also I can change them to other format.

Thank you @looeee. I owe you a beer 😉

0reactions
NicekDevcommented, Apr 12, 2018

@looeee I did a PR here: #13841

There is only this “if” line that I know is not so nice… If you could just check it and propose change maybe 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

FBXLoader fails to load file · Issue #18986 · mrdoob/three.js
I have a series of exports from a small-ish CAD software in FBX. When I try to load any of them in the...
Read more >
FBX Loader not loading some FBX files - three.js forum
Uncaught TypeError: Cannot read property 'traverse' of undefined. In this case my 3D model was never loaded from the FBX file, yet I...
Read more >
FBXLoader doesn't load a fbx model 3d in three.js
Hello I'm trying to import an fbx model into my scene, but there is not much info on it online I had found...
Read more >
Three.js Fbx file Loaders / pernifloss - Observable
Just a simple notebook rendering a fbx file with threejs, from a file input or an url. fileRenderer = "" ... FBXLoader =...
Read more >
FBX Loader - Three.js Tutorials - sbcode.net
The FBX format is used to provide interoperability between digital content creation applications and game engines such as Blender, Maya, Autodesk, Unity, Unreal ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found