google / google/model-viewer

Expose GLTFInstance.userData in the API

Open
#4,821 1 comment 3 reactions 0 assignees View on GitHub
type: feature
Dominant language
TypeScript
Stars
8.2k
Forks
947
PR merge metrics
No merged PRs in 30d

Description

### Description

It would be useful to have access to custom data embedded in the GLTF file. ThreeJS appears to save this in a [`userData`](https://threejs.org/docs/#api/en/core/Object3D.userData) property, which is already being used in this project for the variant logic. My client uses \ to show models that change appearance based on some user input. The `userData` could be utlized to store information on how the user input needs to be processed for a particular model or material. Another use-case might be to store the annotation data right in the GLTF file.

I would be happy to implement this if this is something that is deemed in-scope for this project.

### Version

- model-viewer: v3.5.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.