diff options
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 1424 |
1 files changed, 773 insertions, 651 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 033d0f79..9fe32736 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -19,19 +19,19 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
19 | 19 | ||
20 | /* === BEGIN: Models === */ | 20 | /* === BEGIN: Models === */ |
21 | _arrLayers:{ | 21 | _arrLayers:{ |
22 | serializable: true, | 22 | serializable:true, |
23 | value:[] | 23 | value:[] |
24 | }, | 24 | }, |
25 | 25 | ||
26 | arrLayers:{ | 26 | arrLayers:{ |
27 | serializable: true, | 27 | serializable:true, |
28 | get:function () { | 28 | get:function () { |
29 | return this._arrLayers; | 29 | return this._arrLayers; |
30 | }, | 30 | }, |
31 | set:function (newVal) { | 31 | set:function (newVal) { |
32 | this._arrLayers = newVal; | 32 | this._arrLayers = newVal; |
33 | this.needsDraw = true; | 33 | this.needsDraw = true; |
34 | this._cacheArrays(); | 34 | this.cacheTimeline(); |
35 | } | 35 | } |
36 | }, | 36 | }, |
37 | 37 | ||
@@ -50,12 +50,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
50 | 50 | ||
51 | 51 | ||
52 | _layerRepetition:{ | 52 | _layerRepetition:{ |
53 | serializable: true, | 53 | serializable:true, |
54 | value:null | 54 | value:null |
55 | }, | 55 | }, |
56 | 56 | ||
57 | layerRepetition:{ | 57 | layerRepetition:{ |
58 | serializable: true, | 58 | serializable:true, |
59 | get:function () { | 59 | get:function () { |
60 | return this._layerRepetition; | 60 | return this._layerRepetition; |
61 | }, | 61 | }, |
@@ -64,18 +64,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
64 | } | 64 | } |
65 | }, | 65 | }, |
66 | 66 | ||
67 | _cacheArrays : { | ||
68 | value: function() { | ||
69 | if (this._boolCacheArrays) { | ||
70 | this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; | ||
71 | |||
72 | } | ||
73 | } | ||
74 | }, | ||
75 | |||
76 | // Set to false to skip array caching array sets in current document | 67 | // Set to false to skip array caching array sets in current document |
77 | _boolCacheArrays : { | 68 | _boolCacheArrays:{ |
78 | value: true | 69 | value:true |
79 | }, | 70 | }, |
80 | 71 | ||
81 | _currentLayerNumber:{ | 72 | _currentLayerNumber:{ |
@@ -89,93 +80,84 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
89 | set:function (newVal) { | 80 | set:function (newVal) { |
90 | if (newVal !== this._currentLayerNumber) { | 81 | if (newVal !== this._currentLayerNumber) { |
91 | this._currentLayerNumber = newVal; | 82 | this._currentLayerNumber = newVal; |
92 | this._setCurrentLayerNumber(); | 83 | this.cacheTimeline(); |
93 | } | 84 | } |
94 | } | 85 | } |
95 | }, | 86 | }, |
96 | 87 | ||
97 | _setCurrentLayerNumber:{ | 88 | _currentLayerSelected:{ |
98 | value:function(){ | 89 | value:null |
99 | if (this._boolCacheArrays) { | ||
100 | this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; | ||
101 | } | ||
102 | } | ||
103 | }, | 90 | }, |
104 | 91 | currentLayerSelected:{ | |
105 | _hashKey:{ | 92 | get:function () { |
106 | value:0 | 93 | return this._currentLayerSelected; |
107 | }, | 94 | }, |
95 | set:function (newVal) { | ||
96 | this._currentLayerSelected = newVal; | ||
97 | this.cacheTimeline(); | ||
98 | } | ||
99 | }, | ||
108 | 100 | ||
109 | hashKey:{ | 101 | _selectedLayerID:{ |
102 | value:false | ||
103 | }, | ||
104 | selectedLayerID:{ | ||
110 | get:function () { | 105 | get:function () { |
111 | return this._hashKey; | 106 | return this._selectedLayerID; |
112 | }, | 107 | }, |
113 | set:function (newVal) { | 108 | set:function (newVal) { |
114 | if (newVal !== this._hashKey) { | 109 | if (newVal === false) { |
115 | this._hashKey = newVal; | 110 | // We are clearing the timeline, so just set the value and return. |
116 | this._setHashKey(); | 111 | this._selectedLayerID = newVal; |
112 | return; | ||
113 | } | ||
114 | if (newVal !== this._selectedLayerID) { | ||
115 | var selectIndex = this.getLayerIndexByID(newVal); | ||
116 | this._selectedLayerID = newVal; | ||
117 | this._captureSelection = true; | ||
118 | this.selectLayer(selectIndex); | ||
117 | } | 119 | } |
118 | } | 120 | } |
119 | }, | 121 | }, |
120 | 122 | ||
121 | _setHashKey:{ | 123 | _millisecondsOffset:{ |
122 | value:function(){ | 124 | value:1000 |
123 | if (this._boolCacheArrays) { | ||
124 | this.application.ninja.currentDocument.hashKey = this.hashKey; | ||
125 | } | ||
126 | } | ||
127 | }, | 125 | }, |
128 | 126 | ||
129 | _currentLayerSelected:{ | 127 | millisecondsOffset:{ |
130 | value: null | 128 | get:function () { |
129 | return this._millisecondsOffset; | ||
131 | }, | 130 | }, |
132 | currentLayerSelected : { | 131 | set:function (newVal) { |
133 | get: function() { | 132 | if (newVal !== this._millisecondsOffset) { |
134 | return this._currentLayerSelected; | 133 | this._millisecondsOffset= newVal; |
135 | }, | 134 | this.drawTimeMarkers(); |
136 | set: function(newVal) { | 135 | NJevent('tlZoomSlider',this); |
137 | this._currentLayerSelected = newVal; | 136 | } |
138 | this.application.ninja.currentDocument.tlCurrentLayerSelected = newVal; | 137 | } |
139 | } | ||
140 | }, | 138 | }, |
141 | 139 | ||
142 | _selectedLayerID:{ | 140 | tweenarray:{ |
143 | value: false | 141 | value:[], |
144 | }, | 142 | writable:true |
145 | selectedLayerID : { | ||
146 | get: function() { | ||
147 | return this._selectedLayerID; | ||
148 | }, | ||
149 | set: function(newVal) { | ||
150 | if (newVal === false) { | ||
151 | // We are clearing the timeline, so just set the value and return. | ||
152 | this._selectedLayerID = newVal; | ||
153 | return; | ||
154 | } | ||
155 | if (newVal !== this._selectedLayerID) { | ||
156 | var selectIndex = this.getLayerIndexByID(newVal); | ||
157 | this._selectedLayerID = newVal; | ||
158 | this._captureSelection = true; | ||
159 | this.selectLayer(selectIndex, true); | ||
160 | } | ||
161 | } | ||
162 | }, | 143 | }, |
163 | 144 | ||
164 | millisecondsOffset:{ | 145 | tempArray:{ |
165 | value:1000 | 146 | value:[], |
147 | writable:true | ||
166 | }, | 148 | }, |
167 | 149 | ||
168 | _masterDuration:{ | 150 | _masterDuration:{ |
169 | serializable: true, | 151 | serializable:true, |
170 | value:0 | 152 | value:0 |
171 | }, | 153 | }, |
172 | 154 | ||
173 | masterDuration:{ | 155 | masterDuration:{ |
174 | serializable:true, | 156 | serializable:true, |
175 | get:function(){ | 157 | get:function () { |
176 | return this._masterDuration; | 158 | return this._masterDuration; |
177 | }, | 159 | }, |
178 | set:function(val){ | 160 | set:function (val) { |
179 |