Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] GltfExporter correctly handles multiple mesh instances per entity #4683

Merged
merged 2 commits into from
Oct 3, 2022

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Sep 30, 2022

  • before, we would walk all mesh instances in a render component, and store their index as a mesh index of a node. The problem was that if there were multiple mesh instances, the index would get overwritten and only the last mesh would be assigned
  • this PR changes the way mesh instances are collected to collect them per node. And from all of these, a single gltf mesh is created, with each mesh instance forming a primitive.
  • this also makes export of model components working - as all mesh instances are attached to a root node, even though internally they store the node they need the transform from.

In the screenshot, both a sphere and a cone are added to a single render component, and both meshes are exported. Before, only the cone (second mesh) would be visible.
Screenshot 2022-09-30 at 14 08 36

@mvaligursky mvaligursky self-assigned this Sep 30, 2022
@mvaligursky mvaligursky added bug area: graphics Graphics related issue labels Sep 30, 2022
@mvaligursky mvaligursky mentioned this pull request Sep 30, 2022
7 tasks
Co-authored-by: Hermann Rolfes <lama12345@gmail.com>
@mvaligursky mvaligursky merged commit 5e714c7 into main Oct 3, 2022
@mvaligursky mvaligursky deleted the mvaligurslky-gltf-export-meshes branch October 3, 2022 08:40
mvaligursky added a commit that referenced this pull request Oct 6, 2022
…ty (#4683)

* [Fix] GltfExporter correctly handles multiple mesh instances per entity

* Update extras/exporters/gltf-exporter.js

Co-authored-by: Hermann Rolfes <lama12345@gmail.com>

Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
Co-authored-by: Hermann Rolfes <lama12345@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants