Detect more animated items
Okay cool, I noticed that "A Warm Winters Night Background" sometimes animates when other things are playing, but the animations aren't _detected_. (Huh, I actually thought we just didn't schedule ticks in that case? But maybe I'm missing something.) Anyway, some movies don't use the built-in frames construct to animate, and instead use tweens that hook into the timeline and mutate the stage. Okay! Now we detect those. This _did_ enable the Play/Pause button on some items that don't actually animate in practice, like the "#1 Fan Room Background", which seems to have an animated string of lights in the corner that got layered incorrectly. Maybe we should add a new glitch type, to flag movies that don't actually animate?
This commit is contained in:
parent
dcfcbf9ff7
commit
a19c2facbf
1 changed files with 5 additions and 0 deletions
|
@ -453,7 +453,12 @@ export function buildMovieClip(library, libraryUrl) {
|
||||||
*/
|
*/
|
||||||
export function hasAnimations(createjsNode) {
|
export function hasAnimations(createjsNode) {
|
||||||
return (
|
return (
|
||||||
|
// Some nodes have simple animation frames.
|
||||||
createjsNode.totalFrames > 1 ||
|
createjsNode.totalFrames > 1 ||
|
||||||
|
// Tweens are a form of animation that can happen separately from frames.
|
||||||
|
// They expect timer ticks to happen, and they change the scene accordingly.
|
||||||
|
createjsNode?.timeline?.tweens?.length >= 1 ||
|
||||||
|
// And some nodes have _children_ that are animated.
|
||||||
(createjsNode.children || []).some(hasAnimations)
|
(createjsNode.children || []).some(hasAnimations)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue