IrrAssimp (mesh import/export)

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: IrrAssimp (mesh import/export)

Post by robmar »

FBX format is designed for interchange, so no problem using that one. Most other formats are now in the public domain, and the newer formats are not easy to crack.
JLouisB
Posts: 67
Joined: Tue Jul 24, 2012 12:36 pm
Location: France

Re: IrrAssimp (mesh import/export)

Post by JLouisB »

robmar wrote:Did animation support get added? Tried using the latest Asimp to import an animated FBX and it crashed immediately.
Hi,
It's supposed to work.
You can already try to see if the bug come from Assimp or Irrassimp by trying to load the model in one of the 2 model viewers bundled with Assimp (there is a DirectX viwer (DirectX SDK needed) and a Qt viewer (Qt needed))
If it's an issue with Irrassimp give me a test file and I will check that
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: IrrAssimp (mesh import/export)

Post by robmar »

Hi, thanks for the tip! I just installed your Assimp Viewer, and it works absolutely perfectly with FBX animations, even complex ones.
So I then downloaded IrrAssimp and ran the demo main.cpp with Irrlicht 1.8.4 official version, and it loads but there is no animation at all.
I´ll try it now with 1.7.3 see if that works.
Yur AssimpViewer is using vertex shader skinning? It runs so many times faster than the CPU-based skinning on Irrlicht!
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: IrrAssimp (mesh import/export)

Post by robmar »

Okay that was a bit of a nightmare! Assimp master files still have an x86 dll copy placed in the x64 folder since 3-years ago, which was confusing!
There are numerous complaints about this on various forums, so would be great if someone would fix that to stop people wasting time with the same old problem.

As per Assimp with 1.8.4, on 1.7.3 it also only produces a working animated file for the ninja.b3d

The animated .x and .fbx files do not animate using the 3.3.1 (latest as of this date) with either release of Irrlicht, so there must be a problem with the IrrAssimp implementation.

I did not recompile Assimp, just used to provided x86 lib and dll with the IrrAssimp test code.
The .x, .fbx and .b3d files, but only the b3d animates.
No error are listed.
Why would files imported into Irrlicht with IrrAssimp NOT animate when the AssimpViewer works fine?

AssimpViewer uses a better animation system, about 8 times faster than Irrlicht, so I guess that the Irrlicht SkinnedMesh isn't being setup correctly.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: IrrAssimp (mesh import/export)

Post by robmar »

@JLouisB you said its supposed to work, but it doesn't work with either .x or .fbx, there are no animation parameters for either file of these type using IrrAssimp, the HasAnimation variable is disabled after loading, so it seems that no animation frames are detected during the Assimp load, or most likely by the IrrAssimp code, failing to set up the Irrlich mesh parameters as needed.
I'm puzzled that no one noticed this, or didn't make a post about it.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: IrrAssimp (mesh import/export)

Post by robmar »

The problem with IrrAssimp is that it does not load the joint positions, rotations or scaling anywhere!
CreateAnimations() in IrrAssimpImport.cpp is called, these vars are loaded from the joints, but Visual Studio cannot find any setting of these variables in the joints!
This them causes HasAnimation() to return false, and bingo, no animations.
Assimp is able to animate in the viewer, so the library has the code to process the joints params and frames, but this is not implemented in IrrAssimp.
Any advice on adding the code to set these params, FBX contains the AnimationStack, with AnimationLayer, where there are the weights for skin morphing and these params (vars) are also there somewhere, Lcl Rotation, etc?
JLouisB
Posts: 67
Joined: Tue Jul 24, 2012 12:36 pm
Location: France

Re: IrrAssimp (mesh import/export)

Post by JLouisB »

Hi,
robmar wrote:Hi, thanks for the tip! I just installed your Assimp Viewer, and it works absolutely perfectly with FBX animations, even complex ones.
So I then downloaded IrrAssimp and ran the demo main.cpp with Irrlicht 1.8.4 official version, and it loads but there is no animation at all.
I´ll try it now with 1.7.3 see if that works.
Yur AssimpViewer is using vertex shader skinning? It runs so many times faster than the CPU-based skinning on Irrlicht!
This is not "my" viewer, credit go to the Assimp developers for this great viewer !
I have just tested my main.cpp/ninja.b3d example with Irrlicht 1.8.4 + Assimp trunk version (there is not often official release of Assimp so I always use the master version that I compile myself) and I see no problem with that.
So maybe this is related to the Assimp version that do you use ?
Can you try with the "master" version ? (they are generally quite stable)

I don't think the Assimp viewer uses GPU skinning from what I saw of the code it's also made with the CPU.
robmar wrote:Okay that was a bit of a nightmare! Assimp master files still have an x86 dll copy placed in the x64 folder since 3-years ago, which was confusing!
There are numerous complaints about this on various forums, so would be great if someone would fix that to stop people wasting time with the same old problem.

As per Assimp with 1.8.4, on 1.7.3 it also only produces a working animated file for the ninja.b3d

The animated .x and .fbx files do not animate using the 3.3.1 (latest as of this date) with either release of Irrlicht, so there must be a problem with the IrrAssimp implementation.

I did not recompile Assimp, just used to provided x86 lib and dll with the IrrAssimp test code.
The .x, .fbx and .b3d files, but only the b3d animates.
No error are listed.
Why would files imported into Irrlicht with IrrAssimp NOT animate when the AssimpViewer works fine?

AssimpViewer uses a better animation system, about 8 times faster than Irrlicht, so I guess that the Irrlicht SkinnedMesh isn't being setup correctly.
Ok, so it explain your previous issue !

The last official update is Assimp 4.10 (released in december 2017)
Assimp 3.3.1 is an old version released in 2016, I recommend you to use the last version which include also some fix for some FBX files

About your issue with your FBX and X files, can you give your test files so I can run some tests ? (with something like dropbox or you can find my mail on my github profile)
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: IrrAssimp (mesh import/export)

Post by robmar »

Okay, phew, great! I´ve now found the Assimp site, as searching on Google for "Assimp download" only losts the older 3.XX GitHub site!!

I will now repeat the testing, again, with the newest release 4.10! Thanks! :)
JLouisB
Posts: 67
Joined: Tue Jul 24, 2012 12:36 pm
Location: France

Re: IrrAssimp (mesh import/export)

Post by JLouisB »

it is always better to use the official website/github to download a library to be sure that you use an official and up to date version :
https://github.com/assimp/assimp
http://www.assimp.org/

But you can still send me a test file, as you describe it there is a problem with irrassimp
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: IrrAssimp (mesh import/export)

Post by robmar »

Sure, but Google lists the Assimp GitHUB with version 3.1, and that page looks official, it would be useful to remove that, or make a note about the later version so people don't have the same problem.

Anyway, I installed the latest Viewer, the X64 viewer is "not compatible" with my Intel i7 7700HQ / GTX 1050 system, but that can't be because of a lack of SS2 as the i7 has that!
The x86 version works fine, but identically to the older 3.1 version, it loads Blender FBX, but not those exported from 3DS Studio 2012 or later.

More problematic is that IrrAssimp no longer compiles, Visual Studio 2017 compiling under V100, reports that the classname Importer on line 140 of Importer.hpp, is unknown, error C2059, C2238, unexpected token preceeding ´;´

The included files changed on installing the newer Assimp 4.1, but Importer is found using "Peek definition" etc.

Is this a known issue?
JLouisB
Posts: 67
Joined: Tue Jul 24, 2012 12:36 pm
Location: France

Re: IrrAssimp (mesh import/export)

Post by JLouisB »

Sure, but Google lists the Assimp GitHUB with version 3.1, and that page looks official, it would be useful to remove that, or make a note about the later version so people don't have the same problem.
http://assimp.sourceforge.net/ is the old website, not up to date
Anyway, I installed the latest Viewer, the X64 viewer is "not compatible" with my Intel i7 7700HQ / GTX 1050 system, but that can't be because of a lack of SS2 as the i7 has that!
The x86 version works fine, but identically to the older 3.1 version, it loads Blender FBX, but not those exported from 3DS Studio 2012 or later.
What do you mean by "not compatible" ?
Do you have a compilation error, a crash ?
About your FBX issue, if have have the issue to load them with the assimp viewer, try with the master version (download it on github and compile it), maybe it has been fixed since the last update.
Or you can give me a file and I have a recent Assimp build to try it
More problematic is that IrrAssimp no longer compiles, Visual Studio 2017 compiling under V100, reports that the classname Importer on line 140 of Importer.hpp, is unknown, error C2059, C2238, unexpected token preceeding ´;´
"compiling under V100"
Do you mean the VS 2010 compiler ?
You need at least C++11 support to use the last versions of assimp, you will have some compliation error otherwise, I recommend you to update your compiler
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: IrrAssimp (mesh import/export)

Post by robmar »

Thanks a lot for the tip, I changed to V140 and now it compiles, but it shows unresolved external aiNode, I tried copying in the assimp.lib but made no difference. Having some setting instructions for Visual Studio would make life easier!
I set the lib path, assimo.lib in the imports list on the linker, anything else to check?
I´ll try to recompile Assimp 4.1 using CMake, but I can´t find much in the way of instructions.
JLouisB
Posts: 67
Joined: Tue Jul 24, 2012 12:36 pm
Location: France

Re: IrrAssimp (mesh import/export)

Post by JLouisB »

Thanks a lot for the tip, I changed to V140 and now it compiles, but it shows unresolved external aiNode, I tried copying in the assimp.lib but made no difference. Having some setting instructions for Visual Studio would make life easier!
I set the lib path, assimo.lib in the imports list on the linker, anything else to check?
I´ll try to recompile Assimp 4.1 using CMake, but I can´t find much in the way of instructions.
I always compile Assimp myself, it's not very complicated :
1. Download the source code of Assimp
2. Launch CMake GUI
3. Set the folder where you have your Assimp source code
4. Set a folder where you want to build the library
5. OPTIONAL : just in case where you have Qt installed, you can set the path to Qt to build a
6. Click "Configure"/ select you compiler in the list / "Use default native compiler" and click "Finish"
7. Click "Generate"
8. Click "Open project", it will open VS and now you can build "Assimp, "Assimp viewer" and "Assimp cmd"

Image
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: IrrAssimp (mesh import/export)

Post by robmar »

Thanks, appreciate that, I'm feeling burnt out trying to get code working that a) never could have worked, or b) lacks instructions! ;)
I have CMake GUI, but I saw several Assimp...io CMake files, and I wasn't sure which one to load.

Do I need QT, I'd like to compile Assimp in 32-but X86 to start, Win10.

Is the code fot the Assimp viewer there too?

You know I started off following advice on the forum, old advice, to use FBX import from IrrExt, but it didn't work at all, then I started going through the code, and it seemed incomplete! Incomplete, I´ve read the entire FBX format, IrrExt isn't just incomplete, its just a shell, doesn't even process the needed tokens, or inflate the compressed section, there is no ZLib use in it!
Its a painful way to learn and a bad waste of time, which is irreplaceable! Sorry for the rant!
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: IrrAssimp (mesh import/export)

Post by robmar »

Have you seen this Assimp Viewer page, the downloads all point to Assimp 3.1
http://assimp.sourceforge.net/main_downloads.html
Post Reply