I followed the examples of the animations very closely but my animations wont play. when looking into the data, the time of my animationAction is NaN. Since I’m doing the same thing as on the example, and I’m using the same version of threejs; I’m unsure where the issue might be.
I don’t see this NaN value in my console. One obvious error happens at another place:
You are overwriting the materials of the loaded FBX file with a custom one which is not prepared for skinning. I suggest you remove these lines for now and use the material provided by the loader. Besides, try to work with the latest FBXLoader from the repo. You are using a npm package which is not based on the latest FBXLoader.
Thanks, I’m guessing I have to get it from /examples/js/loaders/FbxLoader.js?
I tried a couple things but since this module is written as a closure, I’m not sure if I’ll be able to do it this way without poluting the global space with THREE. Is this what you are suggesting, or is there a better way to do this?
Do you mean copying the file to my own codebase? I was trying to avoid that and do it via es6 imports or require.
if the closure would be written as (function .. )(THREE), you could do something like const loader = require('FbxLoader')(THREE) and use the existing codebase (and stay up to date)
It’s a pretty old version of the loader but the changes you’ll need to make are the same on the latest version. It’s works as an ES6 module. I’ve never used the require syntax so don’t know if it will work that way.
Do you mean copying the file to my own codebase?
Yes, there is currently no easy way around that, that I know of - unless you are using Webpack, then you could try some of the scripts people have shared on this thread: