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 RemoteTransform3D to always use global rotation if use_global_coordinates is true #97498

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TheSofox
Copy link
Contributor

Fixes #97470.

RemoteTransform3D would sometimes update the rotation of its target object according to local coordinates even when use_global_coordinates was true. This PR fixes that.

Incidentally, if the settings to update Scale Position and Rotation were all true, this bug wouldn't be triggered.

@TheSofox TheSofox requested a review from a team as a code owner September 26, 2024 15:33
@AThousandShips AThousandShips added bug topic:3d cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Sep 26, 2024
@AThousandShips AThousandShips added this to the 4.4 milestone Sep 26, 2024
@fire fire requested a review from TokageItLab September 27, 2024 10:13
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.

Seems like scale has the same problem, i.e. it's not global.

@TheSofox
Copy link
Contributor Author

Got weird behaviour when I tried to switch Scale to global too. Rather than dig in, I just decided to go with the Global Rotation fix which I was sure worked.

@akien-mga
Copy link
Member

CC @MajorMcDoom to confirm this works for your use case.

I'd also like some input from mathy contributors, it seems weird to me to use global rotation but not global scale, but I'm not too up-to-date on the intricacies of successive matrix operations.

This should also be compared with RemoteTransform2D to make sure the logic is consistent (there it seems to handle rotation differently by starting from the transform to sync with).

@MajorMcDoom
Copy link
Contributor

MajorMcDoom commented Jan 31, 2025

CC @MajorMcDoom to confirm this works for your use case.

I'll check in a bit.

I'd also like some input from mathy contributors, it seems weird to me to use global rotation but not global scale, but I'm not too up-to-date on the intricacies of successive matrix operations.

It definitely is weird to use local scale when global is enabled, especially since global scale is used when all the properties are true. So there's some weird inconsistency there in the behaviour. You can get into a situation where simply enabling position syncing will make the global scale work properly, which is quite odd. I do understand the challenges though, since the meaning of "global scale" becomes a little open to interpretation when you disable rotation syncing, but we definitely need a better solution than now. It could also use a bit of optimizing.

@MajorMcDoom
Copy link
Contributor

@akien-mga
UPDATE:
Confirmed that this PR does fix the specific issue in #97470

@MajorMcDoom
Copy link
Contributor

MajorMcDoom commented Jan 31, 2025

After taking a closer look, I did another take here: #102223, which attempts to fix all the space-related issues in one go, plus some optimizations. (It couldn't be done as an additional step to this PR - it completely restructures the code and calls different methods).

Of course, we could still go with this smaller, more targeted fix if it feels safer.

@akien-mga akien-mga modified the milestones: 4.4, 4.5 Feb 11, 2025
@akien-mga akien-mga added the cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release label Feb 11, 2025
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 cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release topic:3d
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RemoteTransform3D applies incorrect rotation when Update Scale is disabled
5 participants