kotlin-graphics / assimp

JVM Open Asset Import Library (Assimp)
Other
95 stars 28 forks source link

loading spider.fbx gives numMeshes = 0? #23

Closed maali82 closed 5 years ago

maali82 commented 5 years ago

hi, good initiative to wrap assimp for kotlin!

I implemented 'com.github.kotlin-graphics:assimp:v4.0-beta15' (also tried it with beta14) and did a val scene = Importer().readFile("spider.fbx") followed by println("scene has ${scene!!.numMeshes} meshes") yet, that returns 0... hence it also does not load any vertex data in further loading stages as I assume you loop with numMeshes to create each AiMesh. It does seem to count numLights and numCameras correctly. Also, loading an .obj, it all works fine in terms of getting the right vertex data for my buffers. (obviously spider.fbx is the one in your test data)

Any clue what's with that? Oh and a second question, any way to turn the built-in logger more (and less) verbose? e.g. repress material warnings when you don't supply a .mtl and stuff :)

elect86 commented 5 years ago

Hallo Maali,

thanks :)

I will look into that in the next future, but I must say this has very low priority for me, so if you may want jump in and contribute, dont hesitate.

About the logging stuff, I have still to grasp how to do the state-of-art logging, if you also want to contribute in this part, you are more than welcome :)

Right now I'm working on splitting uno in multiple modules to reduce the dependencies pollution (already done on imgui)

Sylvyrfysh commented 5 years ago

With the logging topic, I can work on adding logging if you'd like, elect. I'll peek at this problem in a bit, can you upload your file so I have a resource to test on?

On Wed, May 29, 2019, 14:15 Giuseppe Barbieri notifications@github.com wrote:

Hallo Maali,

thanks :)

I will look into that in the next future, but I must say this has very low priority for me, so if you may want jump in and contribute, dont hesitate.

About the logging stuff, I have still to grasp how to do the state-of-art logging, if you also want to contribute in this part, you are more than welcome :)

Right now I'm working on splitting uno in multiple modules to reduce the dependencies pollution (already done on imgui)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kotlin-graphics/assimp/issues/23?email_source=notifications&email_token=ADTJ6QBTXI4FY4DIENEFNHLPX3I4XA5CNFSM4HQPAHZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWQLVRQ#issuecomment-497072838, or mute the thread https://github.com/notifications/unsubscribe-auth/ADTJ6QBEFOCUDEZSY2QVXNLPX3I4XANCNFSM4HQPAHZA .

maali82 commented 5 years ago

it's part of the master already, in its test data, so i assumed it should work or at least be a good choice to test it with :) here: https://github.com/kotlin-graphics/assimp/tree/master/src/test/resources/models/FBX/spider.fbx

maali82 commented 5 years ago

as for logging, it already has logging (with mu-KLogger). It prompts errors and warnings, but the original assimp has some flags to set the logger verbosity level which can be helpful with bug hunting like this or making it STFU about acknowledged warnings (such as the missing materials i mentioned before) in a release :)

elect86 commented 5 years ago

@Sylvyrfysh Sure, it'd be great :)

maali82 commented 5 years ago

I made a minimal project (without any other 3D engine stuff) to show the problem. When you load spider.fbx, it only prompts 1 camera and 1 light, rest is 0. When you load teapot2.obj, a random .obj I had around, it does count 1 mesh and shows its vertices just fine. https://github.com/maali82/tempassimpfbxtest/blob/master/src/main/kotlin/main.kt

Wasabi375 commented 5 years ago

@Sylvyrfysh You said you want to work on logging. Did you also take a look at the issue with the meshes? I have some time this evening and tomorrow so if you haven't looked into it yet I can take a look. Only if you want, there are some other things I can do as well 😜

Sylvyrfysh commented 5 years ago

I had some issues getting things set back up on my main Dev rig, so I set up my other rig with it and can do it today, but go ahead of you wish. I can just with on the logging pieces

On Fri, May 31, 2019, 07:11 Burkhard Mittelbach notifications@github.com wrote:

@Sylvyrfysh https://github.com/Sylvyrfysh You said you want to work on logging. Did you also take a look at the issue with the meshes? I have some time this evening and tomorrow so if you haven't looked into it yet I can take a look. Only if you want, there are some other things I can do as well 😜

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kotlin-graphics/assimp/issues/23?email_source=notifications&email_token=ADTJ6QGW5ENH2PAE2XEH3KDPYEIYPA5CNFSM4HQPAHZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWVBRJY#issuecomment-497686695, or mute the thread https://github.com/notifications/unsubscribe-auth/ADTJ6QHNHHZSZAFZ55T4BXTPYEIYPANCNFSM4HQPAHZA .

Wasabi375 commented 5 years ago

I fixed a crash in a toString method of the Token class in d4cc2a29a44ddcdac69cd5544f4316ac416cf465. So at least logging is working for this file now. To enable logging in the sample project this line in the build.gradle file has to be changed

compile 'org.slf4j:slf4j-nop:1.7.21'

to

compile 'org.slf4j:slf4j-simple:1.7.26'

That way you see all the logged exceptions, which I hope will help solve the problem 😄


Also is this what you want in terms of logging @maali82? In that case you might want to take a closer look at slf4j. There are different implementations that allow for more and less control with regards to logging. The one you used in your sample slf4j-nop disables all log calls, so you wont see anything.

Wasabi375 commented 5 years ago

I slightly changed the spider.fbx file so testing is easier. I removed the camera and the light from it. That way it reflects the spider.obj file on which the test case is modeled. For some reason the material data in spider.fbx does not match the material data in spider.mtl, therefor this test does not contain any checks of the material if the fbx file is tested. The obj file still has tests for the materials. We test the material of fbx files with in other test cases though.

What we do not test is the data for lights or cameras, since I removed them.