]> git.tdb.fi Git - libs/gl.git/blob - blender/io_mspgl/export_armature.py
Remove useless namespace prefixes
[libs/gl.git] / blender / io_mspgl / export_armature.py
1 class ArmatureExporter:
2         def export(self, context, out_file):
3                 obj = context.active_object
4                 if obj.type!="ARMATURE":
5                         raise Exception("Can only export Armature data")
6
7                 from .armature import Armature
8
9                 armature = Armature(obj.data)
10                 armature.sort_links()
11
12                 from .outfile import open_outfile
13                 out_file = open_outfile(out_file)
14
15                 for l in armature.links:
16                         out_file.begin("link", '"{}"'.format(l.name))
17                         out_file.write("index", l.index)
18                         if l.parent:
19                                 out_file.write("parent", '"{}"'.format(l.parent.name))
20                         out_file.write("base", *tuple(l.base))
21                         out_file.end()