KhronosGroup / glTF

glTF – Runtime 3D Asset Delivery
Other
7.2k stars 1.14k forks source link

Unique Object ID #1713

Open elpie89 opened 5 years ago

elpie89 commented 5 years ago

Hi all, as discussed on Babylon Exporter GitHub we have a situation where many objects across differents GLTF files are sharing animations. Also, we are working with files that contain more than 5000 nodes and artists are struggling with a pipeline where the moment a single keyframe is changed the entire scene must be re-exported.

We implemented this solution, proposed by @Selmar on #1448. Adding a unique identifier to every node and animation channels target. This way we can eventually split the animation from the model and, on the engine side, we can blend data coming from different GLTF files.

As we would like to share this extension to BabylonExporter we are discussing on the way the specification should be implemented We wonder if the uniqueness of the object should be an isolated extension, were eventually, some other extensions can be built on top of that.

What do you think about this? should we have a UniqueIdentifierExtension that will end up with something like this?


    {
      "skin": 0,
      "mesh": 0,
      "translation": [
        0.0,
        -0.0287759788,
        -0.0076726065
      ],
      "name": "L_Shoulder_JNT",
      "extensions": {
        "ASOBO_unique_id": {
          "id": "shoulder"
        }
      }
    },```
Drigax commented 4 years ago

Very clean and simple, this does look like a good way to implement a skeletal "interface" or any other cross scene problem involving nodes of a given application specific type.

SFSimDev commented 3 years ago

Sorry to bring up an old post but..

@elpie89 I know this sounds wrong, but is the ASOBO_unique_id actually a common name that the engine uses to merge the models? e.g.

in arm.gltf

_"name": "arm", "extensions": { "ASOBO_uniqueid": { "id": "body" }

in leg.gltf

_"name": "leg", "extensions": { "ASOBO_uniqueid": { "id": "body" }

? I'm having trouble getting the objects merging. My XML is referencing them correctly.

I have tried to use an ASOBO_unique_id such as 'leg' and 'arm' and let the model.xml do the joining but that doesn't seem to work either so I'm getting desperate :|

Thanks for any help you can provide.

Selmar commented 3 years ago

@SFSimDev answered here

javagl commented 1 year ago

This is currently being discussed again in https://github.com/KhronosGroup/glTF/issues/2337 , just in case that people want to chime in with information about the ASOBO_unique_id extension, or their experiences while implementing it.

aaronfranke commented 10 months ago

The example JSON in the OP is confusing to me. The object appears to be the left shoulder joint based on the name, but it has a unique ID of "shoulder". This makes me wonder what the right shoulder's unique ID would be. If it's also "shoulder", then the ID is not unique. If it's "Right shoulder" or similar, then why isn't the left one called "Left shoulder"?