Skip to content

Commit

Permalink
finished merge with master
Browse files Browse the repository at this point in the history
- saveJSON works for one keyframe: one has to iterate over targetValues and create JSON for each frame
- loadJSON does not work: one needs to load all frames into targetValues in order for it to work
  • Loading branch information
cedric-lorenz committed May 31, 2021
1 parent b17fc2d commit 5abbedc
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ buildComponents
createColorPropertyFrom: aMorph
| colorTarget |
colorTarget := (AnimationsEditorPropertyColor new).
colorTarget animationsEditor: self.
colorTarget targetMorph: aMorph.
colorTarget targetColor: aMorph color.
^ colorTarget.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ buildComponents
createPositionPropertyFrom: aMorph
| positionTarget |
positionTarget := (AnimationsEditorPropertyPosition new).
positionTarget animationsEditor: self.
positionTarget targetMorph: aMorph.
positionTarget positionX: (aMorph position) x.
positionTarget positionY: (aMorph position) y.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ buildComponents
createRotationPropertyFrom: aMorph
| rotationTarget |
rotationTarget := (AnimationsEditorPropertyRotation new).
rotationTarget animationsEditor: self.
rotationTarget targetMorph: aMorph.
rotationTarget targetRotation: aMorph rotationDegrees.
^ rotationTarget.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ buildComponents
createSizePropertyFrom: aMorph
| sizeTarget |
sizeTarget := (AnimationsEditorPropertySize new).
sizeTarget animationsEditor: self.
sizeTarget targetMorph: aMorph.
sizeTarget targetWidth.
sizeTarget targetWidth: (aMorph extent) x.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ createStartInformation: aMorph
with: #value -> aMorph rotationDegrees.
Dictionary
with: #name -> 'positionX'
with: #value -> aMorph x.
with: #value -> aMorph position x.
Dictionary
with: #name -> 'positionY'
with: #value -> aMorph y.
with: #value -> aMorph position y.
Dictionary
with: #name -> 'width'
with: #value -> aMorph width.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
"collectAllEmptyPanels" : "DM 8/5/2020 21:02",
"collectInformationBar" : "DM 8/5/2020 21:02",
"collectPropertyTreeMorph" : "DM 8/5/2020 21:02",
"createColorPropertyFrom:" : "DM 8/7/2020 10:48",
"createColorPropertyFrom:" : "CL 5/31/2021 15:58",
"createMorphFromString:" : "LW 5/15/2021 14:12",
"createPositionPropertyFrom:" : "DM 8/6/2020 10:09",
"createRotationPropertyFrom:" : "FH 5/13/2021 10:16",
"createSizePropertyFrom:" : "DM 7/8/2020 14:29",
"createStartInformation:" : "MH 5/20/2021 11:24",
"createPositionPropertyFrom:" : "CL 5/31/2021 15:58",
"createRotationPropertyFrom:" : "CL 5/31/2021 15:59",
"createSizePropertyFrom:" : "CL 5/31/2021 15:59",
"createStartInformation:" : "CL 5/31/2021 15:51",
"createStructure:with:" : "NB 5/13/2021 10:25",
"defaultEmptyPanels" : "DM 8/7/2020 17:37",
"defaultPropertyPanelPosition" : "DM 8/6/2020 10:38",
Expand Down Expand Up @@ -80,7 +80,7 @@
"propertyTreeMorph" : "DM 6/22/2020 01:28",
"propertyTreeMorph:" : "DM 6/18/2020 08:59",
"resetTargetMorph" : "DM 8/5/2020 20:05",
"saveAnimations" : "NB 5/13/2021 09:35",
"saveAnimations" : "CL 5/31/2021 14:48",
"saveToJson:" : "NB 5/21/2021 09:05",
"seedProperties" : "DM 8/5/2020 19:54",
"selectMorphByHand" : "DM 8/5/2020 20:07",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
animation
isKeyframeExistent

^ (self targetValues isEmpty) not.
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
animation
playAnimationWithStartEnd: aStartEndProperty
| animations comp |
self copyOfTargetMorph: self targetMorph copy.
animations := (self createCompositeAnimationFor: self targetMorph withStartEnd: aStartEndProperty).

comp := AnimCompositeAnimation new.
animations do: [:each | comp add: each.].
comp start.
(self isKeyframeExistent)
ifTrue: [
self copyOfTargetMorph: self targetMorph copy.
animations := (self createCompositeAnimationFor: self targetMorph withStartEnd: aStartEndProperty).

comp := AnimCompositeAnimation new.
animations do: [:each | comp add: each.].
comp start.]

ifFalse: [self animationsEditor updateInformationText: 'Please specify at least one keyframe to play an animation.'].


Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"<" : "DM 8/6/2020 10:57",
"<=" : "DM 8/6/2020 10:57",
"addKeyframe" : "CL 5/11/2021 09:41",
"animationString" : "DM 7/8/2020 14:47",
"animationString" : "CL 5/31/2021 14:40",
"animationsEditor" : "DM 8/5/2020 21:01",
"animationsEditor:" : "DM 8/5/2020 19:45",
"buildUIWith:" : "JIZ 6/3/2020 16:35",
Expand All @@ -21,8 +21,9 @@
"frame:" : "CL 5/13/2021 10:25",
"hasSubproperties" : "DM 8/6/2020 11:02",
"isKey:outOfBound:" : "CL 5/30/2021 13:39",
"isKeyframeExistent" : "CL 5/31/2021 15:42",
"messageKeyframeOutOfBounds" : "CL 5/27/2021 09:49",
"playAnimationWithStartEnd:" : "mjs 5/23/2021 13:55",
"playAnimationWithStartEnd:" : "CL 5/31/2021 15:42",
"resetTargetMorph" : "mjs 5/21/2021 11:30",
"resetTargetMorphForAllProperties" : "FH 5/13/2021 12:02",
"subproperties" : "DM 8/6/2020 10:58",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ animationString
morph: aMorph;
startValue: 1.0;
endValue: 0.0;
duration: ', (self targetDuration//2),';
duration: ', (self targetFrame//2),';
finishBlock: [aMorph color: ', self targetColorAsString, '.]);
add: (AnimAlphaBlendAnimation new
morph: aMorph;
startValue: 0.0;
endValue: 1.0;
duration: ',(self targetDuration//2),');
duration: ',(self targetFrame//2),');
loopCount: 1;
register;
state: #paused.'.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instance" : {
"addKeyframe" : "mjs 5/23/2021 13:58",
"animationPropertyFor:" : "mjs 5/23/2021 13:51",
"animationString" : "DM 8/7/2020 21:25",
"animationString" : "CL 5/31/2021 14:48",
"buildInputColorWith:" : "CL 5/13/2021 11:13",
"buildInputFrameWith:" : "CL 5/9/2021 14:22",
"buildPanelWith:" : "CL 5/9/2021 14:20",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
accessing
animationString
^ 'AnimPropertyAnimation new
duration: ', self targetDuration,';
duration: ', self targetFrame,';
property: #position;
startValue: ', (self targetMorph position), ';
endValue:', self targetPosition asString, ';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instance" : {
"addKeyframe" : "mjs 5/23/2021 13:58",
"animationPropertyFor:" : "mjs 5/23/2021 13:50",
"animationString" : "DM 8/7/2020 21:25",
"animationString" : "CL 5/31/2021 14:48",
"buildInputFrameWith:" : "CL 5/11/2021 10:46",
"buildInputXWith:" : "CL 5/9/2021 14:15",
"buildInputYWith:" : "CL 5/9/2021 14:15",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
accessing
animationString
^ 'AnimPropertyAnimation new
duration: ', self targetDuration,';
duration: ', self targetFrame,';
property: #rotationDegrees;
startValue: ', self targetMorph rotationDegrees, ';
endValue: ', self targetRotation, ';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instance" : {
"addKeyframe" : "mjs 5/23/2021 13:58",
"animationPropertyFor:" : "mjs 5/23/2021 13:51",
"animationString" : "DM 8/7/2020 21:25",
"animationString" : "CL 5/31/2021 14:48",
"buildInputFrameWith:" : "CL 5/13/2021 12:04",
"buildInputRotationWith:" : "CL 5/13/2021 11:12",
"buildPanelWith:" : "CL 5/9/2021 14:20",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
accessing
animationString
^ 'AnimPropertyAnimation new
duration: ', self targetDuration,';
duration: ', self targetFrame,';
property: #extent;
startValue: ', self targetMorph extent, ';
endValue: ', self targetSize, ';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instance" : {
"addKeyframe" : "mjs 5/23/2021 13:58",
"animationPropertyFor:" : "mjs 5/23/2021 13:51",
"animationString" : "DM 8/7/2020 21:25",
"animationString" : "CL 5/31/2021 14:48",
"buildInputFrameWith:" : "CL 5/9/2021 14:22",
"buildInputHeightWith:" : "CL 5/13/2021 11:12",
"buildInputWidthWith:" : "CL 5/13/2021 11:12",
Expand Down

0 comments on commit 5abbedc

Please sign in to comment.