prefrontalcortex / UnityGLTF

Runtime GLTF Loader for Unity3D
MIT License
163 stars 41 forks source link

Expose ExportMesh API using PrimKey array #55

Closed robertlong closed 2 years ago

robertlong commented 2 years ago

I'm implementing the OMI_collider extension as a UnityGLTF extension and I need to export the sharedMesh attached to a MeshCollider. In order to do so I need to be able to pass that shared mesh to the ExportMesh API. This PR changes ExportMesh and ExportPrimitive to operate on PrimKey instances instead of GameObject instances.

hybridherbst commented 2 years ago

Thanks! Do you have an example script to verify that the output is what you're expecting?

robertlong commented 2 years ago

Yup, here it is: https://gist.github.com/robertlong/8593b4f07dac350381892521ee273c36

I'll have the whole project open sourced as soon as I can figure out how best to package it separately from the rest of our assets.

hybridherbst commented 2 years ago

Merged and released in 1.12.0-pre