diff options
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; |