Latest FBXLoader giving a TypeError on loading a model

FBX Model Version 7400
TEST2.fbx (2.1 MB)
text_alpha text_glow texture

Error:
TypeError: child.material.clone is not a function
at Three.es.js:60764
at Mesh.traverse (Three.es.js:3918)
at Group.traverse (Three.es.js:3924)
at FBXTreeParser.setupMorphMaterials (Three.es.js:60742)
at FBXTreeParser.parseScene (Three.es.js:60174)
at FBXTreeParser.parse (Three.es.js:59479)
at FBXLoader.parse (Three.es.js:59452)
at Object.onLoad (Three.es.js:59398)
at XMLHttpRequest. (Three.es.js:21917)
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)

The model mentioned above gives the above Type Error. This happens only with the latest version of FBXLoader. It works fine with the earlier loader.

Can you also share text_alpha.jpg? In any event, the model seems to load fine with the latest version of FBXLoader (R98):

result

text_alpha

Now all errors are gone and still the model renders just fine. I think you have to demonstrate the problem with a live example.

You were right, it was working. But when I use it as an NPM module in angular project then this error pops up.

Most three.js related npm modules are not maintain by the core development team. The best thing you can do is to grab the latest version of the loader and transform it into a module by yourself (which is actually not complicated). There might be a better solution in the future though. For now, it’s more reliable to stick to the source files of the official repo.

2 Likes

ok thanks for helping me