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

Fix 3D camera override when there is no camera in scene tree #100698

Conversation

aryan-11825114
Copy link
Contributor

Previously if there was no camera in the scene tree, on overriding the camera, it would receive no input, this P.R. fixes it.

Preview

Screencast.from.2024-12-21.18-27-25.webm

MRP

test.zip

@aryan-11825114 aryan-11825114 requested a review from a team as a code owner December 21, 2024 13:05
@Sauermann Sauermann changed the title Fix camera override when there is no camera in scene tree Fix 3D camera override when there is no camera in scene tree Dec 21, 2024
@AThousandShips AThousandShips added this to the 4.4 milestone Dec 21, 2024
@Hilderin
Copy link
Contributor

Hilderin commented Jan 13, 2025

The code looks great and it works when testing with the artefact build.

But it's impossible to select an element in the scene in 3D when there's no Camera3D.
My guess is this condition in RuntimeNodeSelect::_find_3d_items_at_pos:

Camera3D *camera = root->get_viewport()->get_camera_3d();
if (!camera) {
	return;
}

@aryan-11825114
Copy link
Contributor Author

Selection seems to work on removing the condition, should I commit it in this P.R.

@Hilderin
Copy link
Contributor

Yes, I think you should include it in this PR.

@aryan-11825114 aryan-11825114 force-pushed the fix-interactive-camera-not-taking-input-when-no-camera branch from 275aecf to ec243a5 Compare January 18, 2025 08:58
@aryan-11825114 aryan-11825114 force-pushed the fix-interactive-camera-not-taking-input-when-no-camera branch from ec243a5 to 2e4eb59 Compare January 18, 2025 09:09
@aryan-11825114
Copy link
Contributor Author

Changes made and rebased.

Copy link
Contributor

@Hilderin Hilderin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superbe! Thanks!

@Repiteo Repiteo merged commit 791c87e into godotengine:master Jan 20, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jan 20, 2025

Thanks!

@aryan-11825114 aryan-11825114 deleted the fix-interactive-camera-not-taking-input-when-no-camera branch January 20, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants