3

I am using a few DAE models in a SceneKit scene in my app. However, textures do not show up on the models in the application even though they are shown in Xcode. I am also using the textures that I include in the app's asset catalogue.

Here is the texture I applying to the diffuse channel of the model. I am dragging this to the model in Xcode to apply it, and Xcode shows the model with the texture in its model view.

Here is the texture I applying to the diffuse channel of the model.

And the model itself: https://www.dropbox.com/s/lzqkgoumu9yshcf/amalthea.dae?dl=0 The model was exported (in Blender) from this Blender file:
https://www.dropbox.com/s/kt3n9f2kn6w6cij/amalthea.blend?dl=0

I am loading the model into my scene as follows:

let scene = SCNScene(named: "amalthea.dae")

Anything obvious that I am overlooking?

Brandon Slaght
  • 1,025
  • 1
  • 12
  • 34

1 Answers1

5

Revised answer: After downloading the dae file.

The most likely cause is that your textures are not on a path that is reachable relative to the model location.

The texture reference in the dae file is:

 <init_from>Assets.xcassets/jupiter/amalthea/amaltheamap.imageset/amalthea.jpg</init_from>

I think it should be relative to model location. Try changing the texture reference in the dae (using any text editor) to just "amalthea.jpg". Then copy the jpg to same folder where the model is.

 <init_from>amalthea.jpg</init_from>

A more detailed discussion can be found here.

Community
  • 1
  • 1
sambro
  • 816
  • 5
  • 12
  • Unfortunately this approach doesn't work. I still get an untextured model. Are you getting this to work in a simple example application? – Brandon Slaght Mar 31 '17 at 23:07