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

GLTFInstantiator mutates input data #1762

Open
3 tasks
Pessimistress opened this issue Jul 8, 2023 · 1 comment
Open
3 tasks

GLTFInstantiator mutates input data #1762

Pessimistress opened this issue Jul 8, 2023 · 1 comment
Labels
Milestone

Comments

@Pessimistress
Copy link
Collaborator

Actual Result

GLTFInstantiator.instantiate adds _node and _mesh fields to node and mesh:

// TODO: avoid changing the gltf
if (!gltfMesh._mesh) {

This prevents the gltf object from being used to create another instance, and there is no easy way to undo this change.

Expected Result

Input object should not be mutated.

Reproduce Steps

visgl/deck.gl#7950

To Do List

  • Add label and assign to milestone
  • Coding
  • Test
@ibgreen
Copy link
Collaborator

ibgreen commented Jul 8, 2023

I suppose a quick fix for 8.5 would be to deep clone everything (except arraybuffers) before instantiating.

That is probabely appropriate since for 9.0 the gltf instantiation needs to be refactored quite extensively.

@ibgreen ibgreen added this to the 8.5.6 milestone Jul 8, 2023
@ibgreen ibgreen added the bug label Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants