X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=blender%2Fio_mspgl%2Fexport_animation.py;h=45eff8f9d09e80cdbe8aa0d0a18520f8db0559fd;hp=e2c7733df69be358cd5e54029675a2caebc5361d;hb=475c875fd12e264f093a88c8c4dc52ee13991569;hpb=10994840972fb9bc6c1be210a9772a102f514149 diff --git a/blender/io_mspgl/export_animation.py b/blender/io_mspgl/export_animation.py index e2c7733d..45eff8f9 100644 --- a/blender/io_mspgl/export_animation.py +++ b/blender/io_mspgl/export_animation.py @@ -5,6 +5,7 @@ class AnimationExporter: def __init__(self): self.export_all = False self.collection = True + self.looping_threshold = 0.001 def export_to_file(self, context, out_fn): if self.export_all: @@ -31,7 +32,8 @@ class AnimationExporter: if self.collection: from .datafile import Statement with open(os.path.join(path, base+".mdc"), "w") as out_file: - for r in resources.values(): + for n in sorted(resources.keys()): + r = resources[n] st = Statement("animation", r.name) st.sub = r.statements st.write_to_file(out_file) @@ -55,7 +57,7 @@ class AnimationExporter: def export_animation(self, context, action): from .animation import create_animation_from_action - anim = create_animation_from_action(context, action) + anim = create_animation_from_action(context, action, looping_threshold=self.looping_threshold) from .datafile import Resource, Statement resource = Resource(action.name+".anim") @@ -100,5 +102,7 @@ class AnimationExporter: resource.statements.append(st) + resource.statements.append(Statement("looping", anim.looping)) + return resource