-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove JSONLoader from core #15310
Remove JSONLoader from core #15310
Conversation
Lets see how many people bump into this... |
Thanks! |
@Mugen87 how about doing something like this: if ( "THREE" in window && "JSONLoader" in THREE ) {
// old code goes here
} So at least we can offer people this solution: <script src="../build/three.js" /></script>
<script src="js/loaders/deprecated/JSONLoader.js"></script>
He is busy writing a fantastic book 😍 |
I'm not sure about this. In general, I would prefer a hard cut and "force" people to use the better and future-proof geometry format. If we start introducing such fallbacks, we also have to do this for |
Here is some code users might want to use to convert const map = new Map();
function convertToBufferGeometry( object ) {
object.traverse( ( child ) => {
const geometry = child.geometry;
if ( geometry && geometry.isGeometry ) {
const uuid = geometry.uuid;
let bufferGeometry;
if ( map.has( uuid ) ) {
bufferGeometry = map.get( uuid );
} else {
bufferGeometry = new THREE.BufferGeometry().fromGeometry( geometry );
map.set( uuid, bufferGeometry );
}
child.geometry = bufferGeometry;
}
} );
} |
How about giving people some notice before forcing them to make the change? if ( "THREE" in window && "JSONLoader" in THREE ) {
// old code goes here
console.warn( 'After R105 the ObjectLoader will no longer be able to load geometries of type Geometry. Please update your code before then.' );
} |
Then you also have to do this for TBH, I vote against this. It is not hard to convert (at least static) models which rely on A more determined strategy will allow us to finally move forward with stuff like #11603 |
The difference with
In order to run that script they'll have to load the file first. Now they have no way of doing that unless they replace the whole |
Yes. You would have to do the conversion before you upgrade the library. |
But well, I'm feeling you prefer the fallback option. I'll add a PR 😇 |
This really sucks. I now have to COMPLETELY redo my workflow. Don't like being forced to do this. |
I know it sucks but we have to move away from
No one forces you to upgrade the library 😇 |
Hi, can you please explain the reason why Geometry loader is being deprecated? |
From a performance point of view So the loader was removed since the respective format is going to be deprecated. More information right here #15387 |
This PR does two things:
JSONLoader
from core. The loader is now located inexamples/js/loaders/deprecated/JSONLoader.js
.ObjectLoader
's dependency toJSONLoader
. This meanObjectLoader
is not able to load geometries of typeGeometry
anymore. Instead, an error is logged.