You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 24, 2023. It is now read-only.
Edit mode is meant to have the app without any loops executing so that objects can be interacted with. The current implementation of this replaces useFrame and useUpdate with an editor version that lets us suspend the callback, but only for calls that originate in the user app -- not from libraries. Consequently, any library interaction or even pointer events from R3F still occur in edit mode.
This can be seen in the ClickAndHover R3F example.
Proposed solution
Instead, I think we should suspend the R3F loop by setting it to never and then running our own loop for rendering while in edit mode. When we exit edit mode, we suspend our loop and let the app execute as it normally would. The API for doing this would be the same between v8 and v9 but v9 would allow more options, for example suspending only certain stages for the purpose of debug.
Edit mode is meant to have the app without any loops executing so that objects can be interacted with. The current implementation of this replaces
useFrameanduseUpdatewith an editor version that lets us suspend the callback, but only for calls that originate in the user app -- not from libraries. Consequently, any library interaction or even pointer events from R3F still occur in edit mode.This can be seen in the ClickAndHover R3F example.
Proposed solution
Instead, I think we should suspend the R3F loop by setting it to
neverand then running our own loop for rendering while in edit mode. When we exit edit mode, we suspend our loop and let the app execute as it normally would. The API for doing this would be the same between v8 and v9 but v9 would allow more options, for example suspending only certain stages for the purpose of debug.