summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Rubinsky <chaosus89@gmail.com>2022-12-15 20:28:45 +0300
committerGitHub <noreply@github.com>2022-12-15 20:28:45 +0300
commitfac614cdea363b363accbb3937b4136dc1e8e3b1 (patch)
tree00636f2dea77e88f16b20ed82bbc44688fa315ed
parent5c83e95103e795f70d8e06be5151f1f597ece1d0 (diff)
parentbf3966abf9da8bb7d86d13c7fdf37b3327236cd5 (diff)
Merge pull request #70110 from Chaosus/fix_inspector_instance_uniform
Fix undefined
-rw-r--r--scene/3d/visual_instance_3d.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/3d/visual_instance_3d.cpp b/scene/3d/visual_instance_3d.cpp
index b5b37bf837..0f214ecd97 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<Material> &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());
}