In my project I use three in react (0.98) to render some json exported by blender 2.76 in order to produce images that I can modify with images in order on top of that to save the images and show them.
The entire process is called mockuprenderer.
Everything worked fine till the day that three js doesnt use anymore the objectloader and replace it with LegacyJSONloader. Unfortunately my problem is that there are no types relative to this loader and I need them because the project is written in typescript.
Do you have some solution for that?
That’s is not entirely correct. THREE.ObjectLoader is still available and you can use it to load JSON in the Object/Scene format. THREE.JSONLoader was removed with R99 from the core. It is now THREE.LegacyJSONLoader and part of the examples.
The problem is that you work with an exporter which was removed from the project almost a year ago. Because of this, you still need to work with THREE.LegacyJSONLoader. Have you considered to switch to a glTF based workflow instead?
I don’t think there will be type definitions for deprecated classes from the official side. You might want to use the following type definitions from another project. However, a few methods are missing (.setPath(), .setResourcePath() and .setCrossOrigin()).
Hi Mugen87 thanks for the answer, you re totally right. It’s just that now redo all the project basing the thing on gtlf files is a little bit crazy. I have to review the entire project. so you think three js will not provide types in the future for LegacyJSONloader and because of this I should pass to gltf ?
hello i am working with legacyJSONLoader and when i write this line of code <‘import * as THREE from’ https://threejs.org/build/three.module.js’ this error appears "Uncaught TypeError: THREE.LegacyJSONLoader is not a constructor " any suggestion please
gym-ceiling.js has 256 different materials. You have to change the color property of all materials to see the effect that you want.
BTW: This type of model design is highly inefficient especially since all 256 material seems to have the same properties. I suggest you import the glb file into Blender, merge all parts of the geometry into a single entity, adjust the color and then export to glb again.