[fixed] Bug in new OBJ-loader-code of Irrlicht 1.1

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
jettitore
Posts: 11
Joined: Sat Jun 24, 2006 11:27 pm

[fixed] Bug in new OBJ-loader-code of Irrlicht 1.1

Post by jettitore »

Hi all,

I've changed from Irrlicht 1.0 to Irrlicht 1.1, but now my programm does not work anymore. (it still compiles) Everytime I try to call GetMesh-Function an access violation occurs. (Attempted to read or write protected memory. This is often an indication that other memory is corrupt.)

In Irrlicht 1.0 this code worked perfectly, but now the GetMesh("path")-Function causes this error. (but only when loading obj-files)

Code: Select all

IMesh mesh = smgr.GetMesh(path_wall).GetMesh(0);
I'm using Visual Studion .NET 2005, Windows XP, DirectX9, (now) Irrlicht 1.1 and I'm using C#.

I hope somebody knows a workaround for my problem. Thanks.

jettitore
Last edited by jettitore on Sat Oct 14, 2006 8:37 pm, edited 1 time in total.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Did the 1.0 interfaces return references? The 1.1 interfaces return pointers, and so that code should be:

Code: Select all

(assuming 
scene::ISceneManager* smgr = device->getSceneManager();)

IMesh * mesh = smgr->GetMesh(path_wall)->GetMesh(0); 
With validity checking omitted for brevity.
jettitore
Posts: 11
Joined: Sat Jun 24, 2006 11:27 pm

Post by jettitore »

rogerborg wrote:Did the 1.0 interfaces return references? The 1.1 interfaces return pointers,
Ehm, no. I've found out that my md2-files are causing no access-violation, but loading obj-files causes a access-violation-exception. Maybe the improved obj-loader has a bug? Is there although a solution to load my obj-files? Thanks for your help.

jettitore
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Oh, hang on, is your application written in C#?
jettitore
Posts: 11
Joined: Sat Jun 24, 2006 11:27 pm

Post by jettitore »

rogerborg wrote:Oh, hang on, is your application written in C#?
Oh sorry, that i didn't mention this. :( Yes it is written in c# and it worked fine with irrlicht 1.0. But the, in the change-log described, better obj-loader-code causes now access-violations. But I see no way to fix this. Is there maybe any tool that can convert my obj-files to obj-files that are conform with irrlicht 1.1?

Thanks.
jettitore
loonychewy
Posts: 22
Joined: Fri Dec 30, 2005 2:00 am
Location: Singapore
Contact:

Post by loonychewy »

Are you able to debug the engine and see which part of the mesh loader it crashes in, or are you able to post your obj model somewhere for us to test?
By right the loader should load any obj files without any specific restrictions.
jettitore
Posts: 11
Joined: Sat Jun 24, 2006 11:27 pm

Post by jettitore »

loonychewy wrote:Are you able to debug the engine and see which part of the mesh loader it crashes in, or are you able to post your obj model somewhere for us to test?
By right the loader should load any obj files without any specific restrictions.
The old loader of Irrlicht 1.0 was able to load my Obj-Files. Unfortunately I'm not able to debug the buggy Irrlichtcode, but here is a link to the Obj-File that causes Irrlicht to crash. (It's a simple cube)

The Obj-File was created by Maya 7.0.

Thank you for your help.
jettitore
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

this is working in svn, i suspect it's because the mtl file was referenced but could not be found.
try placing the mtl file in the same folder as the mesh, or grab the latest code from svn
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
jettitore
Posts: 11
Joined: Sat Jun 24, 2006 11:27 pm

Post by jettitore »

bitplane wrote:this is working in svn, i suspect it's because the mtl file was referenced but could not be found.
try placing the mtl file in the same folder as the mesh, or grab the latest code from svn
Yes it works now. Thank you for your help. :)

But btw: what is the MTL-file good for? I've resaved the obj-file with another programm and this new obj-file works flawless without a MTL-file, why?

jettitore
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

mtl files contain information about the materials that the meshes in the obj file use, i guess some exporters will not have a "usemtl" line in the obj file if the default materials are used.
you could also delete this line from your file in notepad if you don't want to use one.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
jettitore
Posts: 11
Joined: Sat Jun 24, 2006 11:27 pm

Post by jettitore »

ah okay.

Then once again, thanks for the help. :)

jettitore
Post Reply