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

[3.x] Fix ViewportTexture error when viewport is used from a child scene #52365

Merged
merged 1 commit into from
Oct 5, 2021

Conversation

jitspoe
Copy link
Contributor

@jitspoe jitspoe commented Sep 3, 2021

This should hopefully fix some of the viewport errors mentioned in #27790

@jitspoe jitspoe requested a review from a team as a code owner September 3, 2021 00:44
@Calinou Calinou added this to the 3.4 milestone Sep 3, 2021
@jitspoe jitspoe force-pushed the 3.x.viewport_error_fix branch from 3dced0a to 5777905 Compare September 3, 2021 08:26
if (vp) {
vp->viewport_textures.erase(this);
}
if (get_local_scene()) {
Copy link
Member

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;
}

@akien-mga
Copy link
Member

Is this also relevant for 4.0?

@jitspoe
Copy link
Contributor Author

jitspoe commented Sep 16, 2021

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.
@akien-mga akien-mga force-pushed the 3.x.viewport_error_fix branch from 5777905 to d2637ca Compare October 5, 2021 10:19
@akien-mga
Copy link
Member

akien-mga commented Oct 5, 2021

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).

@akien-mga akien-mga changed the title Fix invalid errors when a separate child scene file contains a viewport and that viewport is used for a texture in the current scene to fix #27790. [3.x] Fix ViewportTexture error when viewport is used from a child scene Oct 5, 2021
@jitspoe
Copy link
Contributor Author

jitspoe commented Oct 5, 2021

Thanks for taking care of that. Was off on vacation + busy with other stuff, so I didn't get around to cleaning this up.

@akien-mga akien-mga merged commit d35fccb into godotengine:3.x Oct 5, 2021
@akien-mga
Copy link
Member

Thanks!

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