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")
7 from .armature import Armature
9 armature = Armature(obj.data)
12 from .outfile import open_outfile
13 out_file = open_outfile(out_file)
15 for l in armature.links:
16 out_file.begin("link", '"{}"'.format(l.name))
17 out_file.write("index", l.index)
19 out_file.write("parent", '"{}"'.format(l.parent.name))
20 out_file.write("base", *tuple(l.base))