eugenebokhan / asset-import-kit

Swift framework for loading various 3d models in SceneKit
BSD 3-Clause "New" or "Revised" License
85 stars 23 forks source link

Mutliple UV Channels not read #5

Open BiohazardWTF opened 5 years ago

BiohazardWTF commented 5 years ago

Hi!

I've been trying to load an fbx with multiple UV channels, but had no success. After checking everything on the designer's side (export settings, etc) I've found the problem in AssetImportKit's side.

It seems that when creating SCNGeometrysources, in the makeTextureGeometrySource method, the code iterates all aiMesh.mTextureCoords but only looks for the first result, as seen here:

for aiMesh in aiMeshes {
    if let textureCoordinates = aiMesh.mTextureCoords.0 {
        //Process data
    }
}

The code should correctly process every channel provided by Assimp (8 max, AFAIK).

I hope this gets fixed soon! :D

eugenebokhan commented 5 years ago

@BiohazardWTF Please provide me the model you used.

BiohazardWTF commented 4 years ago

I don't have a model with multiple UV channels anymore :\ Any model with multiple UV channels from turbosquid or similar websites should do the trick. Anyway, I'll try to contact our designer to ask for a simple model. Thanks for your time @eugenebokhan :)