I have an animation created in Cinema 4D (baked and everything) and the animation plays perfectly fine in the GLTF viewer https://gltf-viewer.donmccurdy.com/
and even in the GLTF preview extension is VSCode.
However when I try to load it using the THREE.GLTFLoader, I keep getting this error:
If I import this file in gltf-viewer, the file can be successfully loaded and the animation starts but I get an out-of-memory runtime error after a certain time. Consider to reduce the complexity of your geometry so it’s more suitable for an interactive 3D application. Right now, your file is 528 MB big. A bit too much I guess^^.
Great thanks, so I went ahead and reduced the size of the animation and upgraded to three@0.106.2. I am now running into this problem and have no idea what angle to tackle this from: the GLTF that I
am exporting (Cinema 4D settings) or the code itself.
Ah, didn’t see that. Thanks!
Is there the option to change the MeshStandardMaterial to another material and/or import materials from the .gltf file as well?
You can change the materials after loading the glTF asset. For this, you traverse through the loaded scene and freely change to different materials. E.g.
gltf.scene.traverse( function( child ) {
if ( child.isMesh ) child.material = otherMaterial; // change the material for all meshes in the scene
} );