summaryrefslogtreecommitdiff
path: root/src/editorui/doodads.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/editorui/doodads.py39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/editorui/doodads.py b/src/editorui/doodads.py
index 52d09fc..632551d 100644
--- a/src/editorui/doodads.py
+++ b/src/editorui/doodads.py
@@ -220,13 +220,48 @@ class KPEditorDoodad(KPEditorItem):
data = data.toFloat()[0]
else:
data = str(data)
+
rowList.append(data)
- anmList.append(tuple(rowList))
+
+ Loop = rowList[0]
+ Type = rowList[3]
+ Curve = rowList[1]
+ Frames = rowList[2]
+ StartVal = rowList[4]
+ EndVal = rowList[5]
+
+ Timeline = QtCore.QTimeLine()
+
+ # Interpolate the correct modifier
+ if Curve == "Linear":
+ Timeline.setCurveShape(3)
+ elif Curve == "Sinusoidial":
+ Timeline.setCurveShape(4)
+ elif Curve == "Cosinoidial":
+ Timeline.setCurveShape(5)
+
+ Timeline.setFrameRange(StartVal, EndVal)
+
+ if Loop == "Contiguous":
+ Timeline.setLoopCount(1)
+ elif Loop == "Loop":
+ Timeline.setLoopCount(1000000000) # Dollars *holds pinky to corner of mouth*
+ elif Loop == "Reversible Loop":
+ Timeline.setLoopCount(1)
+ Timeline.finished.connect(Timeline.toggleDirection)
+ Timeline.finished.connect(Timeline.start)
+
+ Timeline.setDuration(Frames/60.0*1000) # Wii goes at 60 frames per second
+
+ rowList.append(Timeline)
+ KP.mapScene.timeLines.append(Timeline)
+
+ anmList.append(rowList)
doodad.animations = anmList
- print anmList
+ self.update()
class HiddenProxy(QtGui.QGraphicsProxyWidget):