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

Rework Scene and GUI Editor connection #13353

Merged
merged 2 commits into from
Dec 16, 2022

Conversation

carolhmj
Copy link
Contributor

Currently, when a GUI Editor instance is opened through the Inspector, all existing controls on the Scene are removed and then re-added to both the "live" scene and the editor scene. This has been causing variety of problems, such as:

  • When a control in the editor is scaled, it doesn't update visually on the live scene
  • If a control in the live scene is linked to a mesh, it loses that connection after the editor is opened
  • Scroll viewers on the live scene lose scroll functionality once the editor is opened
  • Controls on the live scene changed size because the editor scene could have a different size

This PR introduces a new approach, such as when the editor is opened, the "live" scene's Controls are cloned and the clones added to the editor scene. Then, it periodically executes the opposite operation, cloning the editor controllers and adding them to the live scene.

@RaananW
Copy link
Member

RaananW commented Dec 16, 2022

Copy link
Member

@RaananW RaananW left a comment

Choose a reason for hiding this comment

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

Repeating something I said offline -

great work!

The only issue I see here is when you include images in your GUI. if an image URL is provided the image will be downloaded and decoded on every change, even when it's not the image that was updated.

This should be tracked in a different issue and resolved to allow a more efficient update of the ADT.

Copy link
Member

@sebavan sebavan left a comment

Choose a reason for hiding this comment

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

only nits :-)

packages/dev/gui/src/2D/controls/control.ts Show resolved Hide resolved
packages/dev/gui/src/2D/controls/control.ts Show resolved Hide resolved
@sebavan sebavan enabled auto-merge December 16, 2022 20:31
@sebavan sebavan merged commit 8315747 into BabylonJS:master Dec 16, 2022
@carolhmj carolhmj deleted the reworkPGAndGEConnection2 branch July 19, 2023 13:33
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.

3 participants