Page 1 of 1
AddAnimatedMeshSceneNode obj crash!
Posted: Sat Dec 03, 2005 3:08 am
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!
Posted: Sat Dec 03, 2005 5:04 am
by bitplane
try exporting it from milkshape instead, irrlicht chokes on some types of obj
Posted: Sat Dec 03, 2005 8:46 pm
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?
Posted: Sat Dec 03, 2005 10:14 pm
by bitplane
use blender 2.37 and the x exporter. I've never used it myself, but other people swear by it
Posted: Sun Dec 04, 2005 6:37 pm
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!
Posted: Sun Dec 04, 2005 6:56 pm
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!!
Posted: Mon Dec 05, 2005 10:57 am
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)