Browse Source

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.
Hugo Locurcio 3 năm trước cách đây
mục cha
commit
b6caa0587a
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      scene/register_scene_types.cpp

+ 8 - 0
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.