-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
PropertyBinding falls back to root node for incorrect paths/nodes #25286
Comments
The fallback to the root node is present since the new animation system was added via #6934. The specific commit which add I' don't know if there is a use case that breaks if the fallback is removed and an error throw/logged instead. I'm not sure it's worth to find this out since you can easily use |
I think the behaviour with I ran into this case with files using Trying to sanitize each and every animation track before playing it on each and every asset doesn't sound like something that should happen on app level to me... |
What would your desired behavior? Just ignoring the binding and log a warning? |
Yep - a warning is logged later in the code already, all I changed to fix this was to remove the fallback to root - It will then log something like this instead of applying the animations to the root: |
I've searched the history again and couldn't find something. When we log a warning, it's at least easy to relate a potential breakage to the removal of the fallback. It's also easy to add the code back if necessary. And we finally know its purpose and can document it (or work on an alternative solution). So I guess I'm fine with a PR. |
I think there might be important cases where an empty object name (e.g. |
@donmccurdy I believe that case is handled explicitly already - empty nodeName (in a couple of combinations) is targeted at root: https://github.com/mrdoob/three.js/blob/dev/src/animation/PropertyBinding.js#L196-L202 |
PR is up @Mugen87 |
Description
I'm not sure if this is/was intended, but we've run into a number of cases where slightly wrong animation property names result in horribly broken results, because instead of ignoring incorrect paths three falls back to applying everything to the root node (often resulting in chaos).
If that's not intended, I can take a look at making a PR.
Maybe someone knows why this is used in a number of places (falling back to the root if parsing the path fails):
Reproduction steps
Code
Live example
https://jsfiddle.net/nqyf79mp/31/
Version
dev
The text was updated successfully, but these errors were encountered: