-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
[3.x] Fix ViewportTexture error when viewport is used from a child scene #52365
Conversation
3dced0a
to
5777905
Compare
scene/main/viewport.cpp
Outdated
if (vp) { | ||
vp->viewport_textures.erase(this); | ||
} | ||
if (get_local_scene()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd save on indentation and Git diff with:
if (!get_local_scene()) {
return;
}
Is this also relevant for 4.0? |
That's a good question. I think when I initially made the change, I was having trouble getting 4.0 to run. I seem to remember something about the viewport stuff changing, but looking at master, that function appears to be the same. Perhaps I should do the proper fix in master then pull it over to 3.x. |
Fix invalid errors when a separate child scene file contains a viewport and that viewport is used for a texture in the current scene. Fixes godotengine#27790.
5777905
to
d2637ca
Compare
I pushed an update to improve the code changes, as the check was already being done just a couple lines below. Also amended the title, keep in mind that Git commit titles should be kept succinct (full description can go in the body of the commit message). |
Thanks for taking care of that. Was off on vacation + busy with other stuff, so I didn't get around to cleaning this up. |
Thanks! |
This should hopefully fix some of the viewport errors mentioned in #27790