Sign in to follow this  
rzn

DirectX9 animation export to X file problem.

Recommended Posts

Hello,

I have a problem concerning export of skinned meshes with animation from 3ds max 2012 file to an X file suitable for DirectX 9. I have written a program which is capable of loading a model from an X file and playing it's animations. I've used tiny_4anim.x from SDK up until now and it worked perfectly, that means, I have been able to play each animation in my program. But we needed to add a new model to our project, so now we have another 3ds max model with different animations. But I have no success exporting it to an X file so that I could use it in my program. The most successful attempt was when I could load a model but the animation didn't play. I have also used DXViewer to test my X files and the model loads fine but the animation isn't played, unlike with tiny_4anim.x. The animations are played correctly in 3dsmax itself. What may be the source of this problem? Maybe I should use some specific export settings? I use Pandasoft exporter for 3dsmax. The language I use is C++.

Thanks in advance.

Share this post


Link to post
Share on other sites
i do not think the x file is a waste of time. at least not for learning how it skinned meshes work. maybe for other reasons, but if you are learning, i don't see it that way. i took the x file and learned how to do animations first in software, then in hardware. now i roll my own format that suits what i need. i wasn't able to do that prior to learning how and why things were arranged a certain way.

none the less, are you trying to animate the x files in software or hardware?

if in hardware, have a look at the directx 10 sdk from nvidia ( skinned instancing ). yes, it runs on dx 10, however it loads the models in dx 9. i took this principle in the beginning and then would convert them to a seperate model format once i got it working.

i know hte tiny x model was a mystery to me for a while.

hope this helps, and i don't consider learning anything a waste of time.

Share this post


Link to post
Share on other sites
[quote][opinion] The time spent learning how to work with x files is wasted time. Look for a better alternative. [/opinion][/quote]
Like what? I've done some research and this is what I've managed to gather: X files are deprecated and are not reliable and they are not to be used for commercial projects. But what should we do? Parse 3ds files manually? Export them to another format and parse it? But then we won't be able to use D3DXLoadMeshHierarchyFromX function and we'll have to do everything ourselves. It seemed easier to stick with DX's functions. What's the correct way of doing these things?!

Share this post


Link to post
Share on other sites
[quote name='rzn' timestamp='1317917511' post='4869813']
[quote][opinion] The time spent learning how to work with x files is wasted time. Look for a better alternative. [/opinion][/quote]
Like what? I've done some research and this is what I've managed to gather: X files are deprecated and are not reliable and they are not to be used for commercial projects. But what should we do? Parse 3ds files manually? Export them to another format and parse it? But then we won't be able to use D3DXLoadMeshHierarchyFromX function and we'll have to do everything ourselves. It seemed easier to stick with DX's functions. What's the correct way of doing these things?![/quote]
Before attempting to add animation to your game/engine, you should learn how to load vertex buffers with data, how to work with shaders, how to set shader variables from your application, how to load data from files, and a few other rather basic tasks. Once you're comfortable with this you should be able to apply a few types of deformation effects to your geometry, like sine waves, procedural deformations, vertex blending (tweening)... etc. Skinning is then not a very complicated type of deformation to apply to your geometry. There are a few samples and tutorials out there which teach how to work with shaders to do skinning.


The second part of the problem is to get your models, skinning weights, and bone animations from whatever content development software your artists or yourself want to use (like Maya or 3D max). For Maya, there was a dude called Rob the bloke (google robthebloke) that made a website that mainly teaches how to get this data from Maya into your application, with full samples and everything. The Unreal Engine has exporter plugins for Maya and Max for example, while Unity can read Maya scene files directly, or load .fbx files which contain animation data (see [url="http://unity3d.com/support/documentation/Manual/Character-Animation.html"]this [/url]and [url="http://unity3d.com/support/documentation/Manual/HOWTO-importObject.html"]this[/url]). Working with fbx files seems like the better choice to get started with.

Or, if it's a viable option to you, just use an existing engine. Best of luck.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this