Merge pull request #61432 from Chaosus/fix_material_free_errors
Fix errors when materials attached to 3d object are not freed
This commit is contained in:
commit
6b9f6823c4
@ -496,3 +496,12 @@ void GeometryInstance3D::_bind_methods() {
|
|||||||
GeometryInstance3D::GeometryInstance3D() {
|
GeometryInstance3D::GeometryInstance3D() {
|
||||||
//RS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),0);
|
//RS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GeometryInstance3D::~GeometryInstance3D() {
|
||||||
|
if (material_overlay.is_valid()) {
|
||||||
|
set_material_overlay(Ref<Material>());
|
||||||
|
}
|
||||||
|
if (material_override.is_valid()) {
|
||||||
|
set_material_override(Ref<Material>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -188,6 +188,7 @@ public:
|
|||||||
|
|
||||||
TypedArray<String> get_configuration_warnings() const override;
|
TypedArray<String> get_configuration_warnings() const override;
|
||||||
GeometryInstance3D();
|
GeometryInstance3D();
|
||||||
|
virtual ~GeometryInstance3D();
|
||||||
};
|
};
|
||||||
|
|
||||||
VARIANT_ENUM_CAST(GeometryInstance3D::ShadowCastingSetting);
|
VARIANT_ENUM_CAST(GeometryInstance3D::ShadowCastingSetting);
|
||||||
|
Loading…
Reference in New Issue
Block a user