From 50211638adcff654194301ce5d5a6fd6f283c8e1 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 15 May 2012 01:10:31 -0700 Subject: fix bug with animation names string not reset on open doc Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 8693e828..b55db18a 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -726,6 +726,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList[0]; if(this.animatedElement!==undefined){ this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); + this.animationNamesString = this.animationName; if(this.animationName){ trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); this.nextKeyframe = 0; -- cgit v1.2.3 From 7cf24d4adf741deae04728f9c091e11c2876a8df Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 15 May 2012 01:22:47 -0700 Subject: update stage element on sub prop keyframe select Signed-off-by: Jonathan Duran --- js/panels/Timeline/Tween.reel/Tween.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index 3c0223c1..30678beb 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -278,6 +278,12 @@ var Tween = exports.Tween = Montage.create(Component, { if(this.parentComponent.parentComponent.isSubproperty){ // set property specific style on element + var currentValue = this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty]; + + + + this.application.ninja.elementMediator.setProperty([this.parentComponent.parentComponent.animatedElement], this.parentComponent.parentComponent.trackEditorProperty, [currentValue], "Change", "tween"); + } else { // move animated element to correct position on stage var currentTop = this.tweenedProperties["top"] + "px"; -- cgit v1.2.3 From b7adc6f1ec09edcad523b1ddd32856ddf27c6724 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 15 May 2012 10:02:26 -0700 Subject: remove console logs. add retrieve tweens method for prop tracks Signed-off-by: Jonathan Duran --- js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js | 17 ++++++++++++++++- js/panels/Timeline/Tween.reel/Tween.js | 11 ++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js index 31e0b3b6..b3a31bf2 100644 --- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js +++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js @@ -28,6 +28,21 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { } }, + didDraw:{ + value:function () { + if ((!this.application.ninja.documentController.creatingNewFile) || (!this.application.ninja.currentDocument.setLevel)) { + if (this.application.ninja.currentDocument.documentRoot.children[0]) { + var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); + if (selectedIndex !== false) { + if (!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created) { + //this.retrieveStoredStyleTweens(); + } + } + } + } + } + }, + trackEditorProperty:{ value:"" }, @@ -248,7 +263,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { retrieveStoredStyleTweens:{ value:function(){ - + console.log("retrieve style tweens"); } }, diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index 30678beb..fb2ce4b4 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -234,8 +234,8 @@ var Tween = exports.Tween = Montage.create(Component, { //console.log(eventDetail); if(eventDetail.type == "setProperties"){ - // ignore top, left, width, and height - console.log(eventDetail.data.value[0]); + // need to ignore top, left, width, and height + //console.log(eventDetail.data.value[0]); this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty] = eventDetail.data.value[0]; this.parentComponent.parentComponent.updatePropKeyframeRule(); @@ -245,8 +245,8 @@ var Tween = exports.Tween = Montage.create(Component, { this.parentComponent.parentComponent.updatePropKeyframeRule(); } else if(eventDetail.type == "setProperty"){ - // ignore top, left, width, and height - console.log(eventDetail.data.value[0]); + // need to ignore top, left, width, and height + //console.log(eventDetail.data.value[0]); this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty] = eventDetail.data.value[0]; this.parentComponent.parentComponent.updatePropKeyframeRule(); @@ -279,9 +279,6 @@ var Tween = exports.Tween = Montage.create(Component, { if(this.parentComponent.parentComponent.isSubproperty){ // set property specific style on element var currentValue = this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty]; - - - this.application.ninja.elementMediator.setProperty([this.parentComponent.parentComponent.animatedElement], this.parentComponent.parentComponent.trackEditorProperty, [currentValue], "Change", "tween"); } else { -- cgit v1.2.3 From e9995c973acadc507b802fdefdb22b4c4bf82325 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 15 May 2012 11:27:51 -0700 Subject: fix keyframe splitting Signed-off-by: Jonathan Duran --- js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js | 9 +++++++-- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 4 ++++ js/panels/Timeline/Tween.reel/Tween.js | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js index b3a31bf2..f2004b94 100644 --- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js +++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js @@ -201,7 +201,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { //console.log("Property track editorProperty set to: " + this.trackEditorProperty); } } else if (this.trackType === "position") { - console.log("Property track editorProperty set to: " + this.trackEditorProperty); + //console.log("Property track editorProperty set to: " + this.trackEditorProperty); } this.insertPropTween(0); @@ -217,7 +217,12 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { handleNewPropTween:{ value:function(ev){ - this.insertPropTween(ev.offsetX); + if (ev.offsetX > this.propTweens[this.propTweens.length - 1].tweenData.keyFramePosition) { + this.insertPropTween(ev.offsetX); + } else { + console.log("spitting sub keyframes not yet supported"); + } + } }, diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index b55db18a..a38ecb30 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -603,9 +603,13 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.addAnimationRuleToElement(ev); this.updateKeyframeRule(); } else { + //console.log(ev); if (ev.target.className === "tracklane") { this.handleNewTween(ev); this.updateKeyframeRule(); + } else if (ev.target.className === "tween_span" && ev.target.parentElement.parentElement.className === "tracklane"){ + this.handleNewTween(ev); + this.updateKeyframeRule(); } } } else { diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index fb2ce4b4..33fed17a 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -280,7 +280,7 @@ var Tween = exports.Tween = Montage.create(Component, { // set property specific style on element var currentValue = this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty]; this.application.ninja.elementMediator.setProperty([this.parentComponent.parentComponent.animatedElement], this.parentComponent.parentComponent.trackEditorProperty, [currentValue], "Change", "tween"); - + //console.log(currentValue); } else { // move animated element to correct position on stage var currentTop = this.tweenedProperties["top"] + "px"; -- cgit v1.2.3