Exporting animation in collada format
by john lomax · in Artist Corner · 10/26/2009 (8:09 pm) · 22 replies
Hey guys, I am a student at Columbia college Chicago currently in my senior year capstone class and am needing assistance in exporting joint based animation from maya to torque 3d. Has anyone been successfully able to not have to use dts and export only using open collada ? I would greatly appreciate any sort of help from you guys, thanks a lot I truly do appreciate people taking the time to help.
#2
10/26/2009 (10:05 pm)
Sorry, the only reason I did that was because I was not to sure what section to post in since it was torque and maya related. Basically I am having problems exporting animation from maya using the dae open collada format. I was able to export the animation but all I see within the shape editor is the joints moving and not the actually mesh, in fact the mesh did not even come in only the joints. I have not seen any sort of documentation on using open collada to take animation from maya to torque so that is what is making this very difficult. Any sort of direction or help would be greatly appreciated, thanks Chris.
#3
I am using Maya 2008 and open collada exporter for Maya. I have characters that are animated and are exporting in but distorted. The animations seem to play fine but freak out, models slide around and are not posed properly.
Can anyone help me with understanding the skeletal setup in Maya so they come in and play animations correctly?
One character I loaded the geometry looks fine but it does not move correctly. When I bring in another character he is contorted and bent all to hell and back.. Do you know how that should be set up in hierarchy or does it require special nodes?
Please help us.
10/26/2009 (11:06 pm)
We are having trouble to;I am using Maya 2008 and open collada exporter for Maya. I have characters that are animated and are exporting in but distorted. The animations seem to play fine but freak out, models slide around and are not posed properly.
Can anyone help me with understanding the skeletal setup in Maya so they come in and play animations correctly?
One character I loaded the geometry looks fine but it does not move correctly. When I bring in another character he is contorted and bent all to hell and back.. Do you know how that should be set up in hierarchy or does it require special nodes?
Please help us.
#4
So no geometry was visible in the Shape Editor at all? Were there any errors or warnings in the console log?
10/27/2009 (1:10 am)
Quote:all I see within the shape editor is the joints moving and not the actually mesh, in fact the mesh did not even come in only the joints.
So no geometry was visible in the Shape Editor at all? Were there any errors or warnings in the console log?
#5
10/27/2009 (1:16 am)
no not any at all when I exported it did not give any errors. If you have exported animation using dae It would help a GREAT deal if you would go through your process of how you do it. I know that is a lot to ask and I am sure you are busy but it would be amazing to know how people are using open collada to export out animation from maya. Thanks again for responding Chris.
#6
I mean, were there any warnings or errors in the console.log file when you imported the model into T3D.
Unfortunately I am not a Maya user. However, I wrote the T3D collada loader so I am very interested in making sure it loads everything correctly. Are you able to send me the model in question? (email is in profile, remember to remove the null).
10/27/2009 (1:59 am)
Quote:when I exported it did not give any errors.
I mean, were there any warnings or errors in the console.log file when you imported the model into T3D.
Quote:If you have exported animation using dae It would help a GREAT deal if you would go through your process of how you do it.
Unfortunately I am not a Maya user. However, I wrote the T3D collada loader so I am very interested in making sure it loads everything correctly. Are you able to send me the model in question? (email is in profile, remember to remove the null).
#7
10/27/2009 (2:30 am)
Absolutely Chris I have no problem with sending you the file, I am going to send it to you as soon as possible. Just to let you know also the animation is baked into the joints I am not sure if that is a problem or not. I know I am saying thanks a lot but thank you again :p
#8
1. www.garagegames.com/community/forums/viewthread/104415/1#comment-692367
2. www.garagegames.com/community/forums/viewthread/102739/1#comment-691837
10/27/2009 (6:30 pm)
I can see the geometry and the animation plays perfectly when I import it here. Could you try applying these bugfixes and let me know if they fix the problem for you?1. www.garagegames.com/community/forums/viewthread/104415/1#comment-692367
2. www.garagegames.com/community/forums/viewthread/102739/1#comment-691837
#9
So I just finished up installing the newest version of torque 3D and as you said the model loaded in correctly and plays the animation correctly as well. I am not completely sure but when importing before in torque 3d 1.0 the mesh would not come with the joints and the unit scaling was completely off so I think it was a matter of just upgrading to 1.1. I would have not assumed that that would have been the issue. I took a look at the two threads that you sent me links to and this is very very good to know especially the one on have a dence vertices count causing problems when importing using collada. Thank you so much for your help Chris and taking the time to check out my files. If I have any questions later on about anything else involving animation with collada would you mind if i asked you about it ?
10/28/2009 (12:26 pm)
Hey Chris ! So I just finished up installing the newest version of torque 3D and as you said the model loaded in correctly and plays the animation correctly as well. I am not completely sure but when importing before in torque 3d 1.0 the mesh would not come with the joints and the unit scaling was completely off so I think it was a matter of just upgrading to 1.1. I would have not assumed that that would have been the issue. I took a look at the two threads that you sent me links to and this is very very good to know especially the one on have a dence vertices count causing problems when importing using collada. Thank you so much for your help Chris and taking the time to check out my files. If I have any questions later on about anything else involving animation with collada would you mind if i asked you about it ?
#10
10/28/2009 (7:52 pm)
Glad your model is working for you now, John. Don't hesitate to create new threads if you have other questions or find a bug; it's better than emailing me direct since others can see the answer/solution as well. :-)
#11
Long time no talk man I hope all is going well and that you have an awesome Christmas and new years coming up. So like usual I am having some issues again involving the same problems as before dealing with exporting Collada animation and I seriously did trouble shoot the problem to the brim but i still am ending up with the same screwy results,I hate to bother you but I am completely out o options. Ok so here is the issue, I have a model with an idle joint based animation in maya. The animation has been baked into the joints as it was before. So, Essentially what I am trying to do is the same thing that the default Gideon character does and that is have a root pose that consist of no animation then export out dae sequences that only consist of me exporting the skeleton and the animation to lower the file size basically the same way that Gideon is used but using dae files instead of dts. I have gotten this to work before on the previous model that we took a look at earlier in this post. Ok, so the problem that I am having is that when I export the root pose with no animation but just joints, mesh and skinning their is no problem. But when adding a new sequence which is the actual animation their is one of two problems that occur. The first is the model and joints will fly completely off the grid from where the root pose is and is in the air and the animation is distorted. But this does mean the animation is coming in just extremely distorted. The other problem that may occur is torque will just crash all together when trying to open the animation sequence. I have had no problems with the root at all but I assuming thats because it consist of now animation to destroy it. I would love any sort of help that you can give Chris, I am really desperate and need the help because the project I am working on right now with my classmates will just not work at all if this issue is not resolved sooner or later. But I do understand that sometimes these things happen and can never be resolved because their are way to many variables. I am attaching some pics at the bottom that consist of some of what is happening. Their is also a link to send space where you can grab all the dae files and even the maya files if you wanna mess around with those. Thank you so much Chris for even taking the time to read over this I really appreciate it. One last thing, their are two types of idles in their they are both exactly the same except one of the models is holding and axe and the other is not. I get the same distorted results in both files. Thanks again and happy holidays !!!
Export settings for idle root pose (No animation)

Export settings for idle root pose (Animation enabled)

When root pose with no animation sequence has been added

When root pose with no animation sequence has been added with axe

Result of adding an animation sequence

Link to dae files:
www.sendspace.com/file/wjl0n2
12/20/2009 (9:22 pm)
Hey Chris !Long time no talk man I hope all is going well and that you have an awesome Christmas and new years coming up. So like usual I am having some issues again involving the same problems as before dealing with exporting Collada animation and I seriously did trouble shoot the problem to the brim but i still am ending up with the same screwy results,I hate to bother you but I am completely out o options. Ok so here is the issue, I have a model with an idle joint based animation in maya. The animation has been baked into the joints as it was before. So, Essentially what I am trying to do is the same thing that the default Gideon character does and that is have a root pose that consist of no animation then export out dae sequences that only consist of me exporting the skeleton and the animation to lower the file size basically the same way that Gideon is used but using dae files instead of dts. I have gotten this to work before on the previous model that we took a look at earlier in this post. Ok, so the problem that I am having is that when I export the root pose with no animation but just joints, mesh and skinning their is no problem. But when adding a new sequence which is the actual animation their is one of two problems that occur. The first is the model and joints will fly completely off the grid from where the root pose is and is in the air and the animation is distorted. But this does mean the animation is coming in just extremely distorted. The other problem that may occur is torque will just crash all together when trying to open the animation sequence. I have had no problems with the root at all but I assuming thats because it consist of now animation to destroy it. I would love any sort of help that you can give Chris, I am really desperate and need the help because the project I am working on right now with my classmates will just not work at all if this issue is not resolved sooner or later. But I do understand that sometimes these things happen and can never be resolved because their are way to many variables. I am attaching some pics at the bottom that consist of some of what is happening. Their is also a link to send space where you can grab all the dae files and even the maya files if you wanna mess around with those. Thank you so much Chris for even taking the time to read over this I really appreciate it. One last thing, their are two types of idles in their they are both exactly the same except one of the models is holding and axe and the other is not. I get the same distorted results in both files. Thanks again and happy holidays !!!
Export settings for idle root pose (No animation)

Export settings for idle root pose (Animation enabled)

When root pose with no animation sequence has been added

When root pose with no animation sequence has been added with axe

Result of adding an animation sequence

Link to dae files:
www.sendspace.com/file/wjl0n2
#12
I'll take a look at the files and let you know what I find. Are you running T3D 1.0.1 or 1.1 alpha?
BTW, solid blocks of text are a bit hard on the eyes, so feel free to mix in a few paragraphs next time, eh? ;-)
12/22/2009 (3:39 am)
Hi John,I'll take a look at the files and let you know what I find. Are you running T3D 1.0.1 or 1.1 alpha?
BTW, solid blocks of text are a bit hard on the eyes, so feel free to mix in a few paragraphs next time, eh? ;-)
#13
As always, thanks so much for taking the time to take a look at the files. Right now I am currently using T3D 1.0.1. Haha sorry about the huge blocks of text I def understand what you mean about all of the text being so tight together being hard on your eyes sometimes.I will write things a little cleaner for now on haha. Anything you are able to find would be great help Chris, thank you so much again !
12/22/2009 (6:31 am)
Hey Chris !As always, thanks so much for taking the time to take a look at the files. Right now I am currently using T3D 1.0.1. Haha sorry about the huge blocks of text I def understand what you mean about all of the text being so tight together being hard on your eyes sometimes.I will write things a little cleaner for now on haha. Anything you are able to find would be great help Chris, thank you so much again !
#14
Is there some kind of weird scaling applied to the model in Maya? It appears that all animated node positions are 100x larger than they should be. Non-animated node positions are normal.
For example, in Ogre_Idle_Root_Pose.dae, the "Root" node is at position "0 1.259655 -0.006664816". But in Ogre_Idle_Animation.dae, this node has animated positions like "0 125.9655 -0.6664816".
If I edit the collada loader source code to ignore animated node translations, then the animation plays fine - the model's feet move through the floor since there is no translation, but it appears the node rotations are ok.
I see this as well. The problem is that the collada model contains a <skin> that references a non-existent <mesh> element. Is it possible to export only the animated node transforms and not the <skin> information? Maybe try unchecking the "Skin and joints" checkbox for animation-only files?
I put a quick bugfix in for this issue to prevent the crash (since we don't actually use the skinning information in animation-only files). Let me know if you want it (if you can't find a way to export animations without the skin data).
12/22/2009 (8:38 pm)
Quote:The first is the model and joints will fly completely off the grid from where the root pose is and is in the air and the animation is distorted.
Is there some kind of weird scaling applied to the model in Maya? It appears that all animated node positions are 100x larger than they should be. Non-animated node positions are normal.
For example, in Ogre_Idle_Root_Pose.dae, the "Root" node is at position "0 1.259655 -0.006664816". But in Ogre_Idle_Animation.dae, this node has animated positions like "0 125.9655 -0.6664816".
If I edit the collada loader source code to ignore animated node translations, then the animation plays fine - the model's feet move through the floor since there is no translation, but it appears the node rotations are ok.
Quote:The other problem that may occur is torque will just crash all together when trying to open the animation sequence.
I see this as well. The problem is that the collada model contains a <skin> that references a non-existent <mesh> element. Is it possible to export only the animated node transforms and not the <skin> information? Maybe try unchecking the "Skin and joints" checkbox for animation-only files?
I put a quick bugfix in for this issue to prevent the crash (since we don't actually use the skinning information in animation-only files). Let me know if you want it (if you can't find a way to export animations without the skin data).
#15
Thanks a lot for taking a look at at the files and troubleshooting them. A lot of what you are saying makes sense, I am going to consult with the animators on these issues and troubleshoot with them with the information that you have given me.
I have actually tried unchecking The skin and joints node for animation only but when doing that it does not even show as a sequence and the file size is very small say around 2 to 3 kb. I will try this again, Also I am going to send you one of those files and make sure that their is even any sort of animation within the file and another file checking off animation and "skin and joints."
You are such a great help, I hope that in some way that me coming to you with these issues may even result in a good way to form documention later on. i have written a document already for the school for importing and exporting static meshes and texture from maya to torque including all sorts of problems that can occur with geometry within maya, maybe sometime in the future you can take a look at it and see if im hitting all the key areas.
Thanks a bunch a lot chris ! I will get back to you soon from when I am done messing around more with the information you have given.
(animation exported with animation and "skin and joints" unchecked) ( animation with "skin and joints" and animation checked)
www.sendspace.com/file/57mvsu
12/23/2009 (1:03 am)
Hey Chris !!Thanks a lot for taking a look at at the files and troubleshooting them. A lot of what you are saying makes sense, I am going to consult with the animators on these issues and troubleshoot with them with the information that you have given me.
I have actually tried unchecking The skin and joints node for animation only but when doing that it does not even show as a sequence and the file size is very small say around 2 to 3 kb. I will try this again, Also I am going to send you one of those files and make sure that their is even any sort of animation within the file and another file checking off animation and "skin and joints."
You are such a great help, I hope that in some way that me coming to you with these issues may even result in a good way to form documention later on. i have written a document already for the school for importing and exporting static meshes and texture from maya to torque including all sorts of problems that can occur with geometry within maya, maybe sometime in the future you can take a look at it and see if im hitting all the key areas.
Thanks a bunch a lot chris ! I will get back to you soon from when I am done messing around more with the information you have given.
(animation exported with animation and "skin and joints" unchecked) ( animation with "skin and joints" and animation checked)
www.sendspace.com/file/57mvsu
#16
I hope you enjoyed Christmas and had a great new year :) So I went through the animation files and took what you gave me to troubleshoot with and I am still stumped for the most part. I thought it might of had something to do with freezing the transforms on the mesh in maya but all that did distort the root pose with no animation at all.
So I was wondering if possible you would be able to send the bug fix that you spoke of in the last response and if you would be able to show what should and should not be checked off when exporting. We are going to have to do this for several different animation and characters and the way the skeleton is set up at this point is how it is for the rest of the characters and npc's. I know this is a lot to ask for but it would help so much to finally solve this issue so that we can have a white-box going with some controllable characters. Let me know if their is anything I can do to make this process easier for you like if I need to go into maya and do some sort of fixes before handing off anymore files. Hope to hear from you soon Chris, again i am truly grateful for you help as always.
01/04/2010 (6:43 pm)
Hey ChrisI hope you enjoyed Christmas and had a great new year :) So I went through the animation files and took what you gave me to troubleshoot with and I am still stumped for the most part. I thought it might of had something to do with freezing the transforms on the mesh in maya but all that did distort the root pose with no animation at all.
Quote:If I edit the collada loader source code to ignore animated node translations, then the animation plays fine - the model's feet move through the floor since there is no translation, but it appears the node rotations are ok.
Quote:I put a quick bugfix in for this issue to prevent the crash (since we don't actually use the skinning information in animation-only files). Let me know if you want it (if you can't find a way to export animations without the skin data).
So I was wondering if possible you would be able to send the bug fix that you spoke of in the last response and if you would be able to show what should and should not be checked off when exporting. We are going to have to do this for several different animation and characters and the way the skeleton is set up at this point is how it is for the rest of the characters and npc's. I know this is a lot to ask for but it would help so much to finally solve this issue so that we can have a white-box going with some controllable characters. Let me know if their is anything I can do to make this process easier for you like if I need to go into maya and do some sort of fixes before handing off anymore files. Hope to hear from you soon Chris, again i am truly grateful for you help as always.
#17
In ColladaAppMesh::lockMesh in colladaAppMesh.cpp (about line 860), modify the if statement to:
I'm not a Maya user so wouldn't be able to help you there, sorry. But first, make sure you have the latest version of the exporter (there could have been a bug that is now fixed). Then, since it appears to be a scaling problem with the animated node positions, try changing anything that could be related: bake transforms/sampling/curve constrain etc?
01/12/2010 (6:05 pm)
Quote:So I was wondering if possible you would be able to send the bug fix that you spoke of in the last response
In ColladaAppMesh::lockMesh in colladaAppMesh.cpp (about line 860), modify the if statement to:
// Skinned mesh: source geometry could be static geometry or a morph controller.
geometry = ctrl->getSkin()->getSource().getElement();
if (geometry && geometry->getElementType() == COLLADA_TYPE::CONTROLLER)
geometry = daeSafeCast<domController>(geometry)->getMorph();Quote:show what should and should not be checked off when exporting
I'm not a Maya user so wouldn't be able to help you there, sorry. But first, make sure you have the latest version of the exporter (there could have been a bug that is now fixed). Then, since it appears to be a scaling problem with the animated node positions, try changing anything that could be related: bake transforms/sampling/curve constrain etc?
#18
With this hack in place, the animation plays just fine, although I had to use the Shape Editor to adjust the in/out positions to exclude the first and last frames as their node positions were off.
01/12/2010 (6:16 pm)
If all else fails, you could hack the T3D collada loader to correct for the x100 scaling on node positions. In TSShapeLoader::addNodeTranslation in tsShapeLoader.cpp (about line 951):void TSShapeLoader::addNodeTranslation(Point3F& trans, bool defaultVal)
{
if (!defaultVal)
shape->nodeTranslations.push_back(trans / 100); // @hack: fix bad animated translation from mayaWith this hack in place, the animation plays just fine, although I had to use the Shape Editor to adjust the in/out positions to exclude the first and last frames as their node positions were off.
#19
I am going to try these out in a couple of days since I am reinstalling some software on my computer at the time just because of some wierd things that have been happening. I am going to sit down with one of the scripters/programmers and go over both of these but from what he saw from both of these they are easy to integrate into our build. I will get back to you immedietly with the results but I trust you and I know that this will be fine since you have already used our meshes and skeletal system to have them work.I am wondering if the node positions being scaled that high is because of the fact that max is what primerely what is used as a 3d app reference in all of the t3d documentation. Because of this possibly the node scaling is correct for integration within torque 3d as apposed to maya's default scaling. Thank you so much Chris yet again for your support with this, I know it is probably taking time out of your work to help out but I hope you know that I am greatly appreciative of, you are really making a great difference. Talk to you soon and take care.
01/14/2010 (12:03 am)
Hey Chris !!I am going to try these out in a couple of days since I am reinstalling some software on my computer at the time just because of some wierd things that have been happening. I am going to sit down with one of the scripters/programmers and go over both of these but from what he saw from both of these they are easy to integrate into our build. I will get back to you immedietly with the results but I trust you and I know that this will be fine since you have already used our meshes and skeletal system to have them work.I am wondering if the node positions being scaled that high is because of the fact that max is what primerely what is used as a 3d app reference in all of the t3d documentation. Because of this possibly the node scaling is correct for integration within torque 3d as apposed to maya's default scaling. Thank you so much Chris yet again for your support with this, I know it is probably taking time out of your work to help out but I hope you know that I am greatly appreciative of, you are really making a great difference. Talk to you soon and take care.
#20
The problem is not that the nodes are scaled too high => Torque doesn't care what scaling you use in your model, so long as it is consistent. The problem here is that the node scaling of the root pose and the animated nodes is different, so the animation doesn't match up with the skinning information. I don't know whether this is a bug in the exporter, or something you are doing wrong in maya.
The hack I proposed works around this by scaling down only the animated node positions.
The bad position on the first frame is actually a bug in 1.0.1 and 1.1a (unrelated to your scaling problem). The fix will be in the next release of 1.1, but I will forward you the changes so you can include them as well. With this fix, and the hack above, your models load and play their animations perfectly without any adjustments required.
01/14/2010 (4:57 am)
Quote:I am wondering if the node positions being scaled that high is because of the fact that max is what primerely what is used
The problem is not that the nodes are scaled too high => Torque doesn't care what scaling you use in your model, so long as it is consistent. The problem here is that the node scaling of the root pose and the animated nodes is different, so the animation doesn't match up with the skinning information. I don't know whether this is a bug in the exporter, or something you are doing wrong in maya.
The hack I proposed works around this by scaling down only the animated node positions.
Quote:With this hack in place, the animation plays just fine, although I had to use the Shape Editor to adjust the in/out positions to exclude the first and last frames as their node positions were off.
The bad position on the first frame is actually a bug in 1.0.1 and 1.1a (unrelated to your scaling problem). The fix will be in the next release of 1.1, but I will forward you the changes so you can include them as well. With this fix, and the hack above, your models load and play their animations perfectly without any adjustments required.
Associate Chris Robertson