diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js index 0ad0f34e..37472da8 100644 --- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js +++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js | |||
@@ -309,27 +309,19 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { | |||
309 | 309 | ||
310 | retrieveStoredStyleTweens:{ | 310 | retrieveStoredStyleTweens:{ |
311 | value:function(){ | 311 | value:function(){ |
312 | console.log("retrieving style tweens"); | 312 | console.log("retrieving style tweens " + this.animatedElement + " - " + this.currentKeyframeRule.name); |
313 | console.log(this.currentKeyframeRule); | 313 | console.log(this.currentKeyframeRule); |
314 | 314 | ||
315 | |||
316 | var percentValue, fraction, splitValue; | 315 | var percentValue, fraction, splitValue; |
317 | var currentMilliSec, currentMilliSecPerPixel, clickPosition, tempTiming, tempTimingFloat, trackTiming, i = 0; | 316 | var currentMilliSec, currentMilliSecPerPixel, clickPosition, tempTiming, tempTimingFloat, trackTiming, i = 0; |
318 | 317 | ||
319 | if (this.animatedElement !== undefined) { | 318 | if (this.animatedElement !== undefined) { |
320 | 319 | this.animationName = this.currentKeyframeRule.name; | |
321 | //this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); | ||
322 | |||
323 | // build tweens for this tracks's keyframe rule | ||
324 | if (this.animationName) { | 320 | if (this.animationName) { |
325 | 321 | ||
326 | |||
327 | |||
328 | trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); | 322 | trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); |
329 | this.nextKeyframe = 0; | 323 | this.nextKeyframe = 0; |
330 | 324 | ||
331 | this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument.model.views.design.document); | ||
332 | |||
333 | for (i = 0; this.currentKeyframeRule[i]; i++) { | 325 | for (i = 0; this.currentKeyframeRule[i]; i++) { |
334 | var newTween = {}; | 326 | var newTween = {}; |
335 | newTween.tweenData = {}; | 327 | newTween.tweenData = {}; |
@@ -361,7 +353,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { | |||
361 | newTween.tweenData.keyFrameMillisec = 0; | 353 | newTween.tweenData.keyFrameMillisec = 0; |
362 | newTween.tweenData.tweenID = 0; | 354 | newTween.tweenData.tweenID = 0; |
363 | newTween.tweenData.spanPosition = 0; | 355 | newTween.tweenData.spanPosition = 0; |
364 | this.tweens.push(newTween); | 356 | this.propTweens.push(newTween); |
365 | } | 357 | } |
366 | else { | 358 | else { |
367 | tempTiming = trackTiming.split("s"); | 359 | tempTiming = trackTiming.split("s"); |
@@ -373,16 +365,15 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { | |||
373 | currentMilliSec = fraction * this.trackDuration; | 365 | currentMilliSec = fraction * this.trackDuration; |
374 | currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); | 366 | currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); |
375 | clickPosition = currentMilliSec / currentMilliSecPerPixel; | 367 | clickPosition = currentMilliSec / currentMilliSecPerPixel; |
376 | newTween.tweenData.spanWidth = clickPosition - this.tweens[this.tweens.length - 1].tweenData.keyFramePosition; | 368 | newTween.tweenData.spanWidth = clickPosition - this.propTweens[this.propTweens.length - 1].tweenData.keyFramePosition; |
377 | newTween.tweenData.keyFramePosition = clickPosition; | 369 | newTween.tweenData.keyFramePosition = clickPosition; |
378 | newTween.tweenData.keyFrameMillisec = currentMilliSec; | 370 | newTween.tweenData.keyFrameMillisec = currentMilliSec; |
379 | newTween.tweenData.tweenID = this.nextKeyframe; | 371 | newTween.tweenData.tweenID = this.nextKeyframe; |
380 | newTween.tweenData.spanPosition = clickPosition - newTween.tweenData.spanWidth; | 372 | newTween.tweenData.spanPosition = clickPosition - newTween.tweenData.spanWidth; |
381 | this.tweens.push(newTween); | 373 | this.propTweens.push(newTween); |
382 | } | 374 | } |
383 | this.nextKeyframe += 1; | 375 | this.nextKeyframe += 1; |
384 | } | 376 | } |
385 | this.isTrackAnimated = true; | ||
386 | } | 377 | } |
387 | } | 378 | } |
388 | } | 379 | } |