function loadModel(url) {
return new Promise(res => { fbxLoader.load(url, res); })
}
//Function that is called after model is loaded where basic setup for model is done ( material, size etc.) and it's stored in the array
function storeLoadedModel(object, size, position, _mat) {
object.children[0].material = mat;
object.scale.set(1, 1, 1);
object.position.set(0,0,0);
models.push(object);
}
After this I want to instantiate bunch of same models with animation
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘clone’)
at Object.subclip (chunk-JKTWCPHD.js?v=e962c5f6:22666:27)
I cant figure out why it’s undefined, when I don’t use the clone(), it’s working fine and model loads fine. When i log the model I am getting the model, it’s a group with animations, material, children etc. All looks fine, but for whatever it’s undefined. It probably has something to do with the subclip?
import * as SkeletonUtils from ‘three/examples/jsm/utils/SkeletonUtils.js’;
Are you sure that SkeletonUtils is not defined? Reading the error, it complains about subclip, which I am using. It also specifies the error line to be on the subclip line
I am using fbx with defined subclips in 3ds max. The only way I was able to get it working in threejs from 3ds max was using fbx, so I have to use subclips.
So the SkeletonUtils probably is not able to clone it along with subclips it seems.
The only solution I was able to figure out so far was to load the same model multiple times instead of cloning it. That is of course bad, but is only solution for me right now.