Game Development Community

Exporting Sequences As DSQ

by Brian Wells · in Torque Game Engine · 09/22/2001 (9:36 am) · 21 replies

Question:

I export the model and with imbeded animation, it runs no problem (the individual threads show up fine and you can watch the animations).

Now I want them as seperate DSQ files and I want the model to be exported as just the geometry. When I do this, the DSQ and the DTS files export great, but the animations no longer show up in the threads menu in DTS viewer. Do I have to include some sort of script to show the model where it's animations are? I am assuming the sequences do not know the filenames of the DSQ files, so they do not know where to point to them without a script.

Also, after I write the script will the animations be viewable as threads via the DTS_SHOW like they currently are for me?

I am expecting Tim to try to answer this one for some reason :)
Page «Previous 1 2
#1
09/22/2001 (10:29 am)
You do need to inform the engine which dsq files to load up, this is done using the scripting language, and yes I am answering this post :) This is done on the server using a datablock. A datablock is used because it will get transmitted to the clients who will need to build the shape as well. A good example is the data/shapes/player/player.cs file which initializes the player.
datablock TSShapeConstructor(PlayerDts)
{
   baseShape = "./player.dts";
   sequence0 = "player_root.dsq root";
   sequence1 = "player_forward.dsq run";
};
When the datablock is run it actually loads the .dts merges in the dsq's and adds the new dts image to the resource manager, so if you do this before you load the shape in the show tool, the animations should show up... though I haven't tried this recently.
#2
09/22/2001 (10:41 am)
Small note on this since it already bit me. The show tool expects the datablock filename base to be the same as the .dts your are loading - loading shape player.dts will attempt to load script player.cs from the same directory.
#3
09/23/2001 (2:34 am)
Thanks Guys, I wil try it now.

So do the DSQs only store skeletal animation info, or do they also store all types of animation info (texture animation etc.)
#4
09/23/2001 (2:48 am)
I have no idea. I've only seen it used for skeletal animation though.
#5
09/23/2001 (3:02 am)
Tim,

Any info on why the exporter takes such a long time to do it's thing?

Anything animated takes a butt-long time.
#6
09/23/2001 (3:14 am)
Ok

Well now with the script it crashes...a memory could not be "read" error.

Do I have to preload/cache the animations someshow to see them in show?

Thanks
#7
09/23/2001 (3:35 am)
I'm not very familiar with the exporter code, but from what I understand there are "questionable" activities. I could be wrong on this, but I think one of them is that it compares every vertices of the shape on each keyframe with the previous keyframe to see if anything's changed. It does this to find out if the mesh has been morphed (different than the skeletal animation). This seems a little lame to me, but maybe Max doesn't provide that sort of information easily?

So, basically I think the exporter does a lot of brute force searching; the higher the polycount and the higher the exported frame rate, the slower it's going to be.

By the way, this is something you probably want to double check... make sure your not exporting the animations at some ridiculous frame rate, like anything higher than 30 (though even 30 is fairly high, you can get away with a lot less it most circumstances.)
#8
09/23/2001 (5:14 am)
Someone mentioned in another thread, that anims with a certain option basically export keys for every single frame (rather than just keys that are in the key track in max), so thats something that could cause delays quite a lot.

Hopefully I'll get onto the importer code in a week or so (man do I need to do it :))

Phil.
#9
09/23/2001 (5:18 am)
Well

I believe that Tim is right on the exporter. Whereas the Hlaf Life exporter takes about 3 seconds on a huge model and animation, the DTS exporter is 5 minutes+ even on my 1.6 ghz.
#10
09/23/2001 (11:52 am)
The long export times are primarily due to using physique or morph animations. Physique actually requires you to use morphs which takes a snapshot of the entire mesh for every frame. What you actually want to do is to use COM_Skin (which is available from the discreet opensource site). Turn off collapse transforms when exporting your base shape (.dts). In this base shape, your mesh skin will already have all the vertices assigned to a bone (or biped part) and subsequent sequence files only need to export the bone (or biped) nodes - the engine deforms the mesh in realtime if you use this method. My exports went from 20 minutes for long sequences to about 1 second when I switched to COM_Skin.
#11
11/25/2001 (4:00 pm)
Ok, how does one do this in milkshape?

Or does one yet?
#12
11/26/2001 (5:37 am)
In milkshpae, the exporter save the animation in the DTS file. You may then write a small piece of code to save it as a DSQ file by using the save sequence utility method in the shape class.
#13
11/26/2001 (6:48 am)
Am I right in thinking that milkshape actually exports anims now then?

What about setting up proper orientations etc?

Phil.
#14
11/26/2001 (7:59 am)
while ppl are hear, I was wondering if the exporter supports single meshes for the player or if the mesh should be divided into smaller objects like legs, arms, torso etc
Anthony
#15
11/27/2001 (12:43 pm)
I guess it's that "small piece of code" that is elluding me.

Basic looping anims work, just can't get DSQ's.
#16
11/29/2001 (5:16 am)
If you look at the max2dts exporter, it uses the following function to save sequence into a DSQ file :

void TSShape::exportSequences(Stream * s)

I think, that it will not be too difficult to add it to the milkshape exporter. As my computer was broken for two weeks, I was not able to work on the code. But if this functionnality is not already in the last CVS release of the milkshape exporter, I can look at it (I repaired my computer Monday night ;)
#17
11/30/2001 (11:59 am)
Well, it didn't seem to be in the latest version.

And, I am not sure I understand it well enough to do it myself, so anything that anyone can do would be great :)
#18
12/02/2001 (1:45 am)
I think that Tim will look at it from what he has put in his last .plan file.

Just wait a little bit ;)
#19
12/02/2001 (6:26 am)
WARGH!!!

:)

Patience, ack, who needs it :)
#20
12/02/2001 (1:34 pm)
There is one problem with using DSQs, MilkShape and Max. I recently built a player bone structure in MS, mirroring our current Max player shape so that I could create a new shape in MS, but load our old DSQs output by Max (all our existing animations). Unfortunately, MS performes some bone "normalization" which is not compatible with the Max bones. I've tried working around it, but MS seems pretty adament about performing this normalization. Since the DTS shape must match the bone orientation, MS and Max shapes/DSQs are not compatible.

I've talked to the MilkShape author about it, but he seems to be pretty busy on other stuff. Not sure if he'll ever change it. I may be able to have a "max compatible" export option, but that may only work under some circumstances, it really needs to be changed in MS.
Page «Previous 1 2