Skip to content

Commit

Permalink
fix: index discrepancy between _exportedMaterials and _root.Materials…
Browse files Browse the repository at this point in the history
… lead to wrong texture indices being returned in some cases
  • Loading branch information
hybridherbst committed Dec 14, 2022
1 parent 1bd6459 commit 85baf66
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ private MaterialId CreateAndAddMaterialId(Material materialObj, GLTFMaterial mat
{
var key = materialObj ? materialObj.GetInstanceID() : 0;
if(!_exportedMaterials.ContainsKey(key))
_exportedMaterials.Add(key, _exportedMaterials.Count);
else
_exportedMaterials[key] = _exportedMaterials.Count; // should the count be incremented here?
_exportedMaterials.Add(key, _root.Materials.Count);

var id = new MaterialId
{
Expand Down

0 comments on commit 85baf66

Please sign in to comment.