How the heck do you people animate your stuff?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
cyze
Posts: 10
Joined: Thu Jul 06, 2006 12:00 pm

Post by cyze »

I really don't understand why people using Max feel they need to use this kind of workflow.
Max is plenty capable for all of this...take a little time to learn its toolset.
As far as exporting from Max->Xfile, the PandaXporter does work(providing it was skinned, rigged and animated correctly), you just need to be careful with the settings
I would really love to use the panda exporter directly from max. What are the right settings? And what way is the 'correct' way to animate/rig/skin? I use the Skin modifier on a editable poly, but i cant get it to export properly. Do you have a link or something for the correct settings? Thanks.
dhenton(Blender), electron(blender), and many others(many using max) have been very succesful with direct export of x files... me too.
im sure that many have been able to export animations from blender and max, but the question is how? The direct x exporters that come bundled with the later versions of blender are both broken. I have successfully exported static meshes from several programs, and also animated meshes as long as it's morph/vertex based. Anyone have a good (and up to date) tutorial on blender -> irrlicht workflow would be great.
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

I have strong time availability problems now (besides this thing I've posted about it hundreds of times in this forum) , but there's buried a very old panda settings export long thread I did. I think all that is quite useful today, still. There I explained all.

blender x exporter...never ever trust simply in included exproters, go to plugin author pages...

please read his doc , or you wont be succesful...

also, dig very well in this forum, all you need to know is here too. I dunno how good is the forums search this days...

http://www.ben.3rdimension.co.uk/

remember: a good, great last step is open in mview windows utility, from MS DirectX 8.1 SDK , and save again there as x. It makes it compatible fully with irrlicht.
Finally making games again!
http://www.konekogames.com
cyze
Posts: 10
Joined: Thu Jul 06, 2006 12:00 pm

Post by cyze »

First of all, thanks for the fast response =)

I have googled for the 8.1 SDK forever but since microsoft dont host it anymore, and all the pages that mention it links to microsoft, I can't find it.

Anyone here in the forum have a link to it?

Also i read your post on the panda settings. I will try them the next time i have time to go to school ;)
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

Finally making games again!
http://www.konekogames.com
Vuen
Posts: 25
Joined: Tue Jul 11, 2006 8:03 am

Post by Vuen »

As far as exporting from Max->Xfile, the PandaXporter does work(providing it was skinned, rigged and animated correctly), you just need to be careful with the settings.
The problem with the Panda exporter is that when you export a biped, it actually exports the biped mesh. The skeleton biped is several thousand polygons, which is a total waste. Here's how you get rid of it:


To export a biped-animated mesh from 3ds max 8, first export to Alias (.fbx). Click the Reset button on the export dialog and leaving the default settings. If you get this message:

Image

just click Yes and it'll go away.

Then go File->Reset (make sure you save normally first if you haven't already done so), then File->Import. Choose the Alias (.fbx) file you just exported, and again click Reset on the import dialog. This gives you the animated bone structure without the biped mesh.

Now go File->Export and choose Panda (.x). I use the following settings:

Image

That's it. The .x mesh now works beautifully in Irrlicht, and doesn't include the many thousands of polygons that make up the biped. When I performed this export method on my meshes to clean out the biped, my framerate tripled.


There are a couple things to note. First off is that you don't actually need to perform the Alias export step for it to work; your framerate will just drop a lot. I just export directly to Panda while I'm building my animations, and when I like how they look in game, I do the Alias export step to clean out the biped. If you want to add animations later on, do them on the original max file, then redo this export procedure. You don't ever want to be editing the .fbx imported file directly; use it only to export to .x .

Secondly is the framerate. On the animation tab, you can choose either 3DS Max ticks or Key Frames. The difference is, if you choose Key Frames, every frame sampled gets set to one frame in the mesh, so you have exactly as many frames as keys you sample. This makes it easy to figure out the framerate, but can (probably will) look choppy depending on the sampling rate you use because Irrlicht won't blend between these frames. On the otherhand, if you choose 3DS Max ticks, the keys will be spaced about 4800 frames apart, giving you some nice blending. So you'll need to set some really high animation speeds and adjust your animation loops accordingly.

Third is the sampling rate. Panda does not use the keys you set; it instead samples the animation at the rate you specify. Right now I use 100 FPS in Max, use whatever the reset button does in the Alias exporter, and use a sampling rate of 60 in Panda. This 60 is really way too much (wastes too much memory), but it's because I didn't space out my animations properly. What you want to do is space out your animations fps divided by samplingrate apart in max, so that you won't get your animations blending together in game. Each of my animations (walking, running, dying etc) is 100 frames long, and I'm going to space them out 10 frames each, so I'll be using a sampling rate of 10 frames instead of 60. 10 keys per animation shouldn't use up too much memory.

Fourth is the materials. To apply a texture, I use the default everything in the materials window, only I apply the texture I want to the diffuse map. What you'll want to do is name the texture you're referencing appropriately, so that when Panda exports, you can choose Copy so that it copies and links your material from the .x file appropriately. Then you can skip the texture-loading altogether in your code; when you load the mesh, Irrlicht will load the texture automatically.

Fifth, the Panda exporter supports exporting your animation sequences in the Animation tab, however I am really not a fan of putting the sequences in the .x file itself. Instead I load my sequences separately from an xml file that looks like this:
http://rafb.net/paste/results/Ontruw15.html
This allows me to set up the animations entirely separately; that way if I screw up a sequence I don't need to re-export, and if I change the sampling rate I don't need to change anything but the multiplier in the XML file. I use the IrrXML contained in Irrlicht to parse this into a simple array and reference these myself instead of asking the node to play specific animations. You can use Panda to include the sequences directly, but I have no idea how it works or whether it works at all.

Sixth, I should mention that it doesn't seem to make a difference whether you choose Matrix or Position/Scale/Rotate key type; Irrlicht handles both. Matrix may however be faster because that way Irrlicht doesn't need to recompute these itself; perhaps someone with more knowledge on the internals of the engine could elaborate on this? (Also, if you're following this tutorial for Lightfeather instead of Irrlicht, you need to choose Matrix because it handles strictly quaternion rotations.)



Well, that's basically all I know about mesh exporting. You can see the results in my control system test here:
http://rapidshare.de/files/25815094/game.zip.html
That's a ~800 poly mesh with default skeletal biped exported in this fashion.

Hmm, I didn't intend for this to be this long. If people like it and it works for them too, I can repost it as a tutorial.
Last edited by Vuen on Mon Jul 17, 2006 2:46 pm, edited 3 times in total.
luckymutt
Posts: 453
Joined: Sun Mar 06, 2005 11:56 pm
Location: C-Ville

Post by luckymutt »

Nicely done, Vuen.
I'll just add a small underscore here: the exporting to *.fbx step is only useful if you are creating your skeleton with Max's Biped. If you are creating your own skeleton with Bones, you can skip that part.

Also, it may be worth mentioing, that there is a newer version of the *fbx exporter for Max:
http://usa.autodesk.com/adsk/servlet/in ... id=6839916
Although the one that comes with Max is plenty capable for this operation.

I mentioned it before, and I'll speak it again - I would *really* dig having a *.fbx importer for Irrlicht.
Join us in the Irrlicht chatroom:
[url]irc://irc.freenode.net/irrlicht[/url]

I love deadlines. I like the whooshing sound they make as they fly by. -D.Adams
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

Actually in the old times -surely panda author has improved that- one couldn't export biped. Just had to export as FBX, and then reimport (I explaine dthat in my very old thread of eons ago) as so they get converted as standard bones...seems what it does now is export biped as mesh, for what you say....

You could go and "dummy" in geometry objects tho I dont believe it detects it as dummy...

I think if u did unmark bones animation wouldnt be exported...if not u could try that...In othe rpackages you would just an "export selected"...hmmm...maybe try to hide the biped...tho dont think it'll help.
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

btw, dont ask me for where is it, but there's a plugin to convert biped to bones...(no use for the master scene, but yes for fast export-checks)
Finally making games again!
http://www.konekogames.com
Vuen
Posts: 25
Joined: Tue Jul 11, 2006 8:03 am

Post by Vuen »

vermeer wrote:You could go and "dummy" in geometry objects tho I dont believe it detects it as dummy...

I think if u did unmark bones animation wouldnt be exported...if not u could try that...In othe rpackages you would just an "export selected"...hmmm...maybe try to hide the biped...tho dont think it'll help.
Unfortunately none of these work. The "dummy" option doesn't seem to do anything, as the dummies seem to get exported (as 12-polygon cube meshes in fact) even if you leave this option off. Unmarking bones or doing an export selected on the mesh both result in no animation in the .x file. And hiding things doesn't affect the exporter.
drac_gd
Posts: 132
Joined: Sun Apr 09, 2006 8:43 pm

pandasoft DirectX Export irrlicht loader fix

Post by drac_gd »

I did a hack to make irrlicht read directx files exported from studiomax8/Pandsoft exporter

take a look in bug fixes but you may have to do a lot of reverting code if your not using irrspintz style 32 bit index
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

but...the fact is...the directx export from it does work,actually...
Finally making games again!
http://www.konekogames.com
drac_gd
Posts: 132
Joined: Sun Apr 09, 2006 8:43 pm

Post by drac_gd »

But the fact is that it doesnt work in a lot of cases.. Just look at the number of posts about it.
Are you using the latest from pandasoft?
Are you using the studio max 8 version?
does your model have more than one frame at the root level?
Is your model complex with attached named meshes?
The fact is that a lot of models with sub meshes that show up fine in the directx viewer are screwed up in irrlicht or dont animate and may or may not get fixed by loading in mview and resaving it. In my case this workaround worked in some cases but not all. The changes I made fixed both issues on the models I have. Just because it works in your specific case doesnt mean that it isnt broken or have bugs. Its not just me that have seen the same issues.
In any case dont bother flaming me cause I am giving up trying to help:(
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

I am not flaming.
Is your model complex with attached named meshes?
In a very old post about panda and some others more I made, one of the problems mentioned, and a tip adviced often was, in irrlicht make the models not of attached parts. I earn my food plate as a game artist since a while, and know everything attached can be done single piece or use different skeleton x files combined. (what is more, all your biped problem and the fbx trick, I had adviced since eons in hundreds of posts, so I get the conclussion people don't search)

I am yet trying to see those flames you mention.

I am quite tired of discovering people do not search in the forums,(and some tend to over react) or using google as the searcher with this site as constraint, if the search feature is bad here...which i don't think it is now, but am unsure...

Lol, some ppl get fast to certain conclussions.

My error is trying to help, so much during so many years.

Good luck and have a nice day. Bye.
Finally making games again!
http://www.konekogames.com
Vuen
Posts: 25
Joined: Tue Jul 11, 2006 8:03 am

Post by Vuen »

vermeer, I think the point drag_gd was trying to make is that we shouldn't have to resort to breaking apart our meshes, exporting to alias, resaving in mview, among the many other hacks required to make it work. There is a huge amount of room for improvement in the model loader, and we should be welcoming bugfixes, not ignoring them on account of "it already half-works."
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

There had been already made several bugfixes which are part of the Irrlicht SVN version for some time. Furthermore the bugfixes were not really explained and thus hard to track. I don't think that anyone would refuse bugfixes presented. But presenting a "hack" based on IrrSpintz, without further explanations, and in full code instead of a patch is hardly useful as this requires lots of work to identify and understand the changes. And I'm still not sure that it isn't really a "hack" without ever reading the .x specifications.
Post Reply