-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Allow editor plugins to modify run arguments and re-run from within project #107671
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
base: master
Are you sure you want to change the base?
Conversation
9526981
to
cc21f5f
Compare
cc21f5f
to
65d28c4
Compare
This could still use more testing, although, it's working well for me on Linux (both with the embedded game view and not) so I think I'll take it out of draft NOTE: this is squarely targeting Godot 4.6 at this point |
I think it would be more efficient if you just passed the Vector as argument and don't expect it to be returned. Since it's passed as reference, the plugin can modify it all the same, without making an unnecessary copy. Although the copy is only made when a plugin implements the method, so it's probably fine either way. I also noticed that there is discrepancy between arguments passed to the new method and the ones returned by |
What are the debugger changes for? |
@KoBeWi Thanks for the review!
While passing it as a reference and modifying it in place would work in the engine itself, I don't think it would work from GDScript or GDExtension. In that case, I think a copy would be made as soon as any elements were removed or added to the Since this only happens when the user clicks the "Run project" or "Run scene" button, I don't think we have to worry about being very efficient here.
This is by design. I don't think we want plugins to mess with all the arguments that the editor adds automatically, just the additional ones. Otherwise a plugin could sneakily change which scene is being run, or the port the debugger is going to connect to, etc.
To allow the application to trigger itself to relaunch with different arguments, while still allowing the new instance to run in the embedded game view (if enabled) and connect to the debugger. These changes are to enable PR GodotVR/godot_openxr_vendors#312 for the godot_openxr_vendors GDExtension. That PR aims to allow basically the same as PR #103972 (which only works when running the editor on Android), but instead simulating it on the desktop, so you can test hybrid apps (XR apps that can switch between immersive and 2D panel modes) without having run on a real headset. |
How can this be tested? |
Well, you can test it via GodotVR/godot_openxr_vendors#312 and the Meta XR Simulator, but that's a lot of extra stuff to setup :-) So, here's a minimal demo app to test it: |
Here's a scene that does (almost) the same in vanilla Godot: I guess adding |
This PR aims to allow GDExtensions on desktop platforms to do what PR #103972 does (but that other PR targets the Android editor)
The ultimate goal is to allow the godot_openxr_vendor extension to simulate running a hybrid immersive/flat VR app on desktop, so you don't need to deploy to the headset for testing.
See GodotVR/godot_openxr_vendors#312 for the rest of the implementation of that
This is a DRAFT for now, because I need to do more testing (especially with the new embedded game view on multiple platforms)