]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_animation.py
Add looping detection to animation exporter
[libs/gl.git] / blender / io_mspgl / export_animation.py
index e2c7733df69be358cd5e54029675a2caebc5361d..0d72edb4d5eed4894e1df575e8a5b396213ab158 100644 (file)
@@ -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:
@@ -55,7 +56,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 +101,7 @@ class AnimationExporter:
 
                        resource.statements.append(st)
 
+               resource.statements.append(Statement("looping", anim.looping))
+
                return resource