From b108fc94779df34fe498b8a2b5ce6a155711455c Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Fri, 25 Nov 2011 03:32:29 -0600 Subject: ANIMATIONS AND PREVIEWING ARE WORKING. They look da bomb. Other issues: animation ui editors don't always have proper range settings, deco charatcers, steps, etc. The animation pop up is a bit unruly, tends to move around.' ' --- src/editorui/doodads.py | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'src/editorui/doodads.py') 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): -- cgit v1.2.3