--- /dev/null
+from .outfile import OutFile
+
+class ArmatureExporter:
+ def export(self, context, fn):
+ obj = context.active_object
+ if obj.type!="ARMATURE":
+ raise Exception("Can only export Armature data")
+
+ from .armature import Armature
+
+ armature = Armature(obj.data)
+ armature.sort_links()
+
+ out_file = OutFile(fn)
+ for l in armature.links:
+ out_file.begin("link", '"{}"'.format(l.name))
+ out_file.write("index", l.index)
+ if l.parent:
+ out_file.write("parent", '"{}"'.format(l.parent.name))
+ out_file.write("base", *tuple(l.base))
+ out_file.end()