aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormonikahedman <monika_hedman@brown.edu>2020-02-09 16:14:39 -0500
committermonikahedman <monika_hedman@brown.edu>2020-02-09 16:14:39 -0500
commit771fa67f7fe9b389415bf7043f3832ac92120431 (patch)
tree76e526075185499de588a2f97e71b1959a6304e1 /src
parent79f70eebe0a29f8f3d759eff82dd3446ac3d5ed1 (diff)
parentba835bbe5b31e2ad0badc9f960b75f639e0b02e0 (diff)
Merge branch 'monika_animation' of https://github.com/browngraphicslab/Dash-Web into monika_animation
Diffstat (limited to 'src')
-rw-r--r--src/client/views/animationtimeline/Timeline.tsx21
-rw-r--r--src/client/views/animationtimeline/Track.tsx7
2 files changed, 27 insertions, 1 deletions
diff --git a/src/client/views/animationtimeline/Timeline.tsx b/src/client/views/animationtimeline/Timeline.tsx
index 3c4c5c93f..3942499c9 100644
--- a/src/client/views/animationtimeline/Timeline.tsx
+++ b/src/client/views/animationtimeline/Timeline.tsx
@@ -345,6 +345,7 @@ export class Timeline extends React.Component<FieldViewProps> {
/**
* context menu function.
* opens the timeline or closes the timeline.
+ * Used in: Freeform
*/
timelineContextMenu = (e: React.MouseEvent): void => {
ContextMenu.Instance.addItem({
@@ -515,6 +516,7 @@ export class Timeline extends React.Component<FieldViewProps> {
const roundToggleContainer = this._roundToggleContainerRef.current!;
const timelineContainer = this._timelineContainer.current!;
if (BoolCast(this.props.Document.isATOn)) {
+ //turning on playmode...
roundToggle.style.transform = "translate(0px, 0px)";
roundToggle.style.animationName = "turnoff";
roundToggleContainer.style.animationName = "turnoff";
@@ -522,7 +524,9 @@ export class Timeline extends React.Component<FieldViewProps> {
timelineContainer.style.top = `${-this._containerHeight}px`;
this.props.Document.isATOn = false;
this._isAuthoring = false;
+ this.tracks();
} else {
+ //turning on authoring mode...
roundToggle.style.transform = "translate(20px, 0px)";
roundToggle.style.animationName = "turnon";
roundToggleContainer.style.animationName = "turnon";
@@ -548,7 +552,19 @@ export class Timeline extends React.Component<FieldViewProps> {
return this.toReadTime(current);
}
+ @observable private mapOfTracks: (Track | null)[] = [];
+ @action
+ tracks = () => {
+ console.log(this.mapOfTracks.length);
+ this.mapOfTracks.forEach(track => {
+ if (track !== null) {
+ track.getLastRegion();
+ } else {
+
+ }
+ });
+ }
/**
* if you have any question here, just shoot me an email or text.
* basically the only thing you need to edit besides render methods in track (individual track lines) and keyframe (green region)
@@ -571,7 +587,10 @@ export class Timeline extends React.Component<FieldViewProps> {
<div key="timeline_scrubberhead" className="scrubberhead" onPointerDown={this.onScrubberDown} ></div>
</div>
<div key="timeline_trackbox" className="trackbox" ref={this._trackbox} onPointerDown={this.onPanDown} style={{ width: `${this._totalLength}px` }}>
- {DocListCast(this.children).map(doc => <Track node={doc} currentBarX={this._currentBarX} changeCurrentBarX={this.changeCurrentBarX} transform={this.props.ScreenToLocalTransform()} time={this._time} tickSpacing={this._tickSpacing} tickIncrement={this._tickIncrement} collection={this.props.Document} timelineVisible={this._timelineVisible} />)}
+ {DocListCast(this.children).map(doc => {
+ const track = <Track ref={ref => { this.mapOfTracks.push(ref); }} node={doc} currentBarX={this._currentBarX} changeCurrentBarX={this.changeCurrentBarX} transform={this.props.ScreenToLocalTransform()} time={this._time} tickSpacing={this._tickSpacing} tickIncrement={this._tickIncrement} collection={this.props.Document} timelineVisible={this._timelineVisible} />
+ return track;
+ })}
</div>
</div>
<div className="currentTime">Current: {this.getCurrentTime()}</div>
diff --git a/src/client/views/animationtimeline/Track.tsx b/src/client/views/animationtimeline/Track.tsx
index 84edc6e0a..620668db7 100644
--- a/src/client/views/animationtimeline/Track.tsx
+++ b/src/client/views/animationtimeline/Track.tsx
@@ -80,6 +80,13 @@ export class Track extends React.Component<IProps> {
}
////////////////////////////////
+
+ getLastRegion = () => {
+
+ console.log((this.regions[this.regions.length - 1] as Doc).time);
+ return this.regions[this.regions.length - 1] as Doc;
+ }
+
/**
* keyframe save logic. Needs to be changed so it's more efficient
*