diff options
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js')
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 91 |
1 files changed, 67 insertions, 24 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index bd55f2fb..6d557845 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | |||
@@ -11,10 +11,6 @@ var defaultEventManager = require("montage/core/event/event-manager").defaultEve | |||
11 | 11 | ||
12 | var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | 12 | var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { |
13 | 13 | ||
14 | hasTemplate:{ | ||
15 | value:true | ||
16 | }, | ||
17 | |||
18 | _trackID:{ | 14 | _trackID:{ |
19 | value:null | 15 | value:null |
20 | }, | 16 | }, |
@@ -31,11 +27,21 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
31 | } | 27 | } |
32 | } | 28 | } |
33 | }, | 29 | }, |
34 | 30 | ||
35 | _isFirstDraw: { | 31 | _tween:{ |
36 | value: true | 32 | value:[] |
37 | }, | 33 | }, |
38 | 34 | ||
35 | tween:{ | ||
36 | serializable:true, | ||
37 | get:function () { | ||
38 | return this._tween; | ||
39 | }, | ||
40 | set:function (newVal) { | ||
41 | this._tween = newVal; | ||
42 | } | ||
43 | }, | ||
44 | |||
39 | _isVisible:{ | 45 | _isVisible:{ |
40 | value: true | 46 | value: true |
41 | }, | 47 | }, |
@@ -345,15 +351,51 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
345 | _positionCollapser:{ | 351 | _positionCollapser:{ |
346 | value:null | 352 | value:null |
347 | }, | 353 | }, |
354 | positionCollapser:{ | ||
355 | serializable:true, | ||
356 | get:function(){ | ||
357 | return this._positionCollapser; | ||
358 | }, | ||
359 | set:function(val){ | ||
360 | this._positionCollapser = val; | ||
361 | } | ||
362 | }, | ||
348 | _mainCollapser:{ | 363 | _mainCollapser:{ |
349 | value:null | 364 | value:null |
350 | }, | 365 | }, |
366 | mainCollapser:{ | ||
367 | serializable:true, | ||
368 | get:function () { | ||
369 | return this._mainCollapser; | ||
370 | }, | ||
371 | set:function (val) { | ||
372 | this._mainCollapser = val; | ||
373 | } | ||
374 | }, | ||
351 | _transformCollapser:{ | 375 | _transformCollapser:{ |
352 | value:null | 376 | value:null |
353 | }, | 377 | }, |
378 | transformCollapser:{ | ||
379 | serializable:true, | ||
380 | get:function () { | ||
381 | return this._transformCollapser; | ||
382 | }, | ||
383 | set:function (val) { | ||
384 | this._transformCollapser = val; | ||
385 | } | ||
386 | }, | ||
354 | _styleCollapser:{ | 387 | _styleCollapser:{ |
355 | value:null | 388 | value:null |
356 | }, | 389 | }, |
390 | styleCollapser:{ | ||
391 | serializable:true, | ||
392 | get:function () { | ||
393 | return this._styleCollapser; | ||
394 | }, | ||
395 | set:function (val) { | ||
396 | this._styleCollapser = val; | ||
397 | } | ||
398 | }, | ||
357 | 399 | ||
358 | // Drag and Drop properties | 400 | // Drag and Drop properties |
359 | _dragAndDropHelper : { | 401 | _dragAndDropHelper : { |
@@ -431,6 +473,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
431 | this.isStyleCollapsed = this.trackData.isStyleCollapsed; | 473 | this.isStyleCollapsed = this.trackData.isStyleCollapsed; |
432 | this.trackPosition = this.trackData.trackPosition; | 474 | this.trackPosition = this.trackData.trackPosition; |
433 | this.isVisible = this.trackData.isVisible; | 475 | this.isVisible = this.trackData.isVisible; |
476 | this.trackEditorProperty = "master"; | ||
434 | this.needsDraw = true; | 477 | this.needsDraw = true; |
435 | } | 478 | } |
436 | }, | 479 | }, |
@@ -829,14 +872,12 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
829 | 872 | ||
830 | recreatePropertyTracks:{ | 873 | recreatePropertyTracks:{ |
831 | value:function(ruleSet){ | 874 | value:function(ruleSet){ |
832 | |||
833 | |||
834 | for(var i in ruleSet){ | 875 | for(var i in ruleSet){ |
835 | var styleProp = ruleSet[i][0].style[0]; | 876 | var styleProp = ruleSet[i][0].style[0]; |
836 | console.log(styleProp); | 877 | //console.log(styleProp); |
837 | this.application.ninja.timeline.layerRepetition.childComponents[0].addStyle(styleProp); | 878 | //console.log(ruleSet[i]); |
879 | this.application.ninja.timeline.layerRepetition.childComponents[0].addStyle(styleProp, ruleSet[i]); | ||
838 | } | 880 | } |
839 | |||
840 | } | 881 | } |
841 | }, | 882 | }, |
842 | 883 | ||
@@ -881,8 +922,10 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
881 | keyframeString += keyframePropertyString; | 922 | keyframeString += keyframePropertyString; |
882 | } | 923 | } |
883 | keyframeString += " }"; | 924 | keyframeString += " }"; |
925 | //console.log(keyframeString); | ||
884 | // set the keyframe string as the new rule | 926 | // set the keyframe string as the new rule |
885 | this.currentKeyframeRule = this.ninjaStylesContoller.addRule(keyframeString); | 927 | this.currentKeyframeRule = this.ninjaStylesContoller.addRule(keyframeString); |
928 | //console.log(this.currentKeyframeRule); | ||
886 | this.application.ninja.currentDocument.model.needsSave = true; | 929 | this.application.ninja.currentDocument.model.needsSave = true; |
887 | } | 930 | } |
888 | }, | 931 | }, |
@@ -900,15 +943,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
900 | value:function(){ | 943 | value:function(){ |
901 | // create track objects for position and transform tracks and push into arrays | 944 | // create track objects for position and transform tracks and push into arrays |
902 | 945 | ||
903 | // create 'top' track | ||
904 | var newTopTrack = {}; | ||
905 | newTopTrack.propTrackData = {}; | ||
906 | newTopTrack.propTrackData.propTweens = []; | ||
907 | newTopTrack.propTrackData.styleIndex = 0; | ||
908 | newTopTrack.propTrackData.trackType = "position"; | ||
909 | newTopTrack.propTrackData.trackEditorProperty = "top"; | ||
910 | this.arrPositionTracks.push(newTopTrack); | ||
911 | |||
912 | // create 'left' track | 946 | // create 'left' track |
913 | var newLeftTrack = {}; | 947 | var newLeftTrack = {}; |
914 | newLeftTrack.propTrackData = {}; | 948 | newLeftTrack.propTrackData = {}; |
@@ -918,6 +952,15 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
918 | newLeftTrack.propTrackData.trackEditorProperty = "left"; | 952 | newLeftTrack.propTrackData.trackEditorProperty = "left"; |
919 | this.arrPositionTracks.push(newLeftTrack); | 953 | this.arrPositionTracks.push(newLeftTrack); |
920 | 954 | ||
955 | // create 'top' track | ||
956 | var newTopTrack = {}; | ||
957 | newTopTrack.propTrackData = {}; | ||
958 | newTopTrack.propTrackData.propTweens = []; | ||
959 | newTopTrack.propTrackData.styleIndex = 0; | ||
960 | newTopTrack.propTrackData.trackType = "position"; | ||
961 | newTopTrack.propTrackData.trackEditorProperty = "top"; | ||
962 | this.arrPositionTracks.push(newTopTrack); | ||
963 | |||
921 | // create 'width' track | 964 | // create 'width' track |
922 | var newWidthTrack = {}; | 965 | var newWidthTrack = {}; |
923 | newWidthTrack.propTrackData = {}; | 966 | newWidthTrack.propTrackData = {}; |
@@ -944,8 +987,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
944 | return; | 987 | return; |
945 | } | 988 | } |
946 | if (layerEvent.layerEventType === "newStyle") { | 989 | if (layerEvent.layerEventType === "newStyle") { |
947 | // TODO: Add a real track of tweens. Probably need a method for that. | ||
948 | |||
949 | var newStyleTrack = {}; | 990 | var newStyleTrack = {}; |
950 | newStyleTrack.propTrackData = {}; | 991 | newStyleTrack.propTrackData = {}; |
951 | newStyleTrack.propTrackData.styleSelection = layerEvent.styleSelection; | 992 | newStyleTrack.propTrackData.styleSelection = layerEvent.styleSelection; |
@@ -953,6 +994,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
953 | newStyleTrack.propTrackData.trackType = "style"; | 994 | newStyleTrack.propTrackData.trackType = "style"; |
954 | newStyleTrack.propTrackData.trackEditorProperty = ""; | 995 | newStyleTrack.propTrackData.trackEditorProperty = ""; |
955 | newStyleTrack.propTrackData.styleIndex = layerEvent.styleIndex; | 996 | newStyleTrack.propTrackData.styleIndex = layerEvent.styleIndex; |
997 | newStyleTrack.propTrackData.existingRule = ""; | ||
956 | 998 | ||
957 | this.arrStyleTracks.push(newStyleTrack); | 999 | this.arrStyleTracks.push(newStyleTrack); |
958 | 1000 | ||
@@ -964,6 +1006,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
964 | restoredStyleTrack.propTrackData.trackType = "style"; | 1006 | restoredStyleTrack.propTrackData.trackType = "style"; |
965 | restoredStyleTrack.propTrackData.trackEditorProperty = layerEvent.trackEditorProperty; | 1007 | restoredStyleTrack.propTrackData.trackEditorProperty = layerEvent.trackEditorProperty; |
966 | restoredStyleTrack.propTrackData.styleIndex = layerEvent.styleIndex; | 1008 | restoredStyleTrack.propTrackData.styleIndex = layerEvent.styleIndex; |