Run godot --convert-3to4 (automated conversion)
Apply Godot 4.6 automated conversion: renames Spatial.translate->position, margin_*->offset_*, tool->@tool, .empty()->.is_empty(), DynamicFont->FontFile, onready->@onready, export()->@export, and many more. 127 files changed by the tool. Manual fixes still required for: - godot_db_manager plugin (incompatible APIs: WindowDialog, Tabs, etc.) - lod plugin (Spatial -> Node3D renames) - ResourceLoader.load_interactive removed -> load_threaded_request - OS.set_window_fullscreen removed -> DisplayServer - Viewport.set_size_override removed Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
# Copyright © 2020 Hugo Locurcio and contributors - MIT License
|
||||
# See `LICENSE.md` included in the source distribution for details.
|
||||
extends CPUParticles
|
||||
extends CPUParticles3D
|
||||
class_name LODCPUParticles, "lod_cpu_particles.svg"
|
||||
|
||||
# If `false`, LOD won't update anymore. This can be used for performance comparison
|
||||
# purposes.
|
||||
export var enable_lod := true
|
||||
@export var enable_lod := true
|
||||
|
||||
# The maximum particle emitting distance in units. Past this distance, particles will no longer emit.
|
||||
export(float, 0.0, 1000.0, 0.1) var max_emit_distance := 50
|
||||
@export var max_emit_distance := 50 # (float, 0.0, 1000.0, 0.1)
|
||||
|
||||
# The rate at which LODs will be updated (in seconds). Lower values are more reactive
|
||||
# but use more CPU, which is especially noticeable with large amounts of LOD-enabled nodes.
|
||||
@@ -36,7 +36,7 @@ func _ready() -> void:
|
||||
|
||||
# Add random jitter to the timer to ensure LODs don't all swap at the same time.
|
||||
randomize()
|
||||
timer += rand_range(0, refresh_rate)
|
||||
timer += randf_range(0, refresh_rate)
|
||||
|
||||
# Despite LOD not being related to physics, we chose to run in `_physics_process()`
|
||||
# to minimize the amount of method calls per second (and therefore decrease CPU usage).
|
||||
@@ -45,7 +45,7 @@ func _physics_process(delta: float) -> void:
|
||||
return
|
||||
|
||||
# We need a camera to do the rest.
|
||||
var camera := get_viewport().get_camera()
|
||||
var camera := get_viewport().get_camera_3d()
|
||||
if camera == null:
|
||||
return
|
||||
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
# Copyright © 2020 Hugo Locurcio and contributors - MIT License
|
||||
# See `LICENSE.md` included in the source distribution for details.
|
||||
extends OmniLight
|
||||
extends OmniLight3D
|
||||
class_name LODOmniLight, "lod_omni_light.svg"
|
||||
|
||||
# If `false`, LOD won't update anymore. This can be used for performance comparison
|
||||
# purposes.
|
||||
export var enable_lod := true
|
||||
@export var enable_lod := true
|
||||
|
||||
# The maximum shadow distance in units. Past this distance, the shadow will be disabled.
|
||||
export(float, 0.0, 1000.0, 0.1) var shadow_max_distance := 25
|
||||
@export var shadow_max_distance := 25 # (float, 0.0, 1000.0, 0.1)
|
||||
|
||||
# The distance factor at which the shadow starts fading.
|
||||
# A value of 0.0 will result in the smoothest transition whereas a value of 1.0 disables fading.
|
||||
export(float, 0.0, 1.0, 0.1) var shadow_fade_start := 0.8
|
||||
@export var shadow_fade_start := 0.8 # (float, 0.0, 1.0, 0.1)
|
||||
|
||||
# The maximum shadow distance in units. Past this distance, the light will be hidden.
|
||||
export(float, 0.0, 1000.0, 0.1) var light_max_distance := 50
|
||||
@export var light_max_distance := 50 # (float, 0.0, 1000.0, 0.1)
|
||||
|
||||
# The distance factor at which the light starts fading.
|
||||
# A value of 0.0 will result in the smoothest transition whereas a value of 1.0 disables fading.
|
||||
export(float, 0.0, 1.0, 0.1) var light_fade_start := 0.8
|
||||
@export var light_fade_start := 0.8 # (float, 0.0, 1.0, 0.1)
|
||||
|
||||
# The rate at which LODs will be updated (in seconds). Lower values are more reactive
|
||||
# but use more CPU, which is especially noticeable with large amounts of LOD-enabled nodes.
|
||||
@@ -52,7 +52,7 @@ func _ready() -> void:
|
||||
|
||||
# Add random jitter to the timer to ensure LODs don't all swap at the same time.
|
||||
randomize()
|
||||
timer += rand_range(0, refresh_rate)
|
||||
timer += randf_range(0, refresh_rate)
|
||||
|
||||
# Despite LOD not being related to physics, we chose to run in `_physics_process()`
|
||||
# to minimize the amount of method calls per second (and therefore decrease CPU usage).
|
||||
@@ -61,7 +61,7 @@ func _physics_process(delta: float) -> void:
|
||||
return
|
||||
|
||||
# We need a camera to do the rest.
|
||||
var camera := get_viewport().get_camera()
|
||||
var camera := get_viewport().get_camera_3d()
|
||||
if camera == null:
|
||||
return
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ class_name LODParticles, "lod_particles.svg"
|
||||
|
||||
# If `false`, LOD won't update anymore. This can be used for performance comparison
|
||||
# purposes.
|
||||
export var enable_lod := true
|
||||
@export var enable_lod := true
|
||||
|
||||
# The maximum particle emitting distance in units. Past this distance, particles will no longer emit.
|
||||
export(float, 0.0, 1000.0, 0.1) var max_emit_distance := 50
|
||||
@export var max_emit_distance := 50 # (float, 0.0, 1000.0, 0.1)
|
||||
|
||||
# The rate at which LODs will be updated (in seconds). Lower values are more reactive
|
||||
# but use more CPU, which is especially noticeable with large amounts of LOD-enabled nodes.
|
||||
@@ -36,7 +36,7 @@ func _ready() -> void:
|
||||
|
||||
# Add random jitter to the timer to ensure LODs don't all swap at the same time.
|
||||
randomize()
|
||||
timer += rand_range(0, refresh_rate)
|
||||
timer += randf_range(0, refresh_rate)
|
||||
|
||||
# Despite LOD not being related to physics, we chose to run in `_physics_process()`
|
||||
# to minimize the amount of method calls per second (and therefore decrease CPU usage).
|
||||
@@ -45,7 +45,7 @@ func _physics_process(delta: float) -> void:
|
||||
return
|
||||
|
||||
# We need a camera to do the rest.
|
||||
var camera := get_viewport().get_camera()
|
||||
var camera := get_viewport().get_camera_3d()
|
||||
if camera == null:
|
||||
return
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
# Copyright © 2020 Hugo Locurcio and contributors - MIT License
|
||||
# See `LICENSE.md` included in the source distribution for details.
|
||||
extends Spatial
|
||||
extends Node3D
|
||||
class_name LODSpatial, "lod_spatial.svg"
|
||||
|
||||
# If `false`, LOD won't update anymore. This can be used for performance comparison
|
||||
# purposes.
|
||||
export var enable_lod := true
|
||||
@export var enable_lod := true
|
||||
|
||||
# The maximum LOD 0 (high quality) distance in units.
|
||||
export(float, 0.0, 1000.0, 0.1) var lod_0_max_distance := 10
|
||||
@export var lod_0_max_distance := 10 # (float, 0.0, 1000.0, 0.1)
|
||||
|
||||
# The maximum LOD 1 (medium quality) distance in units.
|
||||
export(float, 0.0, 1000.0, 0.1) var lod_1_max_distance := 25
|
||||
@export var lod_1_max_distance := 25 # (float, 0.0, 1000.0, 0.1)
|
||||
|
||||
# The maximum LOD 2 (low quality) distance in units.
|
||||
# Past this distance, all LOD variants are hidden.
|
||||
export(float, 0.0, 1000.0, 0.1) var lod_2_max_distance := 100
|
||||
@export var lod_2_max_distance := 100 # (float, 0.0, 1000.0, 0.1)
|
||||
|
||||
# The rate at which LODs will be updated (in seconds). Lower values are more reactive
|
||||
# but use more CPU, which is especially noticeable with large amounts of LOD-enabled nodes.
|
||||
@@ -43,7 +43,7 @@ func _ready() -> void:
|
||||
|
||||
# Add random jitter to the timer to ensure LODs don't all swap at the same time.
|
||||
randomize()
|
||||
timer += rand_range(0, refresh_rate)
|
||||
timer += randf_range(0, refresh_rate)
|
||||
|
||||
|
||||
# Despite LOD not being related to physics, we chose to run in `_physics_process()`
|
||||
@@ -53,7 +53,7 @@ func _physics_process(delta: float) -> void:
|
||||
return
|
||||
|
||||
# We need a camera to do the rest.
|
||||
var camera := get_viewport().get_camera()
|
||||
var camera := get_viewport().get_camera_3d()
|
||||
if camera == null:
|
||||
return
|
||||
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
# Copyright © 2020 Hugo Locurcio and contributors - MIT License
|
||||
# See `LICENSE.md` included in the source distribution for details.
|
||||
extends SpotLight
|
||||
extends SpotLight3D
|
||||
class_name LODSpotLight, "lod_spot_light.svg"
|
||||
|
||||
# If `false`, LOD won't update anymore. This can be used for performance comparison
|
||||
# purposes.
|
||||
export var enable_lod := true
|
||||
@export var enable_lod := true
|
||||
|
||||
# The maximum shadow distance in units. Past this distance, the shadow will be disabled.
|
||||
export(float, 0.0, 1000.0, 0.1) var shadow_max_distance := 25
|
||||
@export var shadow_max_distance := 25 # (float, 0.0, 1000.0, 0.1)
|
||||
|
||||
# The distance factor at which the shadow starts fading.
|
||||
# A value of 0.0 will result in the smoothest transition whereas a value of 1.0 disables fading.
|
||||
export(float, 0.0, 1.0, 0.1) var shadow_fade_start := 0.8
|
||||
@export var shadow_fade_start := 0.8 # (float, 0.0, 1.0, 0.1)
|
||||
|
||||
# The maximum shadow distance in units. Past this distance, the light will be hidden.
|
||||
export(float, 0.0, 1000.0, 0.1) var light_max_distance := 50
|
||||
@export var light_max_distance := 50 # (float, 0.0, 1000.0, 0.1)
|
||||
|
||||
# The distance factor at which the light starts fading.
|
||||
# A value of 0.0 will result in the smoothest transition whereas a value of 1.0 disables fading.
|
||||
export(float, 0.0, 1.0, 0.1) var light_fade_start := 0.8
|
||||
@export var light_fade_start := 0.8 # (float, 0.0, 1.0, 0.1)
|
||||
|
||||
# The rate at which LODs will be updated (in seconds). Lower values are more reactive
|
||||
# but use more CPU, which is especially noticeable with large amounts of LOD-enabled nodes.
|
||||
@@ -52,7 +52,7 @@ func _ready() -> void:
|
||||
|
||||
# Add random jitter to the timer to ensure LODs don't all swap at the same time.
|
||||
randomize()
|
||||
timer += rand_range(0, refresh_rate)
|
||||
timer += randf_range(0, refresh_rate)
|
||||
|
||||
# Despite LOD not being related to physics, we chose to run in `_physics_process()`
|
||||
# to minimize the amount of method calls per second (and therefore decrease CPU usage).
|
||||
@@ -61,7 +61,7 @@ func _physics_process(delta: float) -> void:
|
||||
return
|
||||
|
||||
# We need a camera to do the rest.
|
||||
var camera := get_viewport().get_camera()
|
||||
var camera := get_viewport().get_camera_3d()
|
||||
if camera == null:
|
||||
return
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@tool
|
||||
# Copyright © 2020 Hugo Locurcio and contributors - MIT License
|
||||
# See `LICENSE.md` included in the source distribution for details.
|
||||
#
|
||||
# This script is needed to make the `class_name` script visible in the Create New Node dialog
|
||||
# once the plugin is enabled.
|
||||
tool
|
||||
extends EditorPlugin
|
||||
|
||||
Reference in New Issue
Block a user