UnityGLTF icon indicating copy to clipboard operation
UnityGLTF copied to clipboard

How to Load Application Specific Data as well..

Open taharaza16 opened this issue 8 years ago • 5 comments

I have a gltf file in which a mesh primitive looks like this: "primitives": [ { "attributes":{ "BATCHID":"accBatch_0", "NORMAL":"accNormal_0", "POSITION":"accPosition_0" }, "indices":"accIndex_0", "material":"Material_0", "mode":4 }, ] where accBatch_0 for batch id refers to an accessor for accessing all the application specific ids of the vertices

however the library fails to load the file

taharaza16 avatar Aug 27 '18 08:08 taharaza16

First, a snippet above looks like glTF 1.0. Unity loader supports only 2.0. Moreover, BATCHID is not a valid attribute name: all app-specific attribute names must start with _, i.e. it should be _BATCHID.

lexaknyazev avatar Aug 27 '18 11:08 lexaknyazev

how about this??? "primitives": [ { "attributes": { "POSITION": 25, "_BATCHID": 0 }, "indices": 10, "material": 3, "mode": 1 } ]

This is from a gltf 2.0 that has a underscore as well. i cant get Unity to load the file... It also uses webquantized attributes. not sure whats causing the failure.. I can provide the complete gltf as well for testing if needed

taharaza16 avatar Aug 27 '18 12:08 taharaza16

It's hard to say what's causing the failure without seeing the complete asset (also, I'm not a developer of this particular plugin, so the reason might be somewhat Unity-specific). Anyway, could you please check the asset in the validator to ensure that it's valid glTF 2.0?

Btw, UnityGLTF certainly doesn't support quantized attributes extension.

lexaknyazev avatar Aug 27 '18 12:08 lexaknyazev

It isnt a valid GLTF but im expected to get it working anyhow... oh then its probably the quantized attributes. Thanks alot!!!

taharaza16 avatar Aug 28 '18 04:08 taharaza16

We don't support loading invalid glTF files. Metadata information should go in the extensions or extras field of your file.

ericob avatar Jan 04 '19 22:01 ericob