diff --git a/Assets/PolyToolkit/Internal/ImportGltf.cs b/Assets/PolyToolkit/Internal/ImportGltf.cs index 4da7bf3..a087b12 100644 --- a/Assets/PolyToolkit/Internal/ImportGltf.cs +++ b/Assets/PolyToolkit/Internal/ImportGltf.cs @@ -716,6 +716,14 @@ static List 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 }; @@ -736,14 +744,6 @@ static List 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 attributeNames = prim.GetAttributeNames(); foreach (var semantic in attributeNames) {