diff --git a/Assets/VRM10/Runtime/IO/Model/MeshImporterShared.cs b/Assets/VRM10/Runtime/IO/Model/MeshImporterShared.cs index 7db4f0737..76c8b6019 100644 --- a/Assets/VRM10/Runtime/IO/Model/MeshImporterShared.cs +++ b/Assets/VRM10/Runtime/IO/Model/MeshImporterShared.cs @@ -26,7 +26,18 @@ namespace UniVRM10 var positions = src.VertexBuffer.Positions.Bytes.Reinterpret(1); var normals = src.VertexBuffer.Normals?.Bytes.Reinterpret(1) ?? default; var texCoords = src.VertexBuffer.TexCoords?.Bytes.Reinterpret(1) ?? default; - var colors = src.VertexBuffer.Colors?.Bytes.Reinterpret(1) ?? default; + NativeArray colors = default; + if (src.VertexBuffer.Colors is BufferAccessor colorBuffer) + { + if (colorBuffer.ComponentType == AccessorValueType.FLOAT && colorBuffer.AccessorType == AccessorVectorType.VEC4) + { + colors = colorBuffer.Bytes.Reinterpret(1); + } + else + { + Debug.LogWarning($"COLOR_0: {colorBuffer.ComponentType}.{colorBuffer.AccessorType} not supported. skip."); + } + } var weights = src.VertexBuffer.Weights?.GetAsVector4Array() ?? default; var joints = src.VertexBuffer.Joints?.GetAsSkinJointsArray() ?? default;