Animated Mesh Issues

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
Sachiel7
Posts: 21
Joined: Fri Dec 30, 2005 6:24 pm
Location: USA

Animated Mesh Issues

Post by Sachiel7 »

Hi all,
I'm posting this topic because multiple searches didn't reveal anything related to this, and this has been an issue for me for quite some time.

I have some issues with my animated mesh filetypes.

First off, I'm working on a project that likely will end up commercial. So, licensing issues are at stake, and I'm curious about the ability to use MD2 format.
Also, my MD2s always import oddly into irrlicht. I've used a series of different tools, all with the same results - irrlicht seems to 'add' tens to hundreds of frames into the animation. If I have a 'walk' animation on frames 20-40, then the actual start/end frame numbers in the engine end up being different and bigger numbers, like 80-160 (just as an example).
This is frustrating to 're-find' my animations by manually sifting through frames, and I'm not sure why it works that way.
It also seems like irrlicht is not interpolating between frames, which is odd...irrEdit does when I modify the fps and so forth, but not so in my engine. If I set a low fps for a mesh, it snaps between frames. This is partially an issue for things like making a run animation the walk animation, just at a higher fps, or making a slow walk, etc. etc...

But, most of all, I'd prefer to use the ms3d format from milkshape, partially because I've had good results with the format, and because it is free for commercial use without licensing.
There's only one problem with my ms3d files...the animations are always flipped on the x axis. Now after i read that more ms3D support was added in 1.4.1 I thought this would be fixed, but sadly no. It's quite a bother to manually try to flip the animations in my software.

I am surprised that noone on these boards has addressed any of these issues, especially since I've noticed them for like 2 years now.

Anyone know of any solutions, or something i'm just missing?

I use:
-Anim8or, for most modelling
-Ultimate Unwrap 3D, for texture mappinig
-CharacterFX, for animations
-Milkshape3D, for a mix of things, mostly file format conversion
-Visualmarker, for Motion Capture, if needed

Any ideas?
BTW, this occurs in meshes that others have created, so I doubt it is related to my 3D tools...
:(
-=Sachiel7=-
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi.

MD2, MD3 files were created by ID Software. I'm not really sure they released totally the rights. (I think, yes, because IRRlicht wouldnt have implemented them, the DEV take extra care about this). MD2 is VERY limited as its not supporting bone animation (vertex animation). MD3 have more features but still, not sure if IRRlicht as a full working implementation of the format. Same thing about ms3D.

If you really want to import animated meshes inside IRRlicht and don't want to take any chances about licensing, use B3D. (Blitz 3D format)

For some tools to work out your meshes, for 0 cost, I would recommend that you use blender, it has an excellent B3D exporter that you can use.

Milkshape should have the B3D format. Do you have that format in that software?
irrlicht is not interpolating between frames..
How could it interpolate? I'm not sure that IRRlicht can interpolate a vertex animation.(specificaly the MD2 format, as it use specific frames range for each animation loop). This can be possible on Boned animation (.X or .B3D).
If I have a 'walk' animation on frames 20-40, then the actual start/end frame numbers in the engine end up being different and bigger numbers, like 80-160 (just as an example).
I've loaded animated meshes (MD2) format and they appear at the correct frame. This could be related to your LAST tools that save the animation.
Sachiel7
Posts: 21
Joined: Fri Dec 30, 2005 6:24 pm
Location: USA

Post by Sachiel7 »

Yeah, I've tried blender, and I agree, its a great tool, but its just not my cup of tea...
I do have a b3d export option in milkshape, and I tested it.
It works, as intended, however I have yet to test the frame issue, but the bones are animating properly.
If you really want to import animated meshes inside IRRlicht and don't want to take any chances about licensing, use B3D. (Blitz 3D format)
I'd like to use this format, but I can't find any specific source on the web related to the file format being 100% free of licensing. All I can find is that the Blitz Basic SDK and related products require a license, but they don't seem to specifically name the 3D file format. I do notice that on their faq page where they list licensing of specific formats, they do not list b3d.
How could it interpolate? I'm not sure that IRRlicht can interpolate a vertex animation.(specifically the MD2 format, as it use specific frames range for each animation loop). This can be possible on Boned animation (.X or .B3D).
Linear Vertex interpolation between frames. This is how Quake used to do it, and I'm surprised irrlicht doesn't.

Thanks for your help, I'll post again if I have further issues with the frames.
-=Sachiel7=-
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Irrlicht interpolates both md2 and md3 keyframe animations. Don't know why you think otherwise.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

hybrid wrote:Irrlicht interpolates both md2 and md3 keyframe animations. Don't know why you think otherwise.
I'd imagine because if you setAnimationSpeed(x) with a low animation speed, you get jerky rather than smooth motions.

Code: Select all

Index: examples/01.HelloWorld/main.cpp
===================================================================
--- examples/01.HelloWorld/main.cpp	(revision 1422)
+++ examples/01.HelloWorld/main.cpp	(working copy)
@@ -165,6 +165,7 @@
 	{
 		node->setMaterialFlag(EMF_LIGHTING, false);
 		node->setMD2Animation ( scene::EMAT_STAND );
+        node->setAnimationSpeed(3); // Let's do the robot
 		node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
 	}
 
I'm not expressing an opinion on it either way - animation scares me - just noting the possible issue under discussion.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

You make model in milkshape,
export it to cfx via asci format,
animat it in cfx,
and export it (via asci) back to milkshape.
from milkshape export it to directX JT skin and bones (without touching any joint! cause it causes model to explode)
and you have directX animated skin and bone model wich can be loaded to irrlicht.

If this works for you well, you owe me couple of animated models for my game ;)
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

here are the specs on the b3d format.

http://www.blitzbasic.com/sdkspecs/sdks ... _specs.txt

it's public domain so it's as free as you can get.
Elmaron
Posts: 27
Joined: Sat Jan 10, 2009 7:22 pm

Post by Elmaron »

I am pushing this thread because I am having exactly the same issues with md2 animations and it's a bit annoying. (Irrlicht SDK 1.5 on Linux)
irrlicht seems to 'add' tens to hundreds of frames into the animation. If I have a 'walk' animation on frames 20-40, then the actual start/end frame numbers in the engine end up being different and bigger numbers, like 80-160 (just as an example).
This is what also happens to me. I have a model with 2 animation frames which end up being frames 7 to 8, instead of 1 to 2 or 0 to 1. I had to search a lot around before I realised they were just shifted and exactly to that position.
Try it yourself: http://eloxoph.net/man.md2 (a model with 2 animation frames, import it into Blender to check out)
Linear Vertex interpolation between frames. This is how Quake used to do it, and I'm surprised irrlicht doesn't.
I'd imagine because if you setAnimationSpeed(x) with a low animation speed, you get jerky rather than smooth motions.
I set the animation speed to 1 frame per second and there was nothing of interpolation at all. I had the frame number printed out in realtime, and exactly when it flipped from 7.7, 7.8 to 8.1 or something, the animation changed with one big step. No trace of interpolation.

Are those two issues likely to get fixed? They make using md2/vertex frame based animation nearly(?) impossible.


Edit: if this truly turns out to be a bug, maybe some forum mod could move this into the bug reports forum? but let's wait if there isn't someone having an easy solution why it fails so much for me and the thread creator...
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

You can use IAnimatedMeshMD2::getFrameLoop to get the internal frame loop for a named animation, and use IAnimatedMeshSceneNode::setFrameLoop to apply the animation to the node.

As for the floats for frame numbers, we currently only use ints, though I guess this floats will be supported eventually...

edit: ...but this isn't how MD2 animations work. They're supposed to use lots of empty (integer) frames with keyframes spaced unevenly between them, with varying animation speeds to give the best effect. If your modelling program doesn't display them like this then the frame numbers won't look the same and how this varies will depend entirely on your exporter; Irrlicht just uses the frames from the file. Your best option is to use the named animations.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Elmaron
Posts: 27
Joined: Sat Jan 10, 2009 7:22 pm

Post by Elmaron »

..but this isn't how MD2 animations work. They're supposed to use lots of empty (integer) frames with keyframes spaced unevenly between them
This is quite interesting... so I need to set frame names and use them to acess the animations...

I hope you go for floats for frame numbers soon, that would be great! :)
Thx for your helpful answer
Post Reply