Skip to content

Commit 6364c01

Browse files
committed
fix error on glb with no logical materials
1 parent 86efc85 commit 6364c01

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Core/Helpers/GltfUtil.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ public static List<GltfEntry<T>> FromGltfModel<T>(ModelRoot model)
132132

133133
public static (Stream?, Stream?) ExtractCubemapStreams(ModelRoot model)
134134
{
135+
if (model.LogicalMaterials.Count < 1)
136+
{
137+
return default;
138+
}
139+
135140
var material = model.LogicalMaterials[0];
136141
var albedoChannel = material.FindChannel("BaseColor");
137142
var emissionChannel = material.FindChannel("Emissive");

0 commit comments

Comments
 (0)