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 issue with 3D scene drag and drop preview node #85087

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

EelisOtsamo
Copy link
Contributor

@EelisOtsamo EelisOtsamo commented Nov 19, 2023

Fixes #84422

Fixes a bug with drag and dropping multiple scenes in the 3D editor. The preview node was previously being parented inside the loop that iterated over the selected files to drag, when it only had to be parented once.

@EelisOtsamo EelisOtsamo requested a review from a team as a code owner November 19, 2023 13:58
@AThousandShips AThousandShips added this to the 4.3 milestone Nov 19, 2023
@akien-mga akien-mga added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Nov 20, 2023
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

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

This ignores the checks, which I don't think is correct. The same code existed in the canvas item editor (in fact, it was copied here from there), and the same issue was identified there. It was fixed in #15516, and I think you should do the same here.

Introduce a new bool, set it to true in place of the line that you've removed, and then only call add_child if it is set to true. You can see how it's done in the linked PR.

@EelisOtsamo EelisOtsamo force-pushed the fix_scene_drag_and_drop branch 2 times, most recently from 0b65f20 to 58dc662 Compare November 24, 2023 13:43
@EelisOtsamo EelisOtsamo force-pushed the fix_scene_drag_and_drop branch from 58dc662 to 834ccb9 Compare November 24, 2023 13:45
Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

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

LGTM now, thanks!

@akien-mga akien-mga merged commit beb454c into godotengine:master Dec 4, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@YuriSizov
Copy link
Contributor

Cherry-picked for 4.2.1.

@YuriSizov YuriSizov removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Dec 5, 2023
@EelisOtsamo EelisOtsamo deleted the fix_scene_drag_and_drop branch December 9, 2023 10:51
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.

Internal error when adding multiple scenes into the 3D viewport
5 participants