Skip to content

GLTFExporter reorders children in groups. #15561

@MykhailoShavlovskyi

Description

@MykhailoShavlovskyi
Description of the problem

When exporting a model via GLTFExporter, it reorders children in groups (it places groups first and than meshes). For example if my object children structure is [mesh, mesh, group, mesh], the exported object structure will be [group, mesh, mesh, mesh].

Model before export (download here) has a group somewhere in hierarchy
2019-01-11 14_38_04-window

After the export group is placed in the beginning of hierarchy
2019-01-11 14_38_25-window

This behavior is unwanted, as I'm assigning materials based on child index. Would it be possible to adjust the GLTFExporter so it keeps the original hierarchy, in the way that importing and exporting the same model would result in the exact same data?

Three.js version
  • 98
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions