Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Textures only appear in OBJ models #29

Open
jjewett-ares opened this issue Jan 20, 2021 · 11 comments
Open

Textures only appear in OBJ models #29

jjewett-ares opened this issue Jan 20, 2021 · 11 comments

Comments

@jjewett-ares
Copy link

jjewett-ares commented Jan 20, 2021

So far my texture list in an AiScene remains empty for FBX and DAE (1.4.1) formats. OBJ does seem to read the texture file names correctly. I've verified that the models do contain textures that come in alright in the assimpviewer application. I've had my artist export the same model through a variety of applications and formats and the end result is the same. Are textured materials only supported through OBJ models in the Kotlin port currently? I've attached a zip of the model in various formats I've been using for testing. Thanks.
JoshTest.zip

@xfeng609
Copy link

xfeng609 commented Mar 9, 2021

Is there any update on this issues. I tried to load .DAE file into my engine, and the texture reference is missing in the AIMesh. However, after examine the .DAE file, it was determine that there were image library refereed in the file.

@elect86
Copy link
Collaborator

elect86 commented Mar 9, 2021

I'll tale a look in the next days/weeks, but if you want to create a test scenario for that, I can help you settings that up

@afrankel7861
Copy link
Collaborator

afrankel7861 commented May 10, 2021

Giuseppe,
I am a compatriot of jjewett-ares trying to investigate using Kotlin Assimp for geometry IO in our Java/NetBeans environment. Is there anything I can do to make this issue easier for you to investigate the problem with Assimp reading textures in Collada data?
On the other side, can you offer advice on getting started. I have gotten IDEA to build Assimp into an assimp-all.jar, but it does not include all the extras included in that asset from the 4.0 beta 17 release.

@elect86
Copy link
Collaborator

elect86 commented May 11, 2021

Sure, clone the project, add the problematic meshes under test/resources and append additional test under the corresponding already existing tests.

Are you familiar with C? Could you test the native assimp?

@afrankel7861
Copy link
Collaborator

Yes, I am fine with C, and will try the native assimp forthwith.

Up to now, we've focused on the Kotlin assimp becaues our project is in Java under NetBeans. Working with the unfamiliar IntelliJ IDEA has been only marginally successful, compiling the assimp .kt sources but not yet building assimp-all.jar or running the existing tests. That's what I was asking for pointers on getting started about.

@elect86
Copy link
Collaborator

elect86 commented May 13, 2021

Is the project public? Are you using any building tool, such as Gradle or Maven?

@afrankel7861
Copy link
Collaborator

Unfortunately, our project is proprietary, written in Java and built under NetBeans. I am looking to Assimp as an alternate geometry IO facility to be more flexible (more than just Collada) and more portable (Linux as well as Windows).
If I can get Assimp building and testing with whatever open toolchain is convenient, It should be easy to demonstrate reading a simple Collada file and showing the AiScene containing the geometry but not the textures. I've tried various combinations of IDEA, gradle, & cmake, of C++ & Kotlin Assimp, and of Windows+Cygwin & Ubuntu. The failures seem likely due to my unfamiliarity with those environments, so I keep trying. Any advice would be welcome.

@afrankel7861
Copy link
Collaborator

I now have gradle and IntelliJ IDEA working on a git clone of //github.com/kotlin-graphics/assimp
Command line 'gradle build' constructs an assimp-all.jar with only the .class files compiled from the kotlin source, but I finally tumbled to 'gradle shadowJar', which adds in all the extras. And IDEA provides viewing and editing the kotlin source, with many of the details comfortable because similat to NetBeans. I do not yet know how to get IDEA to build the shadowJar, but even this much allows NetBeans debugging in the Java portions and print statement debugging in the kotlin assimp code.

Next, I hope to prepare a sample that illustrates the failure to pick up texture information from a minimal Collada test model, and which demonstrably does not threaten any security concerns. The problem is visible immediately in the AiScene returned by importer.readFile("MyModel.dae"). So it could be a really simple main() in either Java or Kotlin or an adaptation of an existing Kotlin Assimp unit test. The getting-started documents I've found on the Net have all been either ridiculously simple and incomplete, aimed at demonstrating Kotlin's superiority, or else have assumed a general familiarity with IDEA and Gradle that I just don't yet have. Can you recommend something?

@elect86
Copy link
Collaborator

elect86 commented May 14, 2021

I appreciate your efforts and I'll try to not let you down

I added both floor.dae and floor.fbx meshes under test/resources and I wrote the first sketch for testing the collada version

I created a little gif in order to show you how you should execute and debug it

Let me know if there are any other issues

@afrankel7861
Copy link
Collaborator

Thanks for that boost. I can now run testLoad.kt under IDEA and thereby try out Kotlin Assimp on various models. Your animated gif seems to show a GUI Gradle, which I have not yet been successful in installing. I do have a command line Gradle working, and have found that 'gradle shadlowJar' is the task that rebuilds the assimp-all.jar we are trying to call from Java. But do not yet know how to get gradle to execute a program.

Since our immediate target is Collada, I have been woring through src/test/resources/models, looking for models that seem to have textures textures. Many say "Assimp could not find an importer for the file!" Some do find an importer but report that something is wrong with the model. Some do find an importer but throw an exception while loading the model. Some return an AiScene object and report how many of this and that it has and what size meshes it has. Only a few of those report having a texture, and several of those reporting 0 textures do appear to actually have them (from looking at the src model file).

That is working with a clone of https://github.com/kotlin-graphics/assimp. Is there a list of which model formats are fully or partially operational?

jjewett-ares reports better success with assimp-view, but that seems to have been dropped at an earlier release. A clone of https://github.com/assimp/assimp.git lists tags from recent (5.0.1) back through 3.1, and that assimp-view seems to have come from some 3.X. Can you offer any guidance about whether I should pursue the C++ or Kotlin version of Assimp? Will I need to jump in as a collaborator to help speed completion of the aspects we need, of is it all mostly working and I'm just not doing things right?

@elect86
Copy link
Collaborator

elect86 commented May 18, 2021

Thanks for that boost. I can now run testLoad.kt under IDEA and thereby try out Kotlin Assimp on various models. Your animated gif seems to show a GUI Gradle, which I have not yet been successful in installing. I do have a command line Gradle working, and have found that 'gradle shadlowJar' is the task that rebuilds the assimp-all.jar we are trying to call from Java. But do not yet know how to get gradle to execute a program.

Something is wrong then, you should be sure that the project gets imported via Gradle in Idea. The first time you clone, it should happen automatically. But if it doesn't then try to stimulate Idea to pick it up by opening in the editor build.gradle.kts, Idea should show you a popup suggesting to import it via Gradle. If this still fails, close the project and reopen it by explicitly pointing it to the just mentioned file (try deleting .idea folder if it doesn't work)

Since our immediate target is Collada, I have been woring through src/test/resources/models, looking for models that seem to have textures textures. Many say "Assimp could not find an importer for the file!" Some do find an importer but report that something is wrong with the model. Some do find an importer but throw an exception while loading the model. Some return an AiScene object and report how many of this and that it has and what size meshes it has. Only a few of those report having a texture, and several of those reporting 0 textures do appear to actually have them (from looking at the src model file).

Sorry, but who/what are "Many"?

That is working with a clone of https://github.com/kotlin-graphics/assimp. Is there a list of which model formats are fully or partially operational?

You can have an overview here

jjewett-ares reports better success with assimp-view, but that seems to have been dropped at an earlier release. A clone of https://github.com/assimp/assimp.git lists tags from recent (5.0.1) back through 3.1, and that assimp-view seems to have come from some 3.X. Can you offer any guidance about whether I should pursue the C++ or Kotlin version of Assimp? Will I need to jump in as a collaborator to help speed completion of the aspects we need, of is it all mostly working and I'm just not doing things right?

It's quite hard to say anything without knowing better what you are up to, if you want we may have a chat/websession (elect86 at gmail)

If your project is actually on Java, it makes sense to use a pure jvm library since you can dig into that and modify/fix as you please

I've been starting working on it as an hobby, and lately I've been using it for work as well and its features were enough for what I needed at my old job. I'll get back at it sooner or later for my new job, but my time is limited.
Unfortunately I couldn't dedicate it so much time as I wished, but this is an Open Source Project and I'm totally open to contributions, so you can jump right in and start modifying the code yourself to finish what you need

I'll send you an invite right now :)

Ps: I might send one to @jjewett-ares as well, if you/he wish/es

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants