AwesomesauceLabs / piglet-viewer

Demo viewer app for Piglet glTF Importer
MIT License
6 stars 4 forks source link

Cannot import gltf files accompanied with textures #2

Closed ethvedbitdesjan closed 3 years ago

ethvedbitdesjan commented 3 years ago

I am using the unity package and not the demo. I had an issue with the package so I thought I could talk about it here.

I am trying to import .gltf files into unity runtime however when I import the files that are accompanied by textures, I get the following error: ArgumentNullException: Value cannot be null. Parameter name: source System.Linq.Enumerable.Take[TSource] (System.Collections.Generic.IEnumerable1[T] source, System.Int32 count) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) Piglet.TextureUtil.IsKtx2Data (System.Byte[] data) (at Assets/Piglet/Scripts/Util/TextureUtil.cs:46) Piglet.TextureUtil+<ReadTextureEnum>d__5.MoveNext () (at Assets/Piglet/Scripts/Util/TextureUtil.cs:266) Piglet.TextureUtil+<ReadTextureEnum>d__4.MoveNext () (at Assets/Piglet/Scripts/Util/TextureUtil.cs:232) Piglet.GltfImporter+<LoadTexture>d__17.MoveNext () (at Assets/Piglet/Scripts/Importer/GltfImporter.cs:519) Piglet.GltfImporter+<LoadImage>d__18.MoveNext () (at Assets/Piglet/Scripts/Importer/GltfImporter.cs:594) Piglet.GltfImporter+<LoadTexture>d__22.MoveNext () (at Assets/Piglet/Scripts/Importer/GltfImporter.cs:775) Piglet.InterleavedTaskSet1[T].MoveNext () (at Assets/Piglet/Scripts/Util/InterleavedTaskSet.cs:89) Piglet.GltfImporter+<LoadTextures>d__19.MoveNext () (at Assets/Piglet/Scripts/Importer/GltfImporter.cs:681) Piglet.GltfImportTask.MoveNext () (at Assets/Piglet/Scripts/Importer/GltfImportTask.cs:267) RuntimeImportBehaviour.Update () (at Assets/Piglet/Examples/RuntimeImport/Scripts/RuntimeImportBehaviour.cs:80)

Could someone help me understand what the problem is.

Thank you for your help in advance.

AwesomesauceLabs commented 3 years ago

Hi @ethvedbitdesjan!

It looks like Piglet is not able the image files (e.g. PNG or JPG files) referenced by your glTF file.

But I am only guessing. Can you share your glTF file with me (and any associated .png/.jpg/.bin files), so that I can identify the problem with certainty?

If you want, you can email the files to awesomesaucelabs at gmail. (I will keep them private, of course.)

ethvedbitdesjan commented 3 years ago

Hi @AwesomesauceLabs I have emailed you the .zip file I use.

AwesomesauceLabs commented 3 years ago

Hi @ethvedbitdesjan,

I did not receive the email. Can you try again? My email address is awesomesaucelabs@gmail.com.

AwesomesauceLabs commented 3 years ago

Closing this issue because @ethvedbitdesjan found his own solution.

I was not able to reproduce the issue in Piglet 1.3.2, and it turned out that @ethvedbitdesjan was using on older version (Piglet 1.2.0).