Game Development Community

Troubleshooting Exports

by Demolishun · in Artist Corner · 01/22/2012 (6:16 pm) · 0 replies

Here is a script in Python for those troubleshooting their collada outputs:
# Name:        module1
# Purpose:
#
# Author:      demolishun
#
# Created:     11/01/2012
# Copyright:   (c) demolishun 2012
# Licence:     <your licence>
#-------------------------------------------------------------------------------
#!/usr/bin/env python

from lxml import etree

#file1 = "dae/soldier_rigged.dae"
file1 = "stickman_skeleton.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("stickman_skeleton_ref.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 just creates a pretty print version of your data. You will have to modify the code to work with your files.

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