Skip to content

Commit

Permalink
added timebar and started on keyframes
Browse files Browse the repository at this point in the history
  • Loading branch information
Max784 committed Jul 1, 2021
1 parent 410bfae commit 8d64e0b
Show file tree
Hide file tree
Showing 61 changed files with 359 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
eventHandling
switchTimelineToMorphWith: aSubProperty
| morphProperty |

morphProperty := self propertyList detect: [:property | property targetMorph = aSubProperty targetMorph] ifNone: [].
self timeline switchTimelineTo: morphProperty.

(aSubProperty isKindOf: AnimationsEditorPropertyStartEnd)
ifFalse: [
morphProperty := self propertyList detect: [:property | property targetMorph = aSubProperty targetMorph] ifNone: [].
self timeline switchTimelineTo: morphProperty.
].
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
"seedProperties" : "DM 8/5/2020 19:54",
"selectMorphByHand" : "DM 8/5/2020 20:07",
"selectedTreeNode" : "JIZ 5/27/2020 15:31",
"selectedTreeNode:" : "CL 6/25/2021 14:57",
"switchTimelineToMorphWith:" : "CL 6/25/2021 15:01",
"selectedTreeNode:" : "MH 7/1/2021 10:27",
"switchTimelineToMorphWith:" : "MH 7/1/2021 10:33",
"timeline" : "CL 6/25/2021 13:51",
"timeline:" : "CL 6/25/2021 13:51",
"timelines" : "DM 8/6/2020 10:31",
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
as yet unclassified
on: anAnimationsEditorTrack withPosition: aPoint withFrame: aFrame withValue: aValue

^ self basicNew
timeline: anAnimationsEditorTrack;
frame: aFrame;
value: aValue;
initialize;
position: aPoint;
yourself.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
frame: anObject

frame := anObject.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
frame

^ frame
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
initialization
initialize

super initialize.

self color: Color orange.
self extent: 15@15.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
track: anObject

track := anObject.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
track

^ track
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
value: anObject

value := anObject.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"class" : {
"on:withPosition:withFrame:withValue:" : "MH 7/1/2021 12:22" },
"instance" : {
"frame" : "MH 7/1/2021 12:22",
"frame:" : "MH 7/1/2021 12:22",
"initialize" : "MH 7/1/2021 12:23",
"track" : "MH 7/1/2021 12:11",
"track:" : "MH 7/1/2021 12:11",
"value:" : "MH 7/1/2021 12:22" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"category" : "AnimationsEditor-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"track",
"frame",
"value" ],
"name" : "AnimationsEditorKeyframe",
"pools" : [
],
"super" : "RectangleMorph",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
accessing
endTime: aNumber
endTime := aNumber.
endTime := aNumber.
self changed.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
accessing
startTime: aNumber
startTime := aNumber.
startTime := aNumber.
self changed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"defaultStartTime" : "DM 8/6/2020 10:37",
"duration" : "DM 8/4/2020 16:44",
"endTime" : "DM 8/6/2020 10:36",
"endTime:" : "DM 6/18/2020 13:52",
"endTime:" : "MH 7/1/2021 09:35",
"endTimeAsString" : "DM 8/5/2020 20:46",
"initialize" : "DM 6/22/2020 01:37",
"startTime" : "DM 8/6/2020 10:37",
"startTime:" : "DM 6/18/2020 13:51",
"startTime:" : "MH 7/1/2021 09:35",
"startTimeAsString" : "DM 8/5/2020 21:08" } }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
initialize
on: anAnimationsEditorTimeline withExtent: anotherPoint

^ self basicNew
timeline: anAnimationsEditorTimeline;
initialize;
extent: anotherPoint;
yourself.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
updating
addIntermediateLines
| positionX |

self timeline startTime + 1
to: self timeline endTime - 1
do: [:frame | frame \\ 100 = 0
ifTrue: [
positionX := self convertFrameToPosition: frame.
self addLineFrom: positionX @ self height to: positionX @ (self height - self lineHeight)]
].


Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
updating
addLineFrom: aStartPoint to: anEndPoint
| line |

line := LineMorph from: aStartPoint to: anEndPoint color: Color black width: 3.
self addMorph: line.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
updating
addStartEndLine

self addLineFrom: self startMargin @ self height to: self startMargin @ (self height - self startEndLineHeight).
self addLineFrom: self startMargin + self lineSegmentWidth @ self height to: self startMargin + self lineSegmentWidth @ (self height - self startEndLineHeight).



Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
updating
convertFrameToPosition: aFrame
| position |

position := aFrame / ((self timeline endTime - self timeline startTime) / self lineSegmentWidth) + self startMargin.

^position.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
endMargin

^10.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
initialization
initialize

super initialize.
self color: Color white.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
lineHeight

^ 10.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
constants
lineSegmentWidth

^ self width - self startMargin - self endMargin.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
startEndLineHeight

^ 20.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
startMargin

^ 85.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
timeline: anObject

timeline := anObject.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
timeline

^ timeline
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
updating
updateScale

self addStartEndLine.
self addIntermediateLines.


Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"class" : {
"on:withExtent:" : "MH 7/1/2021 10:57" },
"instance" : {
"addIntermediateLines" : "MH 7/1/2021 12:08",
"addLineFrom:to:" : "MH 7/1/2021 10:19",
"addStartEndLine" : "MH 7/1/2021 12:07",
"convertFrameToPosition:" : "MH 7/1/2021 12:05",
"endMargin" : "MH 7/1/2021 10:08",
"initialize" : "MH 7/1/2021 09:48",
"lineHeight" : "MH 7/1/2021 12:06",
"lineSegmentWidth" : "MH 7/1/2021 12:03",
"startEndLineHeight" : "MH 7/1/2021 12:06",
"startMargin" : "MH 7/1/2021 11:34",
"timeline" : "MH 7/1/2021 09:23",
"timeline:" : "MH 7/1/2021 09:23",
"updateScale" : "MH 7/1/2021 12:08" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "AnimationsEditor-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"timeline" ],
"name" : "AnimationsEditorTimebar",
"pools" : [
],
"super" : "RectangleMorph",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
as yet unclassified
initialize
newWith: anAnimationsEditor

^ self
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
initialization
addTimebar
| timebar |

timebar := AnimationsEditorTimebar on: self withExtent: self width @ self trackHeight.
self addMorph: timebar.
self timebar: timebar.
self timebar updateScale.
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
as yet unclassified
creation
addTrackFor: aProperty withPosition: aNumber
| track |

track := AnimationsEditorTrack on: self withProperty: aProperty withPosition: (0 @ aNumber) withExtent: (self width @ self trackHeight).
self addMorph: track.
track := AnimationsEditorTrack
on: self
withProperty: aProperty
withPosition: 0 @ aNumber
withExtent: self width @ self trackHeight.
self addMorph: track



Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
creation
createTracks
| positionY |

positionY := self trackHeight.
self property subproperties do: [:subproperty |
self addTrackFor: subproperty withPosition: positionY.
positionY := positionY + self trackHeight].
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
endTime: anObject

endTime := anObject.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
endTime

^ endTime
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
initialExtent

^ 550 @ 100.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
accessing
initialization
initialize

super initialize.
self extent: 550@100.

self extent: self initialExtent.
self color: Color white.
self initializeStartEndTime.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
initialization
initializeStartEndTime
| startEndProperty |

startEndProperty := self animationsEditor propertyList first.
self
startTime: startEndProperty startTime;
endTime: startEndProperty endTime.
startEndProperty addDependent: self.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
startTime: anObject

startTime := anObject.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
startTime

^ startTime
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
accessing
creation
switchTimelineTo: aProperty
| positionY |

self property: aProperty.
positionY := 0.
aProperty subproperties do: [:subproperty |
self addTrackFor: subproperty withPosition: positionY.
positionY := positionY + self trackHeight].
self addTimebar.
self createTracks.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
timebar: anObject

timebar := anObject.
Loading

0 comments on commit 8d64e0b

Please sign in to comment.