question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyframeTrack: Option to disable validation/optimization?

See original GitHub issue

By default, the KeyframeTrack constructor calls this.validate() and this.optimize(). Those calls are unnecessary for animations that are already optimized, and problematic if the track is going to be split later, such as in https://github.com/mrdoob/three.js/pull/13430. From the Oat the Goat technical writeup

THREE.KeyframeTrack’s constructor calls validate() and optimize() in its constructor, which is unnecessary and was costing us half a second of CPU time per scene.

An option in the KeyframeTrack constructor doesn’t really help, because they’re typically not created directly, and the option would need to be passed through all of the loaders. We could disable the optimization and let users trigger it manually, but I do think it’s a reasonable default. What about a (global) opt-out flag?

THREE.KeyframeTrack.autoValidate = false;
THREE.KeyframeTrack.autoOptimize = false;

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:30 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
donmccurdycommented, Jun 20, 2018

Ok, thanks! I’d meant to say the default should be to optimize (i.e. keep current behavior) as well, and just provide an option — somewhere — to disable it, so I think we’re on the same page.

2reactions
Usnulcommented, Jun 20, 2018

@RemusMar & @donmccurdy

That’s true, but there are millions of assets uploaded on thousands of servers. Do you expect them to be re-exported in the “optimized” way?

It would be ideal for optimization to happen before animation is brought into three.js, but that’s a much harder problem.

Asset pipeline is something everyone has, some put more effort into it that others, some pipelines are completely custom while others are heavily standardized etc. I am not advocating for removal of validation and optimization methods - I think they are wonderful tools that serve real need. I believe that it’s reasonable to assume that once an animation is loaded it is:

  • valid
  • expressed as desired (no optimization is wanted)

When these assumptions are insufficient, i believe it is reasonable to offer the tools (validate and optimize) to the user in order to deal with such usecases.

Unrelated:

@donmccurdy writeup on GOat was quite insightful, especially part about glTF exporter. They said they wrote 13k lines for that interactive experience which, when reading the writeup, indicated me think that there’s a lot of room for improvement in glTF export as well as animation module and three.js in general.

@RemusMar

The backwards compatibility is (should be) a critical factor in software development.

“Everything in moderation”. I don’t subscribe to your view, backwards compatibility is critical for some applications and harmful for others. Language design is one example where backwards compatibility is a clear net negative for the user, take C++ as example, there are a fraction of a percent of a percent of C++ developers who can rightfully claim to know all of ‘standard’ C++ - thanks to backwards compatibility. Backwards compatibility is expensive, it bloats your code, it takes time, it leads to rigidity in your architecture which strongly opposes evolution and progress. Three.js is not backwards compatible, I enjoy migration and deprecation notices, but that’s not backwards compatibility, I can’t boot up my application written against three.js r50 in three.js r93 and expect it to work - it doesn’t. There is something called “semantic versioning” which might be a good thing for people to familiarize themselves with, if not to practice religiously. /rant

Read more comments on GitHub >

github_iconTop Results From Across the Web

KeyframeTrack – three.js docs
A KeyframeTrack is a timed sequence of keyframes, which are composed of lists of times and related values, and which are used to...
Read more >
Adding, navigating, and setting keyframes in Premiere Pro
Add keyframes · Click the Add/Remove Keyframe button in the Effect Controls panel and then adjust the effect property's value. · Ctrl-click ( ......
Read more >
Example of three.js KeyframeTrack with smoothing (cubic ...
From my testing, parsing the interpolation method in the KeyframeTrack constructor is insufficient. var position = new THREE.VectorKeyframeTrack ...
Read more >
Change, remove or turn off animation effects - Microsoft Support
Learn how to replace or remove animations applied to objects in a PowerPoint presentation. ... Under Show options, select Show without animation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found