AddAnimatedMeshSceneNode obj crash!

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Kikketer
Posts: 9
Joined: Fri Nov 11, 2005 3:41 pm
Location: Wisconsin
Contact:

AddAnimatedMeshSceneNode obj crash!

Post by Kikketer »

I have a scene running just fine if I use a .ms3d mesh and .png texture. But I need to use an .obj and .mtl.

After some work I narrowed down the problem:

Code: Select all

ISceneNode node = device.SceneManager.AddAnimatedMeshSceneNode(device.SceneManager.GetMesh(@"Turtle1.obj"),null,-1);

Console.writeline(node.ID);
The runtime error tells me that it is trying to reference a null object at the Console.writeline.

When I change the mesh to "Turtle1.ms3d" it works fine. (by the way I have the Turtle1.ms3d and the Turtle1.obj in the same folder)

Is there something different I have to do to use obj?? Please help!

Stats:
The obj was exported from blender
Using C# to write the code along with irrlicht.net

If you need more info let me know!
- Give a weed an inch, it'll take a yard -
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

try exporting it from milkshape instead, irrlicht chokes on some types of obj
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Kikketer
Posts: 9
Joined: Fri Nov 11, 2005 3:41 pm
Location: Wisconsin
Contact:

Post by Kikketer »

My modeler is sending me the meshes in .blend format. Is there a way to convert without havng to change the 3D animation suite that he wants to use?
- Give a weed an inch, it'll take a yard -
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

use blender 2.37 and the x exporter. I've never used it myself, but other people swear by it
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Kikketer
Posts: 9
Joined: Fri Nov 11, 2005 3:41 pm
Location: Wisconsin
Contact:

Post by Kikketer »

This is starting to get frustrating...

I exported the model to .x and I can even view it in the Direct X viewer (when I double click on the .x file).

Still when I try to use it in the engine I get a null reference error. The crazy thing is, it still works if I use a .ms3d file that I downloaded.

I even imported the .obj version of my original mesh into Milkshape, saw it there, then saved it as a .ms3d. When I tried to use that version, it still crashed.

GRRR!
- Give a weed an inch, it'll take a yard -
Kikketer
Posts: 9
Joined: Fri Nov 11, 2005 3:41 pm
Location: Wisconsin
Contact:

Post by Kikketer »

There is an update:

I didn't read the beginning of the error, it reads:

Code: Select all

Could not load mesh, because file could not be opened.: Turtle.obj
Could not open file of texture: Turtle.mtl
Could not load texture: Turtle.mtl
Then it goes on with the null reference, which makes sense because the mesh wasn't loaded.

Do I have to stick the .obj files into a differnt folder or something basic like that? I'm lost!!
- Give a weed an inch, it'll take a yard -
bearSoft
Posts: 165
Joined: Fri Apr 01, 2005 9:55 pm
Location: Denmark

Post by bearSoft »

Do I have to stick the .obj files into a differnt folder
no, if u can load a 3ds mesh from a folder and place ur obj model in the same folder and only change the irr code to the obj model, then u should be in the clear -however, as someone already told u 'obj' is not a unique formate.
the 'obj' file u have may not be a wavefront obj ('proper' obj) so ur turtle may simply be in a format irr can not handle
Can u open turtle.obj in anim8tor? ..if u have it (freeware)
Regards.
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
Post Reply