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

.glb import error #49

Open
kndol opened this issue Jun 1, 2020 · 10 comments
Open

.glb import error #49

kndol opened this issue Jun 1, 2020 · 10 comments

Comments

@kndol
Copy link

kndol commented Jun 1, 2020

When I try to import .glb file made by Tilt Brush, I meet an error:

Asset import failed, "Assets/glb/kbk.glb" > GlbError: bin length%4
TiltBrushToolkit.GlbParser.Err (System.String fmt, System.Object[] args) (at Assets/TiltBrush/Scripts/Gltf/GlbParser.cs:32)
TiltBrushToolkit.GlbParser.GetBinChunk (System.String glbPath) (at Assets/TiltBrush/Scripts/Gltf/GlbParser.cs:126)
TiltBrushToolkit.BufferedStreamLoader.Load (System.String uri) (at Assets/TiltBrush/Scripts/Gltf/IUriLoader.cs:126)
TiltBrushToolkit.Gltf2Root.Dereference (System.Boolean isGlb, TiltBrushToolkit.IUriLoader uriLoader) (at Assets/TiltBrush/Scripts/Gltf/Gltf2Schema.cs:103)
TiltBrushToolkit.ImportGltf.BeginImport (System.String gltfOrGlbPath, TiltBrushToolkit.IUriLoader uriLoader, TiltBrushToolkit.GltfImportOptions options) (at Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs:253)
TiltBrushToolkit.ImportGltf.Import (System.String gltfOrGlbPath, TiltBrushToolkit.IUriLoader uriLoader, TiltBrushToolkit.IImportMaterialCollector materialCollector, TiltBrushToolkit.GltfImportOptions options) (at Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs:166)
TiltBrushToolkit.Glb2Importer.OnImportAsset (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at Assets/TiltBrush/Scripts/Editor/Glb2Importer.cs:45)
UnityEditor.Experimental.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at /Users/builduser/buildslave/unity/build/Modules/AssetPipelineEditor/Public/ScriptedImporter.cs:22)

.glb file size is 1,523,711,658 bytes, and it cannot be divided by 4. I guess this problem is of the Tilt Brush app.

@dubois
Copy link
Contributor

dubois commented Jun 1, 2020

Have you seen it with other .tilt files besides this one? How big is the .tilt?

@kndol
Copy link
Author

kndol commented Jun 5, 2020

The size of .tlt file is 121,975,962 bytes.
Currently, only this file has the problem.

@ShamanUX
Copy link

ShamanUX commented Jun 9, 2021

I'm having the same problem. Did you find a solution?

@dubois
Copy link
Contributor

dubois commented Jul 7, 2021

It is very likely a problem in Tilt Brush, not the Tilt Brush Toolkit. Tilt Brush development has suspended, but I suggest logging a bug in https://github.com/icosa-gallery/open-brush

@n1ckfg
Copy link

n1ckfg commented Jul 7, 2021

I'd try just opening it in Open Brush first and see what happens--that's built in Unity 2019 instead of 2018, and I'd expect GLTF handling to improve for each major version

@dubois
Copy link
Contributor

dubois commented Jul 7, 2021

Good point to try it out first before reporting the bug!

Tilt Brush / Open Brush gltf export is homegrown. Well, mostly homegrown; it's originally based on some truly ancient Tony Parisi code. If the bug's now fixed, it'll be thanks to some kind Open Brush volunteer!

@Lesterpaintstheworld
Copy link

Same problem here on OpenBrush

@andybak
Copy link

andybak commented Dec 22, 2021

Quick potential workaround.

Comment out line 126 in Assets/TiltBrush/Scripts/Gltf/GlbParser.cs and reimport the asset.

// if ((binLength % 4) != 0) { Err("bin length%4"); }

@dubois
Copy link
Contributor

dubois commented Dec 22, 2021

This should be moved to a bug in OpenBrush. The bug is that TB/OB creates non-spec-compliant .glb files. Andy's workaround may not be a 100% fix, since there may be other issues with the glb data lurking around

@Gildas310
Copy link

Quick potential workaround.

Comment out line 126 in Assets/TiltBrush/Scripts/Gltf/GlbParser.cs and reimport the asset.

// if ((binLength % 4) != 0) { Err("bin length%4"); }

Hi Andybak, I am happy to see you again

your solution works for me in Unity URP 2020.3.33f1 with the tilt-brush-unitySDK-URP-AltSpace-alpha_v06.unitypackage

I just comment out, then restart the unity project

So thank you again !

My glb file weighs 99.2 Mo and it comes from Tilt Brush

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants