diff options
author | Jonathan Duran | 2012-07-19 10:19:41 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-07-19 10:19:41 -0700 |
commit | 6431037185722a63064c2f2fb31fe0e325c9653a (patch) | |
tree | 40d3448dd69a94bddac22cf39b4875eee5615684 /js | |
parent | 142dc59794769ad783ab050b27b4f56ac5773afb (diff) | |
download | ninja-6431037185722a63064c2f2fb31fe0e325c9653a.tar.gz |
FIx 3D animation workflow
Can now add 3D to any keyframe and all the tween will initialize their 3D identity matrices
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js')
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 26 | ||||
-rw-r--r-- | js/panels/Timeline/Tween.reel/Tween.js | 4 |
2 files changed, 30 insertions, 0 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index f3ab0d84..56e5d2f1 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | |||
@@ -354,6 +354,20 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
354 | } | 354 | } |
355 | }, | 355 | }, |
356 | 356 | ||
357 | _enabled3D:{ | ||
358 | value:false | ||
359 | }, | ||
360 | enabled3D:{ | ||
361 | serializable:true, | ||
362 | get:function () { | ||
363 | return this._enabled3D; | ||
364 | }, | ||
365 | set:function (val) { | ||
366 | this._enabled3D = val; | ||
367 | this.trackData.enabled3D = val; | ||
368 | } | ||
369 | }, | ||
370 | |||
357 | _ruleList:{ | 371 | _ruleList:{ |
358 | value:[] | 372 | value:[] |
359 | }, | 373 | }, |
@@ -495,6 +509,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
495 | this.trackPosition = this.trackData.trackPosition; | 509 | this.trackPosition = this.trackData.trackPosition; |
496 | this.isVisible = this.trackData.isVisible; | 510 | this.isVisible = this.trackData.isVisible; |
497 | this.stageElement = this.trackData.stageElement; | 511 | this.stageElement = this.trackData.stageElement; |
512 | this.enabled3D = this.trackData.enabled3D; | ||
498 | this.trackEditorProperty = "master"; | 513 | this.trackEditorProperty = "master"; |
499 | this.needsDraw = true; | 514 | this.needsDraw = true; |
500 | } | 515 | } |
@@ -1087,6 +1102,17 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
1087 | } | 1102 | } |
1088 | }, | 1103 | }, |
1089 | 1104 | ||
1105 | initial3DforAllTweens:{ | ||
1106 | value:function(){ | ||
1107 | var j; | ||
1108 | var tweensLength = this.tweens.length; | ||
1109 | for (j = 0; j < tweensLength; j++) { | ||
1110 | this.tweens[j].tweenData.tweenedProperties["-webkit-transform"] = "perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)"; | ||
1111 | } | ||
1112 | this.enabled3D = true; | ||
1113 | } | ||
1114 | }, | ||
1115 | |||
1090 | addAnimationRuleToElement:{ | 1116 | addAnimationRuleToElement:{ |
1091 | value:function (tweenEvent) { | 1117 | value:function (tweenEvent) { |
1092 | this.tweens[0].tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop + "px"; | 1118 | this.tweens[0].tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop + "px"; |
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index 0f567fbd..e3f9e71a 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js | |||
@@ -299,6 +299,10 @@ var Tween = exports.Tween = Montage.create(Component, { | |||
299 | this.parentComponent.parentComponent.updateKeyframeRule(); | 299 | this.parentComponent.parentComponent.updateKeyframeRule(); |
300 | this.isTweenAnimated = true; | 300 | this.isTweenAnimated = true; |
301 | } | 301 | } |
302 | |||
303 | if(!this.parentComponent.parentComponent.enabled3D){ | ||
304 | this.parentComponent.parentComponent.initial3DforAllTweens(); | ||
305 | } | ||
302 | 306 | ||
303 | if (eventDetail.source === "translateTool" || eventDetail.source === "rotateTool") { | 307 | if (eventDetail.source === "translateTool" || eventDetail.source === "rotateTool") { |
304 | var arrMat = eventDetail.data.value[0].properties.mat, | 308 | var arrMat = eventDetail.data.value[0].properties.mat, |