I am managing the creation of a 3D Asset library, with a delivery expectation of 5,000 models per pass, with several passes each from multiple model creation vendors. The works in progress are all in FBX format, with final delivery in binary gltf (glb) format.
I've been reading the gltf/glb format and I do not see any field where "user data" can be placed. I want to place a string in each glb model identifying the model in such a manner that the model's location in the storage file system and information placement in a database can be validated.
So far, I see everything we need for the 3D assets in the gltf format, but is there any field for user string information? I can easily imagine, of the tens of thousands of models in the final library, some being accidently placed in wrong directories by humans, and/or fat finger typing errors while entering a model's database information, and/or fat finger errors simply entering a filename.
I want a user data field for an identification string so the handling of model storage in the file system and info placement in a database can be automated using software operating off that user data field. Likewise, a user data field can be used to validate a model received is the model requested while developing, and can be used when walking every file of the storage directory hierarchy to validate the presence of every file in that hierarchy using something other than the filename.
CodePudding user response:
Each object in a glTF or GLB file has a .extras
property that can store arbitrary JSON content. For example, scene.extras
or asset.extras
would probably be natural places for the data you're describing.
3D libraries and game engines should then read that data and make it available to user applications. For example, the 3D library https://threejs.org/ puts the .extras
fields from the glTF file into its Object3D.userData
values.