From bf3966abf9da8bb7d86d13c7fdf37b3327236cd5 Mon Sep 17 00:00:00 2001 From: Yuri Rubinsky Date: Thu, 15 Dec 2022 18:32:17 +0300 Subject: [PATCH] Fix the update of the inspector when instance shader uniform has changed --- scene/3d/visual_instance_3d.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scene/3d/visual_instance_3d.cpp b/scene/3d/visual_instance_3d.cpp index b5b37bf8376..0f214ecd975 100644 --- a/scene/3d/visual_instance_3d.cpp +++ b/scene/3d/visual_instance_3d.cpp @@ -30,6 +30,7 @@ #include "visual_instance_3d.h" +#include "core/core_string_names.h" #include "scene/scene_string_names.h" AABB VisualInstance3D::get_aabb() const { @@ -134,7 +135,13 @@ VisualInstance3D::~VisualInstance3D() { } void GeometryInstance3D::set_material_override(const Ref &p_material) { + if (material_override.is_valid()) { + material_override->disconnect(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed)); + } material_override = p_material; + if (material_override.is_valid()) { + material_override->connect(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed)); + } RS::get_singleton()->instance_geometry_set_material_override(get_instance(), p_material.is_valid() ? p_material->get_rid() : RID()); }