Merge pull request #70110 from Chaosus/fix_inspector_instance_uniform

Fix undefined
This commit is contained in:
Yuri Rubinsky 2022-12-15 20:28:45 +03:00 committed by GitHub
commit fac614cdea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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());
}