question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Editor Import] Projects without Library folder will fail to import previously imported glTFs

See original GitHub issue

Describe the bug Opening a pre-existing project, which doesn’t have it’s Library folder already present, will fail to import previously imported glTFs. This use case occurs due to CI pipelines on GitHub starting with the fresh clone of a project, with no library file, though is reproducible by manually wiping your Library folder. Error seems to be coming from a NRE, GltfImporter.cs:123 when attempting to add a material:

                for (var i = 0; i < m_Gltf.materialCount; i++) {
                    var mat = m_Gltf.GetMaterial(i);
                    AddObjectToAsset(ctx, $"materials/{mat.name}", mat);
                }

Files

Attach or link to .gltf/.glb files that trigger the bug. Should work with any gltf/glb, but here: rounded_cube_test.zip

To Reproduce Steps to reproduce the behavior:

  • Add any glTF to a Unity Project through the editor
  • It will import successfully
  • Close the project
  • Delete Library folder
  • Re-open the project
  • Note errors in console (see screenshot) and glTF has not imported.

Expected behavior The glTF imports sucessfully.

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

  • glTFast version: Tested on 4.0.0, 4.5.0
  • Unity Editor version: 2020.3.14f1, 2020.3.26f1
  • Render Pipeline: Universal Render Pipeline 10.5.1 (on .14f1)
  • Platform: Windows, Linux CI

Additional context Originally filed at: https://github.com/atteneder/DracoUnity/issues/39

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
hybridherbstcommented, Feb 17, 2022

Ah right, famous AssetDB order inconsistencies 😃

Fwiw, we started replacing almost all asset loading that has to happen with calls to AssetDatabase.LoadAssetAtPath<T>(AssetDatabase.GUIDToAssetPath("84743587345873458947539")) with GUID-based references since it seems everything involving “find”/“searcher” services (Shader.Find, AssetDatabase.Find) are not deterministically available.

1reaction
mikeskydevcommented, Feb 22, 2022

Thanks for this fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Draco compressed glTF import fails on headless pipeline #39
Hi, I'm using glTFast and DracoUnity in a GitHub Actions pipeline, with draco compressed GLBs. The files are imported into the project ......
Read more >
[Solved] ERROR Libraries that could not be imported
When importing libraries (i.e. BLynk) it gives errors on some libraries. Example. LIBRARIES THAT COULD NOT BE IMPORTED: [BlynkESP8266_Lib]
Read more >
Photos showing in imports but not in Library.
My usual workflow is to import photos from an SD card, edit specific ones, save them to my desktop, and then import the...
Read more >
[RELEASED] Piglet: glTF Importer
Piglet can import glTF models into your Unity project, either in the Editor by drag-and-drop, or at runtime via a simple API.
Read more >
Some projects cannot be imported because they already ...
Uncheck the "copy projects into workspace" checkbox, and then click "refresh" button, you will be able to import the project.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found