Code Monkey home page Code Monkey logo

Comments (6)

dmsurti avatar dmsurti commented on June 27, 2024

@JakubKahovec I did not create any of these DAE files used in the example app; they come from various sources namely:

  • Files in assimp
  • Files from openframeworks
  • Files from apple examples

What platform are you using AssimpKit on? iOS or macOS.

Your issue could be related to the fact that AssimpKit assumes the texture files are placed along side the source file, the dae files in your case. See: https://github.com/dmsurti/AssimpKit/blob/master/AssimpKit/Code/Model/AssimpImporter.m#L595

So even if Blender puts aside the texture files, as long as you can place the dae file, texture files alongside in one directory, then AssimpKit should be able to read those fine. Otherwise, can you send me a sample of the DAE file which does not get imported with AssimpKit and I could look into it?

Thanks.

from assimpkit.

JakubKahovec avatar JakubKahovec commented on June 27, 2024

Thank you for your quick response. I'm using AssimpKit on iOS.
Table.zip
I'm attaching the exported files.

from assimpkit.

dmsurti avatar dmsurti commented on June 27, 2024

@JakubKahovec Thanks for the files. I will check it over the weekend and let you know.

from assimpkit.

dmsurti avatar dmsurti commented on June 27, 2024

@JakubKahovec AssimpKit fails with the following error:

2017-08-14 23:12:42.558685+0530 OSX-Example[20693:1606676] -[AssimpImporter importScene:postProcessFlags:] [Line 137]  Scene importing failed for filePath /Users/deepaksurti/Downloads/Table/Wood_Table.dae
2017-08-14 23:12:42.558711+0530 OSX-Example[20693:1606676] -[AssimpImporter importScene:postProcessFlags:] [Line 138]  Scene importing failed with error Collada: Unable to resolve effect texture entry "**table_Col_png-sampler**", ended up at ID "**table_Col_png**".

A quick look at your .dae file in a text editor refers to this:

            <diffuse>
              <texture texture="table_Col_png-sampler" texcoord="UVMap.001"/>
            </diffuse>

I think your diffuse texture may be missing when you export your asset from Blender. Sorry, but I don't have a detailed idea of how Collada exporter of Blender works, but check out their settings and ensure that whatever textures you have used in your blender scene are all exported.

--

By the way, I just checked with the SceneKit editor and a sample app, as SceneKit directly supports Collada and you don't need any other library TBH. SceneKit's collada importer is more lenient as it just renders the table without any textures applied, which shows that there is a problem with the way Blender has exported the dae file and the textures. AssimpKit (with assimp) is not so forgiving :-(

I have attached a sample SceneKit project for this asset
TableSceneKit.zip. Check out this screenshot.

screenshot 2017-08-14 23 24 57

Please try with a new export with the dae file and all textures in place, if you still need to use AssimpKit.

Hope this helps. Thanks :-)

from assimpkit.

JakubKahovec avatar JakubKahovec commented on June 27, 2024

@dmsurti thank you for such thorough analysis. I've concluded pretty much the same. When exporting though I tried several options but I was not able to export it in such a way it would work. I also tried other tools like Cinema 4D or SketchUp but with none of them I was able to export it so that it loadable with texturess in AssimpKit. Without textures it works pretty good, but the only models where textures work corretly are the ones which you have part of your iOS example. Do you have an experience with some tool which would export models into Collada DAE format and textures would load correctly with Assimkit ?

from assimpkit.

dmsurti avatar dmsurti commented on June 27, 2024

@JakubKahovec I found a .dae file with a 3D model of a wooden create and specular, diffuse and normal textures. I exported it from Blender with the following settings:

screenshot 2017-08-17 20 43 25

Note that I check the options to Include textures and also the Copy option, so that the texture files are copied to the destination where you place your exported .dae file.

Then I exported this model in AssimpKit and checked with both MacOS and iOS example viewers:

screenshot 2017-08-17 20 36 47

screenshot 2017-08-17 20 41 05

PS: The blend file I used for testing this is proprietary and hence I cannot share it, Sorry!

I hope the above instructions can help you further. So I would suggest you try exporting from Blender correctly and then if AssimpKit does not work, open this issue again. I am closing it for now.

from assimpkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.