diff --git a/addons/godot-jolt/android/libgodot-jolt_android-arm32.so b/addons/godot-jolt/android/libgodot-jolt_android-arm32.so
index 5282da6..895e3ae 100644
Binary files a/addons/godot-jolt/android/libgodot-jolt_android-arm32.so and b/addons/godot-jolt/android/libgodot-jolt_android-arm32.so differ
diff --git a/addons/godot-jolt/android/libgodot-jolt_android-arm32_editor.so b/addons/godot-jolt/android/libgodot-jolt_android-arm32_editor.so
index 2430955..aa41186 100644
Binary files a/addons/godot-jolt/android/libgodot-jolt_android-arm32_editor.so and b/addons/godot-jolt/android/libgodot-jolt_android-arm32_editor.so differ
diff --git a/addons/godot-jolt/android/libgodot-jolt_android-arm64.so b/addons/godot-jolt/android/libgodot-jolt_android-arm64.so
index 6b79392..b635c93 100644
Binary files a/addons/godot-jolt/android/libgodot-jolt_android-arm64.so and b/addons/godot-jolt/android/libgodot-jolt_android-arm64.so differ
diff --git a/addons/godot-jolt/android/libgodot-jolt_android-arm64_editor.so b/addons/godot-jolt/android/libgodot-jolt_android-arm64_editor.so
index 95d6b26..ea24afc 100644
Binary files a/addons/godot-jolt/android/libgodot-jolt_android-arm64_editor.so and b/addons/godot-jolt/android/libgodot-jolt_android-arm64_editor.so differ
diff --git a/addons/godot-jolt/android/libgodot-jolt_android-x64.so b/addons/godot-jolt/android/libgodot-jolt_android-x64.so
index 4e4882e..c17e926 100644
Binary files a/addons/godot-jolt/android/libgodot-jolt_android-x64.so and b/addons/godot-jolt/android/libgodot-jolt_android-x64.so differ
diff --git a/addons/godot-jolt/android/libgodot-jolt_android-x64_editor.so b/addons/godot-jolt/android/libgodot-jolt_android-x64_editor.so
index e93e93a..c586d83 100644
Binary files a/addons/godot-jolt/android/libgodot-jolt_android-x64_editor.so and b/addons/godot-jolt/android/libgodot-jolt_android-x64_editor.so differ
diff --git a/addons/godot-jolt/android/libgodot-jolt_android-x86.so b/addons/godot-jolt/android/libgodot-jolt_android-x86.so
index 485fa22..70fb7d4 100644
Binary files a/addons/godot-jolt/android/libgodot-jolt_android-x86.so and b/addons/godot-jolt/android/libgodot-jolt_android-x86.so differ
diff --git a/addons/godot-jolt/android/libgodot-jolt_android-x86_editor.so b/addons/godot-jolt/android/libgodot-jolt_android-x86_editor.so
index a061017..2fdcd8d 100644
Binary files a/addons/godot-jolt/android/libgodot-jolt_android-x86_editor.so and b/addons/godot-jolt/android/libgodot-jolt_android-x86_editor.so differ
diff --git a/addons/godot-jolt/godot-jolt.gdextension b/addons/godot-jolt/godot-jolt.gdextension
index e866e8b..ff4ba58 100644
--- a/addons/godot-jolt/godot-jolt.gdextension
+++ b/addons/godot-jolt/godot-jolt.gdextension
@@ -1,36 +1,37 @@
[configuration]
entry_symbol = "godot_jolt_main"
-compatibility_minimum = "4.2"
+compatibility_minimum = "4.3"
+compatibility_maximum = "4.3"
[libraries]
-windows.release.x86_64 = "windows/godot-jolt_windows-x64.dll"
-windows.debug.x86_64 = "windows/godot-jolt_windows-x64_editor.dll"
+windows.release.single.x86_64 = "windows/godot-jolt_windows-x64.dll"
+windows.debug.single.x86_64 = "windows/godot-jolt_windows-x64_editor.dll"
-windows.release.x86_32 = "windows/godot-jolt_windows-x86.dll"
-windows.debug.x86_32 = "windows/godot-jolt_windows-x86_editor.dll"
+windows.release.single.x86_32 = "windows/godot-jolt_windows-x86.dll"
+windows.debug.single.x86_32 = "windows/godot-jolt_windows-x86_editor.dll"
-linux.release.x86_64 = "linux/godot-jolt_linux-x64.so"
-linux.debug.x86_64 = "linux/godot-jolt_linux-x64_editor.so"
+linux.release.single.x86_64 = "linux/godot-jolt_linux-x64.so"
+linux.debug.single.x86_64 = "linux/godot-jolt_linux-x64_editor.so"
-linux.release.x86_32 = "linux/godot-jolt_linux-x86.so"
-linux.debug.x86_32 = "linux/godot-jolt_linux-x86_editor.so"
+linux.release.single.x86_32 = "linux/godot-jolt_linux-x86.so"
+linux.debug.single.x86_32 = "linux/godot-jolt_linux-x86_editor.so"
-macos.release = "macos/godot-jolt_macos.framework"
-macos.debug = "macos/godot-jolt_macos_editor.framework"
+macos.release.single = "macos/godot-jolt_macos.framework"
+macos.debug.single = "macos/godot-jolt_macos_editor.framework"
-ios.release = "ios/godot-jolt_ios.framework"
-ios.debug = "ios/godot-jolt_ios_editor.framework"
+ios.release.single = "ios/godot-jolt_ios.framework"
+ios.debug.single = "ios/godot-jolt_ios_editor.framework"
-android.release.arm64 = "android/libgodot-jolt_android-arm64.so"
-android.debug.arm64 = "android/libgodot-jolt_android-arm64_editor.so"
+android.release.single.arm64 = "android/libgodot-jolt_android-arm64.so"
+android.debug.single.arm64 = "android/libgodot-jolt_android-arm64_editor.so"
-android.release.arm32 = "android/libgodot-jolt_android-arm32.so"
-android.debug.arm32 = "android/libgodot-jolt_android-arm32_editor.so"
+android.release.single.arm32 = "android/libgodot-jolt_android-arm32.so"
+android.debug.single.arm32 = "android/libgodot-jolt_android-arm32_editor.so"
-android.release.x86_64 = "android/libgodot-jolt_android-x64.so"
-android.debug.x86_64 = "android/libgodot-jolt_android-x64_editor.so"
+android.release.single.x86_64 = "android/libgodot-jolt_android-x64.so"
+android.debug.single.x86_64 = "android/libgodot-jolt_android-x64_editor.so"
-android.release.x86_32 = "android/libgodot-jolt_android-x86.so"
-android.debug.x86_32 = "android/libgodot-jolt_android-x86_editor.so"
+android.release.single.x86_32 = "android/libgodot-jolt_android-x86.so"
+android.debug.single.x86_32 = "android/libgodot-jolt_android-x86_editor.so"
diff --git a/addons/godot-jolt/ios/godot-jolt_ios.framework/Info.plist b/addons/godot-jolt/ios/godot-jolt_ios.framework/Info.plist
index 68ab9f6..fbd1b8c 100644
--- a/addons/godot-jolt/ios/godot-jolt_ios.framework/Info.plist
+++ b/addons/godot-jolt/ios/godot-jolt_ios.framework/Info.plist
@@ -17,16 +17,35 @@
NSHumanReadableCopyright
Copyright (c) Mikael Hermansson and Godot Jolt contributors.
CFBundleVersion
- 0.12.0
+ 0.13.0
CFBundleShortVersionString
- 0.12.0
+ 0.13.0
CFBundlePackageType
FMWK
+ CFBundleSupportedPlatforms
+
+ iPhoneOS
+
CSResourcesFileMapped
DTPlatformName
iphoneos
MinimumOSVersion
12.0
+
+
+ AvailableLibraries
+
+
+ BinaryPath
+ godot-jolt_ios.dylib
+
+
diff --git a/addons/godot-jolt/ios/godot-jolt_ios.framework/godot-jolt_ios b/addons/godot-jolt/ios/godot-jolt_ios.framework/godot-jolt_ios
index 37c9d5a..ddcf767 100644
Binary files a/addons/godot-jolt/ios/godot-jolt_ios.framework/godot-jolt_ios and b/addons/godot-jolt/ios/godot-jolt_ios.framework/godot-jolt_ios differ
diff --git a/addons/godot-jolt/ios/godot-jolt_ios_editor.framework/Info.plist b/addons/godot-jolt/ios/godot-jolt_ios_editor.framework/Info.plist
index f3c28dc..6c3ccc1 100644
--- a/addons/godot-jolt/ios/godot-jolt_ios_editor.framework/Info.plist
+++ b/addons/godot-jolt/ios/godot-jolt_ios_editor.framework/Info.plist
@@ -17,16 +17,35 @@
NSHumanReadableCopyright
Copyright (c) Mikael Hermansson and Godot Jolt contributors.
CFBundleVersion
- 0.12.0
+ 0.13.0
CFBundleShortVersionString
- 0.12.0
+ 0.13.0
CFBundlePackageType
FMWK
+ CFBundleSupportedPlatforms
+
+ iPhoneOS
+
CSResourcesFileMapped
DTPlatformName
iphoneos
MinimumOSVersion
12.0
+
+
+ AvailableLibraries
+
+
+ BinaryPath
+ godot-jolt_ios_editor.dylib
+
+
diff --git a/addons/godot-jolt/ios/godot-jolt_ios_editor.framework/godot-jolt_ios_editor b/addons/godot-jolt/ios/godot-jolt_ios_editor.framework/godot-jolt_ios_editor
index 9e8140c..3159ac8 100644
Binary files a/addons/godot-jolt/ios/godot-jolt_ios_editor.framework/godot-jolt_ios_editor and b/addons/godot-jolt/ios/godot-jolt_ios_editor.framework/godot-jolt_ios_editor differ
diff --git a/addons/godot-jolt/linux/godot-jolt_linux-x64.so b/addons/godot-jolt/linux/godot-jolt_linux-x64.so
index 364242d..292fd8e 100644
Binary files a/addons/godot-jolt/linux/godot-jolt_linux-x64.so and b/addons/godot-jolt/linux/godot-jolt_linux-x64.so differ
diff --git a/addons/godot-jolt/linux/godot-jolt_linux-x64_editor.so b/addons/godot-jolt/linux/godot-jolt_linux-x64_editor.so
index 4ad0285..27a30c6 100644
Binary files a/addons/godot-jolt/linux/godot-jolt_linux-x64_editor.so and b/addons/godot-jolt/linux/godot-jolt_linux-x64_editor.so differ
diff --git a/addons/godot-jolt/linux/godot-jolt_linux-x86.so b/addons/godot-jolt/linux/godot-jolt_linux-x86.so
index ad7d2be..78d210b 100644
Binary files a/addons/godot-jolt/linux/godot-jolt_linux-x86.so and b/addons/godot-jolt/linux/godot-jolt_linux-x86.so differ
diff --git a/addons/godot-jolt/linux/godot-jolt_linux-x86_editor.so b/addons/godot-jolt/linux/godot-jolt_linux-x86_editor.so
index e639d07..5b438a1 100644
Binary files a/addons/godot-jolt/linux/godot-jolt_linux-x86_editor.so and b/addons/godot-jolt/linux/godot-jolt_linux-x86_editor.so differ
diff --git a/addons/godot-jolt/macos/godot-jolt_macos.framework/Resources/Info.plist b/addons/godot-jolt/macos/godot-jolt_macos.framework/Resources/Info.plist
index f88e713..d88bb93 100644
--- a/addons/godot-jolt/macos/godot-jolt_macos.framework/Resources/Info.plist
+++ b/addons/godot-jolt/macos/godot-jolt_macos.framework/Resources/Info.plist
@@ -17,11 +17,15 @@
NSHumanReadableCopyright
Copyright (c) Mikael Hermansson and Godot Jolt contributors.
CFBundleVersion
- 0.12.0
+ 0.13.0
CFBundleShortVersionString
- 0.12.0
+ 0.13.0
CFBundlePackageType
FMWK
+ CFBundleSupportedPlatforms
+
+ MacOSX
+
CSResourcesFileMapped
DTPlatformName
diff --git a/addons/godot-jolt/macos/godot-jolt_macos.framework/_CodeSignature/CodeResources b/addons/godot-jolt/macos/godot-jolt_macos.framework/_CodeSignature/CodeResources
index cb463f5..fc97dbe 100644
--- a/addons/godot-jolt/macos/godot-jolt_macos.framework/_CodeSignature/CodeResources
+++ b/addons/godot-jolt/macos/godot-jolt_macos.framework/_CodeSignature/CodeResources
@@ -6,7 +6,7 @@
Resources/Info.plist
- HxpaqrKUN+D+lkF90Phqlb+CZKo=
+ +hmuH+erxzRxY/FPATmWbEaqOys=
files2
@@ -15,7 +15,7 @@
hash2
- ZTtvl19PLRzCoTuDRMZ2FnJXIXsLYRhaBFxjroNsLDw=
+ WsqyDktXR1oDgMLbvIUu+PMJsJAnbBKIUYnKgafFEGc=
diff --git a/addons/godot-jolt/macos/godot-jolt_macos.framework/godot-jolt_macos b/addons/godot-jolt/macos/godot-jolt_macos.framework/godot-jolt_macos
index 1d5bd24..2757fa5 100644
Binary files a/addons/godot-jolt/macos/godot-jolt_macos.framework/godot-jolt_macos and b/addons/godot-jolt/macos/godot-jolt_macos.framework/godot-jolt_macos differ
diff --git a/addons/godot-jolt/macos/godot-jolt_macos_editor.framework/Resources/Info.plist b/addons/godot-jolt/macos/godot-jolt_macos_editor.framework/Resources/Info.plist
index ac10d93..c09d6aa 100644
--- a/addons/godot-jolt/macos/godot-jolt_macos_editor.framework/Resources/Info.plist
+++ b/addons/godot-jolt/macos/godot-jolt_macos_editor.framework/Resources/Info.plist
@@ -17,11 +17,15 @@
NSHumanReadableCopyright
Copyright (c) Mikael Hermansson and Godot Jolt contributors.
CFBundleVersion
- 0.12.0
+ 0.13.0
CFBundleShortVersionString
- 0.12.0
+ 0.13.0
CFBundlePackageType
FMWK
+ CFBundleSupportedPlatforms
+
+ MacOSX
+
CSResourcesFileMapped
DTPlatformName
diff --git a/addons/godot-jolt/macos/godot-jolt_macos_editor.framework/_CodeSignature/CodeResources b/addons/godot-jolt/macos/godot-jolt_macos_editor.framework/_CodeSignature/CodeResources
index 4b087b4..26077b6 100644
--- a/addons/godot-jolt/macos/godot-jolt_macos_editor.framework/_CodeSignature/CodeResources
+++ b/addons/godot-jolt/macos/godot-jolt_macos_editor.framework/_CodeSignature/CodeResources
@@ -6,7 +6,7 @@
Resources/Info.plist
- CpU1kp9qZhdCVqKdSia+981vm40=
+ GsvlA3T0mwbtJS37DcxlHyr4Vro=
files2
@@ -15,7 +15,7 @@
hash2
- 4CTRXI34pj3JIJzQDUUZTlAagKWQeohPQN20M0VCK4o=
+ 4Rs/lwMrLlMFf5H+0QtaW/gUNP59U2nHlU4LBmarG1Q=
diff --git a/addons/godot-jolt/macos/godot-jolt_macos_editor.framework/godot-jolt_macos_editor b/addons/godot-jolt/macos/godot-jolt_macos_editor.framework/godot-jolt_macos_editor
index 3787fa9..8f633a1 100644
Binary files a/addons/godot-jolt/macos/godot-jolt_macos_editor.framework/godot-jolt_macos_editor and b/addons/godot-jolt/macos/godot-jolt_macos_editor.framework/godot-jolt_macos_editor differ
diff --git a/addons/godot-jolt/windows/godot-jolt_windows-x64.dll b/addons/godot-jolt/windows/godot-jolt_windows-x64.dll
index ce010d6..f4bd77e 100644
Binary files a/addons/godot-jolt/windows/godot-jolt_windows-x64.dll and b/addons/godot-jolt/windows/godot-jolt_windows-x64.dll differ
diff --git a/addons/godot-jolt/windows/godot-jolt_windows-x64_editor.dll b/addons/godot-jolt/windows/godot-jolt_windows-x64_editor.dll
index 9ed5550..13ab204 100644
Binary files a/addons/godot-jolt/windows/godot-jolt_windows-x64_editor.dll and b/addons/godot-jolt/windows/godot-jolt_windows-x64_editor.dll differ
diff --git a/addons/godot-jolt/windows/godot-jolt_windows-x86.dll b/addons/godot-jolt/windows/godot-jolt_windows-x86.dll
index b6c44f7..7c126e9 100644
Binary files a/addons/godot-jolt/windows/godot-jolt_windows-x86.dll and b/addons/godot-jolt/windows/godot-jolt_windows-x86.dll differ
diff --git a/addons/godot-jolt/windows/godot-jolt_windows-x86_editor.dll b/addons/godot-jolt/windows/godot-jolt_windows-x86_editor.dll
index 7312494..d652d5b 100644
Binary files a/addons/godot-jolt/windows/godot-jolt_windows-x86_editor.dll and b/addons/godot-jolt/windows/godot-jolt_windows-x86_editor.dll differ
diff --git a/addons/gut/fonts/AnonymousPro-Bold.ttf.import b/addons/gut/fonts/AnonymousPro-Bold.ttf.import
index a3eb479..de1351f 100644
--- a/addons/gut/fonts/AnonymousPro-Bold.ttf.import
+++ b/addons/gut/fonts/AnonymousPro-Bold.ttf.import
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/AnonymousPro-Bold.ttf-9d8fef4d357af5b52cd60af
Rendering=null
antialiasing=1
generate_mipmaps=false
+disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
diff --git a/addons/gut/fonts/AnonymousPro-BoldItalic.ttf.import b/addons/gut/fonts/AnonymousPro-BoldItalic.ttf.import
index ef28dd8..bdde207 100644
--- a/addons/gut/fonts/AnonymousPro-BoldItalic.ttf.import
+++ b/addons/gut/fonts/AnonymousPro-BoldItalic.ttf.import
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/AnonymousPro-BoldItalic.ttf-4274bf704d3d6b9cd
Rendering=null
antialiasing=1
generate_mipmaps=false
+disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
diff --git a/addons/gut/fonts/AnonymousPro-Italic.ttf.import b/addons/gut/fonts/AnonymousPro-Italic.ttf.import
index 1779af1..ce3e5b9 100644
--- a/addons/gut/fonts/AnonymousPro-Italic.ttf.import
+++ b/addons/gut/fonts/AnonymousPro-Italic.ttf.import
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/AnonymousPro-Italic.ttf-9989590b02137b799e13d
Rendering=null
antialiasing=1
generate_mipmaps=false
+disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
diff --git a/addons/gut/fonts/AnonymousPro-Regular.ttf.import b/addons/gut/fonts/AnonymousPro-Regular.ttf.import
index 1e2975b..a567498 100644
--- a/addons/gut/fonts/AnonymousPro-Regular.ttf.import
+++ b/addons/gut/fonts/AnonymousPro-Regular.ttf.import
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/AnonymousPro-Regular.ttf-856c843fd6f89964d2ca
Rendering=null
antialiasing=1
generate_mipmaps=false
+disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
diff --git a/addons/gut/fonts/CourierPrime-Bold.ttf.import b/addons/gut/fonts/CourierPrime-Bold.ttf.import
index 7d60fb0..cb05171 100644
--- a/addons/gut/fonts/CourierPrime-Bold.ttf.import
+++ b/addons/gut/fonts/CourierPrime-Bold.ttf.import
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/CourierPrime-Bold.ttf-1f003c66d63ebed70964e77
Rendering=null
antialiasing=1
generate_mipmaps=false
+disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
diff --git a/addons/gut/fonts/CourierPrime-BoldItalic.ttf.import b/addons/gut/fonts/CourierPrime-BoldItalic.ttf.import
index 4678c9e..0a9a7b7 100644
--- a/addons/gut/fonts/CourierPrime-BoldItalic.ttf.import
+++ b/addons/gut/fonts/CourierPrime-BoldItalic.ttf.import
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/CourierPrime-BoldItalic.ttf-65ebcc61dd5e1dfa8
Rendering=null
antialiasing=1
generate_mipmaps=false
+disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
diff --git a/addons/gut/fonts/CourierPrime-Italic.ttf.import b/addons/gut/fonts/CourierPrime-Italic.ttf.import
index 522e295..89412fc 100644
--- a/addons/gut/fonts/CourierPrime-Italic.ttf.import
+++ b/addons/gut/fonts/CourierPrime-Italic.ttf.import
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/CourierPrime-Italic.ttf-baa9156a73770735a0f72
Rendering=null
antialiasing=1
generate_mipmaps=false
+disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
diff --git a/addons/gut/fonts/CourierPrime-Regular.ttf.import b/addons/gut/fonts/CourierPrime-Regular.ttf.import
index 3817466..9fde40b 100644
--- a/addons/gut/fonts/CourierPrime-Regular.ttf.import
+++ b/addons/gut/fonts/CourierPrime-Regular.ttf.import
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/CourierPrime-Regular.ttf-3babe7e4a7a588dfc9a8
Rendering=null
antialiasing=1
generate_mipmaps=false
+disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
diff --git a/addons/gut/fonts/LobsterTwo-Bold.ttf.import b/addons/gut/fonts/LobsterTwo-Bold.ttf.import
index 7548ad0..673d151 100644
--- a/addons/gut/fonts/LobsterTwo-Bold.ttf.import
+++ b/addons/gut/fonts/LobsterTwo-Bold.ttf.import
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/LobsterTwo-Bold.ttf-7c7f734103b58a32491a47881
Rendering=null
antialiasing=1
generate_mipmaps=false
+disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
diff --git a/addons/gut/fonts/LobsterTwo-BoldItalic.ttf.import b/addons/gut/fonts/LobsterTwo-BoldItalic.ttf.import
index 4b609e8..62048b0 100644
--- a/addons/gut/fonts/LobsterTwo-BoldItalic.ttf.import
+++ b/addons/gut/fonts/LobsterTwo-BoldItalic.ttf.import
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/LobsterTwo-BoldItalic.ttf-227406a33e84448e6aa
Rendering=null
antialiasing=1
generate_mipmaps=false
+disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
diff --git a/addons/gut/fonts/LobsterTwo-Italic.ttf.import b/addons/gut/fonts/LobsterTwo-Italic.ttf.import
index 5899b79..d3ca272 100644
--- a/addons/gut/fonts/LobsterTwo-Italic.ttf.import
+++ b/addons/gut/fonts/LobsterTwo-Italic.ttf.import
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/LobsterTwo-Italic.ttf-f93abf6c25390c85ad5fb6c
Rendering=null
antialiasing=1
generate_mipmaps=false
+disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
diff --git a/addons/gut/fonts/LobsterTwo-Regular.ttf.import b/addons/gut/fonts/LobsterTwo-Regular.ttf.import
index 45a12c8..9cc7542 100644
--- a/addons/gut/fonts/LobsterTwo-Regular.ttf.import
+++ b/addons/gut/fonts/LobsterTwo-Regular.ttf.import
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/LobsterTwo-Regular.ttf-f3fcfa01cd671c8da433dd
Rendering=null
antialiasing=1
generate_mipmaps=false
+disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
diff --git a/addons/terrain_3d/README.md b/addons/terrain_3d/README.md
index 429ccec..47f2953 100644
--- a/addons/terrain_3d/README.md
+++ b/addons/terrain_3d/README.md
@@ -4,20 +4,21 @@
A high performance, editable terrain system for Godot 4.
## Features
-* Written in C++ as a GDExtension plugin, which works with official engine builds
+* Written in C++ as a GDExtension addon, which works with official engine builds
* Can be accessed by GDScript, C#, and any language Godot supports
* Geometric Clipmap Mesh Terrain, as used in The Witcher 3. See [System Architecture](https://terrain3d.readthedocs.io/en/stable/docs/system_architecture.html)
* Up to 16k x 16k in 1k regions (imagine multiple islands without paying for 16k^2 vram)
-* Up to 10 Levels of Detail (LODs)
-* Up to 32 texture sets using albedo, normal, roughness, height
+* Up to 32 textures
+* Up to 10 levels of detail
+* Foliage instancing
* Sculpting, holes, texture painting, texture detiling, painting colors and wetness
-* Supports importing heightmaps from [HTerrain](https://github.com/Zylann/godot_heightmap_plugin/), WorldMachine, Unity, Unreal and any tool that can export a heightmap (raw/r16/exr/+). See [importing data](https://terrain3d.readthedocs.io/en/stable/docs/import_export.html)
+* Imports heightmaps from [HTerrain](https://github.com/Zylann/godot_heightmap_plugin/), WorldMachine, Unity, Unreal and any tool that can export a heightmap (raw/r16/exr/+). See [importing data](https://terrain3d.readthedocs.io/en/stable/docs/import_export.html)
See [Project Status](https://terrain3d.readthedocs.io/en/stable/docs/project_status.html) for details.
## Getting Started
-1. Read the [Installation](https://terrain3d.readthedocs.io/en/stable/docs/installation.html) instructions, and the rest of the [documentation](https://terrain3d.readthedocs.io/en/stable/index.html).
+1. Read the [Installation & Upgrades](https://terrain3d.readthedocs.io/en/stable/docs/installation.html) instructions.
2. For support, read [Getting Help](https://terrain3d.readthedocs.io/en/stable/docs/getting_help.html) or join our [Discord server](https://tokisan.com/discord).
@@ -51,5 +52,5 @@ Please see [CONTRIBUTING.md](https://github.com/TokisanGames/Terrain3D/blob/main
## License
-This plugin has been released under the [MIT License](https://github.com/TokisanGames/Terrain3D/blob/main/LICENSE.txt).
+This addon has been released under the [MIT License](https://github.com/TokisanGames/Terrain3D/blob/main/LICENSE.txt).
diff --git a/addons/terrain_3d/bin/libterrain.android.debug.arm32.so b/addons/terrain_3d/bin/libterrain.android.debug.arm32.so
index 2c1fd71..4429d13 100644
Binary files a/addons/terrain_3d/bin/libterrain.android.debug.arm32.so and b/addons/terrain_3d/bin/libterrain.android.debug.arm32.so differ
diff --git a/addons/terrain_3d/bin/libterrain.android.debug.arm64.so b/addons/terrain_3d/bin/libterrain.android.debug.arm64.so
index 61222b1..1e2905f 100644
Binary files a/addons/terrain_3d/bin/libterrain.android.debug.arm64.so and b/addons/terrain_3d/bin/libterrain.android.debug.arm64.so differ
diff --git a/addons/terrain_3d/bin/libterrain.android.release.arm32.so b/addons/terrain_3d/bin/libterrain.android.release.arm32.so
index 87d3121..8e6ba2f 100644
Binary files a/addons/terrain_3d/bin/libterrain.android.release.arm32.so and b/addons/terrain_3d/bin/libterrain.android.release.arm32.so differ
diff --git a/addons/terrain_3d/bin/libterrain.android.release.arm64.so b/addons/terrain_3d/bin/libterrain.android.release.arm64.so
index 6db9bd5..6ff140b 100644
Binary files a/addons/terrain_3d/bin/libterrain.android.release.arm64.so and b/addons/terrain_3d/bin/libterrain.android.release.arm64.so differ
diff --git a/addons/terrain_3d/bin/libterrain.ios.debug.universal.dylib b/addons/terrain_3d/bin/libterrain.ios.debug.universal.dylib
index ffec4f2..58c56bc 100644
Binary files a/addons/terrain_3d/bin/libterrain.ios.debug.universal.dylib and b/addons/terrain_3d/bin/libterrain.ios.debug.universal.dylib differ
diff --git a/addons/terrain_3d/bin/libterrain.ios.release.universal.dylib b/addons/terrain_3d/bin/libterrain.ios.release.universal.dylib
index af713b7..be5b107 100644
Binary files a/addons/terrain_3d/bin/libterrain.ios.release.universal.dylib and b/addons/terrain_3d/bin/libterrain.ios.release.universal.dylib differ
diff --git a/addons/terrain_3d/bin/libterrain.linux.debug.x86_64.so b/addons/terrain_3d/bin/libterrain.linux.debug.x86_64.so
index 21531f0..e78a649 100644
Binary files a/addons/terrain_3d/bin/libterrain.linux.debug.x86_64.so and b/addons/terrain_3d/bin/libterrain.linux.debug.x86_64.so differ
diff --git a/addons/terrain_3d/bin/libterrain.linux.release.x86_64.so b/addons/terrain_3d/bin/libterrain.linux.release.x86_64.so
index 7681cbc..8f8756c 100644
Binary files a/addons/terrain_3d/bin/libterrain.linux.release.x86_64.so and b/addons/terrain_3d/bin/libterrain.linux.release.x86_64.so differ
diff --git a/addons/terrain_3d/bin/libterrain.macos.debug.framework/libterrain.macos.debug b/addons/terrain_3d/bin/libterrain.macos.debug.framework/libterrain.macos.debug
index a5300c3..d340a95 100644
Binary files a/addons/terrain_3d/bin/libterrain.macos.debug.framework/libterrain.macos.debug and b/addons/terrain_3d/bin/libterrain.macos.debug.framework/libterrain.macos.debug differ
diff --git a/addons/terrain_3d/bin/libterrain.macos.release.framework/libterrain.macos.release b/addons/terrain_3d/bin/libterrain.macos.release.framework/libterrain.macos.release
index e8cbc9b..9d39905 100644
Binary files a/addons/terrain_3d/bin/libterrain.macos.release.framework/libterrain.macos.release and b/addons/terrain_3d/bin/libterrain.macos.release.framework/libterrain.macos.release differ
diff --git a/addons/terrain_3d/bin/libterrain.windows.debug.x86_64.dll b/addons/terrain_3d/bin/libterrain.windows.debug.x86_64.dll
index 0bfd004..1904d12 100644
Binary files a/addons/terrain_3d/bin/libterrain.windows.debug.x86_64.dll and b/addons/terrain_3d/bin/libterrain.windows.debug.x86_64.dll differ
diff --git a/addons/terrain_3d/bin/libterrain.windows.release.x86_64.dll b/addons/terrain_3d/bin/libterrain.windows.release.x86_64.dll
index d4b066f..ed84c94 100644
Binary files a/addons/terrain_3d/bin/libterrain.windows.release.x86_64.dll and b/addons/terrain_3d/bin/libterrain.windows.release.x86_64.dll differ
diff --git a/addons/terrain_3d/editor.gd b/addons/terrain_3d/editor.gd
index 12fdf43..14062ef 100644
--- a/addons/terrain_3d/editor.gd
+++ b/addons/terrain_3d/editor.gd
@@ -11,24 +11,17 @@ const PS_DOCK_POSITION: String = "terrain3d/config/dock_position"
const PS_DOCK_PINNED: String = "terrain3d/config/dock_pinned"
var terrain: Terrain3D
+var _last_terrain: Terrain3D
var nav_region: NavigationRegion3D
var editor: Terrain3DEditor
var ui: Node # Terrain3DUI see Godot #75388
+var asset_dock: PanelContainer
var region_gizmo: RegionGizmo
var visible: bool
var current_region_position: Vector2
var mouse_global_position: Vector3 = Vector3.ZERO
-enum DOCK_STATE {
- HIDDEN = -1,
- SIDEBAR = 0,
- BOTTOM = 1,
-}
-var asset_dock: Control
-var dock_state: DOCK_STATE = -1
-var dock_position: DockSlot = DOCK_SLOT_RIGHT_BL
-
# Track negative input (CTRL)
var _negative_input: bool = false
# Track state prior to pressing CTRL: -1 not tracked, 0 false, 1 true
@@ -45,21 +38,12 @@ func _enter_tree() -> void:
scene_changed.connect(_on_scene_changed)
- if ProjectSettings.has_setting(PS_DOCK_POSITION):
- dock_position = ProjectSettings.get_setting(PS_DOCK_POSITION)
asset_dock = load(ASSET_DOCK).instantiate()
- await asset_dock.ready
- if ProjectSettings.has_setting(PS_DOCK_PINNED):
- asset_dock.placement_pin.button_pressed = ProjectSettings.get_setting(PS_DOCK_PINNED)
- asset_dock.placement_pin.toggled.connect(_on_asset_dock_pin_changed)
- asset_dock.placement_option.selected = dock_position
- asset_dock.placement_changed.connect(_on_asset_dock_placement_changed)
- asset_dock.resource_changed.connect(_on_asset_dock_resource_changed)
- asset_dock.resource_inspected.connect(_on_asset_dock_resource_inspected)
- asset_dock.resource_selected.connect(_on_asset_dock_resource_selected)
-
+ asset_dock.initialize(self)
+
func _exit_tree() -> void:
+ asset_dock.remove_dock(true)
asset_dock.queue_free()
ui.queue_free()
editor.free()
@@ -68,10 +52,19 @@ func _exit_tree() -> void:
func _handles(p_object: Object) -> bool:
- if p_object is Terrain3D or p_object is NavigationRegion3D:
+ if p_object is Terrain3D:
return true
- if p_object is Terrain3DObjects or (p_object is Node3D and p_object.get_parent() is Terrain3DObjects):
+
+ # Terrain3DObjects requires access to EditorUndoRedoManager. The only way to make sure it
+ # always has it, is to pass it in here. _edit is NOT called if the node is cut and pasted.
+ if p_object is Terrain3DObjects:
+ p_object.editor_setup(self)
+ elif p_object is Node3D and p_object.get_parent() is Terrain3DObjects:
+ p_object.get_parent().editor_setup(self)
+
+ if is_instance_valid(_last_terrain) and _last_terrain.is_inside_tree() and p_object is NavigationRegion3D:
return true
+
return false
@@ -83,55 +76,35 @@ func _edit(p_object: Object) -> void:
if p_object == terrain:
return
terrain = p_object
+ _last_terrain = terrain
editor.set_terrain(terrain)
region_gizmo.set_node_3d(terrain)
terrain.add_gizmo(region_gizmo)
terrain.set_plugin(self)
- if not terrain.texture_list_changed.is_connected(_load_textures):
- terrain.texture_list_changed.connect(_load_textures)
- _load_textures()
+ # Connect to new Assets resource
+ if not terrain.assets_changed.is_connected(asset_dock.update_assets):
+ terrain.assets_changed.connect(asset_dock.update_assets)
+ asset_dock.update_assets()
+ # Connect to new Storage resource
if not terrain.storage_changed.is_connected(_load_storage):
terrain.storage_changed.connect(_load_storage)
_load_storage()
else:
- terrain = null
-
- if p_object is NavigationRegion3D:
- nav_region = p_object
- else:
- nav_region = null
+ _clear()
+
+ if is_instance_valid(_last_terrain) and _last_terrain.is_inside_tree():
+ if p_object is NavigationRegion3D:
+ nav_region = p_object
+ else:
+ nav_region = null
+
- if p_object is Terrain3DObjects:
- p_object.editor_setup(self)
- elif p_object is Node3D and p_object.get_parent() is Terrain3DObjects:
- p_object.get_parent().editor_setup(self)
-
-
func _make_visible(p_visible: bool, p_redraw: bool = false) -> void:
visible = p_visible
ui.set_visible(visible)
update_region_grid()
-
- # Manage Asset Dock position and visibility
- if visible and dock_state == DOCK_STATE.HIDDEN:
- if dock_position < DOCK_SLOT_MAX:
- add_control_to_dock(dock_position, asset_dock)
- dock_state = DOCK_STATE.SIDEBAR
- asset_dock.move_slider(true)
- else:
- add_control_to_bottom_panel(asset_dock, "Terrain3D")
- make_bottom_panel_item_visible(asset_dock)
- dock_state = DOCK_STATE.BOTTOM
- asset_dock.move_slider(false)
- elif not visible and dock_state != DOCK_STATE.HIDDEN:
- var pinned: bool = false
- if p_redraw or ( asset_dock.placement_pin and not asset_dock.placement_pin.button_pressed):
- if dock_state == DOCK_STATE.SIDEBAR:
- remove_control_from_docks(asset_dock)
- else:
- remove_control_from_bottom_panel(asset_dock)
- dock_state = DOCK_STATE.HIDDEN
+ asset_dock.update_dock(visible)
func _clear() -> void:
@@ -196,7 +169,7 @@ func _forward_3d_gui_input(p_viewport_camera: Camera3D, p_event: InputEvent) ->
else:
# Else look for intersection with terrain
var intersection_point: Vector3 = terrain.get_intersection(camera_pos, camera_dir)
- if intersection_point.z > 3.4e38: # double max
+ if intersection_point.z > 3.4e38 or is_nan(intersection_point.z): # max double or nan
return AFTER_GUI_INPUT_STOP
mouse_global_position = intersection_point
@@ -260,12 +233,6 @@ func _forward_3d_gui_input(p_viewport_camera: Camera3D, p_event: InputEvent) ->
return AFTER_GUI_INPUT_PASS
-
-func is_terrain_valid() -> bool:
- if is_instance_valid(terrain) and terrain.get_storage():
- return true
- return false
-
func _load_storage() -> void:
if terrain:
@@ -293,63 +260,40 @@ func update_region_grid() -> void:
region_gizmo.grid = [Vector2i.ZERO]
-func _load_textures() -> void:
- if terrain and terrain.texture_list:
- if not terrain.texture_list.textures_changed.is_connected(update_asset_dock):
- terrain.texture_list.textures_changed.connect(update_asset_dock)
- update_asset_dock()
-
-
-func update_asset_dock(p_texture_list: Terrain3DTextureList = null) -> void:
- asset_dock.clear()
-
- if is_terrain_valid() and terrain.texture_list:
- var texture_count: int = terrain.texture_list.get_texture_count()
- for i in texture_count:
- var texture: Terrain3DTexture = terrain.texture_list.get_texture(i)
- asset_dock.add_item(texture)
-
- if texture_count < Terrain3DTextureList.MAX_TEXTURES:
- asset_dock.add_item()
-
-
-func _on_asset_dock_pin_changed(toggled: bool) -> void:
- ProjectSettings.set_setting(PS_DOCK_PINNED, toggled)
- ProjectSettings.save()
-
-
-func _on_asset_dock_placement_changed(index: int) -> void:
- dock_position = clamp(index, 0, DOCK_SLOT_MAX)
- ProjectSettings.set_setting(PS_DOCK_POSITION, dock_position)
- ProjectSettings.save()
- _make_visible(false, true) # Hide to redraw
- _make_visible(true)
-
-
-func _on_asset_dock_resource_changed(p_texture: Resource, p_index: int) -> void:
- if is_terrain_valid():
- # If removing last entry and its selected, clear inspector
- if not p_texture and p_index == asset_dock.get_selected_index() and \
- asset_dock.get_selected_index() == asset_dock.entries.size() - 2:
- get_editor_interface().inspect_object(null)
- terrain.get_texture_list().set_texture(p_index, p_texture)
-
-
-func _on_asset_dock_resource_selected() -> void:
- # If not on a texture painting tool, then switch to Paint
- if editor.get_tool() != Terrain3DEditor.TEXTURE:
- var paint_btn: Button = ui.toolbar.get_node_or_null("PaintBaseTexture")
- if paint_btn:
- paint_btn.set_pressed(true)
- ui._on_tool_changed(Terrain3DEditor.TEXTURE, Terrain3DEditor.REPLACE)
- ui._on_setting_changed()
-
-
-func _on_asset_dock_resource_inspected(texture: Resource) -> void:
- get_editor_interface().inspect_object(texture, "", true)
-
-
func _on_scene_changed(scene_root: Node) -> void:
- if scene_root:
- for node in scene_root.find_children("", "Terrain3DObjects"):
- node.editor_setup(self)
+ if not scene_root:
+ return
+
+ for node in scene_root.find_children("", "Terrain3DObjects"):
+ node.editor_setup(self)
+
+ asset_dock.update_assets()
+ await get_tree().create_timer(2).timeout
+ asset_dock.update_thumbnails()
+
+
+func is_terrain_valid(p_terrain: Terrain3D = null) -> bool:
+ var t: Terrain3D
+ if p_terrain:
+ t = p_terrain
+ else:
+ t = terrain
+ if is_instance_valid(t) and t.is_inside_tree() and t.get_storage():
+ return true
+ return false
+
+
+func is_selected() -> bool:
+ var selected: Array[Node] = get_editor_interface().get_selection().get_selected_nodes()
+ for node in selected:
+ if node.get_instance_id() == _last_terrain.get_instance_id():
+ return true
+
+ return false
+
+
+func select_terrain() -> void:
+ if is_instance_valid(_last_terrain) and is_terrain_valid(_last_terrain) and not is_selected():
+ var es: EditorSelection = get_editor_interface().get_selection()
+ es.clear()
+ es.add_node(_last_terrain)
diff --git a/addons/terrain_3d/extras/import_sgt.gd b/addons/terrain_3d/extras/import_sgt.gd
new file mode 100644
index 0000000..b8b45aa
--- /dev/null
+++ b/addons/terrain_3d/extras/import_sgt.gd
@@ -0,0 +1,41 @@
+## Import From SimpleGrassTextured
+#
+# This script demonstrates how to import transforms from SimpleGrassTextured. To use it:
+#
+# 1. Setup the mesh asset you wish to use in the asset dock.
+# 1. Select your Terrain3D node.
+# 1. In the inspector, click Script (very bottom) and Quick Load import_sgt.gd.
+# 1. At the very top, assign your SimpleGrassTextured node.
+# 1. Input the desired mesh asset ID.
+# 1. Click import. The output window and console will report when finished.
+# 1. Clear the script from your Terrain3D node, and save your scene.
+#
+# The instance transforms are now stored in your Storage resource.
+#
+# Use clear_instances to erase all instances that match the assign_mesh_id.
+#
+# The add_transforms function (called by add_multimesh) applies the height_offset specified in the
+# Terrain3DMeshAsset.
+# Once the transforms are imported, you can reassign any mesh you like into this mesh slot.
+
+@tool
+extends Terrain3D
+
+@export var simple_grass_textured: MultiMeshInstance3D
+@export var assign_mesh_id: int
+@export var import: bool = false : set = import_sgt
+@export var clear_instances: bool = false : set = clear_multimeshes
+
+
+func clear_multimeshes(value: bool) -> void:
+ get_instancer().clear_by_mesh(assign_mesh_id)
+
+
+func import_sgt(value: bool) -> void:
+ var sgt_mm: MultiMesh = simple_grass_textured.multimesh
+ var global_xform: Transform3D = simple_grass_textured.global_transform
+ print("Starting to import %d instances from SimpleGrassTextured using mesh id %d" % [ sgt_mm.instance_count, assign_mesh_id])
+ var time: int = Time.get_ticks_msec()
+ get_instancer().add_multimesh(assign_mesh_id, sgt_mm, simple_grass_textured.global_transform)
+ print("Import complete in %.2f seconds" % [ float(Time.get_ticks_msec() - time)/1000. ])
+
diff --git a/addons/terrain_3d/extras/project_on_terrain3d.gd b/addons/terrain_3d/extras/project_on_terrain3d.gd
index 6ef6d83..976fd4f 100644
--- a/addons/terrain_3d/extras/project_on_terrain3d.gd
+++ b/addons/terrain_3d/extras/project_on_terrain3d.gd
@@ -5,6 +5,12 @@
# Then uncomment everything below
# In the editor, add this modifier to Scatter, then set your Terrain3D node
+# This script is an addon for HungryProton's Scatter https://github.com/HungryProton/scatter
+# It allows Scatter to detect the terrain height from Terrain3D
+# Copy this file into /addons/proton_scatter/src/modifiers
+# Then uncomment everything below (select, press CTRL+K)
+# In the editor, add this modifier, then set your Terrain3D node
+
#@tool
#extends "base_modifier.gd"
#
@@ -19,66 +25,66 @@
#
#
#func _init() -> void:
-# display_name = "Project On Terrain3D"
-# category = "Edit"
-# can_restrict_height = false
-# global_reference_frame_available = true
-# local_reference_frame_available = true
-# individual_instances_reference_frame_available = true
-# use_global_space_by_default()
+ #display_name = "Project On Terrain3D"
+ #category = "Edit"
+ #can_restrict_height = false
+ #global_reference_frame_available = true
+ #local_reference_frame_available = true
+ #individual_instances_reference_frame_available = true
+ #use_global_space_by_default()
#
-# documentation.add_paragraph(
-# "This is a duplicate of `Project on Colliders` that queries the terrain system
-# for height and sets the transform height appropriately.
+ #documentation.add_paragraph(
+ #"This is a duplicate of `Project on Colliders` that queries the terrain system
+ #for height and sets the transform height appropriately.
#
-# This modifier must have terrain_node set to a Terrain3D node.")
+ #This modifier must have terrain_node set to a Terrain3D node.")
#
-# var p := documentation.add_parameter("Terrain Node")
-# p.set_type("NodePath")
-# p.set_description("Set your Terrain3D node.")
-#
-# p = documentation.add_parameter("Align with collision normal")
-# p.set_type("bool")
-# p.set_description(
-# "Rotate the transform to align it with the collision normal in case
-# the ray cast hit a collider.")
+ #var p := documentation.add_parameter("Terrain Node")
+ #p.set_type("NodePath")
+ #p.set_description("Set your Terrain3D node.")
+ #
+ #p = documentation.add_parameter("Align with collision normal")
+ #p.set_type("bool")
+ #p.set_description(
+ #"Rotate the transform to align it with the collision normal in case
+ #the ray cast hit a collider.")
#
#
#func _process_transforms(transforms, domain, _seed) -> void:
-# if transforms.is_empty():
-# return
+ #if transforms.is_empty():
+ #return
#
-# if terrain_node:
-# _terrain = domain.get_root().get_node_or_null(terrain_node)
+ #if terrain_node:
+ #_terrain = domain.get_root().get_node_or_null(terrain_node)
#
-# if not _terrain:
-# warning += """No Terrain3D node found"""
-# return
+ #if not _terrain:
+ #warning += """No Terrain3D node found"""
+ #return
#
-# if not _terrain.storage:
-# warning += """Terrain3D storage is not initialized"""
-# return
+ #if not _terrain.storage:
+ #warning += """Terrain3D storage is not initialized"""
+ #return
#
-# # Get global transform
-# var gt: Transform3D = domain.get_global_transform()
-# var gt_inverse: Transform3D = gt.affine_inverse()
-# for i in transforms.list.size():
-# var location: Vector3 = (gt * transforms.list[i]).origin
-# var height: float = _terrain.storage.get_height(location)
-# var normal: Vector3 = _terrain.storage.get_normal(location)
+ ## Get global transform
+ #var gt: Transform3D = domain.get_global_transform()
+ #var gt_inverse := gt.affine_inverse()
+ #for i in transforms.list.size():
+ #var location: Vector3 = (gt * transforms.list[i]).origin
+ #var height: float = _terrain.storage.get_height(location)
+ #var normal: Vector3 = _terrain.storage.get_normal(location)
+ #
+ #if align_with_collision_normal and not is_nan(normal.x):
+ #transforms.list[i].basis.y = normal
+ #transforms.list[i].basis.x = -transforms.list[i].basis.z.cross(normal)
+ #transforms.list[i].basis = transforms.list[i].basis.orthonormalized()
#
-# if align_with_collision_normal:
-# transforms.list[i].basis.y = normal
-# transforms.list[i].basis.x = -transforms.list[i].basis.z.cross(normal)
-# transforms.list[i].basis = transforms.list[i].basis.orthonormalized()
+ #transforms.list[i].origin.y = gt.origin.y if is_nan(height) else height - gt.origin.y
#
-# transforms.list[i].origin.y = height - gt.origin.y
-#
-# if transforms.is_empty():
-# warning += """Every point has been removed. Possible reasons include: \n
-# + No collider is close enough to the shapes.
-# + Ray length is too short.
-# + Ray direction is incorrect.
-# + Collision mask is not set properly.
-# + Max slope is too low.
-# """
+ #if transforms.is_empty():
+ #warning += """Every point has been removed. Possible reasons include: \n
+ #+ No collider is close enough to the shapes.
+ #+ Ray length is too short.
+ #+ Ray direction is incorrect.
+ #+ Collision mask is not set properly.
+ #+ Max slope is too low.
+ #"""
diff --git a/addons/terrain_3d/icons/icon_terrain_material.svg b/addons/terrain_3d/icons/autoshader.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_terrain_material.svg
rename to addons/terrain_3d/icons/autoshader.svg
diff --git a/addons/terrain_3d/icons/icon_brush.svg.import b/addons/terrain_3d/icons/autoshader.svg.import
similarity index 71%
rename from addons/terrain_3d/icons/icon_brush.svg.import
rename to addons/terrain_3d/icons/autoshader.svg.import
index 3cb66ae..1551553 100644
--- a/addons/terrain_3d/icons/icon_brush.svg.import
+++ b/addons/terrain_3d/icons/autoshader.svg.import
@@ -2,8 +2,8 @@
importer="texture"
type="CompressedTexture2D"
-uid="uid://dbby47aoknjeb"
-path="res://.godot/imported/icon_brush.svg-8886426485f67abe2233686de39952ce.ctex"
+uid="uid://bdwolwswwy8wr"
+path="res://.godot/imported/autoshader.svg-9998e61bbc6afd5b134b767acd17a425.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
@@ -11,8 +11,8 @@ metadata={
[deps]
-source_file="res://addons/terrain_3d/icons/icon_brush.svg"
-dest_files=["res://.godot/imported/icon_brush.svg-8886426485f67abe2233686de39952ce.ctex"]
+source_file="res://addons/terrain_3d/icons/autoshader.svg"
+dest_files=["res://.godot/imported/autoshader.svg-9998e61bbc6afd5b134b767acd17a425.ctex"]
[params]
diff --git a/addons/terrain_3d/icons/icon_color.svg b/addons/terrain_3d/icons/color_paint.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_color.svg
rename to addons/terrain_3d/icons/color_paint.svg
diff --git a/addons/terrain_3d/icons/icon_picker.svg.import b/addons/terrain_3d/icons/color_paint.svg.import
similarity index 71%
rename from addons/terrain_3d/icons/icon_picker.svg.import
rename to addons/terrain_3d/icons/color_paint.svg.import
index 6ba7564..56d0d5d 100644
--- a/addons/terrain_3d/icons/icon_picker.svg.import
+++ b/addons/terrain_3d/icons/color_paint.svg.import
@@ -2,8 +2,8 @@
importer="texture"
type="CompressedTexture2D"
-uid="uid://iiocbe4njv5s"
-path="res://.godot/imported/icon_picker.svg-9f872a162ed3e0053283f4bf299ac645.ctex"
+uid="uid://krrmpalen8xu"
+path="res://.godot/imported/color_paint.svg-2a416ebf35da04135017e5c6ef53ea57.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
@@ -11,8 +11,8 @@ metadata={
[deps]
-source_file="res://addons/terrain_3d/icons/icon_picker.svg"
-dest_files=["res://.godot/imported/icon_picker.svg-9f872a162ed3e0053283f4bf299ac645.ctex"]
+source_file="res://addons/terrain_3d/icons/color_paint.svg"
+dest_files=["res://.godot/imported/color_paint.svg-2a416ebf35da04135017e5c6ef53ea57.ctex"]
[params]
diff --git a/addons/terrain_3d/icons/icon_height_add.svg b/addons/terrain_3d/icons/height_add.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_height_add.svg
rename to addons/terrain_3d/icons/height_add.svg
diff --git a/addons/terrain_3d/icons/icon_color.svg.import b/addons/terrain_3d/icons/height_add.svg.import
similarity index 71%
rename from addons/terrain_3d/icons/icon_color.svg.import
rename to addons/terrain_3d/icons/height_add.svg.import
index 27f1fce..e1bbbad 100644
--- a/addons/terrain_3d/icons/icon_color.svg.import
+++ b/addons/terrain_3d/icons/height_add.svg.import
@@ -2,8 +2,8 @@
importer="texture"
type="CompressedTexture2D"
-uid="uid://bump6ax7j3rp1"
-path="res://.godot/imported/icon_color.svg-b5b52e67ad2f610c27688c5daeb9cd1c.ctex"
+uid="uid://bcmbqryggekg1"
+path="res://.godot/imported/height_add.svg-9e680ce71fa4c541748e081b99167369.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
@@ -11,8 +11,8 @@ metadata={
[deps]
-source_file="res://addons/terrain_3d/icons/icon_color.svg"
-dest_files=["res://.godot/imported/icon_color.svg-b5b52e67ad2f610c27688c5daeb9cd1c.ctex"]
+source_file="res://addons/terrain_3d/icons/height_add.svg"
+dest_files=["res://.godot/imported/height_add.svg-9e680ce71fa4c541748e081b99167369.ctex"]
[params]
diff --git a/addons/terrain_3d/icons/icon_height_div.svg b/addons/terrain_3d/icons/height_div.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_height_div.svg
rename to addons/terrain_3d/icons/height_div.svg
diff --git a/addons/terrain_3d/icons/height_div.svg.import b/addons/terrain_3d/icons/height_div.svg.import
new file mode 100644
index 0000000..c894274
--- /dev/null
+++ b/addons/terrain_3d/icons/height_div.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://danh7tb2v6rx7"
+path="res://.godot/imported/height_div.svg-449a465f9fdd11ab59f2f1c78815408c.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/height_div.svg"
+dest_files=["res://.godot/imported/height_div.svg-449a465f9fdd11ab59f2f1c78815408c.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_height_flat.svg b/addons/terrain_3d/icons/height_flat.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_height_flat.svg
rename to addons/terrain_3d/icons/height_flat.svg
diff --git a/addons/terrain_3d/icons/height_flat.svg.import b/addons/terrain_3d/icons/height_flat.svg.import
new file mode 100644
index 0000000..fd0e685
--- /dev/null
+++ b/addons/terrain_3d/icons/height_flat.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://crj0xfyiyr45u"
+path="res://.godot/imported/height_flat.svg-be726a006bf06e05a7a8867510f3996e.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/height_flat.svg"
+dest_files=["res://.godot/imported/height_flat.svg-be726a006bf06e05a7a8867510f3996e.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_height_mul.svg b/addons/terrain_3d/icons/height_mul.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_height_mul.svg
rename to addons/terrain_3d/icons/height_mul.svg
diff --git a/addons/terrain_3d/icons/height_mul.svg.import b/addons/terrain_3d/icons/height_mul.svg.import
new file mode 100644
index 0000000..b20aadc
--- /dev/null
+++ b/addons/terrain_3d/icons/height_mul.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bu3q0645kb3el"
+path="res://.godot/imported/height_mul.svg-2dca20fa42a85408713e9bfe411f3c79.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/height_mul.svg"
+dest_files=["res://.godot/imported/height_mul.svg-2dca20fa42a85408713e9bfe411f3c79.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_height_slope.svg b/addons/terrain_3d/icons/height_slope.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_height_slope.svg
rename to addons/terrain_3d/icons/height_slope.svg
diff --git a/addons/terrain_3d/icons/height_slope.svg.import b/addons/terrain_3d/icons/height_slope.svg.import
new file mode 100644
index 0000000..ed55b14
--- /dev/null
+++ b/addons/terrain_3d/icons/height_slope.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://0cd7so4kw7da"
+path="res://.godot/imported/height_slope.svg-e20540c5538d0c57a9d229a772b3d1b3.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/height_slope.svg"
+dest_files=["res://.godot/imported/height_slope.svg-e20540c5538d0c57a9d229a772b3d1b3.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_height_smooth.svg b/addons/terrain_3d/icons/height_smooth.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_height_smooth.svg
rename to addons/terrain_3d/icons/height_smooth.svg
diff --git a/addons/terrain_3d/icons/height_smooth.svg.import b/addons/terrain_3d/icons/height_smooth.svg.import
new file mode 100644
index 0000000..eef9e53
--- /dev/null
+++ b/addons/terrain_3d/icons/height_smooth.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://chrbx4xnxyiel"
+path="res://.godot/imported/height_smooth.svg-d8fc43572f5984eef64c886a49988c06.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/height_smooth.svg"
+dest_files=["res://.godot/imported/height_smooth.svg-d8fc43572f5984eef64c886a49988c06.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_height_sub.svg b/addons/terrain_3d/icons/height_sub.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_height_sub.svg
rename to addons/terrain_3d/icons/height_sub.svg
diff --git a/addons/terrain_3d/icons/icon_holes.svg.import b/addons/terrain_3d/icons/height_sub.svg.import
similarity index 71%
rename from addons/terrain_3d/icons/icon_holes.svg.import
rename to addons/terrain_3d/icons/height_sub.svg.import
index d8a42b7..4dc17eb 100644
--- a/addons/terrain_3d/icons/icon_holes.svg.import
+++ b/addons/terrain_3d/icons/height_sub.svg.import
@@ -2,8 +2,8 @@
importer="texture"
type="CompressedTexture2D"
-uid="uid://4qj0x1rs0a83"
-path="res://.godot/imported/icon_holes.svg-fadd8eef4df4cdc393621d5ff25aa8e3.ctex"
+uid="uid://mo3hnbk3ffjs"
+path="res://.godot/imported/height_sub.svg-1a14a9bb856f3db0faa02dba3c807b50.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
@@ -11,8 +11,8 @@ metadata={
[deps]
-source_file="res://addons/terrain_3d/icons/icon_holes.svg"
-dest_files=["res://.godot/imported/icon_holes.svg-fadd8eef4df4cdc393621d5ff25aa8e3.ctex"]
+source_file="res://addons/terrain_3d/icons/height_sub.svg"
+dest_files=["res://.godot/imported/height_sub.svg-1a14a9bb856f3db0faa02dba3c807b50.ctex"]
[params]
diff --git a/addons/terrain_3d/icons/icon_holes.svg b/addons/terrain_3d/icons/holes.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_holes.svg
rename to addons/terrain_3d/icons/holes.svg
diff --git a/addons/terrain_3d/icons/icon_spray.svg.import b/addons/terrain_3d/icons/holes.svg.import
similarity index 71%
rename from addons/terrain_3d/icons/icon_spray.svg.import
rename to addons/terrain_3d/icons/holes.svg.import
index ba57122..8117195 100644
--- a/addons/terrain_3d/icons/icon_spray.svg.import
+++ b/addons/terrain_3d/icons/holes.svg.import
@@ -2,8 +2,8 @@
importer="texture"
type="CompressedTexture2D"
-uid="uid://28jdhtmo0tcm"
-path="res://.godot/imported/icon_spray.svg-d9864c87d5d420aa9f80c0d3fdc80e87.ctex"
+uid="uid://bsmaxekrmnuy2"
+path="res://.godot/imported/holes.svg-a7cb97bb50d7879cd274646e207b9213.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
@@ -11,8 +11,8 @@ metadata={
[deps]
-source_file="res://addons/terrain_3d/icons/icon_spray.svg"
-dest_files=["res://.godot/imported/icon_spray.svg-d9864c87d5d420aa9f80c0d3fdc80e87.ctex"]
+source_file="res://addons/terrain_3d/icons/holes.svg"
+dest_files=["res://.godot/imported/holes.svg-a7cb97bb50d7879cd274646e207b9213.ctex"]
[params]
diff --git a/addons/terrain_3d/icons/icon_height_add.svg.import b/addons/terrain_3d/icons/icon_height_add.svg.import
deleted file mode 100644
index e8c2611..0000000
--- a/addons/terrain_3d/icons/icon_height_add.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://8ma1rbcinto3"
-path="res://.godot/imported/icon_height_add.svg-2928bbcb35ef4816ead056c5bcf5bdbd.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_height_add.svg"
-dest_files=["res://.godot/imported/icon_height_add.svg-2928bbcb35ef4816ead056c5bcf5bdbd.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_height_div.svg.import b/addons/terrain_3d/icons/icon_height_div.svg.import
deleted file mode 100644
index 982fe22..0000000
--- a/addons/terrain_3d/icons/icon_height_div.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://5xwklmfyqaha"
-path="res://.godot/imported/icon_height_div.svg-982f74e4859453a7d67caa2f6a71b056.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_height_div.svg"
-dest_files=["res://.godot/imported/icon_height_div.svg-982f74e4859453a7d67caa2f6a71b056.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_height_flat.svg.import b/addons/terrain_3d/icons/icon_height_flat.svg.import
deleted file mode 100644
index f5c5247..0000000
--- a/addons/terrain_3d/icons/icon_height_flat.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://cpfvqnfgrw4e"
-path="res://.godot/imported/icon_height_flat.svg-e58f6a7038e84631a5f56866c4c671e0.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_height_flat.svg"
-dest_files=["res://.godot/imported/icon_height_flat.svg-e58f6a7038e84631a5f56866c4c671e0.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_height_mul.svg.import b/addons/terrain_3d/icons/icon_height_mul.svg.import
deleted file mode 100644
index cfa978c..0000000
--- a/addons/terrain_3d/icons/icon_height_mul.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://bkqdmfjtug1c7"
-path="res://.godot/imported/icon_height_mul.svg-b6b666e20be820f5aa48e7410648290c.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_height_mul.svg"
-dest_files=["res://.godot/imported/icon_height_mul.svg-b6b666e20be820f5aa48e7410648290c.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_height_slope.svg.import b/addons/terrain_3d/icons/icon_height_slope.svg.import
deleted file mode 100644
index 118de23..0000000
--- a/addons/terrain_3d/icons/icon_height_slope.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://wkm8llh72h1m"
-path="res://.godot/imported/icon_height_slope.svg-2a8181e8d9f9b74739d6f4a9e62f040d.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_height_slope.svg"
-dest_files=["res://.godot/imported/icon_height_slope.svg-2a8181e8d9f9b74739d6f4a9e62f040d.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_height_smooth.svg.import b/addons/terrain_3d/icons/icon_height_smooth.svg.import
deleted file mode 100644
index 0a3e974..0000000
--- a/addons/terrain_3d/icons/icon_height_smooth.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://fhvnyvqmygfs"
-path="res://.godot/imported/icon_height_smooth.svg-83cfb47d64fb9579b212027a5aa50672.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_height_smooth.svg"
-dest_files=["res://.godot/imported/icon_height_smooth.svg-83cfb47d64fb9579b212027a5aa50672.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_height_sub.svg.import b/addons/terrain_3d/icons/icon_height_sub.svg.import
deleted file mode 100644
index 01a10cd..0000000
--- a/addons/terrain_3d/icons/icon_height_sub.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://cbtqb5fq02yx1"
-path="res://.godot/imported/icon_height_sub.svg-f01f73a219b6c1858d4bd958d01e8130.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_height_sub.svg"
-dest_files=["res://.godot/imported/icon_height_sub.svg-f01f73a219b6c1858d4bd958d01e8130.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_map_remove.svg.import b/addons/terrain_3d/icons/icon_map_remove.svg.import
deleted file mode 100644
index 41f4442..0000000
--- a/addons/terrain_3d/icons/icon_map_remove.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://bavktgaibu05s"
-path="res://.godot/imported/icon_map_remove.svg-bf5a269f9171f7027b6de1785cc63713.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_map_remove.svg"
-dest_files=["res://.godot/imported/icon_map_remove.svg-bf5a269f9171f7027b6de1785cc63713.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_multimesh.svg.import b/addons/terrain_3d/icons/icon_multimesh.svg.import
deleted file mode 100644
index 66664c4..0000000
--- a/addons/terrain_3d/icons/icon_multimesh.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://c5004ol65cqti"
-path="res://.godot/imported/icon_multimesh.svg-9447b6c5fe1ee9d406fd55dd3c63e196.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_multimesh.svg"
-dest_files=["res://.godot/imported/icon_multimesh.svg-9447b6c5fe1ee9d406fd55dd3c63e196.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_navigation.svg.import b/addons/terrain_3d/icons/icon_navigation.svg.import
deleted file mode 100644
index 7afe437..0000000
--- a/addons/terrain_3d/icons/icon_navigation.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://dewr4ro7nrg7y"
-path="res://.godot/imported/icon_navigation.svg-35e49ee3c403c103a0079d4156b0d168.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_navigation.svg"
-dest_files=["res://.godot/imported/icon_navigation.svg-35e49ee3c403c103a0079d4156b0d168.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_picker_checked.svg.import b/addons/terrain_3d/icons/icon_picker_checked.svg.import
deleted file mode 100644
index 568696e..0000000
--- a/addons/terrain_3d/icons/icon_picker_checked.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://73eyg81dnj2e"
-path="res://.godot/imported/icon_picker_checked.svg-4e271ac1a29c979a28440c683998675e.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_picker_checked.svg"
-dest_files=["res://.godot/imported/icon_picker_checked.svg-4e271ac1a29c979a28440c683998675e.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_terrain3d.svg.import b/addons/terrain_3d/icons/icon_terrain3d.svg.import
deleted file mode 100644
index 09f496b..0000000
--- a/addons/terrain_3d/icons/icon_terrain3d.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://cyfcx5hwray0d"
-path="res://.godot/imported/icon_terrain3d.svg-39252bb986e607c413d93e00ee31a619.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_terrain3d.svg"
-dest_files=["res://.godot/imported/icon_terrain3d.svg-39252bb986e607c413d93e00ee31a619.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_terrain_layer_material.svg.import b/addons/terrain_3d/icons/icon_terrain_layer_material.svg.import
deleted file mode 100644
index 130b5fe..0000000
--- a/addons/terrain_3d/icons/icon_terrain_layer_material.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://1bsjjcq0cv08"
-path="res://.godot/imported/icon_terrain_layer_material.svg-f3d447e84f51556fc60c5f0bd3f57443.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_terrain_layer_material.svg"
-dest_files=["res://.godot/imported/icon_terrain_layer_material.svg-f3d447e84f51556fc60c5f0bd3f57443.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_terrain_material.svg.import b/addons/terrain_3d/icons/icon_terrain_material.svg.import
deleted file mode 100644
index ca135d4..0000000
--- a/addons/terrain_3d/icons/icon_terrain_material.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://hsoj3vbpdg6d"
-path="res://.godot/imported/icon_terrain_material.svg-ea0cde03d29920e042a4043982714cbe.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_terrain_material.svg"
-dest_files=["res://.godot/imported/icon_terrain_material.svg-ea0cde03d29920e042a4043982714cbe.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_wetness.svg.import b/addons/terrain_3d/icons/icon_wetness.svg.import
deleted file mode 100644
index 336742c..0000000
--- a/addons/terrain_3d/icons/icon_wetness.svg.import
+++ /dev/null
@@ -1,38 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://cidqhk7wrkcl7"
-path="res://.godot/imported/icon_wetness.svg-6c67b1e4e9435c1aa106bee56f000e06.ctex"
-metadata={
-"has_editor_variant": true,
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/terrain_3d/icons/icon_wetness.svg"
-dest_files=["res://.godot/imported/icon_wetness.svg-6c67b1e4e9435c1aa106bee56f000e06.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=true
-editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_terrain_layer_material.svg b/addons/terrain_3d/icons/layers.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_terrain_layer_material.svg
rename to addons/terrain_3d/icons/layers.svg
diff --git a/addons/terrain_3d/icons/layers.svg.import b/addons/terrain_3d/icons/layers.svg.import
new file mode 100644
index 0000000..559cd21
--- /dev/null
+++ b/addons/terrain_3d/icons/layers.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cs1la1mashf2e"
+path="res://.godot/imported/layers.svg-4a679bb626c5179d3773f33e77e4a5e4.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/layers.svg"
+dest_files=["res://.godot/imported/layers.svg-4a679bb626c5179d3773f33e77e4a5e4.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_multimesh.svg b/addons/terrain_3d/icons/multimesh.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_multimesh.svg
rename to addons/terrain_3d/icons/multimesh.svg
diff --git a/addons/terrain_3d/icons/multimesh.svg.import b/addons/terrain_3d/icons/multimesh.svg.import
new file mode 100644
index 0000000..1493feb
--- /dev/null
+++ b/addons/terrain_3d/icons/multimesh.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cjlcl5lf20ve0"
+path="res://.godot/imported/multimesh.svg-5487b93b04ddbaae37b5d3e91f10750b.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/multimesh.svg"
+dest_files=["res://.godot/imported/multimesh.svg-5487b93b04ddbaae37b5d3e91f10750b.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_navigation.svg b/addons/terrain_3d/icons/navigation.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_navigation.svg
rename to addons/terrain_3d/icons/navigation.svg
diff --git a/addons/terrain_3d/icons/navigation.svg.import b/addons/terrain_3d/icons/navigation.svg.import
new file mode 100644
index 0000000..d8ac263
--- /dev/null
+++ b/addons/terrain_3d/icons/navigation.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://f3po5pogkv2b"
+path="res://.godot/imported/navigation.svg-1e4cf210c589be8d2911c522d4a17d78.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/navigation.svg"
+dest_files=["res://.godot/imported/navigation.svg-1e4cf210c589be8d2911c522d4a17d78.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_picker.svg b/addons/terrain_3d/icons/picker.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_picker.svg
rename to addons/terrain_3d/icons/picker.svg
diff --git a/addons/terrain_3d/icons/picker.svg.import b/addons/terrain_3d/icons/picker.svg.import
new file mode 100644
index 0000000..4a7369e
--- /dev/null
+++ b/addons/terrain_3d/icons/picker.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://c11ip32w7ln4v"
+path="res://.godot/imported/picker.svg-0ed48f8d7e66014d2aac4b303bc65df6.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/picker.svg"
+dest_files=["res://.godot/imported/picker.svg-0ed48f8d7e66014d2aac4b303bc65df6.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_picker_checked.svg b/addons/terrain_3d/icons/picker_checked.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_picker_checked.svg
rename to addons/terrain_3d/icons/picker_checked.svg
diff --git a/addons/terrain_3d/icons/picker_checked.svg.import b/addons/terrain_3d/icons/picker_checked.svg.import
new file mode 100644
index 0000000..ff53b15
--- /dev/null
+++ b/addons/terrain_3d/icons/picker_checked.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bg8x6o32ggt88"
+path="res://.godot/imported/picker_checked.svg-81f35b6ae38bccc8aa9e7ae22b530168.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/picker_checked.svg"
+dest_files=["res://.godot/imported/picker_checked.svg-81f35b6ae38bccc8aa9e7ae22b530168.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_map_add.svg b/addons/terrain_3d/icons/region_add.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_map_add.svg
rename to addons/terrain_3d/icons/region_add.svg
diff --git a/addons/terrain_3d/icons/region_add.svg.import b/addons/terrain_3d/icons/region_add.svg.import
new file mode 100644
index 0000000..e50c30b
--- /dev/null
+++ b/addons/terrain_3d/icons/region_add.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://c0tn453fsckv5"
+path="res://.godot/imported/region_add.svg-a05dc161a452dd3e024f9835a737d9f0.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/region_add.svg"
+dest_files=["res://.godot/imported/region_add.svg-a05dc161a452dd3e024f9835a737d9f0.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_map_remove.svg b/addons/terrain_3d/icons/region_remove.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_map_remove.svg
rename to addons/terrain_3d/icons/region_remove.svg
diff --git a/addons/terrain_3d/icons/region_remove.svg.import b/addons/terrain_3d/icons/region_remove.svg.import
new file mode 100644
index 0000000..6ded856
--- /dev/null
+++ b/addons/terrain_3d/icons/region_remove.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cbpo5eamf3bx2"
+path="res://.godot/imported/region_remove.svg-5710e8aeb34f1eaa06e637634f4a7d16.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/region_remove.svg"
+dest_files=["res://.godot/imported/region_remove.svg-5710e8aeb34f1eaa06e637634f4a7d16.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_terrain3d.svg b/addons/terrain_3d/icons/terrain3d.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_terrain3d.svg
rename to addons/terrain_3d/icons/terrain3d.svg
diff --git a/addons/terrain_3d/icons/terrain3d.svg.import b/addons/terrain_3d/icons/terrain3d.svg.import
new file mode 100644
index 0000000..c077de1
--- /dev/null
+++ b/addons/terrain_3d/icons/terrain3d.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bnsydn4jkyeyn"
+path="res://.godot/imported/terrain3d.svg-eb45756f1a003759fda81eaa1db10769.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/terrain3d.svg"
+dest_files=["res://.godot/imported/terrain3d.svg-eb45756f1a003759fda81eaa1db10769.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_brush.svg b/addons/terrain_3d/icons/texture_paint.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_brush.svg
rename to addons/terrain_3d/icons/texture_paint.svg
diff --git a/addons/terrain_3d/icons/texture_paint.svg.import b/addons/terrain_3d/icons/texture_paint.svg.import
new file mode 100644
index 0000000..8a09d92
--- /dev/null
+++ b/addons/terrain_3d/icons/texture_paint.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://duo8valena3a2"
+path="res://.godot/imported/texture_paint.svg-72da4fd2096377e625a8fe09cdacb0e4.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/texture_paint.svg"
+dest_files=["res://.godot/imported/texture_paint.svg-72da4fd2096377e625a8fe09cdacb0e4.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/icons/icon_spray.svg b/addons/terrain_3d/icons/texture_spray.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_spray.svg
rename to addons/terrain_3d/icons/texture_spray.svg
diff --git a/addons/terrain_3d/icons/icon_map_add.svg.import b/addons/terrain_3d/icons/texture_spray.svg.import
similarity index 71%
rename from addons/terrain_3d/icons/icon_map_add.svg.import
rename to addons/terrain_3d/icons/texture_spray.svg.import
index 385706b..c4acc6f 100644
--- a/addons/terrain_3d/icons/icon_map_add.svg.import
+++ b/addons/terrain_3d/icons/texture_spray.svg.import
@@ -2,8 +2,8 @@
importer="texture"
type="CompressedTexture2D"
-uid="uid://dkgbiictluyh8"
-path="res://.godot/imported/icon_map_add.svg-a13cebbb261c5138d4ca5cbb5df24202.ctex"
+uid="uid://16yfxe7xe703"
+path="res://.godot/imported/texture_spray.svg-326fee11cf418653e621bc222a470861.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
@@ -11,8 +11,8 @@ metadata={
[deps]
-source_file="res://addons/terrain_3d/icons/icon_map_add.svg"
-dest_files=["res://.godot/imported/icon_map_add.svg-a13cebbb261c5138d4ca5cbb5df24202.ctex"]
+source_file="res://addons/terrain_3d/icons/texture_spray.svg"
+dest_files=["res://.godot/imported/texture_spray.svg-326fee11cf418653e621bc222a470861.ctex"]
[params]
diff --git a/addons/terrain_3d/icons/icon_wetness.svg b/addons/terrain_3d/icons/wetness.svg
similarity index 100%
rename from addons/terrain_3d/icons/icon_wetness.svg
rename to addons/terrain_3d/icons/wetness.svg
diff --git a/addons/terrain_3d/icons/wetness.svg.import b/addons/terrain_3d/icons/wetness.svg.import
new file mode 100644
index 0000000..9379330
--- /dev/null
+++ b/addons/terrain_3d/icons/wetness.svg.import
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bcgg0srmqsh3n"
+path="res://.godot/imported/wetness.svg-9b2ddec096ab7734492b77b20c75c82b.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/terrain_3d/icons/wetness.svg"
+dest_files=["res://.godot/imported/wetness.svg-9b2ddec096ab7734492b77b20c75c82b.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/terrain_3d/plugin.cfg b/addons/terrain_3d/plugin.cfg
index d485abf..b738b1d 100644
--- a/addons/terrain_3d/plugin.cfg
+++ b/addons/terrain_3d/plugin.cfg
@@ -3,5 +3,5 @@
name="Terrain3D"
description="A high performance, editable terrain system for Godot 4."
author="Cory Petkovsek & Roope Palmroos"
-version="0.9.2-dev"
+version="0.9.2"
script="editor.gd"
diff --git a/addons/terrain_3d/src/asset_dock.gd b/addons/terrain_3d/src/asset_dock.gd
index 6cbbb1b..b4fea39 100644
--- a/addons/terrain_3d/src/asset_dock.gd
+++ b/addons/terrain_3d/src/asset_dock.gd
@@ -1,119 +1,426 @@
@tool
extends PanelContainer
+#class_name Terrain3DAssetDock
-signal placement_changed(index: int)
-signal resource_changed(resource: Resource, index: int)
-signal resource_inspected(resource: Resource)
-signal resource_selected
+signal confirmation_closed
+signal confirmation_confirmed
+signal confirmation_canceled
-var list: ListContainer
-var entries: Array[ListEntry]
-var selected_index: int = 0
-var focus_style: StyleBox
+const PS_DOCK_SLOT: String = "terrain3d/config/dock_slot"
+const PS_DOCK_TILE_SIZE: String = "terrain3d/config/dock_tile_size"
+const PS_DOCK_FLOATING: String = "terrain3d/config/dock_floating"
+const PS_DOCK_PINNED: String = "terrain3d/config/dock_always_on_top"
+const PS_DOCK_WINDOW_POSITION: String = "terrain3d/config/dock_window_position"
+const PS_DOCK_WINDOW_SIZE: String = "terrain3d/config/dock_window_size"
-@onready var placement_option: OptionButton = $VBox/PlacementHBox/Options
-@onready var placement_pin: Button = $VBox/PlacementHBox/Pinned
-@onready var size_slider: HSlider = $VBox/SizeSlider
+var texture_list: ListContainer
+var mesh_list: ListContainer
+var _current_list: ListContainer
+var _last_thumb_update_time: int = 0
+const MAX_UPDATE_TIME: int = 1000
+
+var placement_opt: OptionButton
+var floating_btn: Button
+var pinned_btn: Button
+var size_slider: HSlider
+var box: BoxContainer
+var buttons: BoxContainer
+var textures_btn: Button
+var meshes_btn: Button
+var asset_container: ScrollContainer
+var confirm_dialog: ConfirmationDialog
+var _confirmed: bool = false
+
+# Used only for editor, so change to single visible/hiddden
+enum {
+ HIDDEN = -1,
+ SIDEBAR = 0,
+ BOTTOM = 1,
+ WINDOWED = 2,
+}
+var state: int = HIDDEN
+
+var window: Window
+var _godot_editor_window: Window # The main Godot Editor window
+var _godot_last_state: Window.Mode = Window.MODE_FULLSCREEN
+
+enum {
+ POS_LEFT_UL = 0,
+ POS_LEFT_BL = 1,
+ POS_LEFT_UR = 2,
+ POS_LEFT_BR = 3,
+ POS_RIGHT_UL = 4,
+ POS_RIGHT_BL = 5,
+ POS_RIGHT_UR = 6,
+ POS_RIGHT_BR = 7,
+ POS_BOTTOM = 8,
+ POS_MAX = 9,
+}
+var slot: int = POS_RIGHT_BR
+var _initialized: bool = false
+var plugin: EditorPlugin
+var editor_settings: EditorSettings
+
+
+func initialize(p_plugin: EditorPlugin) -> void:
+ if p_plugin:
+ plugin = p_plugin
+
+ # Get editor window. Structure is root:Window/EditorNode/Base Control
+ _godot_editor_window = plugin.get_editor_interface().get_base_control().get_parent().get_parent()
+ _godot_last_state = _godot_editor_window.mode
+
+ placement_opt = $Box/Buttons/PlacementOpt
+ pinned_btn = $Box/Buttons/Pinned
+ floating_btn = $Box/Buttons/Floating
+ floating_btn.owner = null
+ size_slider = $Box/Buttons/SizeSlider
+ size_slider.owner = null
+ box = $Box
+ buttons = $Box/Buttons
+ textures_btn = $Box/Buttons/TexturesBtn
+ meshes_btn = $Box/Buttons/MeshesBtn
+ asset_container = $Box/ScrollContainer
+
+ texture_list = ListContainer.new()
+ texture_list.plugin = plugin
+ texture_list.type = Terrain3DAssets.TYPE_TEXTURE
+ asset_container.add_child(texture_list)
+ mesh_list = ListContainer.new()
+ mesh_list.plugin = plugin
+ mesh_list.type = Terrain3DAssets.TYPE_MESH
+ mesh_list.visible = false
+ asset_container.add_child(mesh_list)
+ _current_list = texture_list
+
+ editor_settings = EditorInterface.get_editor_settings()
+ load_editor_settings()
+
+ # Connect signals
+ resized.connect(update_layout)
+ textures_btn.pressed.connect(_on_textures_pressed)
+ meshes_btn.pressed.connect(_on_meshes_pressed)
+ placement_opt.item_selected.connect(set_slot)
+ floating_btn.pressed.connect(make_dock_float)
+ pinned_btn.toggled.connect(_on_pin_changed)
+ pinned_btn.visible = false
+ size_slider.value_changed.connect(_on_slider_changed)
+ plugin.ui.toolbar.tool_changed.connect(_on_tool_changed)
+
+ meshes_btn.add_theme_font_size_override("font_size", 16 * EditorInterface.get_editor_scale())
+ textures_btn.add_theme_font_size_override("font_size", 16 * EditorInterface.get_editor_scale())
+
+ _initialized = true
+ update_dock(plugin.visible)
+ update_layout()
func _ready() -> void:
- placement_option.item_selected.connect(_on_placement_selected)
- size_slider.value_changed.connect(_on_slider_changed)
+ if not _initialized:
+ return
+
+ # Setup styles
+ set("theme_override_styles/panel", get_theme_stylebox("panel", "Panel"))
+ # Avoid saving icon resources in tscn when editing w/ a tool script
+ if plugin.get_editor_interface().get_edited_scene_root() != self:
+ pinned_btn.icon = get_theme_icon("Pin", "EditorIcons")
+ pinned_btn.text = ""
+ floating_btn.icon = get_theme_icon("MakeFloating", "EditorIcons")
+ floating_btn.text = ""
+
+ update_thumbnails()
+ confirm_dialog = ConfirmationDialog.new()
+ add_child(confirm_dialog)
+ confirm_dialog.hide()
+ confirm_dialog.confirmed.connect(func(): _confirmed = true; \
+ emit_signal("confirmation_closed"); \
+ emit_signal("confirmation_confirmed") )
+ confirm_dialog.canceled.connect(func(): _confirmed = false; \
+ emit_signal("confirmation_closed"); \
+ emit_signal("confirmation_canceled") )
+
+
+func get_current_list() -> ListContainer:
+ return _current_list
+
+
+## Dock placement
+
+func set_slot(p_slot: int) -> void:
+ p_slot = clamp(p_slot, 0, POS_MAX-1)
- list = ListContainer.new()
- list.set_v_size_flags(SIZE_EXPAND_FILL)
- list.set_h_size_flags(SIZE_EXPAND_FILL)
- $VBox/ScrollContainer.add_child(list)
-
- # Copy theme from the editor, but since its a tool script, avoid saving icon resources in tscn
- if EditorScript.new().get_editor_interface().get_edited_scene_root() != self:
- set("theme_override_styles/panel", get_theme_stylebox("panel", "Panel"))
- $VBox/Label.set("theme_override_styles/normal", get_theme_stylebox("bg", "EditorInspectorCategory"))
- $VBox/Label.set("theme_override_fonts/font", get_theme_font("bold", "EditorFonts"))
- $VBox/Label.set("theme_override_font_sizes/font_size",get_theme_font_size("bold_size", "EditorFonts"))
- placement_pin.icon = get_theme_icon("Pin", "EditorIcons")
- placement_pin.text = ""
-
- # Setup style for selected assets
- focus_style = get_theme_stylebox("focus", "Button").duplicate()
- focus_style.set_border_width_all(2)
- focus_style.set_border_color(Color(1, 1, 1, .67))
+ if slot != p_slot:
+ slot = p_slot
+ placement_opt.selected = slot
+ save_editor_settings()
+ plugin.select_terrain()
+ update_dock(plugin.visible)
-func _on_placement_selected(index: int) -> void:
- emit_signal("placement_changed", index)
+func remove_dock(p_force: bool = false) -> void:
+ if state == SIDEBAR:
+ plugin.remove_control_from_docks(self)
+ state = HIDDEN
+
+ elif state == BOTTOM:
+ plugin.remove_control_from_bottom_panel(self)
+ state = HIDDEN
+
+ # If windowed and destination is not window or final exit, otherwise leave
+ elif state == WINDOWED and p_force:
+ if not window:
+ return
+ var parent: Node = get_parent()
+ if parent:
+ parent.remove_child(self)
+ _godot_editor_window.mouse_entered.disconnect(_on_godot_window_entered)
+ _godot_editor_window.focus_entered.disconnect(_on_godot_focus_entered)
+ _godot_editor_window.focus_exited.disconnect(_on_godot_focus_exited)
+ window.hide()
+ window.queue_free()
+ window = null
+ floating_btn.button_pressed = false
+ floating_btn.visible = true
+ pinned_btn.visible = false
+ placement_opt.visible = true
+ state = HIDDEN
+ update_dock(plugin.visible) # return window to side/bottom
+
+
+func update_dock(p_visible: bool) -> void:
+ update_assets()
+ if not _initialized:
+ return
+
+ if window:
+ return
+ elif floating_btn.button_pressed:
+ # No window, but floating button pressed, occurs when from editor settings
+ make_dock_float()
+ return
+
+ remove_dock()
+ # Add dock to new destination
+ # Sidebar
+ if slot < POS_BOTTOM:
+ state = SIDEBAR
+ plugin.add_control_to_dock(slot, self)
+ elif slot == POS_BOTTOM:
+ state = BOTTOM
+ plugin.add_control_to_bottom_panel(self, "Terrain3D")
+ if p_visible:
+ plugin.make_bottom_panel_item_visible(self)
+
+
+func update_layout() -> void:
+ if not _initialized:
+ return
+
+ # Detect if we have a new window from Make floating, grab it so we can free it properly
+ if not window and get_parent() and get_parent().get_parent() is Window:
+ window = get_parent().get_parent()
+ make_dock_float()
+ return # Will call this function again upon display
+
+ var size_parent: Control = size_slider.get_parent()
+ # Vertical layout in window / sidebar
+ if window or slot < POS_BOTTOM:
+ box.vertical = true
+ buttons.vertical = false
+
+ if size.x >= 500 and size_parent != buttons:
+ size_slider.reparent(buttons)
+ buttons.move_child(size_slider, 3)
+ elif size.x < 500 and size_parent != box:
+ size_slider.reparent(box)
+ box.move_child(size_slider, 1)
+ floating_btn.reparent(buttons)
+ buttons.move_child(floating_btn, 4)
+
+ # Wide layout on bottom bar
+ else:
+ size_slider.reparent(buttons)
+ buttons.move_child(size_slider, 3)
+ floating_btn.reparent(box)
+ box.vertical = false
+ buttons.vertical = true
+
+ save_editor_settings()
+
+
+func update_thumbnails() -> void:
+ if not is_instance_valid(plugin.terrain):
+ return
+ if _current_list.type == Terrain3DAssets.TYPE_MESH and \
+ Time.get_ticks_msec() - _last_thumb_update_time > MAX_UPDATE_TIME:
+ plugin.terrain.assets.create_mesh_thumbnails()
+ _last_thumb_update_time = Time.get_ticks_msec()
+ for mesh_asset in mesh_list.entries:
+ mesh_asset.queue_redraw()
+## Dock Button handlers
+
+
+func _on_pin_changed(toggled: bool) -> void:
+ if window:
+ window.always_on_top = pinned_btn.button_pressed
+ save_editor_settings()
func _on_slider_changed(value: float) -> void:
- if list:
- list.set_entry_size(value)
+ if texture_list:
+ texture_list.set_entry_width(value)
+ if mesh_list:
+ mesh_list.set_entry_width(value)
+ save_editor_settings()
-func move_slider(to_side: bool) -> void:
- if to_side and size_slider.get_parent() != $VBox:
- size_slider.reparent($VBox)
- $VBox.move_child(size_slider, 2)
- size_slider.custom_minimum_size = Vector2(0, 0)
- elif not to_side and size_slider.get_parent() == $VBox:
- size_slider.reparent($VBox/PlacementHBox)
- $VBox/PlacementHBox.move_child(size_slider, 2)
- size_slider.custom_minimum_size = Vector2(300, 10)
+func _on_textures_pressed() -> void:
+ _current_list = texture_list
+ texture_list.update_asset_list()
+ texture_list.visible = true
+ mesh_list.visible = false
+ textures_btn.button_pressed = true
+ meshes_btn.button_pressed = false
+ texture_list.set_selected_id(texture_list.selected_id)
+ plugin.get_editor_interface().edit_node(plugin.terrain)
-func clear() -> void:
- for i in entries:
- i.get_parent().remove_child(i)
- i.queue_free()
- entries.clear()
+func _on_meshes_pressed() -> void:
+ _current_list = mesh_list
+ mesh_list.update_asset_list()
+ mesh_list.visible = true
+ texture_list.visible = false
+ meshes_btn.button_pressed = true
+ textures_btn.button_pressed = false
+ mesh_list.set_selected_id(mesh_list.selected_id)
+ plugin.get_editor_interface().edit_node(plugin.terrain)
+ update_thumbnails()
-func add_item(p_resource: Resource = null) -> void:
- var entry: ListEntry = ListEntry.new()
- entry.focus_style = focus_style
- var index: int = entries.size()
+func _on_tool_changed(p_tool: Terrain3DEditor.Tool, p_operation: Terrain3DEditor.Operation) -> void:
+ if p_tool == Terrain3DEditor.INSTANCER:
+ _on_meshes_pressed()
+ elif p_tool == Terrain3DEditor.TEXTURE:
+ _on_textures_pressed()
+
+
+## Update Dock Contents
+
+
+func update_assets() -> void:
+ if not _initialized:
+ return
- entry.set_edited_resource(p_resource)
- entry.selected.connect(set_selected_index.bind(index))
- entry.inspected.connect(notify_resource_inspected)
- entry.changed.connect(notify_resource_changed.bind(index))
+ # Verify signals to individual lists
+ if plugin.is_terrain_valid() and plugin.terrain.assets:
+ if not plugin.terrain.assets.textures_changed.is_connected(texture_list.update_asset_list):
+ plugin.terrain.assets.textures_changed.connect(texture_list.update_asset_list)
+ if not plugin.terrain.assets.meshes_changed.is_connected(mesh_list.update_asset_list):
+ plugin.terrain.assets.meshes_changed.connect(mesh_list.update_asset_list)
+
+ _current_list.update_asset_list()
+
+## Window Management
+
+
+func make_dock_float() -> void:
+ # If already created (eg from editor Make Floating)
+ if not window:
+ remove_dock()
+ create_window()
+
+ state = WINDOWED
+ pinned_btn.visible = true
+ floating_btn.visible = false
+ placement_opt.visible = false
+ window.title = "Terrain3D Asset Dock"
+ window.always_on_top = pinned_btn.button_pressed
+ window.close_requested.connect(remove_dock.bind(true))
+ visible = true # Is hidden when pops off of bottom. ??
+ _godot_editor_window.grab_focus()
+
+
+func create_window() -> void:
+ window = Window.new()
+ window.wrap_controls = true
+ var mc := MarginContainer.new()
+ mc.set_anchors_preset(PRESET_FULL_RECT, false)
+ mc.add_child(self)
+ window.add_child(mc)
+ window.set_transient(false)
+ window.set_size(get_setting(PS_DOCK_WINDOW_SIZE, Vector2i(512, 512)))
+ window.set_position(get_setting(PS_DOCK_WINDOW_POSITION, Vector2i(704, 284)))
+ plugin.add_child(window)
+ window.show()
+ window.window_input.connect(_on_window_input)
+ window.focus_exited.connect(_on_window_focus_exited)
+ _godot_editor_window.mouse_entered.connect(_on_godot_window_entered)
+ _godot_editor_window.focus_entered.connect(_on_godot_focus_entered)
+ _godot_editor_window.focus_exited.connect(_on_godot_focus_exited)
+
+
+func _on_window_input(event: InputEvent) -> void:
+ # Capture CTRL+S when doc focused to save scene)
+ if event is InputEventKey and event.keycode == KEY_S and event.pressed and event.is_command_or_control_pressed():
+ save_editor_settings()
+ plugin.get_editor_interface().save_scene()
+
+
+func _on_window_focus_exited() -> void:
+ # Capture window position w/o other changes
+ save_editor_settings()
+
+
+func _on_godot_window_entered() -> void:
+ if is_instance_valid(window) and window.has_focus():
+ _godot_editor_window.grab_focus()
+
+
+func _on_godot_focus_entered() -> void:
+ # If asset dock is windowed, and Godot was minimized, and now is not, restore asset dock window
+ if is_instance_valid(window):
+ if _godot_last_state == Window.MODE_MINIMIZED and _godot_editor_window.mode != Window.MODE_MINIMIZED:
+ window.show()
+ _godot_last_state = _godot_editor_window.mode
+ _godot_editor_window.grab_focus()
+
+
+func _on_godot_focus_exited() -> void:
+ if is_instance_valid(window) and _godot_editor_window.mode == Window.MODE_MINIMIZED:
+ window.hide()
+ _godot_last_state = _godot_editor_window.mode
+
+
+## Manage Editor Settings
+
+
+func get_setting(p_str: String, p_default: Variant) -> Variant:
+ if editor_settings.has_setting(p_str):
+ return editor_settings.get_setting(p_str)
+ else:
+ return p_default
+
+
+func load_editor_settings() -> void:
+ floating_btn.button_pressed = get_setting(PS_DOCK_FLOATING, false)
+ pinned_btn.button_pressed = get_setting(PS_DOCK_PINNED, true)
+ size_slider.value = get_setting(PS_DOCK_TILE_SIZE, 83)
+ set_slot(get_setting(PS_DOCK_SLOT, POS_BOTTOM))
+ _on_slider_changed(size_slider.value)
+ # Window pos/size set on window creation in update_dock
+ update_dock(plugin.visible)
- if p_resource:
- entry.set_selected(index == selected_index)
- if not p_resource.id_changed.is_connected(set_selected_after_swap):
- p_resource.id_changed.connect(set_selected_after_swap)
- list.add_child(entry)
- entries.push_back(entry)
-
-
-func set_selected_after_swap(p_old_index: int, p_new_index: int) -> void:
- set_selected_index(clamp(p_new_index, 0, entries.size() - 2))
-
-
-func set_selected_index(p_index: int) -> void:
- selected_index = p_index
- emit_signal("resource_selected")
-
- for i in entries.size():
- var entry: ListEntry = entries[i]
- entry.set_selected(i == selected_index)
-
-
-func get_selected_index() -> int:
- return selected_index
-
-
-func notify_resource_inspected(p_resource: Resource) -> void:
- emit_signal("resource_inspected", p_resource)
-
-
-func notify_resource_changed(p_resource: Resource, p_index: int) -> void:
- emit_signal("resource_changed", p_resource, p_index)
- if !p_resource:
- var last_offset: int = 2
- if p_index == entries.size()-2:
- last_offset = 3
- selected_index = clamp(selected_index, 0, entries.size() - last_offset)
+func save_editor_settings() -> void:
+ if not _initialized:
+ return
+ editor_settings.set_setting(PS_DOCK_SLOT, slot)
+ editor_settings.set_setting(PS_DOCK_TILE_SIZE, size_slider.value)
+ editor_settings.set_setting(PS_DOCK_FLOATING, floating_btn.button_pressed)
+ editor_settings.set_setting(PS_DOCK_PINNED, pinned_btn.button_pressed)
+ if window:
+ editor_settings.set_setting(PS_DOCK_WINDOW_SIZE, window.size)
+ editor_settings.set_setting(PS_DOCK_WINDOW_POSITION, window.position)
##############################################################
@@ -122,18 +429,182 @@ func notify_resource_changed(p_resource: Resource, p_index: int) -> void:
class ListContainer extends Container:
+ var plugin: EditorPlugin
+ var type := Terrain3DAssets.TYPE_TEXTURE
+ var entries: Array[ListEntry]
+ var selected_id: int = 0
var height: float = 0
var width: float = 83
+ var focus_style: StyleBox
+
+
+ func _ready() -> void:
+ set_v_size_flags(SIZE_EXPAND_FILL)
+ set_h_size_flags(SIZE_EXPAND_FILL)
+ focus_style = get_theme_stylebox("focus", "Button").duplicate()
+ focus_style.set_border_width_all(2)
+ focus_style.set_border_color(Color(1, 1, 1, .67))
+
+
+ func clear() -> void:
+ for e in entries:
+ e.get_parent().remove_child(e)
+ e.queue_free()
+ entries.clear()
+
+
+ func update_asset_list() -> void:
+ clear()
+
+ # Grab terrain
+ var t: Terrain3D
+ if plugin.is_terrain_valid():
+ t = plugin.terrain
+ elif is_instance_valid(plugin._last_terrain) and plugin.is_terrain_valid(plugin._last_terrain):
+ t = plugin._last_terrain
+ else:
+ return
+
+ if not t.assets:
+ return
+
+ if type == Terrain3DAssets.TYPE_TEXTURE:
+ var texture_count: int = t.assets.get_texture_count()
+ for i in texture_count:
+ var texture: Terrain3DTextureAsset = t.assets.get_texture(i)
+ add_item(texture)
+ if texture_count < Terrain3DAssets.MAX_TEXTURES:
+ add_item()
+ else:
+ var mesh_count: int = t.assets.get_mesh_count()
+ for i in mesh_count:
+ var mesh: Terrain3DMeshAsset = t.assets.get_mesh_asset(i)
+ add_item(mesh, t.assets)
+ if mesh_count < Terrain3DAssets.MAX_MESHES:
+ add_item()
+ if selected_id >= mesh_count or selected_id < 0:
+ set_selected_id(0)
+
+
+ func add_item(p_resource: Resource = null, p_assets: Terrain3DAssets = null) -> void:
+ var entry: ListEntry = ListEntry.new()
+ entry.focus_style = focus_style
+ var id: int = entries.size()
+
+ entry.set_edited_resource(p_resource)
+ entry.hovered.connect(_on_resource_hovered.bind(id))
+ entry.selected.connect(set_selected_id.bind(id))
+ entry.inspected.connect(_on_resource_inspected)
+ entry.changed.connect(_on_resource_changed.bind(id))
+ entry.type = type
+ entry.asset_list = p_assets
+ add_child(entry)
+ entries.push_back(entry)
+
+ if p_resource:
+ entry.set_selected(id == selected_id)
+ if not p_resource.id_changed.is_connected(set_selected_after_swap):
+ p_resource.id_changed.connect(set_selected_after_swap)
+
+
+ func _on_resource_hovered(p_id: int):
+ if type == Terrain3DAssets.TYPE_MESH:
+ if plugin.terrain:
+ plugin.terrain.assets.create_mesh_thumbnails(p_id)
+
+
+ func set_selected_after_swap(p_type: Terrain3DAssets.AssetType, p_old_id: int, p_new_id: int) -> void:
+ set_selected_id(clamp(p_new_id, 0, entries.size() - 2))
+
+
+ func set_selected_id(p_id: int) -> void:
+ selected_id = p_id
+
+ for i in entries.size():
+ var entry: ListEntry = entries[i]
+ entry.set_selected(i == selected_id)
+
+ plugin.select_terrain()
+
+ # Select Paint tool if clicking a texture
+ if type == Terrain3DAssets.TYPE_TEXTURE and plugin.editor.get_tool() != Terrain3DEditor.TEXTURE:
+ var paint_btn: Button = plugin.ui.toolbar.get_node_or_null("PaintBaseTexture")
+ if paint_btn:
+ paint_btn.set_pressed(true)
+ plugin.ui._on_tool_changed(Terrain3DEditor.TEXTURE, Terrain3DEditor.REPLACE)
+
+ elif type == Terrain3DAssets.TYPE_MESH and plugin.editor.get_tool() != Terrain3DEditor.INSTANCER:
+ var instancer_btn: Button = plugin.ui.toolbar.get_node_or_null("InstanceMeshes")
+ if instancer_btn:
+ instancer_btn.set_pressed(true)
+ plugin.ui._on_tool_changed(Terrain3DEditor.INSTANCER, Terrain3DEditor.ADD)
+
+ # Update editor with selected brush
+ plugin.ui._on_setting_changed()
+
+
+ func _on_resource_inspected(p_resource: Resource) -> void:
+ await get_tree().create_timer(.01).timeout
+ plugin.get_editor_interface().edit_resource(p_resource)
- func set_entry_size(value: float) -> void:
- width = clamp(value, 56, 256)
+ func _on_resource_changed(p_resource: Resource, p_id: int) -> void:
+ if not p_resource:
+ var asset_dock: Control = get_parent().get_parent().get_parent()
+ if type == Terrain3DAssets.TYPE_TEXTURE:
+ asset_dock.confirm_dialog.dialog_text = "Are you sure you want to clear this texture?"
+ else:
+ asset_dock.confirm_dialog.dialog_text = "Are you sure you want to clear this mesh and delete all instances?"
+ asset_dock.confirm_dialog.popup_centered()
+ await asset_dock.confirmation_closed
+ if not asset_dock._confirmed:
+ update_asset_list()
+ return
+
+ if not plugin.is_terrain_valid():
+ plugin.select_terrain()
+ await get_tree().create_timer(.01).timeout
+
+ if plugin.is_terrain_valid():
+ if type == Terrain3DAssets.TYPE_TEXTURE:
+ plugin.terrain.get_assets().set_texture(p_id, p_resource)
+ else:
+ plugin.terrain.get_assets().set_mesh_asset(p_id, p_resource)
+ await get_tree().create_timer(.01).timeout
+ plugin.terrain.assets.create_mesh_thumbnails(p_id)
+
+ # If removing an entry, clear inspector
+ if not p_resource:
+ plugin.get_editor_interface().inspect_object(null)
+
+ # If null resource, remove last
+ if not p_resource:
+ var last_offset: int = 2
+ if p_id == entries.size()-2:
+ last_offset = 3
+ set_selected_id(clamp(selected_id, 0, entries.size() - last_offset))
+
+ # Update editor with selected brush
+ plugin.ui._on_setting_changed()
+
+
+ func get_selected_id() -> int:
+ return selected_id
+
+
+
+ func set_entry_width(value: float) -> void:
+ width = clamp(value, 56, 230)
redraw()
+ func get_entry_width() -> float:
+ return width
+
+
func redraw() -> void:
height = 0
- var index: int = 0
+ var id: int = 0
var separation: float = 4
var columns: int = 3
columns = clamp(size.x / width, 1, 100)
@@ -141,12 +612,13 @@ class ListContainer extends Container:
for c in get_children():
if is_instance_valid(c):
c.size = Vector2(width, width) - Vector2(separation, separation)
- c.position = Vector2(index % columns, index / columns) * width + \
+ c.position = Vector2(id % columns, id / columns) * width + \
Vector2(separation / columns, separation / columns)
height = max(height, c.position.y + width)
- index += 1
+ id += 1
+ # Needed to enable ScrollContainer scroll bar
func _get_minimum_size() -> Vector2:
return Vector2(0, height)
@@ -162,14 +634,18 @@ class ListContainer extends Container:
class ListEntry extends VBoxContainer:
+ signal hovered()
signal selected()
- signal changed(resource: Terrain3DTexture)
- signal inspected(resource: Terrain3DTexture)
+ signal changed(resource: Resource)
+ signal inspected(resource: Resource)
- var resource: Terrain3DTexture
+ var resource: Resource
+ var type := Terrain3DAssets.TYPE_TEXTURE
+ var _thumbnail: Texture2D
var drop_data: bool = false
var is_hovered: bool = false
var is_selected: bool = false
+ var asset_list: Terrain3DAssets
var button_clear: TextureButton
var button_edit: TextureButton
@@ -180,7 +656,7 @@ class ListEntry extends VBoxContainer:
@onready var edit_icon: Texture2D = get_theme_icon("Edit", "EditorIcons")
@onready var background: StyleBox = get_theme_stylebox("pressed", "Button")
var focus_style: StyleBox
-
+
func _ready() -> void:
var icon_size: Vector2 = Vector2(12, 12)
@@ -213,8 +689,11 @@ class ListEntry extends VBoxContainer:
name_label.add_theme_font_size_override("font_size", 15)
name_label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
name_label.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
- name_label.text = "Add New"
-
+ if type == Terrain3DAssets.TYPE_TEXTURE:
+ name_label.text = "Add Texture"
+ else:
+ name_label.text = "Add Mesh"
+
func _notification(p_what) -> void:
match p_what:
@@ -224,22 +703,33 @@ class ListEntry extends VBoxContainer:
draw_style_box(background, rect)
draw_texture(add_icon, (get_size() / 2) - (add_icon.get_size() / 2))
else:
- name_label.text = resource.get_name()
- self_modulate = resource.get_albedo_color()
- var texture: Texture2D = resource.get_albedo_texture()
- if texture:
- draw_texture_rect(texture, rect, false)
- texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST_WITH_MIPMAPS
+ if type == Terrain3DAssets.TYPE_TEXTURE:
+ name_label.text = (resource as Terrain3DTextureAsset).get_name()
+ self_modulate = resource.get_albedo_color()
+ _thumbnail = resource.get_albedo_texture()
+ if _thumbnail:
+ draw_texture_rect(_thumbnail, rect, false)
+ texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST_WITH_MIPMAPS
+ else:
+ name_label.text = (resource as Terrain3DMeshAsset).get_name()
+ var id: int = (resource as Terrain3DMeshAsset).get_id()
+ _thumbnail = resource.get_thumbnail()
+ if _thumbnail:
+ draw_texture_rect(_thumbnail, rect, false)
+ texture_filter = CanvasItem.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS
+ else:
+ draw_rect(rect, Color(.15, .15, .15, 1.))
name_label.add_theme_font_size_override("font_size", 4 + rect.size.x/10)
if drop_data:
draw_style_box(focus_style, rect)
if is_hovered:
- draw_rect(rect, Color(1,1,1,0.2))
+ draw_rect(rect, Color(1, 1, 1, 0.2))
if is_selected:
draw_style_box(focus_style, rect)
NOTIFICATION_MOUSE_ENTER:
is_hovered = true
name_label.visible = true
+ emit_signal("hovered")
queue_redraw()
NOTIFICATION_MOUSE_EXIT:
is_hovered = false
@@ -255,7 +745,10 @@ class ListEntry extends VBoxContainer:
MOUSE_BUTTON_LEFT:
# If `Add new` is clicked
if !resource:
- set_edited_resource(Terrain3DTexture.new(), false)
+ if type == Terrain3DAssets.TYPE_TEXTURE:
+ set_edited_resource(Terrain3DTextureAsset.new(), false)
+ else:
+ set_edited_resource(Terrain3DMeshAsset.new(), false)
edit()
else:
emit_signal("selected")
@@ -279,19 +772,38 @@ class ListEntry extends VBoxContainer:
func _drop_data(p_at_position: Vector2, p_data: Variant) -> void:
if typeof(p_data) == TYPE_DICTIONARY:
var res: Resource = load(p_data.files[0])
- if res is Terrain3DTexture:
+ if res is Texture2D and type == Terrain3DAssets.TYPE_TEXTURE:
+ var ta := Terrain3DTextureAsset.new()
+ if resource is Terrain3DTextureAsset:
+ ta.id = resource.id
+ ta.set_albedo_texture(res)
+ set_edited_resource(ta, false)
+ resource = ta
+ elif res is Terrain3DTextureAsset and type == Terrain3DAssets.TYPE_TEXTURE:
+ if resource is Terrain3DTextureAsset:
+ res.id = resource.id
set_edited_resource(res, false)
- if res is Texture2D:
- var surf: Terrain3DTexture = Terrain3DTexture.new()
- surf.set_albedo_texture(res)
- set_edited_resource(surf, false)
+ elif res is PackedScene and type == Terrain3DAssets.TYPE_MESH:
+ var ma := Terrain3DMeshAsset.new()
+ if resource is Terrain3DMeshAsset:
+ ma.id = resource.id
+ ma.set_scene_file(res)
+ set_edited_resource(ma, false)
+ resource = ma
+ elif res is Terrain3DMeshAsset and type == Terrain3DAssets.TYPE_MESH:
+ if resource is Terrain3DMeshAsset:
+ res.id = resource.id
+ set_edited_resource(res, false)
+ emit_signal("selected")
+ emit_signal("inspected", resource)
-
- func set_edited_resource(p_res: Terrain3DTexture, p_no_signal: bool = true) -> void:
+
+
+ func set_edited_resource(p_res: Resource, p_no_signal: bool = true) -> void:
resource = p_res
if resource:
- resource.setting_changed.connect(_on_texture_changed)
- resource.file_changed.connect(_on_texture_changed)
+ resource.setting_changed.connect(_on_resource_changed)
+ resource.file_changed.connect(_on_resource_changed)
if button_clear:
button_clear.set_visible(resource != null)
@@ -301,7 +813,7 @@ class ListEntry extends VBoxContainer:
emit_signal("changed", resource)
- func _on_texture_changed() -> void:
+ func _on_resource_changed() -> void:
emit_signal("changed", resource)
diff --git a/addons/terrain_3d/src/asset_dock.tscn b/addons/terrain_3d/src/asset_dock.tscn
index d9bc025..16a0586 100644
--- a/addons/terrain_3d/src/asset_dock.tscn
+++ b/addons/terrain_3d/src/asset_dock.tscn
@@ -3,26 +3,45 @@
[ext_resource type="Script" path="res://addons/terrain_3d/src/asset_dock.gd" id="1_e23pg"]
[node name="Terrain3D" type="PanelContainer"]
-custom_minimum_size = Vector2(256, 136)
-offset_right = 256.0
-offset_bottom = 128.0
+custom_minimum_size = Vector2(256, 95)
+offset_right = 766.0
+offset_bottom = 100.0
script = ExtResource("1_e23pg")
-[node name="VBox" type="VBoxContainer" parent="."]
+[node name="Box" type="BoxContainer" parent="."]
+layout_mode = 2
+size_flags_vertical = 3
+vertical = true
+
+[node name="Buttons" type="BoxContainer" parent="Box"]
layout_mode = 2
-[node name="PlacementHBox" type="HBoxContainer" parent="VBox"]
-layout_mode = 2
-
-[node name="Label" type="Label" parent="VBox/PlacementHBox"]
-layout_mode = 2
-text = "Dock Position: "
-
-[node name="Options" type="OptionButton" parent="VBox/PlacementHBox"]
+[node name="TexturesBtn" type="Button" parent="Box/Buttons"]
+custom_minimum_size = Vector2(80, 30)
layout_mode = 2
size_flags_horizontal = 3
+size_flags_vertical = 0
+theme_override_font_sizes/font_size = 16
+toggle_mode = true
+button_pressed = true
+text = "Textures"
+
+[node name="MeshesBtn" type="Button" parent="Box/Buttons"]
+custom_minimum_size = Vector2(80, 30)
+layout_mode = 2
+size_flags_horizontal = 3
+size_flags_vertical = 0
+theme_override_font_sizes/font_size = 16
+toggle_mode = true
+text = "Meshes"
+
+[node name="PlacementOpt" type="OptionButton" parent="Box/Buttons"]
+custom_minimum_size = Vector2(80, 30)
+layout_mode = 2
+size_flags_horizontal = 3
+size_flags_vertical = 0
item_count = 9
-selected = 5
+selected = 7
popup/item_0/text = "Left_UL"
popup/item_0/id = 0
popup/item_1/text = "Left_BL"
@@ -42,28 +61,33 @@ popup/item_7/id = 7
popup/item_8/text = "Bottom"
popup/item_8/id = 8
-[node name="Pinned" type="Button" parent="VBox/PlacementHBox"]
+[node name="SizeSlider" type="HSlider" parent="Box/Buttons"]
+custom_minimum_size = Vector2(80, 10)
layout_mode = 2
-tooltip_text = "Keep panel visible even if Terrain3D is not selected. Useful for keeping dock floating."
+size_flags_horizontal = 3
+min_value = 56.0
+max_value = 230.0
+value = 83.0
+
+[node name="Floating" type="Button" parent="Box/Buttons"]
+layout_mode = 2
+size_flags_horizontal = 0
+size_flags_vertical = 0
+tooltip_text = "Pop this dock out to a floating window."
+toggle_mode = true
+text = "F"
+flat = true
+
+[node name="Pinned" type="Button" parent="Box/Buttons"]
+layout_mode = 2
+size_flags_horizontal = 0
+size_flags_vertical = 0
+tooltip_text = "Make this window \"Always on top\"."
toggle_mode = true
text = "P"
flat = true
-[node name="Label" type="Label" parent="VBox"]
-layout_mode = 2
-theme_override_font_sizes/font_size = 16
-text = "Textures"
-horizontal_alignment = 1
-vertical_alignment = 1
-
-[node name="SizeSlider" type="HSlider" parent="VBox"]
-custom_minimum_size = Vector2(100, 10)
-layout_mode = 2
-min_value = 56.0
-max_value = 256.0
-value = 83.0
-
-[node name="ScrollContainer" type="ScrollContainer" parent="VBox"]
+[node name="ScrollContainer" type="ScrollContainer" parent="Box"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
diff --git a/addons/terrain_3d/src/baker.gd b/addons/terrain_3d/src/baker.gd
index a4cb99a..0a53ba4 100644
--- a/addons/terrain_3d/src/baker.gd
+++ b/addons/terrain_3d/src/baker.gd
@@ -193,7 +193,7 @@ func _bake_nav_region_nav_mesh(p_nav_region: NavigationRegion3D) -> void:
aabb = p_nav_region.global_transform * aabb
var faces: PackedVector3Array = terrain.generate_nav_mesh_source_geometry(aabb)
if not faces.is_empty():
- source_geometry_data.add_faces(faces, p_nav_region.global_transform.inverse())
+ source_geometry_data.add_faces(faces, Transform3D.IDENTITY)
NavigationMeshGenerator.bake_from_source_geometry_data(nav_mesh, source_geometry_data)
diff --git a/addons/terrain_3d/src/multi_picker.gd b/addons/terrain_3d/src/multi_picker.gd
index 01abd3e..aa228bd 100644
--- a/addons/terrain_3d/src/multi_picker.gd
+++ b/addons/terrain_3d/src/multi_picker.gd
@@ -5,8 +5,8 @@ signal pressed
signal value_changed
-const ICON_PICKER: String = "res://addons/terrain_3d/icons/icon_picker.svg"
-const ICON_PICKER_CHECKED: String = "res://addons/terrain_3d/icons/icon_picker_checked.svg"
+const ICON_PICKER: String = "res://addons/terrain_3d/icons/picker.svg"
+const ICON_PICKER_CHECKED: String = "res://addons/terrain_3d/icons/picker_checked.svg"
const MAX_POINTS: int = 2
diff --git a/addons/terrain_3d/src/terrain_tools.gd b/addons/terrain_3d/src/terrain_tools.gd
index f99b0aa..91efc3c 100644
--- a/addons/terrain_3d/src/terrain_tools.gd
+++ b/addons/terrain_3d/src/terrain_tools.gd
@@ -39,6 +39,12 @@ func _enter_tree() -> void:
add_child(menu_button)
+func _exit_tree() -> void:
+ # TODO: If packer isn't freed, Godot complains about ObjectDB instances leaked and
+ # resources still in use at exit. Figure out why.
+ packer.free()
+
+
func _on_menu_pressed(p_id: int) -> void:
match p_id:
MENU_BAKE_ARRAY_MESH:
diff --git a/addons/terrain_3d/src/tool_settings.gd b/addons/terrain_3d/src/tool_settings.gd
index 00328e1..ad9a195 100644
--- a/addons/terrain_3d/src/tool_settings.gd
+++ b/addons/terrain_3d/src/tool_settings.gd
@@ -23,7 +23,7 @@ enum SettingType {
const MultiPicker: Script = preload("res://addons/terrain_3d/src/multi_picker.gd")
const DEFAULT_BRUSH: String = "circle0.exr"
const BRUSH_PATH: String = "res://addons/terrain_3d/brushes"
-const PICKER_ICON: String = "res://addons/terrain_3d/icons/icon_picker.svg"
+const PICKER_ICON: String = "res://addons/terrain_3d/icons/picker.svg"
# Add settings flags
const NONE: int = 0x0
@@ -103,6 +103,41 @@ func _ready() -> void:
add_setting({ "name":"drawable", "type":SettingType.CHECKBOX, "list":main_list, "default":false,
"flags":ADD_SEPARATOR })
settings["drawable"].toggled.connect(_on_drawable_toggled)
+
+ ## Instancer
+ height_list = create_submenu(main_list, "Height", Layout.VERTICAL)
+ add_setting({ "name":"height_offset", "type":SettingType.SLIDER, "list":height_list, "default":0,
+ "unit":"m", "range":Vector3(-10, 10, 0.05), "flags":ALLOW_OUT_OF_BOUNDS })
+ add_setting({ "name":"random_height", "label":"Random Height ±", "type":SettingType.SLIDER,
+ "list":height_list, "default":0, "unit":"m", "range":Vector3(0, 10, 0.05),
+ "flags":ALLOW_OUT_OF_BOUNDS })
+
+ scale_list = create_submenu(main_list, "Scale", Layout.VERTICAL)
+ add_setting({ "name":"fixed_scale", "type":SettingType.SLIDER, "list":scale_list, "default":100,
+ "unit":"%", "range":Vector3(1, 1000, 1), "flags":ALLOW_OUT_OF_BOUNDS })
+ add_setting({ "name":"random_scale", "label":"Random Scale ±", "type":SettingType.SLIDER, "list":scale_list,
+ "default":20, "unit":"%", "range":Vector3(0, 99, 1), "flags":ALLOW_OUT_OF_BOUNDS })
+
+ rotation_list = create_submenu(main_list, "Rotation", Layout.VERTICAL)
+ add_setting({ "name":"fixed_spin", "label":"Fixed Spin (Around Y)", "type":SettingType.SLIDER, "list":rotation_list,
+ "default":0, "unit":"°", "range":Vector3(0, 360, 1) })
+ add_setting({ "name":"random_spin", "type":SettingType.SLIDER, "list":rotation_list, "default":360,
+ "unit":"°", "range":Vector3(0, 360, 1) })
+ add_setting({ "name":"fixed_angle", "label":"Fixed Angle (From Y)", "type":SettingType.SLIDER, "list":rotation_list,
+ "default":0, "unit":"°", "range":Vector3(-85, 85, 1), "flags":ALLOW_OUT_OF_BOUNDS })
+ add_setting({ "name":"random_angle", "label":"Random Angle ±", "type":SettingType.SLIDER, "list":rotation_list,
+ "default":10, "unit":"°", "range":Vector3(0, 85, 1), "flags":ALLOW_OUT_OF_BOUNDS })
+ add_setting({ "name":"align_to_normal", "type":SettingType.CHECKBOX, "list":rotation_list, "default":false })
+
+ color_list = create_submenu(main_list, "Color", Layout.VERTICAL)
+ add_setting({ "name":"vertex_color", "type":SettingType.COLOR_SELECT, "list":color_list,
+ "default":Color.WHITE })
+ add_setting({ "name":"random_hue", "label":"Random Hue Shift ±", "type":SettingType.SLIDER,
+ "list":color_list, "default":0, "unit":"°", "range":Vector3(0, 360, 1) })
+ add_setting({ "name":"random_darken", "type":SettingType.SLIDER, "list":color_list, "default":50,
+ "unit":"%", "range":Vector3(0, 100, 1) })
+ #add_setting({ "name":"blend_mode", "type":SettingType.OPTION, "list":color_list, "default":0,
+ #"range":Vector3(0, 3, 1) })
var spacer: Control = Control.new()
spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL
@@ -135,10 +170,10 @@ func create_submenu(p_parent: Control, p_button_name: String, p_layout: Layout)
var panel_style: StyleBox = get_theme_stylebox("panel", "PopupMenu").duplicate()
panel_style.set_content_margin_all(10)
submenu.set("theme_override_styles/panel", panel_style)
+ submenu.add_to_group("terrain3d_submenus")
# Pop up menu on hover, hide on exit
menu_button.mouse_entered.connect(_on_show_submenu.bind(true, menu_button))
- menu_button.mouse_exited.connect(_on_show_submenu.bind(false, menu_button))
submenu.mouse_exited.connect(_on_show_submenu.bind(false, menu_button))
var sublist: Container
@@ -171,6 +206,8 @@ func _on_show_submenu(p_toggled: bool, p_button: Button) -> void:
if not p_toggled and ( in_button or in_panel ):
return
+ # Hide all submenus before possibly enabling the current one
+ get_tree().call_group("terrain3d_submenus", "set_visible", false)
var popup: PopupPanel = p_button.get_child(0)
var popup_pos: Vector2 = p_button.get_screen_transform().origin
popup.set_visible(p_toggled)
@@ -326,6 +363,7 @@ func add_setting(p_args: Dictionary) -> void:
SettingType.PICKER:
var button := Button.new()
+ button.set_v_size_flags(SIZE_SHRINK_CENTER)
button.icon = load(PICKER_ICON)
button.tooltip_text = "Pick value from the Terrain"
button.pressed.connect(_on_pick.bind(p_default))
@@ -361,7 +399,6 @@ func add_setting(p_args: Dictionary) -> void:
spin_slider.set_step(p_step)
spin_slider.set_value(p_default)
spin_slider.set_suffix(p_suffix)
- spin_slider.set_h_size_flags(SIZE_SHRINK_CENTER)
spin_slider.set_v_size_flags(SIZE_SHRINK_CENTER)
spin_slider.set_custom_minimum_size(Vector2(75, 0))
@@ -378,8 +415,6 @@ func add_setting(p_args: Dictionary) -> void:
else: # DOUBLE_SLIDER
var label := Label.new()
- label.set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER)
- label.set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER)
label.set_custom_minimum_size(Vector2(75, 0))
slider = DoubleSlider.new()
slider.label = label
@@ -394,7 +429,6 @@ func add_setting(p_args: Dictionary) -> void:
slider.set_step(p_step)
slider.set_value(p_default)
slider.set_v_size_flags(SIZE_SHRINK_CENTER)
- slider.set_h_size_flags(SIZE_SHRINK_END | SIZE_EXPAND)
slider.set_custom_minimum_size(Vector2(60, 10))
control.name = p_name.to_pascal_case()
diff --git a/addons/terrain_3d/src/toolbar.gd b/addons/terrain_3d/src/toolbar.gd
index c177edb..4128400 100644
--- a/addons/terrain_3d/src/toolbar.gd
+++ b/addons/terrain_3d/src/toolbar.gd
@@ -3,22 +3,23 @@ extends VBoxContainer
signal tool_changed(p_tool: Terrain3DEditor.Tool, p_operation: Terrain3DEditor.Operation)
-const ICON_REGION_ADD: String = "res://addons/terrain_3d/icons/icon_map_add.svg"
-const ICON_REGION_REMOVE: String = "res://addons/terrain_3d/icons/icon_map_remove.svg"
-const ICON_HEIGHT_ADD: String = "res://addons/terrain_3d/icons/icon_height_add.svg"
-const ICON_HEIGHT_SUB: String = "res://addons/terrain_3d/icons/icon_height_sub.svg"
-const ICON_HEIGHT_MUL: String = "res://addons/terrain_3d/icons/icon_height_mul.svg"
-const ICON_HEIGHT_DIV: String = "res://addons/terrain_3d/icons/icon_height_div.svg"
-const ICON_HEIGHT_FLAT: String = "res://addons/terrain_3d/icons/icon_height_flat.svg"
-const ICON_HEIGHT_SLOPE: String = "res://addons/terrain_3d/icons/icon_height_slope.svg"
-const ICON_HEIGHT_SMOOTH: String = "res://addons/terrain_3d/icons/icon_height_smooth.svg"
-const ICON_PAINT_TEXTURE: String = "res://addons/terrain_3d/icons/icon_brush.svg"
-const ICON_SPRAY_TEXTURE: String = "res://addons/terrain_3d/icons/icon_spray.svg"
-const ICON_COLOR: String = "res://addons/terrain_3d/icons/icon_color.svg"
-const ICON_WETNESS: String = "res://addons/terrain_3d/icons/icon_wetness.svg"
-const ICON_AUTOSHADER: String = "res://addons/terrain_3d/icons/icon_terrain_material.svg"
-const ICON_HOLES: String = "res://addons/terrain_3d/icons/icon_holes.svg"
-const ICON_NAVIGATION: String = "res://addons/terrain_3d/icons/icon_navigation.svg"
+const ICON_REGION_ADD: String = "res://addons/terrain_3d/icons/region_add.svg"
+const ICON_REGION_REMOVE: String = "res://addons/terrain_3d/icons/region_remove.svg"
+const ICON_HEIGHT_ADD: String = "res://addons/terrain_3d/icons/height_add.svg"
+const ICON_HEIGHT_SUB: String = "res://addons/terrain_3d/icons/height_sub.svg"
+const ICON_HEIGHT_MUL: String = "res://addons/terrain_3d/icons/height_mul.svg"
+const ICON_HEIGHT_DIV: String = "res://addons/terrain_3d/icons/height_div.svg"
+const ICON_HEIGHT_FLAT: String = "res://addons/terrain_3d/icons/height_flat.svg"
+const ICON_HEIGHT_SLOPE: String = "res://addons/terrain_3d/icons/height_slope.svg"
+const ICON_HEIGHT_SMOOTH: String = "res://addons/terrain_3d/icons/height_smooth.svg"
+const ICON_PAINT_TEXTURE: String = "res://addons/terrain_3d/icons/texture_paint.svg"
+const ICON_SPRAY_TEXTURE: String = "res://addons/terrain_3d/icons/texture_spray.svg"
+const ICON_COLOR: String = "res://addons/terrain_3d/icons/color_paint.svg"
+const ICON_WETNESS: String = "res://addons/terrain_3d/icons/wetness.svg"
+const ICON_AUTOSHADER: String = "res://addons/terrain_3d/icons/autoshader.svg"
+const ICON_HOLES: String = "res://addons/terrain_3d/icons/holes.svg"
+const ICON_NAVIGATION: String = "res://addons/terrain_3d/icons/navigation.svg"
+const ICON_INSTANCER: String = "res://addons/terrain_3d/icons/multimesh.svg"
var tool_group: ButtonGroup = ButtonGroup.new()
@@ -31,7 +32,7 @@ func _ready() -> void:
tool_group.connect("pressed", _on_tool_selected)
add_tool_button(Terrain3DEditor.REGION, Terrain3DEditor.ADD, "Add Region", load(ICON_REGION_ADD), tool_group)
- add_tool_button(Terrain3DEditor.REGION, Terrain3DEditor.SUBTRACT, "Delete Region", load(ICON_REGION_REMOVE), tool_group)
+ add_tool_button(Terrain3DEditor.REGION, Terrain3DEditor.SUBTRACT, "Remove Region", load(ICON_REGION_REMOVE), tool_group)
add_child(HSeparator.new())
add_tool_button(Terrain3DEditor.HEIGHT, Terrain3DEditor.ADD, "Raise", load(ICON_HEIGHT_ADD), tool_group)
add_tool_button(Terrain3DEditor.HEIGHT, Terrain3DEditor.SUBTRACT, "Lower", load(ICON_HEIGHT_SUB), tool_group)
@@ -50,6 +51,7 @@ func _ready() -> void:
add_child(HSeparator.new())
add_tool_button(Terrain3DEditor.HOLES, Terrain3DEditor.REPLACE, "Create Holes", load(ICON_HOLES), tool_group)
add_tool_button(Terrain3DEditor.NAVIGATION, Terrain3DEditor.REPLACE, "Paint Navigable Area", load(ICON_NAVIGATION), tool_group)
+ add_tool_button(Terrain3DEditor.INSTANCER, Terrain3DEditor.ADD, "Instance Meshes", load(ICON_INSTANCER), tool_group)
var buttons: Array[BaseButton] = tool_group.get_buttons()
buttons[0].set_pressed(true)
diff --git a/addons/terrain_3d/src/ui.gd b/addons/terrain_3d/src/ui.gd
index 236eb4d..bc6df8a 100644
--- a/addons/terrain_3d/src/ui.gd
+++ b/addons/terrain_3d/src/ui.gd
@@ -21,6 +21,7 @@ const COLOR_ROUGHNESS := Color.ROYAL_BLUE
const COLOR_AUTOSHADER := Color.DODGER_BLUE
const COLOR_HOLES := Color.BLACK
const COLOR_NAVIGATION := Color.REBECCA_PURPLE
+const COLOR_INSTANCER := Color.CRIMSON
const COLOR_PICK_COLOR := Color.WHITE
const COLOR_PICK_HEIGHT := Color.DARK_RED
const COLOR_PICK_ROUGH := Color.ROYAL_BLUE
@@ -95,8 +96,18 @@ func set_visible(p_visible: bool) -> void:
update_decal()
+func set_menu_visibility(p_list: Control, p_visible: bool) -> void:
+ if p_list:
+ p_list.get_parent().get_parent().visible = p_visible
+
+
func _on_tool_changed(p_tool: Terrain3DEditor.Tool, p_operation: Terrain3DEditor.Operation) -> void:
clear_picking()
+ set_menu_visibility(toolbar_settings.advanced_list, true)
+ set_menu_visibility(toolbar_settings.scale_list, false)
+ set_menu_visibility(toolbar_settings.rotation_list, false)
+ set_menu_visibility(toolbar_settings.height_list, false)
+ set_menu_visibility(toolbar_settings.color_list, false)
# Select which settings to show. Options in tool_settings.gd:_ready
var to_show: PackedStringArray = []
@@ -146,6 +157,27 @@ func _on_tool_changed(p_tool: Terrain3DEditor.Tool, p_operation: Terrain3DEditor
to_show.push_back("size")
to_show.push_back("enable")
+ Terrain3DEditor.INSTANCER:
+ to_show.push_back("size")
+ to_show.push_back("strength")
+ to_show.push_back("enable")
+ set_menu_visibility(toolbar_settings.height_list, true)
+ to_show.push_back("height_offset")
+ to_show.push_back("random_height")
+ set_menu_visibility(toolbar_settings.scale_list, true)
+ to_show.push_back("fixed_scale")
+ to_show.push_back("random_scale")
+ set_menu_visibility(toolbar_settings.rotation_list, true)
+ to_show.push_back("fixed_spin")
+ to_show.push_back("random_spin")
+ to_show.push_back("fixed_angle")
+ to_show.push_back("random_angle")
+ to_show.push_back("align_to_normal")
+ set_menu_visibility(toolbar_settings.color_list, true)
+ to_show.push_back("vertex_color")
+ to_show.push_back("random_darken")
+ to_show.push_back("random_hue")
+
_:
pass
@@ -174,8 +206,7 @@ func _on_setting_changed() -> void:
if not plugin.asset_dock:
return
brush_data = toolbar_settings.get_settings()
- brush_data["strength"] /= 100.0
- brush_data["texture_index"] = plugin.asset_dock.get_selected_index()
+ brush_data["asset_id"] = plugin.asset_dock.get_current_list().get_selected_id()
update_decal()
plugin.editor.set_brush_data(brush_data)
@@ -239,7 +270,7 @@ func update_decal() -> void:
decal.modulate = COLOR_SLOPE
_:
decal.modulate = Color.WHITE
- decal.modulate.a = max(.3, brush_data["strength"])
+ decal.modulate.a = max(.3, brush_data["strength"] * .01)
Terrain3DEditor.TEXTURE:
match plugin.editor.get_operation():
Terrain3DEditor.REPLACE:
@@ -247,15 +278,15 @@ func update_decal() -> void:
decal.modulate.a = 1.0
Terrain3DEditor.ADD:
decal.modulate = COLOR_SPRAY
- decal.modulate.a = max(.3, brush_data["strength"])
+ decal.modulate.a = max(.3, brush_data["strength"] * .01)
_:
decal.modulate = Color.WHITE
Terrain3DEditor.COLOR:
decal.modulate = brush_data["color"].srgb_to_linear()*.5
- decal.modulate.a = max(.3, brush_data["strength"])
+ decal.modulate.a = max(.3, brush_data["strength"] * .01)
Terrain3DEditor.ROUGHNESS:
decal.modulate = COLOR_ROUGHNESS
- decal.modulate.a = max(.3, brush_data["strength"])
+ decal.modulate.a = max(.3, brush_data["strength"] * .01)
Terrain3DEditor.AUTOSHADER:
decal.modulate = COLOR_AUTOSHADER
decal.modulate.a = 1.0
@@ -265,9 +296,13 @@ func update_decal() -> void:
Terrain3DEditor.NAVIGATION:
decal.modulate = COLOR_NAVIGATION
decal.modulate.a = 1.0
+ Terrain3DEditor.INSTANCER:
+ decal.texture_albedo = ring_texture
+ decal.modulate = COLOR_INSTANCER
+ decal.modulate.a = 1.0
_:
decal.modulate = Color.WHITE
- decal.modulate.a = max(.3, brush_data["strength"])
+ decal.modulate.a = max(.3, brush_data["strength"] * .01)
decal.size.y = max(1000, decal.size.y)
decal.albedo_mix = 1.0
decal.cull_mask = 1 << ( plugin.terrain.get_mouse_layer() - 1 )
diff --git a/addons/terrain_3d/terrain.gdextension b/addons/terrain_3d/terrain.gdextension
index 2494546..d24ffba 100644
--- a/addons/terrain_3d/terrain.gdextension
+++ b/addons/terrain_3d/terrain.gdextension
@@ -3,6 +3,10 @@
entry_symbol = "terrain_3d_init"
compatibility_minimum = 4.2
+[icons]
+
+Terrain3D = "res://addons/terrain_3d/icons/terrain3d.svg"
+
[libraries]
windows.debug.x86_64 = "res://addons/terrain_3d/bin/libterrain.windows.debug.x86_64.dll"
diff --git a/addons/terrain_3d/tools/importer.gd b/addons/terrain_3d/tools/importer.gd
index 5eef545..b563844 100644
--- a/addons/terrain_3d/tools/importer.gd
+++ b/addons/terrain_3d/tools/importer.gd
@@ -19,7 +19,7 @@ func reset_settings(p_value) -> void:
r16_size = Vector2i(1024, 1024)
storage = null
material = null
- texture_list = null
+ assets = null
func reset_terrain(p_value) -> void:
@@ -63,7 +63,7 @@ func start_import(p_value: bool) -> void:
if color_file_name:
img = Terrain3DUtil.load_image(color_file_name, ResourceLoader.CACHE_MODE_IGNORE)
imported_images[Terrain3DStorage.TYPE_COLOR] = img
- if texture_list.get_texture_count() == 0:
+ if assets.get_texture_count() == 0:
material.show_checkered = false
material.show_colormap = true
storage.import_images(imported_images, import_position, import_offset, import_scale)
diff --git a/addons/terrain_3d/tools/importer.tscn b/addons/terrain_3d/tools/importer.tscn
index ce4d9e7..cfa152c 100644
--- a/addons/terrain_3d/tools/importer.tscn
+++ b/addons/terrain_3d/tools/importer.tscn
@@ -7,10 +7,10 @@
[sub_resource type="Terrain3DMaterial" id="Terrain3DMaterial_cjpaa"]
show_checkered = true
-[sub_resource type="Terrain3DTextureList" id="Terrain3DTextureList_yjkn1"]
+[sub_resource type="Terrain3DAssets" id="Terrain3DAssets_gbxcd"]
[node name="Importer" type="Terrain3D"]
storage = SubResource("Terrain3DStorage_rmuvl")
material = SubResource("Terrain3DMaterial_cjpaa")
-texture_list = SubResource("Terrain3DTextureList_yjkn1")
+assets = SubResource("Terrain3DAssets_gbxcd")
script = ExtResource("1_60b8f")
diff --git a/addons/terrain_3d/utils/terrain_3d_objects.gd b/addons/terrain_3d/utils/terrain_3d_objects.gd
index 210742b..55d338b 100644
--- a/addons/terrain_3d/utils/terrain_3d_objects.gd
+++ b/addons/terrain_3d/utils/terrain_3d_objects.gd
@@ -7,15 +7,25 @@ const TransformChangedNotifier: Script = preload("res://addons/terrain_3d/utils/
const CHILD_HELPER_NAME: StringName = &"TransformChangedSignaller"
const CHILD_HELPER_PATH: NodePath = ^"TransformChangedSignaller"
-var _editor_interface = null
var _undo_redo = null
var _terrain_id: int
var _offsets: Dictionary # Object ID -> Vector3(X, Y offset relative to terrain height, Z)
var _ignore_transform_change: bool = false
+func _enter_tree() -> void:
+ if not Engine.is_editor_hint():
+ return
+
+ for child in get_children():
+ _on_child_entered_tree(child)
+
+ child_entered_tree.connect(_on_child_entered_tree)
+ child_exiting_tree.connect(_on_child_exiting_tree)
+
+
func _exit_tree() -> void:
- if not Engine.is_editor_hint() or not _editor_interface:
+ if not Engine.is_editor_hint():
return
child_entered_tree.disconnect(_on_child_entered_tree)
@@ -26,23 +36,13 @@ func _exit_tree() -> void:
func editor_setup(p_plugin) -> void:
- if _editor_interface:
- return
-
- _editor_interface = p_plugin.get_editor_interface()
_undo_redo = p_plugin.get_undo_redo()
-
- for child in get_children():
- _on_child_entered_tree(child)
-
- child_entered_tree.connect(_on_child_entered_tree)
- child_exiting_tree.connect(_on_child_exiting_tree)
func get_terrain() -> Terrain3D:
var terrain := instance_from_id(_terrain_id) as Terrain3D
if not terrain or terrain.is_queued_for_deletion() or not terrain.is_inside_tree():
- var terrains: Array[Node] = _editor_interface.get_edited_scene_root().find_children("", "Terrain3D")
+ var terrains: Array[Node] = EditorInterface.get_edited_scene_root().find_children("", "Terrain3D")
if terrains.size() > 0:
terrain = terrains[0]
_terrain_id = terrain.get_instance_id() if terrain else 0
@@ -74,14 +74,21 @@ func _on_child_entered_tree(p_node: Node) -> void:
helper = TransformChangedNotifier.new()
helper.name = CHILD_HELPER_NAME
p_node.add_child(helper, true, INTERNAL_MODE_BACK)
- helper.transform_changed.connect(_on_child_transform_changed.bind(p_node))
assert(p_node.has_node(CHILD_HELPER_PATH))
- var id: int = p_node.get_instance_id()
- if not _offsets.has(id):
- _update_child_offset(p_node)
- else:
- _update_child_position(p_node)
+ # When reparenting a Node3D, Godot changes its transform _after_ reparenting it. So here,
+ # we must use call_deferred, to avoid receiving transform_changed as a result of reparenting.
+ _setup_child_signal.call_deferred(p_node, helper)
+
+
+func _setup_child_signal(p_node: Node, helper: TransformChangedNotifier) -> void:
+ if not p_node.is_inside_tree():
+ return
+ if helper.transform_changed.is_connected(_on_child_transform_changed):
+ return
+
+ helper.transform_changed.connect(_on_child_transform_changed.bind(p_node))
+ _update_child_offset(p_node)
func _on_child_exiting_tree(p_node: Node) -> void:
@@ -90,12 +97,15 @@ func _on_child_exiting_tree(p_node: Node) -> void:
var helper: TransformChangedNotifier = p_node.get_node_or_null(CHILD_HELPER_PATH)
if helper:
+ helper.transform_changed.disconnect(_on_child_transform_changed)
p_node.remove_child(helper)
helper.queue_free()
+
+ _offsets.erase(p_node.get_instance_id())
func _is_node_selected(p_node: Node) -> bool:
- var editor_sel = _editor_interface.get_selection()
+ var editor_sel = EditorInterface.get_selection()
return editor_sel.get_transformable_selected_nodes().has(p_node)
@@ -129,19 +139,20 @@ func _on_child_transform_changed(p_node: Node3D) -> void:
# Make sure that when the user undo's the translation, the offset change gets undone too!
_undo_redo.create_action("Translate", UndoRedo.MERGE_ALL)
- _undo_redo.add_do_property(self, &"_ignore_transform_change", true)
- _undo_redo.add_undo_property(self, &"_ignore_transform_change", true)
- _undo_redo.add_do_property(p_node, &"global_position", new_position)
- _undo_redo.add_undo_property(p_node, &"global_position", old_position)
- _undo_redo.add_do_method(self, &"_set_offset", p_node.get_instance_id(), new_offset)
- _undo_redo.add_undo_method(self, &"_set_offset", p_node.get_instance_id(), old_offset)
- _undo_redo.add_do_property(self, &"_ignore_transform_change", false)
- _undo_redo.add_undo_property(self, &"_ignore_transform_change", false)
+ _undo_redo.add_do_method(self, &"_set_offset_and_position", p_node.get_instance_id(), new_offset, new_position)
+ _undo_redo.add_undo_method(self, &"_set_offset_and_position", p_node.get_instance_id(), old_offset, old_position)
_undo_redo.commit_action()
-func _set_offset(p_id: int, p_offset: Vector3) -> void:
+func _set_offset_and_position(p_id: int, p_offset: Vector3, p_position: Vector3) -> void:
+ var node := instance_from_id(p_id) as Node
+ if not is_instance_valid(node):
+ return
+
+ _ignore_transform_change = true
+ node.global_position = p_position
_offsets[p_id] = p_offset
+ _ignore_transform_change = false
# Overwrite current offset stored for node with its current Y position relative to the terrain