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

Remove viewport restrictions in 2D editor #61873

Closed

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Jun 10, 2022

Attempt to solve the long-standing issue of not being able to move nodes inside another viewport.

At first glance it works great:
godot windows tools 64_TsolVuywxr

Things fall apart when the viewport container is moved:
godot windows tools 64_x6XAvVYo5U
Editor gizmos appear relative to the main viewport instead of the sub-viewport.

If the viewport isn't in a container, the offset doesn't appear, but the node doesn't appear either, even though you can edit it...
godot windows tools 64_eji2P9Zq88

And then there is Window, which has a position offset, but doesn't display anything:
godot windows tools 64_dSXtSZpOBw

So with this solution, you can edit nodes inside a sub-viewport without a problem, IF the sub viewport is inside a container, which is located at (0, 0). It works in other cases too, but the node isn't displayed correctly.

The main reason I opened this PR is #60088. Dialogs were changed from Control to Window, so their content can't be edited easily. IMO it's time to do something about the viewport issue. The PR lays some foundation, and we could think of some fix for the new problems. Mainly the offset problem. Edited nodes in sub-viewport should somehow be able to offset their gizmos based on the viewport position. Not sure if this is possible.

Resolves #20619
Fixes #60088 (content doesn't display, but technically you can edit it)
Closes godotengine/godot-proposals#2139 (I think?)

@reduz
Copy link
Member

reduz commented Aug 6, 2022

Seems good, needs rebase. I would still ask for a review to @groud.

@KoBeWi
Copy link
Member Author

KoBeWi commented Aug 6, 2022

Seems good

Which part xd I attached a few GIFs showing how much it is broken. The editor issues need to be resolved somehow, maybe by adding some helper methods for determining sub-viewport position. Sounds complicated, so I didn't even try yet >_>

@YuriSizov YuriSizov modified the milestones: 4.0, 4.x Jan 12, 2023
@gaoshan0621
Copy link

Any updates?

@KoBeWi
Copy link
Member Author

KoBeWi commented Apr 19, 2023

I opened a PR with alternative approach, which is more promising, but needs to be finished 🙃

@KoBeWi
Copy link
Member Author

KoBeWi commented Nov 18, 2024

Closing in favor of #99401

@KoBeWi KoBeWi closed this Nov 18, 2024
@KoBeWi KoBeWi deleted the viewport_destroyer_or_something branch November 18, 2024 22:41
@KoBeWi KoBeWi removed this from the 4.x milestone Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment