diff options
author | reduz <reduzio@gmail.com> | 2022-06-23 08:19:18 +0200 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2022-06-23 08:19:18 +0200 |
commit | d69e3791bf41dca6c29a9eb24bb92648cce2d692 (patch) | |
tree | a8ca3ff213aad1d5d8210a608092d4ed33b9f637 /scene/3d | |
parent | abb92861f44427e9376fab9ee2f414f14848d6b5 (diff) |
Fix editor-only visibility for lights
* Update visibility again for editor-only lights if owner changes.
Fixes #26399, supersedes #52327
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/light_3d.cpp | 5 | ||||
-rw-r--r-- | scene/3d/light_3d.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp index 28614d7cae..6c999d85e2 100644 --- a/scene/3d/light_3d.cpp +++ b/scene/3d/light_3d.cpp @@ -176,6 +176,11 @@ Ref<Texture2D> Light3D::get_projector() const { return projector; } +void Light3D::owner_changed_notify() { + // For cases where owner changes _after_ entering tree (as example, editor editing). + _update_visibility(); +} + void Light3D::_update_visibility() { if (!is_inside_tree()) { return; diff --git a/scene/3d/light_3d.h b/scene/3d/light_3d.h index 383fa644e5..6ff332df5a 100644 --- a/scene/3d/light_3d.h +++ b/scene/3d/light_3d.h @@ -85,6 +85,8 @@ private: // bind helpers + virtual void owner_changed_notify() override; + protected: RID light; |