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(composer): fix object transforms during reparenting #477

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

sheilaXu
Copy link
Contributor

Overview

Object gets wrong transform during reparenting, issues includes:

  • Tag's scales changes during reparenting
  • Reparenting object between SubModelRef node and other nodes will cause object the move to wrong position
  • Reparenting object to node with scale > 1 will cause object to scale unexpectedly

Before fix:

reparent-issue.mov

After fix:

reparent-fix.mov

Verifying Changes

Scene Composer

For scene-composer package changes specifically, you can preview the component in the published storybook artifact. To do this, wait for the Publish Storybook action to complete below.

  • Click on the workflow details
  • Select the Summary item on the left
  • Download the zip file

To run the storybook build locally, you need a local static web server:

npm install -g httpserver
cd <Extracted Zip Directory>
httpserver

Then open the website http://localhost:8080 to run the doc site.

Legal

This project is available under the Apache 2.0 License.

@sheilaXu sheilaXu marked this pull request as ready for review January 12, 2023 20:54
mumanity
mumanity previously approved these changes Jan 12, 2023

// If the direct new parent is a sub model node, use its modelRef parent
// to calculate the new transforms to prevent the object froming being
// moved to random position.
Copy link
Contributor

Choose a reason for hiding this comment

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

NON-BLOCKING: Position is not random. The placement is from traversing up the hierarchy until it reaches the submodel scene root at the edge of the world space. Suggest updating this in case someone encounters that behavior later so that they can understand it better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will try to make it more clear

mukeshsahay
mukeshsahay previously approved these changes Jan 12, 2023
@sheilaXu sheilaXu merged commit 7a45bb3 into main Jan 13, 2023
@sheilaXu sheilaXu deleted the fix-tag-reparent branch January 13, 2023 00:13
@github-actions github-actions bot mentioned this pull request Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants