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.
This commit is contained in:
Hugo Locurcio 2021-12-14 18:40:00 +01:00
parent 965a527775
commit b6caa0587a
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C

View file

@ -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.