-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
@react-spring/three doesn't update all position parameters when passed to r3f mesh #1430
Comments
... only 10 minutes later I came across this in r3f api readme: https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#piercing-into-nested-properties So I'm now setting individual positions using May I still ask the newbie question of why this is the case? If it's easy to answer that question? |
Can you reduce your sandbox down just to highlight the core issue you're facing? There's too much noise for me to debug. Side note, yes using |
Good point, sorry about that. Have gotten rid of all the clutter, same link here: https://codesandbox.io/s/exploding-square-forked-for-react-spring-github-issue-dont-touch-n48b9?file=/src/App.js |
I think this is a real issue, I was about to log this separately but I guess it's the same: The breakage occurs with using |
@mysterybear |
I had a go at debugging this! (took me quite a long while, but...) I believe the offending line of code is:
Swapping out the I'm keen to make a PR, (with a unit test perhaps?), but I'm not sure if removing/changing that if block is getting rid of an optimisation, does it look safe to do that? |
Some will return a Boolean won't it? So what is the Boolean not returning true blocking from updating...? 🤔 Because I assume for each doesn't return true. |
I think I see what the problem is: |
Okay, well @midanosi ifn you want to make a PR with a test we can evaluate this change with all the demos we have in the repo etc. To check for unwanted side effects, although hopefully there wont be and if there are the tests will bring them up 👍🏼 |
@joshuaellis I saw you assigned this to yourself yesterday. Life got in the way, but I finally submitted a pull request for this fix, wanted to let you know so that the work isn't re-done. |
…1551) * chore: depreciate three-v5 * chore: add three-demo * feat: move rafz to part of monorepo * fix: use new rafz property to let r3f drive animation frames resolves #1518 * chore: delete travis * test: import from @react-spring/rafz * fix: update all values of animated array (#1430) (#1550) Co-authored-by: Michael Hutchings <michael.hutchings@cambridgeconsultants.com> * chore: update lock * fix: typescript errors * fix: allow declare Co-authored-by: Michael Hutchings <33626784+midanosi@users.noreply.github.com> Co-authored-by: Michael Hutchings <michael.hutchings@cambridgeconsultants.com>
released in v9.2.2, big thanks to @midanosi ⭐ |
🐛 Bug Report
I have a spring that I'm trying to use to make position parameter for a Box in r3f to go from e.g. [1,1,1] -> [2,2,2]
But despite interpolating the spring to an array of values, when I pass it into <a.mesh position={interpolatedPosition} />, it only updates the x coordinate. If I change the interpolation fn to make x value static, e.g.
then it'll now update only the y value.
I wasn't sure whether to raise this here or in the r3f repo! Sorry if I got the wrong place. Also aware that this might not be a bug, in which case may I ask for guidance on how to achieve what I'm aiming for?
To Reproduce
See codesandbox
Expected behavior
For all x, y, z parameters to be updated
Link to repro (highly encouraged)
https://codesandbox.io/s/exploding-square-forked-for-react-spring-github-issue-dont-touch-n48b9
Environment
@react-spring/three
v9.1.1react
v17.0.2Edit: changed sandbox link to stay static
The text was updated successfully, but these errors were encountered: