[fixed]Crash when loading .x

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
falko1
Posts: 8
Joined: Mon Jul 23, 2007 1:20 pm
Location: Italy

[fixed]Crash when loading .x

Post by falko1 »

Hello to all this great community!
Forgive my english, I'll do my best to explain the problem. I'm sure the problem is not in my code, because to its extreme semplicity.
I'm trying to convert an animated mesh from .mdl (it's an Half-Life model) to .x format. To do this I'm using Milkshape. I decompile the .mdl, get the .smd (which is the real mesh. it contains the mesh, animations and info about materials) and import into Milkshape. That's ok, I can see the mesh, textures and animations. Now, I try to export to .x with the exporter DirectX 8.0. Everything goes fine until there.
Now, I use this code to load the mesh.

Code: Select all

IAnimatedMeshSceneNode* node = scene->addAnimatedMeshSceneNode(scene->getMesh("osprey.x"));

while(device->run())
{ 
	driver->beginScene(true,true,SColor(255,0,0,255));

		
	scene->drawAll();
	driver->endScene();
}
Simply, isn't it? :)

Ok...I run the program and... CRASH :| It crashes in that function, I checked. However, I don't understand. I do the same with another model made by me, and it's ok. I try with other models and it's ok. Nothing crashes. So i try to reproduce the crash with another model. That model contains two meshes. So, I tried to regroup those meshes to make only one. Perfect! No crashes.... :| But why? Irrlicht can't manage more than one meshes in a .x file? Impossible, I tried with other multi-mesh files, and that's ok.
Until now I don't understand where is the problem.

Had someone the same problem?
Thank you in advance.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Sounds like a bug. Can you please share the "osprey.x" mesh so we can test it?
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
falko1
Posts: 8
Joined: Mon Jul 23, 2007 1:20 pm
Location: Italy

Post by falko1 »

falko1
Posts: 8
Joined: Mon Jul 23, 2007 1:20 pm
Location: Italy

Another bug!

Post by falko1 »

I found another bug here, in mesh animation! It should go in another topic but for now I put this bug here.

I found a strange flickering on some b3d meshes when I enable the manual control of their joints. I tried the same with a ms3d mesh, and it does not flicker!

Here the code:

Code: Select all

	IAnimatedMeshSceneNode* node = scene->addAnimatedMeshSceneNode(scene->getMesh("gman.b3d"));
	node->setMaterialFlag(EMF_LIGHTING, false);
	node->setTransitionTime(1);


	while(device->run())
	{ 
		driver->beginScene(true,true,SColor(255,0,0,255));
		node->animateJoints();


		scene->drawAll();
		driver->endScene();
	}
And the face of the character flicker sometimes... :\
When I change the mesh to .ms3d it's everything ok...nothing flickers, everything work well.
Here the meshes, try them! (b3d = bugged, ms3d = works)

http://www.hostingfiles.net/files/01200 ... manzip.zip









PS: irrlicht version used: 1.4
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The man is loading and animating without problems. Maybe you have the wrong animation frames chosen (and get a jump due to this). The helicopter is also loading correctly (try the meshviewer binary to check such things), however the animation is not working properly. Looks like a corrupted transformation matrix.
falko1
Posts: 8
Joined: Mon Jul 23, 2007 1:20 pm
Location: Italy

Post by falko1 »

There are problems only when I turn on manual joint transformation..does the binary model viewer this? I'll do some tests.
Hybrid, thank you for testing :)
falko1
Posts: 8
Joined: Mon Jul 23, 2007 1:20 pm
Location: Italy

Post by falko1 »

Mmm..hybrid, did you loaded correctly osprey.x? Here crashes, and model viewer too :|
falko1
Posts: 8
Joined: Mon Jul 23, 2007 1:20 pm
Location: Italy

Post by falko1 »

Ah! Wait! The console shows this message just before the crash: "X Loader: Weight id out of range!"

So I think it's a problem of milkshape's directx exporter...bah...

Remains the problem of the b3d which flickers..ms3d is ok
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, I did not try manual joint editing. But I did load the osprey.x, otherwise I wouldn't know it's a helicopter :wink: The warnings are there, I'll have to check what's the problem with them.
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

Didnt know osprey is a helicopter? ;) Never played Half Life? :D
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, I don't play games :o At least no Irrlicht-based ones in the last few years (oh, and a few Wii test games recently :wink: )
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Osprey = pandion haliaetus. It could have been a bird :D
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, it's fixed now. Loads with the latest SVN 1.4 branch, trunk will follow next days. It not only loads correctly, but now it also animates correctly - no more warnings and both rotors are operating :D
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

hybrid wrote:... trunk will follow next days.
Could you please give us a more specific date?
Revision 1171 still seems to suffer from this issue.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, trunk in revision 1171 does, branches/releases/1.4 in revision 1171 does not. It simply needs to be copied over, but I wanted to do it when I also fixed some more issues with Collada in 1.4. You can simply create a patch from the svn browser page here
http://irrlicht.svn.sourceforge.net/vie ... threv=1168
You'll also have to make a patch for the .h file. Both can be applied to trunk.
Post Reply