Game Development Community

Collada animation import - LOGGED

by Tod · in Torque 3D Professional · 05/17/2010 (12:28 pm) · 18 replies

I have a blender model with 619 animation frames. The animation is from a BVH motion capture. I export this to Collada, then peaked in the collada file and saw an animation count=619. Exactly what I expected. The time sequence on the frames is 0.03333 seconds. Which yields just over 20 seconds of animation at 30fps.

However when I load it into T3D, it says I have 773 frames. Why?

Not only do I have an additional 154 frames, but in many of the frames (not all), the end of the bones (i.e feet, hands, head) rotation translations are messed up. Like the head will flop violently for 10-15 frames, then later on a foot will, etc.

I am guessing that these incorrect endpoint rotations are in the extra 154 frames that have been added by torque?

Any clue why this might be happening?

#1
05/17/2010 (1:55 pm)
I don't know about the Blender exporter, but in Maya I had problems when the animations were not exported as "baked transforms" (aka: each keyframe contains a matrix for each node). By default it seems every individual keyable channel is exported separated (x/y/z translation, x/y/z rotation, x/y/z pivot translation, etc, etc, etc) T3D cannot read the animation correctly.
#2
05/19/2010 (11:17 am)
It seems, in its current state, Collada isn't really the savior format that a lot were hoping for. I've tried a few various pieces of software that had support for collada, and every one seems to have their own intrepertation of it. I admit, my hopes were pretty high that I'd be able to use just about any 3D rendering program that supported it and import my assets right into torque.

I haven't seen a DTS exporter for Maya 2011. The closest I have seen in 2008. Blender 2.5 is a great piece of software, but alas, the collada animations they export aren't usable in torque for some reason. As a hobbyist, a purchase of 3DS is out of the question, and that leaves Milkshape (which I think is dead).

I hope a lot of these Collada discrepancies get resolved. I'm not pointing finders at the torque crew or the blender crew. I'd just like to be able to concentrate on what I like to do, and not hunting down work arounds or fighting with my code/art to get it into torque. :-)

#3
05/19/2010 (12:04 pm)
What is the best current exporter for DTS/DSQ modeling then?

It seems like Maya is one of the best ones to update.
#4
05/19/2010 (6:16 pm)
@Tod,

I'd be happy to take a look at the exported COLLADA model if you can send it to me.

You're right that there is a lot of variation in the COLLADA output from different 3D apps; especially early exporter versions when the spec may not have been well understood. My experience though is that this situation is improving all the time as exporters (and T3D) mature.

BTW - you are a T3D binary user, right? Just checking since a number of fixes went into the COLLADA pipeline for the current (and next) beta releases which are currently only available to T3D Pro owners.
#5
05/19/2010 (6:18 pm)
@Manoel: If you have any of those Maya models that were not importing correctly I'd happily take a look at them too. Ideally versions both with and without the 'Baked Transform' flag set so I could verify if/where something is going wrong.
#6
05/19/2010 (6:40 pm)
Yes, I am only a binary. I bought source for the previous versions, TGE and TGEA, but I haven't bought source for T3D. The price has jumped quite a bit since I bought the previous ones. I'd like to make sure that T3D is going in a direction that will stop my use of motrin first. After all it is just a hobby for me, lol.

I've done a lot of digging and have found that the OpenCollada plugin for Maya 2011 (its an RC right now) does the best job. Blender's is buggy without doubt, but mostly Maya can read the blender exports. If I then use Maya's to export, the model does animate proper (although it still has a lot of extra frames).

The biggest issue seems to be with multiple mesh objects parented to one armature. But I think that is a blender issue. I have 1 mesh for the hair (because I need two sided textures), and one mesh for the body. When imported into torque or maya, only the body mesh comes though and I get an error saying it cannot find the material linked to the hair.

So as of right now, I can get a animated model into T3D if I first model it in blender and do not use multiple mesh objects. Then export to collada, import into Maya, then export from Maya back to collada.

I could certainly send you one of my models that I am having issues with if you think it would help.

btw, your name seems very familiar. Aren't you the guy that made the MS3D exporter? Geez, I used that for a long long time and it always worked so good.
#7
05/19/2010 (7:20 pm)
Yep, I wrote the MS3D exporter guy and now look after the T3D COLLADA importer as well. Boy do I miss those easy days of only having to worry about one modeling app!

Please do send one of your Blender exported COLLADA models (email is in my profile, just remove the null). If Maya can import/export a working model from this DAE, then T3D should be able to as well.

On the extra frames issue......does the animation play ok? ie. do the extra frames make it distorted/slower/different in any way?
#8
05/20/2010 (11:00 am)
lol, I always wanted to email you about releasing the source for that exporter, but just never got around to it. I wrote an MS3D importer for the GLScene project and always wanted to expand on your exporter.

As for the extra frames, I haven't put a stop watch on it to see if its changed the FPS of the animation. I somewhat expected it was T3D trying to normalize the animation to some base FPS. Once I was able to find the RC of the Maya exporter that actually didn't break anything, the frame rate issue took a back seat.

Tonight, I'll put together a few different exports both from blender and from Maya and email them. One model with a single mesh and another model with multiple meshes and materials. I'd sure like to get the multiple mesh collada working.

On a note for Maya, The included DAE-FBX exporter that comes with Maya doesnt do a very good job. The OpenCollada one has lots more options and seems to play with torque far better. I suspect that T3D must use some of the OpenCollada code/spec?

Thanks Chris

:-)





#9
05/20/2010 (1:23 pm)
@Tod: not everything is roses in the OpenCollada camp. It is completely unable of exporting vertex colors correctly: it picks whatever color the first vertex in the mesh is using and replicates it for the entire model. This is not even a T3D issue: re-loading the exported DAE back into Maya is enough to confirm this.

The FBX exporter does handle vertex colors well, but it's inferior when it comes to animations and joint hierarchies.
#10
05/20/2010 (3:25 pm)
Quote:I suspect that T3D must use some of the OpenCollada code/spec?

Nope. OpenCollada just does a better job of sticking to the COLLADA spec than many other exporters. Still not perfect (as Manoel points out), but since it's still being actively developed, there's a good chance that those issues will eventually be sorted out.

I would recommend anyone who finds an issue with the OpenCollada exporter to report it to them (opencollada.org/home.html).
#11
05/20/2010 (3:37 pm)
Oh, I totally agree the OpenCollada stuff needs a lot of work. In fact every Collada importer/exporter there is seems to be doing things differently or doesn't support all the features that it should. What really is needed, imo, is a simple way for people to get their artwork into torque without spending huge amounts of time to find a plugin that works. But I have faith in Chris :-)

I am able to export a fully animated and textured model from maya with weighted vertexes and it does work good, but again, only if I use the RC edition of the exporter.

The down side is I am not a maya user really. I do most of my modeling in blender. I guess I am just familiar with the interface.

@Chris, the models are in the mail
#12
05/27/2010 (1:06 am)
I am able to export COLLADA directly from Poser and it works great...just make sure that you use your own models of course:O) Also the OPEN COLLADA works great for 3DS MAX...thought there was one for MAYA too....hmmm I really don't know about MAYA as I don't use it. For animations that I do in MAX, that wont work for COLLADA, I make the master shape with no animations movement but with Bones, and make all the animations from there DTS, try that...
#13
05/27/2010 (10:21 pm)
I think all of Tod's issues have been resolved now; here's a summary for those watching the thread:

1. The frame count difference arose because T3D resamples all animation data at 30fps. This can sometimes cause problems (ie. the bones flipping around on some frames), but can be avoided by exporting your animations at 30fps (so the T3D importer does not need to interpolate keyframes).

2. The problem with the 2 mesh model was a bug in the Blender exporter, where it exported two skin controllers with the same ID. This violates the COLLADA spec and causes the T3D loader to read the wrong weights and bind-transforms for the second mesh.

3. The Blender exporter was also exporting texture coordinates as XY (instead of UV as expected by Torque). The T3D importer will handle this automatically in the next beta.

Tod has fixed issues 2 and 3 in the Blender exporter and has generously provided the changes to the community.
#14
05/27/2010 (11:16 pm)
That "T3D resamples all animation data at 30fps..." is valuable information and should be well noted in the T3D DOC's.
#15
05/31/2010 (12:13 pm)
feeling *Sheepish* for not reading it well:O) no I know what happened im my failed attempts at some animations:O)
#16
05/31/2010 (12:22 pm)
@Chris - Do you have any idea why we can't export animated models with point constraints and have the constraints work?

Example -- a idle animation where the model looks around and moves a little his feet move all over even though in Maya they stay firmly planted.

We can send a model if you would like.

Thanks
#17
05/31/2010 (7:29 pm)
@Chris: I have replied in your original thread.
#18
06/05/2010 (11:05 am)
logged: TQA-225