UniVRM icon indicating copy to clipboard operation
UniVRM copied to clipboard

[UniGLTF] Data of disabled GameObjects still gets exported while being not visible

Open mttbrnnr opened this issue 3 years ago • 1 comments

I'm not sure if someone actually needs it to be like this. In this case consider this a Feature Request for an optional export setting to change the described behavior.

Environments (please complete the following information):

  • UniVRM version: 0.108.0
  • Unity version: Unity-2022.1.20
  • OS: Windows 10

Describe the bug

When exporting an object at runtime to GLTF/GLB, the exporter includes all the disabled data in all child transforms. Therefore there is a lot of unused and invisible data in the model file. By excluding this data, the model size could be reduced significantly in a lot of cases.

This can be reproduced by following these steps:

  1. Export a 3D model that is comprised of multiple GameObjects below the parent transform which is passed to the gltfExporter
  2. Check the size of the exported GLTF/GLB
  3. Take the same model and disable some of the child GameObjects with 3D data in the hierarchy before exporting
  4. Export the model
  5. Compare the new model to the previously exported one. The new model is correctly missing the elements from the disabled GameObjects but is still exactly the same size as the model with no disabled elements.

mttbrnnr avatar Dec 08 '22 16:12 mttbrnnr

GameObject を Export から除外する基準を確認する。

  • activeSelf じゃなくて activeInHierarchy にするべき?

ousttrue avatar Oct 17 '23 12:10 ousttrue