Repository navigation
Conversation
YeldhamDev
left a comment
There was a problem hiding this comment.
Fixes the issue. Would be nice if it exited the preview already focused instead of snapping to it, but this will do for now.
There was a problem hiding this comment.
Tested locally, it mostly works as expected.
However, in certain scenarios, you can still get the original bug to occur:
camera_follow_pilot.mp4
On the above video, I pressed F twice to toggle follow mode at certain points, and the issue eventually occurred depending on what was currently enabled.
I would just disable follow mode as soon as the camera preview mode is entered to avoid the issue.
5689ea3 to
5fc7806
Compare
|
With the latest revision of this PR, I can still get the issue to occur with these steps: follow, preview, pilot, unfollow (by pressing F twice). The issue also occurs when toggling follow mode when both preview and pilot is already enabled, like in |
0e139ae to
6e54b5b
Compare
|
Applying the core fix in Regarding the snapping issue: fixing this safely is complex because the current interpolation system wasn't designed for this specific edge case. Forcing a fix here would risk introducing technical debt. Since it falls outside the immediate scope of this bug, it will be better to address it properly in a PR dedicated to this exact issue. |
Calinou
left a comment
There was a problem hiding this comment.
Tested again (rebased on top of master e7cfa29), it works as expected.
However, this has the adverse effect of not allowing you to use Focus Selection anymore while piloting a camera, even on another node where it would normally be fine. (Focus and Frame Selection still works, as it's newer than this PR.)
The camera will drift back slightly when you press F (which is the new Focus and Frame Selection option rather than just Focus Selection), but at least it doesn't happen permanently. The camera doesn't move when pressing Focus Selection in comparison. It might be worth looking into fixing this in a follow-up, but it's not critical.
6e54b5b to
500a183
Compare
|
This new version of the fix completely removes the Focus and Frame Selection drift, and allows you to use Focus Selection or Focus And Frame Selection on any node that is not a Camera3D. |
What problem(s) does this PR solve?
Camera3Dthat's Followed, Previewed and Piloted at the same time moves without any input #121821Additional information
It is physically impossible to follow and pilot a 3D Camera at the same time. Doing so causes the viewport cursor position to acquire an offset relative to the camera's actual position, resulting in an infinite interpolation loop as the camera continuously tries and fails to catch up to the cursor.
This can be easily proven by zooming in while in follow mode before hitting the pilot button, as this will make the drifting slow as the cursor has a smaller offset that results in a smaller interpolation.
The fix is to disable follow mode before entering pilot mode, while saving the times consecutively focused, in order to restore the follow mode if there was one, after toggling off pilot mode.