From c1df0788f783413fe8ccb779f0096cc7a3767149 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 11 Jun 2019 19:49:01 +0300 Subject: [PATCH] Adjust exported animation keyframes to start from zero time --- blender/io_mspgl/animation.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/blender/io_mspgl/animation.py b/blender/io_mspgl/animation.py index 5ad937df..ffce11f5 100644 --- a/blender/io_mspgl/animation.py +++ b/blender/io_mspgl/animation.py @@ -65,6 +65,14 @@ class Animation: kf.curves.append((c, i)) self.keyframes.sort(key=lambda k: k.time) + self.start_time = self.keyframes[0].time + + for c in self.curves: + for k in c.knots: + k[0] -= self.start_time + + for k in self.keyframes: + k.time -= self.start_time def __getattr__(self, attr): return getattr(self._curve, attr) -- 2.43.0