Skip to content
This repository has been archived by the owner on Jun 24, 2019. It is now read-only.

Commit

Permalink
Poly Toolkit for Unity v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
anokta committed Jul 16, 2018
1 parent 143b2b7 commit 13854da
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Assets/PolyToolkit/Internal/ImportGltf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,14 @@ static List<MeshPrecursor> CreateMeshPrecursorsFromPrimitive(ImportState state,

BrushDescriptor desc = GltfMaterialConverter.LookupBrushDescriptor(prim.MaterialPtr);

if (desc != null) {
if (desc.m_bFbxExportNormalAsTexcoord1) {
// make the gltf look like what the fbx shaders expect
// normals moved to texcoord1
prim.ReplaceAttribute("NORMAL", "TEXCOORD_1");
}
}

ushort[] triangles; {
GltfAccessorBase accessor = prim.IndicesPtr;
IntRange range = new IntRange { max = accessor.count };
Expand All @@ -736,14 +744,6 @@ static List<MeshPrecursor> CreateMeshPrecursorsFromPrimitive(ImportState state,
var subset = readonlySubset;
subset.vertices.min -= (subset.vertices.min % 4);

if (desc != null) {
if (desc.m_bFbxExportNormalAsTexcoord1) {
// make the gltf look like what the fbx shaders expect
// normals moved to texcoord1
prim.ReplaceAttribute("NORMAL", "TEXCOORD_1");
}
}

// Vertex data
HashSet<string> attributeNames = prim.GetAttributeNames();
foreach (var semantic in attributeNames) {
Expand Down

0 comments on commit 13854da

Please sign in to comment.