diff options
author | Colin Noga <Tempus@Spectrum-Song.local> | 2011-11-25 03:32:29 -0600 |
---|---|---|
committer | Colin Noga <Tempus@Spectrum-Song.local> | 2011-11-25 03:32:29 -0600 |
commit | b108fc94779df34fe498b8a2b5ce6a155711455c (patch) | |
tree | e57d6bbcfdbb43ddd67621c5aa999cc7a075ba19 /src/editorui/doodads.py | |
parent | 123ae369ff7e84f75e16c1ada8f248493b35aea6 (diff) | |
download | koopatlas-b108fc94779df34fe498b8a2b5ce6a155711455c.tar.gz koopatlas-b108fc94779df34fe498b8a2b5ce6a155711455c.zip |
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.'
'
Diffstat (limited to '')
-rw-r--r-- | src/editorui/doodads.py | 39 |
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): |