Skip to content

Commit

Permalink
Support reading .glb files in Models/
Browse files Browse the repository at this point in the history
A change from TB

Change-Id: Id000b01590f5d0a2edbb64bbb68a5d30a6c83ede
  • Loading branch information
dubois committed Feb 6, 2020
1 parent 825aeab commit 93e7a6b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions UnitySDK/Assets/TiltBrush/Scripts/Gltf/GlbParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ public static Range GetBinChunk(string glbPath) {
}
}
}

// Returns null if this doesn't look like a glb
public static uint? GetGlbVersion(string glbPath) {
using (BinaryReader reader = new BinaryReader(File.OpenRead(glbPath))) {
if (reader.ReadUInt32() != kFourCC_glTF) {
return null;
}
return reader.ReadUInt32();
}
}
}

}

0 comments on commit 93e7a6b

Please sign in to comment.