|
directx export does not export bones animation into irrlicht game engine
About Truespace Archives
These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.
They are retained here for archive purposes only.
directx export does not export bones animation into irrlicht game engine // Archive: Tech Forum
Post by frootee // Jun 12, 2006, 3:57pm
frootee
Total Posts: 2667
|
Hi folks. I am trying to export a directx file from a simple boned animation.
I have a cylinder with some bones added. The animation plays fine in truespace but when I export as a directx object (store object as single mesh / export animation), it does not animate when loaded into irrlicht.
ANy thoughts?
thanks
jason |
Post by ordaz // Jun 12, 2006, 10:47pm
ordaz
Total Posts: 5
|
This is a tricky question, because of several points. First of all, there's the "Save As" options; for most engines (as long as you don't know how they treat X files once loaded) it's a matter of trial-and-error until you get the right setting for exporting. Second of all, the keyframe settings... and the list could go on.
As an idea, if you haven't already tried, I'd make the typical spinning cube and see if it loads with full animation into the engine. If it does, then I'd try exporting an animated hierarchy (kind of an industrial robot arm) without bones, just direct/straight kinematics. If those both worked, we could focus on the bones themselves. If they don't, perhaps it's a matter of tweaking the Animation Export Settings. |
Post by frootee // Jun 13, 2006, 4:07am
frootee
Total Posts: 2667
|
thanks ordaz. I also loaded the animated mesh into the directx mesh viewer, with the same results. No animation. So either I am doing something wrong, or there is an issue with the truespace directx exporter (ts 6.6), or both.
I have not tried pure IK (no bones) yet, but I will try that next. |
Post by TomG // Jun 13, 2006, 5:16am
TomG
Total Posts: 3397
|
I believe bones don;t export - bones are very unique from system to system, so tend not to export well. Geometry animation (regular translations, scales, rotates, even vertex movement) is much easier to pass between systems because it is much less dependent on the system that made it (the maths for a translation are straightforward and universal - a bones system however is a whole group of calculations that all depend on how bones were implemented).
Add to that that different sytems loading the directx may or may not support bones in one definition or another, and it gets even more complex.
If I recall, the solution is to convert bone animation into vertex animation, there is a Bones2Vertex plugin or process that will do this.
HTH!
Tom |
Post by frootee // Jun 13, 2006, 6:56am
frootee
Total Posts: 2667
|
thanks Tom. I will pursue that. I have not looked at other engine demos but, in the irrlicht demo, there is an animated dwarf, and it looks like there are bones/joints attached. You can see what looks like joint *targets* at the ankles and other places. That's why I thought that we were supposed to export the bones and object as a single object. I will check that out as well.
Tell you the truth, it makes more sense to just export vertex animation anyway, because if it does not work, you may as well go back to the app that you used to create the animation in the first place, rather than try to tweak it further in the game app.
Thanks again!
jason |
Post by TomG // Jun 13, 2006, 3:37pm
TomG
Total Posts: 3397
|
It could well be that the engine supports bones etc - however the chances of succesfully translating tS bones into their bones are slight :) This is the primary issue with bone based animations, ever app does it in a different way (since there are many possible solutions one can come up with to handle bone based animation - but only one way mathematically to do vertex animaton and store and handle 3D points - ok kind of an oversimplification but you get the idea :) )
There may be ways to assign bones in the engine itself to parts of the model? Or some little tool for attaching a skeleton? Or maybe they use some "standard" skeleton from a game format?
Still, the bones2vertex may give you what you need anyway! Let us know how you get on.
Thanks!
Tom |
Post by frootee // Jun 13, 2006, 4:30pm
frootee
Total Posts: 2667
|
Thanks Tom.
Weeeeelllllll....
I am having trouble with vertex animation. I can do it in truespace:
1. right click on the record button in the keyframe editor, and select: Vertex for keyframe recording.
2. set a translation keyframe for the vertex at 0 and 100, where the location of the vertex is translated at 100
3. play back the animation to confirm the vertex does indeed move (the mesh is a cube by the way)
4. Do a File-> Save As -> Object -> Directx
and
make sure: Export Animation, Keyframe Step (1), are set
5. Load this into Microsoft's DirectX mesh viewer (DirectX 9.0C)
6. No animation. Only a non-animated cube.
Am I missing something here? It seems that this ought to work; I am assuming that vertex translation (to stretch/skew an object, for example) is possible with directx, so I think I must be doing something wrong.
Any and all help is most appreciated!
Thanks,
Jason |
Post by frootee // Jun 13, 2006, 5:05pm
frootee
Total Posts: 2667
|
btw... I cannot find the bones2vertex plugin. Anyone know where it may exist?
thanks,
jason |
Post by frootee // Jun 13, 2006, 7:52pm
frootee
Total Posts: 2667
|
Here's how to do it.
Previous Post I found:
//////////////////////////
You can successfully use vertex animation with Motion Studio bones, as long as you don't try to mix skinning and vertex animation. In other words, if you attach an entire object (or group) to a Motion Studio bone, you can also vertex animate that object. However, if you want to use Motion Studio's vertex-level skinning option, that will override any vertex animation.
You can see an example in our Gallery. The facial expressions in the "Yeah!" animation were done with MultiMorph, while the rest of the body was animated with Motion Studio.
Gallery is accessible from the Motion Studio homepage here:
http://www.turbophp.com/MotionStudio/
Scott
////////////////////////////////////////
What I found out tonight:
directx howto
make sure autorecord is on
open keyframe editor
make sure vertex, scale, rotate, and translate are selected
create 2 cylinders
add 2 bones
attach bones to cylinders
do not enable skinning
switch to animate mode in motionstudio
press record key in motionstudio
set keyframe to 20
press record key in motionstudio
rewind in motionstudio
press Play in motionstudio
keyframes for the object are recorded
when done, go to keyframe editor
select each cylinder in turn and move it up, above the bones/skeleton hierarchy. This will move
the vertex keyframes out of the bones system
remove the bones/skeleton system by deleting it in the keyframe editor
save the scene file
save the directx file
load directx file into your favorite game engine or microsoft directx mesh viewer
watch the cylinders spazz out :banana: |
Post by ordaz // Jun 14, 2006, 3:26pm
ordaz
Total Posts: 5
|
Hi again,
Ouch! I get a 404 with "http://www.turbophp.com/MotionStudio/" Perhaps it's somehow my fault...
Now, back to the front...
I don't know why MS has changed the MesViewer; back in older SDKs you could use it to export .X as progressive meshes, and some animations played while they don't in the current version. There are also "minor diferences" from the exported X format to the one we can see in d3dx9mesh.h (from DXSDK); for instance, we export xof 0302txt 0032 and d3dx9mesh.h reads xof 0303txt 0032. Awright, there should be no problems, but that's just a little example. So, when I want bones in DS, I go with D3DXCreateSkinInfoFromBlendedMesh and its frinds... some times having to re-save X (load the X, skin, blend, convert, blend... a pain).
So, about bare DX, I could try and give you a hand (see, it's 3:20 a.m here, my coffee break, I'll be back to coding soon). But about a given engine (one I haven't coded or used), I'm afraid I won't be that helpful, sorry.
Argh! My code just compiled and there are two warnings! This cannot be happening...
Sorry to rush out (I need more caffeine...) |
Post by frootee // Jun 15, 2006, 2:55am
frootee
Total Posts: 2667
|
hi ordaz. Sorry about that broken link. I believe I found workaround, by reading the MotionStudio/ts7 workaround by Frank Ladner, posted in the Roundtable forum.
But it seems I can only export animated meshes of segmented characters from within ts. Is it possible to also export vertex animation into directx, for quick viewing in the mesh viewer? I cannot seem to get that to work.
Also, does microsoft maintain an archive of older versions of the mesh viewer? I am trying to find a version that allows me to perform these functions (for Blender purposes... :-D )
1 - Open the .x file exported from Blender with Mview(the DirectX viewer which comes with DirectX SDK)
2 - Click on MeshOps-Vertex Selection
3 - Click over the mesh
4 - Again MeshOps-Weld Vertices
5 - Select the first 2 options "Remove Back To Back Triangles" and "Regenerate Adjacency"
6 - Then "Apply"
7 - Resave the mesh
thanks!
jason |
Post by frootee // Jun 16, 2006, 2:57am
frootee
Total Posts: 2667
|
Hi ordaz. I found out something interesting last night.
I can use truespace's native bones system to animate a mesh, then load into gamespace light, then export to directx, without a problem. But, I cannot successfully export a model to a directx mesh when I use motionstudio (mostu).
I have tried using mostu in ts6.6, followed by saving the vertex animation, then loading that into gamespace light, without success either.
has anyone successfully boned a mesh with motionstudio and exported to directx format?
thanks,
frootee |
|