Blender and soldier_rigged.dae
by Demolishun · in Artist Corner · 01/08/2012 (10:40 pm) · 2 replies
I have been trying to import the soldier_rigged.dae into blender 2.60. It goes in fine and appears to export fine. When I go in game all the nodes look identical to the original, but it will not load any of the animations. Textures look great and he appears in the holding the gun pose, but no animations. Not sure how he can be in a pose if animations did not load. Strange. I also noticed the file is about 1MB smaller than the original. So something is getting lost in translation.
I was hoping to use the node structure for my own characters and use the existing animations for the soldier. I would really like this to work.
I was hoping to use the node structure for my own characters and use the existing animations for the soldier. I would really like this to work.
About the author
I love programming, I love programming things that go click, whirr, boom. For organized T3D Links visit: http://demolishun.com/?page_id=67
#2
I will bite the bullet and create my own bone structure and animate. Maybe this thread will help someone from taking too much time trying to get the soldier dae to work with blender. That is too bad as it would have saved some time.
Now I did create a simple Python program that reads in a file and spits out a pretty formatted XML structure. This allowed me to walk through the XML to try and determine what is actually going on. I did learn a lot about the collada format that way. If anyone wants this program:
This is written for Python 2.7 and uses the lxml Python library. It actually converts two files so you can edit it for your needs. I may develop more tools like this as I go. I was thinking about an XML explorer type app as I use XML a lot in my work.
01/12/2012 (12:54 pm)
Okay, I was trying to add the DAE file wrong. What actually does get imported looks all messed up. Apparently the rotations for the bones or something is all wrong after import into Blender and export from Blender. The animations do work, but the bone structure is all distorted. So there is a some incompatibility between bones from MAX collada export and blender export. To compound I don't see any options on the blender import or export for collada. So there is really no path to correcting this at this time that I can see.I will bite the bullet and create my own bone structure and animate. Maybe this thread will help someone from taking too much time trying to get the soldier dae to work with blender. That is too bad as it would have saved some time.
Now I did create a simple Python program that reads in a file and spits out a pretty formatted XML structure. This allowed me to walk through the XML to try and determine what is actually going on. I did learn a lot about the collada format that way. If anyone wants this program:
from lxml import etree
file1 = "dae/soldier_rigged.dae"
file2 = "dae/soldier_rigged2.dae"
def main():
fp1 = open(file1)
tree1 = etree.parse(fp1)
fp1.close()
fp2 = open(file2)
tree2 = etree.parse(fp2)
fp2.close()
print "converting 1"
#print(etree.tostring(tree1, pretty_print=True))
fp3 = open("dae/pp_soldier_rigged.dae","w")
fp3.write(etree.tostring(tree1, pretty_print=True))
fp3.close()
print "converting 2"
#print(etree.tostring(tree2, pretty_print=True))
fp4 = open("dae/pp_soldier_rigged2.dae","w")
fp4.write(etree.tostring(tree2, pretty_print=True))
fp4.close()
print "done converting"
if __name__ == '__main__':
main()This is written for Python 2.7 and uses the lxml Python library. It actually converts two files so you can edit it for your needs. I may develop more tools like this as I go. I was thinking about an XML explorer type app as I use XML a lot in my work.
Torque Owner Demolishun
DemolishunConsulting Rocks!
I am going to explore reading in the files using lxml and see if I cannot create a DAE diff between the two files. If I can do that then I can create a tool that will extract the differences between the two files and put back the missing information. No, not perfect, maybe even a bad idea, but it will be interesting to see the results. My goal here is to put back anything that allows the skeleton to function with the animations provided by the soldier. If I can accomplish that then it will allow me to create characters that use that skeleton.
If this does not work then I will just start over with the same skeleton or similar and just do my own animations.