Skip to content

"Generate Lightmap UVs" does not expose options and does not override existing UV2 #871

@hybridherbst

Description

@hybridherbst

Describe the bug 💬

Follow-up to #668. Unity's ModelImporter replaces UV2 when "Generate Lightmap UVs" is selected in the importer, UnityGLTF currently just uses the underlying Unwrapping.GenerateSecondaryUVSet() method, which seems to simply do nothing when there's existing UVs, so we probably need to delete the existing UVs first.

Additionally, it's probably a good idea to expose the parameters that go into that method, same as the FBX importer.

Steps to reproduce 🔢

  1. Import file that has UV2
  2. Enable "Generate Lightmap UVs"
  3. Note no new UVs are generated, in contrast to Unity's model importer

Files to reproduce the issue ♻

See #668

Editor Version 🎲

2021.3

Render Pipeline and version

All

UnityGLTF Version

2.17.1

Operating System 👩‍💻

Windows, macOS, Linux

When does this problem happen?

  • Editor Import
  • Runtime Import
  • Editor Export
  • Runtime Export

Additional Info 📜

No response

Validations 🩹

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions