summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-12-14 18:40:00 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-12-14 18:45:28 +0100
commitb6caa0587a8e16f77b0029c5bb7a70577afb0ec7 (patch)
tree441cb42d41b8f2bda7d534fb9f30c6bc775c4688
parent965a527775359f4b0c868805ad1876bf87ac2857 (diff)
Add compatibility class handlers for portal and room occlusion culling
Portal and room occlusion culling is replaced by raster occlusion in 4.0, which undergoes an entirely different setup process. Therefore, we can only convert those nodes to Node3Ds to allow loading `3.x` scenes while keeping transforms valid.
-rw-r--r--scene/register_scene_types.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 9023b758b6..283a3a4883 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -882,6 +882,14 @@ void register_scene_types() {
ClassDB::add_compatibility_class("GIProbeData", "VoxelGIData");
ClassDB::add_compatibility_class("BakedLightmap", "LightmapGI");
ClassDB::add_compatibility_class("BakedLightmapData", "LightmapGIData");
+ // Portal and room occlusion was replaced by raster occlusion (OccluderInstance3D node).
+ ClassDB::add_compatibility_class("Portal", "Node3D");
+ ClassDB::add_compatibility_class("Room", "Node3D");
+ ClassDB::add_compatibility_class("RoomManager", "Node3D");
+ ClassDB::add_compatibility_class("RoomGroup", "Node3D");
+ ClassDB::add_compatibility_class("Occluder", "Node3D");
+ // The OccluderShapeSphere resource (used in the old Occluder node) is not present anymore.
+ ClassDB::add_compatibility_class("OccluderShapeSphere", "Resource");
// Renamed in 4.0.
// Keep alphabetical ordering to easily locate classes and avoid duplicates.