Fix shadow mesh recursion.
This commit is contained in:
parent
739019e4e4
commit
70860aafd8
|
@ -743,6 +743,7 @@ String MeshStorage::mesh_get_path(RID p_mesh) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeshStorage::mesh_set_shadow_mesh(RID p_mesh, RID p_shadow_mesh) {
|
void MeshStorage::mesh_set_shadow_mesh(RID p_mesh, RID p_shadow_mesh) {
|
||||||
|
ERR_FAIL_COND_MSG(p_mesh == p_shadow_mesh, "Cannot set a mesh as its own shadow mesh.");
|
||||||
Mesh *mesh = mesh_owner.get_or_null(p_mesh);
|
Mesh *mesh = mesh_owner.get_or_null(p_mesh);
|
||||||
ERR_FAIL_NULL(mesh);
|
ERR_FAIL_NULL(mesh);
|
||||||
|
|
||||||
|
|
|
@ -2251,6 +2251,7 @@ Error ArrayMesh::lightmap_unwrap_cached(const Transform3D &p_base_transform, flo
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArrayMesh::set_shadow_mesh(const Ref<ArrayMesh> &p_mesh) {
|
void ArrayMesh::set_shadow_mesh(const Ref<ArrayMesh> &p_mesh) {
|
||||||
|
ERR_FAIL_COND_MSG(p_mesh == this, "Cannot set a mesh as its own shadow mesh.");
|
||||||
shadow_mesh = p_mesh;
|
shadow_mesh = p_mesh;
|
||||||
if (shadow_mesh.is_valid()) {
|
if (shadow_mesh.is_valid()) {
|
||||||
RS::get_singleton()->mesh_set_shadow_mesh(mesh, shadow_mesh->get_rid());
|
RS::get_singleton()->mesh_set_shadow_mesh(mesh, shadow_mesh->get_rid());
|
||||||
|
|
|
@ -783,6 +783,7 @@ String MeshStorage::mesh_get_path(RID p_mesh) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeshStorage::mesh_set_shadow_mesh(RID p_mesh, RID p_shadow_mesh) {
|
void MeshStorage::mesh_set_shadow_mesh(RID p_mesh, RID p_shadow_mesh) {
|
||||||
|
ERR_FAIL_COND_MSG(p_mesh == p_shadow_mesh, "Cannot set a mesh as its own shadow mesh.");
|
||||||
Mesh *mesh = mesh_owner.get_or_null(p_mesh);
|
Mesh *mesh = mesh_owner.get_or_null(p_mesh);
|
||||||
ERR_FAIL_NULL(mesh);
|
ERR_FAIL_NULL(mesh);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue