projects
/
libs
/
gl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f2cab83
)
Adjust exported animation keyframes to start from zero time
author
Mikko Rasa
<tdb@tdb.fi>
Tue, 11 Jun 2019 16:49:01 +0000
(19:49 +0300)
committer
Mikko Rasa
<tdb@tdb.fi>
Tue, 11 Jun 2019 16:49:55 +0000
(19:49 +0300)
blender/io_mspgl/animation.py
patch
|
blob
|
history
diff --git
a/blender/io_mspgl/animation.py
b/blender/io_mspgl/animation.py
index 5ad937df196060b934bd1269718beb6833ac76d4..ffce11f596fc8099b2e48e39d8401beca84f45d2 100644
(file)
--- 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)