Skip to content
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

GLTFLoader: Pass unknown extensions through as .userData #13703

Closed
donmccurdy opened this issue Mar 27, 2018 · 3 comments
Closed

GLTFLoader: Pass unknown extensions through as .userData #13703

donmccurdy opened this issue Mar 27, 2018 · 3 comments

Comments

@donmccurdy
Copy link
Collaborator

glTF 2.0 allows creation of custom extensions, which may be widely supported or specific to a single application. We won't implement all of these in THREE.GLTFLoader, but should provide enough flexibility for users to simple self-service extensions.

An easy place to start: when an object contains extensions not recognized by GLTFLoader, the extension JSON should be passed through verbatim as node.userData wherever possible. As examples, see EXT_animation_map and BLENDER_physics.

Related: #11682

@takahirox
Copy link
Collaborator

takahirox commented Mar 27, 2018

Good to enable users to handle extensions GLTFLoader can't recognize by themselves.

One concern. Sometimes or often parameters in extension can have references to meshes, textures, accessors, so on. So will we return all parsed data to users?

@donmccurdy
Copy link
Collaborator Author

donmccurdy commented Mar 27, 2018

Maybe... In cases like Draco it is very risk to request buffers before they have been used by a known object in the scene. I think we could start by just returning the JSON.

But later on to support extensions that depend on buffers or meshes, maybe we do this:

loader.load('foo.gltf', (gltf) => {
  var scene = gltf.scene;
  var fooExtension = scene.extensions.EXT_foo;;
  var fooBuffer = await gltf.parser.getDependency( 'bufferView', fooExtension.bufferView );
});

@takahirox
Copy link
Collaborator

I think we could start by just returning the JSON.

I haven't seen the links above but some extensions can be handled if we just return JSON? If so, yeah it'd be good start.

@mrdoob mrdoob added this to the rXX milestone Mar 29, 2018
@mrdoob mrdoob removed this from the rXXX milestone Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants