10
$\begingroup$

What is the correct way to export meshes including textures etc for use in SceneKit of iOS 8 or even OS X? By the default options I can only export meshes - somehow I don't get textures to work. Also Preview in OS X has trouble opening anything output from Blender/COLLADA so far. Running OS X Mavericks.

For instance, the ship.dae that is included in a template SceneKit project in Xcode 6 has Y for up, whereas stuff exported from Blender has Z up. Maybe this causes errors in the Apple world? Also importing ship.dae then exporting it with default options gives likewise "bad" COLLADA output. I was doing a diff in the input ship.dae and the output one and the differences were rather many so I don't know where to start.

$\endgroup$
  • $\begingroup$ Have you tried to pass user data to SceneKit through the .dae file? I don't know whether it's possible, though, I'm just curious. $\endgroup$ – rraallvv Feb 24 '15 at 2:24
  • $\begingroup$ I haven't been doing any SceneKit or even Blender for a long time, but it seems like the USD format (Universal Scene Description) is the way forward - already supported in iOS 10. Unfortunately it seems like Blender does not support it, yet. $\endgroup$ – Jonny Jan 11 '17 at 8:31
  • $\begingroup$ press the export button and then done and it will work $\endgroup$ – mr.Bob Aug 14 '17 at 19:42
12
$\begingroup$

Until I can get a tutorial made I will give a couple pointers.

Solve Blender "z" up axis

  1. Create a folder on your desktop and give it an extension of ".scnassets"

  2. Put your collada(.dae) file along with any textures you will be using

  3. Drag the folder into your project and save as copy like usual.

  4. Click on your scnassets folder and you will see a checked box (if not check it) for converting to a "y" up axis.

Using textures with Blender collada

  1. Click on your collada(.dae) file inside your project in xcode.

  2. You should see your scene and on its left side a list of cameras, lights, materials, and such.

  3. Open the materials tab and click on one of your materials.

  4. On the right hand side in the inspection window click on the ball shaped icon to view the diffuse, specularity, and such of that one material.

  5. Click on the diffuse tab and when it opens you should have an option of colors and your textures within your project. Select the texture you used on your model within Blender. As long as you UV unwrapped them properly in blender they should apply instantly within your scene view.

NOTE
Blender will not export the texture for you. No need to check on that tab inside of the collada exporter window.

ANOTHER NOTE If you want to add to or delete something from your scnassets folder, navigate to your project folder to do so and not xcode. This took me a while to figure out so thought I would save everyone the trouble.

$\endgroup$
  • $\begingroup$ Thanks - the axis thing seems to have been set up already. Actually, the meshes' "up" were never incorrect. However when I set "diffuse" to the texture (I am using a texture for a floor), the floor appears to change to use the texture but it's very blurred so it basically just displays an extremely blurred out brown color - the original texture is a fine tatami mat. $\endgroup$ – Jonny Aug 1 '14 at 5:05
  • $\begingroup$ Another note: the template ship.dae has a meter specified as "0.01", whereas anything exported from Blender has "1". Maybe the scale is incorrect. $\endgroup$ – Jonny Aug 1 '14 at 5:21
  • $\begingroup$ Did you uv unwrap your floor in blender. Sounds like all of your vertices are stacked on top of each other and basically displaying the color of one spot of your texture. I haven't had any issues with scale. $\endgroup$ – FlippinFun Aug 1 '14 at 6:18
  • $\begingroup$ Ok you are probably right - I just started with Blender a few days ago and even though the preview within Blender displays the textures, I guess I will have to find out how to exactly do that part. Btw I followed this short tutorial on texturing in Blender: youtube.com/watch?v=Ix6_j-PMtSE Maybe you could include a short texturing part in your tutorial ;-)) I'll set your answer as right. $\endgroup$ – Jonny Aug 1 '14 at 7:08
  • $\begingroup$ Thanks and I will check that out. There are plenty of good tutorials on uv unwrapping on youtube also. $\endgroup$ – FlippinFun Aug 1 '14 at 7:40

protected by David Aug 14 '17 at 20:40

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.