1 from .outfile import OutFile
3 class ArmatureExporter:
4 def export(self, context, fn):
5 obj = context.active_object
6 if obj.type!="ARMATURE":
7 raise Exception("Can only export Armature data")
9 from .armature import Armature
11 armature = Armature(obj.data)
14 out_file = OutFile(fn)
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))