Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clock should not animate by default #6154

Merged
merged 4 commits into from
Jan 25, 2018
Merged

Clock should not animate by default #6154

merged 4 commits into from
Jan 25, 2018

Conversation

ggetz
Copy link
Contributor

@ggetz ggetz commented Jan 24, 2018

As discussed in #6115 (comment)

Since use cases where the viewer should animate are the exception, not the norm, we should not be animating by default.

@ggetz ggetz requested a review from hpinkos January 24, 2018 21:09
@cesium-concierge
Copy link

Signed CLA is on file.

@ggetz, thanks for the pull request! Maintainers, we have a signed CLA from @ggetz, so you can review this at any time.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@ggetz ggetz mentioned this pull request Jan 24, 2018
@@ -90,6 +90,7 @@
selectionIndicator : false,
shadows : true
});
viewer.clockViewModel.shouldAnimate = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend changing all of these to simple viewer.clock.shouldAnimate, since it's clearer and doesn't require the timeline/animation widget to be present.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, does this particular example need animation? May be better to just not animate here (and choose a time that shows shadows so they always toggle, which right now only happens if the clock happens to be at a certain time).

@@ -57,6 +57,7 @@
}];

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.clockViewModel.shouldAnimate = true;cz,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy/paste error: cz,

CHANGES.md Outdated
@@ -4,7 +4,7 @@ Change Log
### 1.42 - 2018-02-01

* Breaking changes
*
* The clock does not animate by default. Set the viewer `ClockViewModel.shouldAnimate` property to `true` to enable animation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use viewer.clock.shouldAnimate here instead of "viewer ClockViewModel.shouldAnimate"

@mramato
Copy link
Contributor

mramato commented Jan 24, 2018

Thanks @ggetz, that's all I have.

Does anyone else have any opinion on this change? I think it's important in conjunction with #6115, but didn't know if anyone had any arguments against.

Thanks

@hpinkos
Copy link
Contributor

hpinkos commented Jan 24, 2018

👍

This also clears up a mistake I keep making where I disable the timeline and animation widgets, but time is still ticking along behind the scenes unbeknownst to me.

@lilleyse
Copy link
Contributor

This seems like a big breaking change to me, and I'm not sure we should do it so soon. Many time dynamic apps will need to be fixed.

I can imagine someone not familiar with viewer.clockViewModel.shouldAnimate loading an animated glTF model and being confused why it doesn't animate. Are there are other common situations like this that we might be forgetting about?

@mramato
Copy link
Contributor

mramato commented Jan 24, 2018

Many time dynamic apps will need to be fixed.

How many time dynamic apps don't provide a means to control animation though? This just changes the default state to not animating.

@ggetz
Copy link
Contributor Author

ggetz commented Jan 24, 2018

How many time dynamic apps don't provide a means to control animation though? This just changes the default state to not animating.

Yes, you can still always just hit "play" on the clock

@lilleyse
Copy link
Contributor

One example might be if an app is listening to scene.preRender and expects the time parameter to change. The app might not even expose animation controls but still require that the current simulation time exists.

Any apps that involve resources expiring may break. While not widely used or even officially part of the 3D Tiles spec yet, Cesium3DTile has an expiration property that cares about the simulation time even though the app appears static. Do KML or CZML have similar concepts?

There are also plenty of apps that expect to auto-play, and authors of those apps will be confused why it doesn't start right away anymore.

Overall I'm just saying that there may be a lot of unintended consequences related to this change.

@mramato
Copy link
Contributor

mramato commented Jan 24, 2018

There are also plenty of apps that expect to auto-play, and authors of those apps will be confused why it doesn't start right away anymore.

Do you have data to back up this assertion?

@ggetz
Copy link
Contributor Author

ggetz commented Jan 24, 2018

We could add a one time developer warning for a few releases? I don't think we can change this functionality without outright breaking it at some point.

@mramato
Copy link
Contributor

mramato commented Jan 24, 2018

We could add a one time developer warning for a few releases? I don't think we can change this functionality without outright breaking it.

What exactly do you have in mind? Simply writing out to the console that the scene no longer animates by default? I'm not sure that buys us anything. This is a trivial change for a dev to make and will have a bullet point in CHANGES. I honestly don't think it will be a big deal at all. We've made larger breaking changes.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jan 25, 2018

  • +1 on the change
  • Just a Breaking change mention in CHANGES.md is OK with me. Warning is up to you all, but I don't think it is needed
  • Consider being able to specify this using a new parameter when calling the Viewer constructor function.

@ggetz
Copy link
Contributor Author

ggetz commented Jan 25, 2018

Added shouldAnimate option to the Viewer constructor.

@mramato
Copy link
Contributor

mramato commented Jan 25, 2018

Thanks @ggetz, I'll merge as soon as this goes green (assuming no one beat me to it)

@mramato mramato merged commit dc4ea0f into master Jan 25, 2018
@mramato mramato deleted the dont-animate-by-default branch January 25, 2018 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants