Merge pull request #53428 from akien-mga/4.x/27790-viewport-error-fix
Fix ViewportTexture error when viewport is used from a child scene
This commit is contained in:
commit
a5d7b49342
@ -57,17 +57,17 @@
|
|||||||
#include "servers/audio_server.h"
|
#include "servers/audio_server.h"
|
||||||
|
|
||||||
void ViewportTexture::setup_local_to_scene() {
|
void ViewportTexture::setup_local_to_scene() {
|
||||||
|
Node *local_scene = get_local_scene();
|
||||||
|
if (!local_scene) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (vp) {
|
if (vp) {
|
||||||
vp->viewport_textures.erase(this);
|
vp->viewport_textures.erase(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
vp = nullptr;
|
vp = nullptr;
|
||||||
|
|
||||||
Node *local_scene = get_local_scene();
|
|
||||||
if (!local_scene) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Node *vpn = local_scene->get_node(path);
|
Node *vpn = local_scene->get_node(path);
|
||||||
ERR_FAIL_COND_MSG(!vpn, "ViewportTexture: Path to node is invalid.");
|
ERR_FAIL_COND_MSG(!vpn, "ViewportTexture: Path to node is invalid.");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user