From b6caa0587a8e16f77b0029c5bb7a70577afb0ec7 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 14 Dec 2021 18:40:00 +0100 Subject: [PATCH] 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. --- scene/register_scene_types.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 9023b758b67..283a3a4883f 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.