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

Enable editing of controls inside viewports in editor #99401

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

Black-Cat
Copy link
Contributor

@Black-Cat Black-Cat commented Nov 18, 2024

Fixes #79289

I've tested:

  • Selection
  • Box Selection
  • Anchors
  • Moving
  • Rotating
  • Scaling
  • Pivot
  • Temporary pivot
  • Smart Snapping
  • Grid Snapping
  • Helpers
  • Focus

Bugsquad edit:
Fixes #20619
Fixes #60088

@Black-Cat Black-Cat requested a review from a team as a code owner November 18, 2024 17:20
@Calinou Calinou added this to the 4.4 milestone Nov 18, 2024
@Calinou Calinou added the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Nov 18, 2024
@KoBeWi
Copy link
Member

KoBeWi commented Nov 18, 2024

Looks like #61873, but actually working.

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

Tested various 2D editor interactions and didn't see any obvious side-effects. It works surprisingly well.

@kitbdev
Copy link
Contributor

kitbdev commented Nov 21, 2024

Some nodes have an incorrect gizmo position when in a Viewport not at the origin, like position indicators for Node2Ds or handles for Line2D, CollisionShape2D, etc.

image

image

image

Selecting works and using the handles works, they're just offset and not rotated or scaled.

Also, If the viewport gets rotated or scaled, using the move or scale tools aren't correct, though the resize gizmos are fine.

image

Copy link
Contributor

@kitbdev kitbdev left a comment

Choose a reason for hiding this comment

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

The issues I mentioned before are all fixed. Looks good!

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally (rebased on top of master 0eadbdb), it mostly works as expected.

On GUI in 3D, I can see the editing controls and interact with them, but nothing appears in the 2D editor viewport:

image

All nodes are set to be visible in the 2D scene tree.

I can see the preview in the inspector though:

image

@kitbdev
Copy link
Contributor

kitbdev commented Nov 29, 2024

On GUI in 3D, I can see the editing controls and interact with them, but nothing appears in the 2D editor viewport:

They also do not appear in 4.3 and in master. This is intentional since SubViewport do not draw anything by themselves. In that scene, the SubViewport is rendered to a MeshInstance3D, so it will only show in the 3D Editor.

So instead, the nodes in a SubViewport without a SubViewportContainer should not be selectable or editable in the canvas editor.

@akien-mga akien-mga merged commit 4b0f178 into godotengine:master Nov 29, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi
Copy link
Member

KoBeWi commented Dec 28, 2024

Unintended consequence is that you can move nodes outside the current scene:

A3lGkciR1z.mp4

Granted, you need a custom EditorPlugin to select such nodes. We could use in_part_of_edited_scene() to prevent this, but it's not really a problem I think 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release topic:editor topic:2d usability
Projects
None yet
5 participants