Skip to content
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

Add a project setting to automatically add Editor's WorldEnvironment, DirectionalLight3D, and/or Camera3D to a 3D scene when running project with Run Current Scene/Run Specific Scene #98328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaydensipe
Copy link
Contributor

@jaydensipe jaydensipe commented Oct 19, 2024

Closes godotengine/godot-proposals#6735
Closes godotengine/godot-proposals#5801
Closes godotengine/godot-proposals#5800
Closes godotengine/godot-proposals#10144 (maybe)
Closes godotengine/godot-proposals#7992 (maybe)
Fixes #95804

image

This commit adds a Project Setting (ENABLED BY DEFAULT) that when running the project with Run Current Scene or Run Specific Scene, adds the preview WorldEnvironment, DirectionalLight3D and/or Camera3D nodes from the Editor into the running game. This will NOT add any preview nodes if they already exist in the scene tree before running. This does NOT affect running a game normally.

I tried to adapt this the best I could to the discussion in godotengine/godot-proposals#5800, but am up to modify it in any way I should.

Some notes:

  1. Code wise, I couldn't find a better way to pass the nodes through the debugger message than (var_to_bytes_with_objects) but chances are I missed something, is there a better way to do this?
  2. Would we want to update this to update when the Environment/Sun preview button is toggled, as it stands right now it is only read when the game is started.

image

image


Before After
Screen.Recording.2024-10-18.214654.mp4
Screen.Recording.2024-10-18.214034.mp4

@jaydensipe jaydensipe requested review from a team as code owners October 19, 2024 01:54
@jaydensipe jaydensipe force-pushed the use-editor-preview-nodes-when-running-current-or-custom-scene branch 6 times, most recently from b3740d6 to fcdd9bb Compare October 19, 2024 06:43
@AThousandShips AThousandShips changed the title Adds a project setting to automatically add Editor's WorldEnvironment, DirectionalLight3D and/or Camera3D to a 3D scene when running project with Run Current Scene/Run Specific Scene Add a project setting to automatically add Editor's WorldEnvironment, DirectionalLight3D, and/or Camera3D to a 3D scene when running project with Run Current Scene/Run Specific Scene Oct 19, 2024
@AThousandShips AThousandShips added this to the 4.x milestone Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment