Reference to the link : https://github.com/mrdoob/three.js/issues/13385#issuecomment-367633829
The .fbx file is fine & Im using the sample code but still fbx is not working form me in chrome!?
Thanks,
Navan.
Reference to the link : https://github.com/mrdoob/three.js/issues/13385#issuecomment-367633829
The .fbx file is fine & Im using the sample code but still fbx is not working form me in chrome!?
Thanks,
Navan.
@nnavaneetha the example code works in its own demo, so there is something about your situation that is different… For us to help you with this question, can you provide a demo? Ideally in Codepen or Neocities or something live, or a ZIP if that’s not possible? Any errors in the JS console? If I drag the file into https://threejs.org/editor/ it works as well. The example you link to uses a very large model, and yours is 1000x smaller; you may just need to scale things appropriately.
Thanks for the reply
Sure,please find the attached code & the respective fbx file
FBX file :
https://github.com/mrdoob/three.js/files/1743816/Busway.3DView-Preview.zip
Source code :
https://github.com/mrdoob/three.js/files/1755830/webgl_loader_fbx.zip
Thanks,
Hi ,
Im using the sample code from ‘webgl_loader_fbx’ from three.js with my own fbx file ,attached in the above reference.
Other sample fbx file are working fine from my local!
Thanks,
Navan.
It’s worth knowing three.js loaders have both an onLoad
callback and an onError
callback. Because this example doesn’t include any error callback, errors aren’t printed and (as you’ve discovered) it’s much harder to find out why something doesn’t work. You can add it as follows:
loader.load( 'my_model.fbx', function (object) {
// ... add object as usual
}, undefined, function (error) {
console.error(error);
} );
Once you add that, the error is pretty easy to spot in the JS console:
TypeError: clipObject is undefined
Stack trace:
clipAction@http://localhost:8080/build/three.js:41230:5
init/<@http://localhost:8080/examples/webgl_loader_fbx.html:110:19
load/<@http://localhost:8080/examples/js/loaders/FBXLoader.js:54:6
load/<@http://localhost:8080/build/three.js:30583:31
webgl_loader_fbx.html:129:6
in short, that means you just need to remove the lines about animation mixers and clip.play()
, because your model has no animation. It also helps to remove the floor, since it’s the same color as the model.
Thanks. You’ve just made my day
Appreciate your quick turn around time.
We previously had a conditional statement around the animation code in the example. Since people use it as a starting point, and this is an easy thing to be confused about, perhaps we should add that back?
Or including the onError
callback maybe. The GLTFLoader example should probably do the same…
Or perhaps both
Personally I found the if statement around animation code great for quickly testing lots of models.
But yeah, we should definitely at least be including the onError
callback.