From 04d0608e606d3afb0c667761806b2bec972c2743 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Thu, 30 Jul 2026 22:02:53 -0500 Subject: [PATCH 01/13] Preload assembly for dynamic support in editor --- Source/Engine/Engine/NativeInterop.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Engine/Engine/NativeInterop.cs b/Source/Engine/Engine/NativeInterop.cs index 304270b34..d6d7e26d9 100644 --- a/Source/Engine/Engine/NativeInterop.cs +++ b/Source/Engine/Engine/NativeInterop.cs @@ -1758,6 +1758,9 @@ namespace FlaxEngine.Interop assembly.GetType("System.Linq.Expressions.Compiler.DelegateHelpers") .GetMethod("MakeNewCustomDelegate", BindingFlags.NonPublic | BindingFlags.Static).CreateDelegate>(); + // Load Microsoft.CSharp assembly into collectible ALC for dynamic binder support + scriptingAssemblyLoadContext.LoadFromAssemblyPath(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly.Location); + // Create dummy delegates to force the dynamic Snippets assembly to be loaded in correcet ALCs MakeNewCustomDelegateFunc(new[] { typeof(void) }); { From b0ba936ebefb4d4ec95bdc13eb43824a99026589 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Thu, 30 Jul 2026 22:12:05 -0500 Subject: [PATCH 02/13] Move to better method location. --- Source/Engine/Engine/NativeInterop.Unmanaged.cs | 5 +++++ Source/Engine/Engine/NativeInterop.cs | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Engine/NativeInterop.Unmanaged.cs b/Source/Engine/Engine/NativeInterop.Unmanaged.cs index 33e102089..7decdcffc 100644 --- a/Source/Engine/Engine/NativeInterop.Unmanaged.cs +++ b/Source/Engine/Engine/NativeInterop.Unmanaged.cs @@ -1011,6 +1011,11 @@ namespace FlaxEngine.Interop scriptingAssemblyLoadContext = new AssemblyLoadContext("Flax", isCollectible: false); #endif DelegateHelpers.InitMethods(); + +#if FLAX_EDITOR + // Load Microsoft.CSharp assembly into collectible ALC for dynamic binder support + scriptingAssemblyLoadContext.LoadFromAssemblyPath(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly.Location); +#endif } [UnmanagedCallersOnly] diff --git a/Source/Engine/Engine/NativeInterop.cs b/Source/Engine/Engine/NativeInterop.cs index d6d7e26d9..304270b34 100644 --- a/Source/Engine/Engine/NativeInterop.cs +++ b/Source/Engine/Engine/NativeInterop.cs @@ -1758,9 +1758,6 @@ namespace FlaxEngine.Interop assembly.GetType("System.Linq.Expressions.Compiler.DelegateHelpers") .GetMethod("MakeNewCustomDelegate", BindingFlags.NonPublic | BindingFlags.Static).CreateDelegate>(); - // Load Microsoft.CSharp assembly into collectible ALC for dynamic binder support - scriptingAssemblyLoadContext.LoadFromAssemblyPath(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly.Location); - // Create dummy delegates to force the dynamic Snippets assembly to be loaded in correcet ALCs MakeNewCustomDelegateFunc(new[] { typeof(void) }); { From a319bdfc90d801512d80ef6299479496d8a8e6fb Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Thu, 30 Jul 2026 22:14:01 -0500 Subject: [PATCH 03/13] Simplify location. --- Source/Engine/Engine/NativeInterop.Unmanaged.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/Engine/Engine/NativeInterop.Unmanaged.cs b/Source/Engine/Engine/NativeInterop.Unmanaged.cs index 7decdcffc..cb8688dcf 100644 --- a/Source/Engine/Engine/NativeInterop.Unmanaged.cs +++ b/Source/Engine/Engine/NativeInterop.Unmanaged.cs @@ -1007,15 +1007,13 @@ namespace FlaxEngine.Interop scriptingAssemblyLoadContext = new AssemblyLoadContext("Flax", isCollectible: true); scriptingAssemblyLoadContext.Resolving += OnScriptingAssemblyLoadContextResolving; + + // Load Microsoft.CSharp assembly into collectible ALC for dynamic binder support + scriptingAssemblyLoadContext.LoadFromAssemblyPath(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly.Location); #else scriptingAssemblyLoadContext = new AssemblyLoadContext("Flax", isCollectible: false); #endif DelegateHelpers.InitMethods(); - -#if FLAX_EDITOR - // Load Microsoft.CSharp assembly into collectible ALC for dynamic binder support - scriptingAssemblyLoadContext.LoadFromAssemblyPath(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly.Location); -#endif } [UnmanagedCallersOnly] From 5b648b18245f29069087d2e55b09c2f1f4462882 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sat, 8 Aug 2026 06:50:32 +0200 Subject: [PATCH 04/13] Fixes --- Content/Shaders/GI/DDGI.flax | 4 ++-- Source/Editor/CustomEditors/Editors/ActorLayerEditor.cs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Content/Shaders/GI/DDGI.flax b/Content/Shaders/GI/DDGI.flax index 6d1431236..074936c0f 100644 --- a/Content/Shaders/GI/DDGI.flax +++ b/Content/Shaders/GI/DDGI.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c0984d39f5226f8eac725b307c88a663d54836a820ae4d4d3cffe73b8fe6d0a2 -size 38199 +oid sha256:470894d00e8fad1a932f21d45c08b8dc96327dd9a8569b0a96d0169da6496c62 +size 38449 diff --git a/Source/Editor/CustomEditors/Editors/ActorLayerEditor.cs b/Source/Editor/CustomEditors/Editors/ActorLayerEditor.cs index 282e8fdac..c121d258b 100644 --- a/Source/Editor/CustomEditors/Editors/ActorLayerEditor.cs +++ b/Source/Editor/CustomEditors/Editors/ActorLayerEditor.cs @@ -41,8 +41,9 @@ namespace FlaxEditor.CustomEditors.Editors private void OnPopupShown(ComboBox comboBox) { - var addOrEditLayersOption = (ContextMenuButton)comboBox.Popup.Items.FirstOrDefault(x => x is FlaxEditor.GUI.ContextMenu.ContextMenuButton b && b.Text == AddOrEditLayersOption); - addOrEditLayersOption?.Icon = Editor.Instance.Icons.Settings12; + var addOrEditLayersOption = (ContextMenuButton)comboBox.Popup.Items.FirstOrDefault(x => x is ContextMenuButton b && b.Text == AddOrEditLayersOption); + if (addOrEditLayersOption != null) + addOrEditLayersOption.Icon = Editor.Instance.Icons.Settings12; } private void UpdateLayerItems(int selectedIndex) From 716f665e39a630fdfd363fc48a2cbe15bcaac182 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 10 Aug 2026 06:04:27 +0200 Subject: [PATCH 05/13] Improve model bounds debug draw for better depth-readability of occluded pixels --- .../Editor/Viewport/Previews/AnimatedModelPreview.cs | 2 +- Source/Editor/Viewport/Previews/AssetPreview.cs | 11 +++++++++++ Source/Editor/Viewport/Previews/ModelPreview.cs | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Viewport/Previews/AnimatedModelPreview.cs b/Source/Editor/Viewport/Previews/AnimatedModelPreview.cs index a5ff3758b..721b8504d 100644 --- a/Source/Editor/Viewport/Previews/AnimatedModelPreview.cs +++ b/Source/Editor/Viewport/Previews/AnimatedModelPreview.cs @@ -405,7 +405,7 @@ namespace FlaxEditor.Viewport.Previews // Draw bounds if (_showBounds) { - DebugDraw.DrawWireBox(_previewModel.Box, Color.Violet.RGBMultiplied(0.8f), 0, false); + DebugDrawBounds(_previewModel.Box); } } diff --git a/Source/Editor/Viewport/Previews/AssetPreview.cs b/Source/Editor/Viewport/Previews/AssetPreview.cs index 3583a9ff0..b6610c880 100644 --- a/Source/Editor/Viewport/Previews/AssetPreview.cs +++ b/Source/Editor/Viewport/Previews/AssetPreview.cs @@ -224,6 +224,17 @@ namespace FlaxEditor.Viewport.Previews } } + /// + /// Draws the bounds of object. + /// + /// Object bounding box. + protected void DebugDrawBounds(BoundingBox box) + { + var color = Color.Violet.RGBMultiplied(0.8f); + DebugDraw.DrawWireBox(box, color.AlphaMultiplied(0.3f), 0, false); + DebugDraw.DrawWireBox(box, color, 0, true); + } + /// /// Called when drawing debug shapes with for this viewport. /// diff --git a/Source/Editor/Viewport/Previews/ModelPreview.cs b/Source/Editor/Viewport/Previews/ModelPreview.cs index d8aad8c59..b6306b905 100644 --- a/Source/Editor/Viewport/Previews/ModelPreview.cs +++ b/Source/Editor/Viewport/Previews/ModelPreview.cs @@ -302,7 +302,7 @@ namespace FlaxEditor.Viewport.Previews // Draw bounds if (_showBounds) { - DebugDraw.DrawWireBox(_previewModel.Box, Color.Violet.RGBMultiplied(0.8f), 0, false); + DebugDrawBounds(_previewModel.Box); } // Draw normals From b7cfb110c3ec9af9de470d37ba103b6ffa9dee72 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 10 Aug 2026 06:05:33 +0200 Subject: [PATCH 06/13] Disable Eye Adaptation in material previews by default --- Source/Editor/Viewport/Previews/MaterialPreview.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Editor/Viewport/Previews/MaterialPreview.cs b/Source/Editor/Viewport/Previews/MaterialPreview.cs index e494df14a..b64a4fdba 100644 --- a/Source/Editor/Viewport/Previews/MaterialPreview.cs +++ b/Source/Editor/Viewport/Previews/MaterialPreview.cs @@ -148,6 +148,7 @@ namespace FlaxEditor.Viewport.Previews // Setup preview scene _previewModel = new StaticModel(); SelectedModelIndex = 0; + Task.ViewFlags &= ~ViewFlags.EyeAdaptation; // Link actors for rendering Task.AddCustomActor(_previewModel); From 8688695b28183c94c62cb5b0ddb8ca00c5082402 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 10 Aug 2026 07:14:22 +0200 Subject: [PATCH 07/13] Clarify UI Control `Enabled` doc --- Source/Engine/UI/GUI/Control.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Engine/UI/GUI/Control.cs b/Source/Engine/UI/GUI/Control.cs index 8ae3b3616..2c8138984 100644 --- a/Source/Engine/UI/GUI/Control.cs +++ b/Source/Engine/UI/GUI/Control.cs @@ -223,9 +223,9 @@ namespace FlaxEngine.GUI public bool IsScrollable { get; set; } = true; /// - /// Gets or sets a value indicating whether the control can respond to user interaction + /// Gets or sets a value indicating whether the control can respond to user interaction. Disabled control remains visible but is grayed out. /// - [EditorOrder(520), Tooltip("If checked, control will receive input events of the user interaction.")] + [EditorOrder(520), Tooltip("If checked, control will receive input events of the user interaction. Disabled control remains visible but is grayed out.")] public bool Enabled { get => _isEnabled; From 0c9431e7d7aaf73f15a4cb0005c0304e2309642b Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Mon, 10 Aug 2026 20:26:47 +0300 Subject: [PATCH 08/13] Pass converted non-const lvalue reference parameters as temporaries --- Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs index c3d2efbd9..c8d73c559 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs @@ -1396,7 +1396,7 @@ namespace Flax.Build.Bindings else if (parameterInfo.Type.IsRef && !parameterInfo.Type.IsConst) { // Non-const lvalue reference parameters needs to be passed via temporary value - if (parameterInfo.Type.Type is "String" or "StringView" or "StringAnsi" or "StringAnsiView" && parameterInfo.Type.GenericArgs == null) + if (!string.IsNullOrWhiteSpace(CppParamsWrappersCache[i])) // Converted values contents.Append(indent).AppendFormat("{2} {0}Temp = {1};", parameterInfo.Name, param, parameterInfo.Type.ToString(false)).AppendLine(); else contents.Append(indent).AppendFormat("{2}& {0}Temp = {1};", parameterInfo.Name, param, parameterInfo.Type.ToString(false)).AppendLine(); From cf052489df0b6888612e84fc5ecadbfd52e6014e Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 11 Aug 2026 11:37:40 +0300 Subject: [PATCH 09/13] Fix Wayland dragging regression --- Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp b/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp index 3bcd2ea88..51a843157 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp +++ b/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp @@ -301,6 +301,8 @@ namespace WaylandImpl auto dragStartWindow = DragSourceWindow != nullptr ? DragSourceWindow->GetSDLWindow() : draggedWindow; wl_surface* originSurface = static_cast(SDL_GetPointerProperty(SDL_GetWindowProperties(dragStartWindow), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, nullptr)); wl_surface* iconSurface = nullptr; + if (!dragWindow) + wl_data_device_start_drag(WrappedDataDevice, dataSource, originSurface, iconSurface, DragSerial); Platform::AtomicStore(&StartFlag, 1); From c5c96b1dac30aeaac86307a28457f7d5c4dd5bad Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 11 Aug 2026 12:39:43 +0300 Subject: [PATCH 10/13] Remove terrain patch collision when patch is removed Fixes #4212 --- Source/Engine/Terrain/TerrainPatch.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Source/Engine/Terrain/TerrainPatch.cpp b/Source/Engine/Terrain/TerrainPatch.cpp index f986cf791..d51745e55 100644 --- a/Source/Engine/Terrain/TerrainPatch.cpp +++ b/Source/Engine/Terrain/TerrainPatch.cpp @@ -110,6 +110,8 @@ void TerrainPatch::Init(Terrain* terrain, int16 x, int16 z) TerrainPatch::~TerrainPatch() { + if (HasCollision()) + DestroyCollision(); #if TERRAIN_EDITING SAFE_DELETE(_dataHeightmap); for (int32 i = 0; i < TERRAIN_MAX_SPLATMAPS_COUNT; i++) @@ -117,12 +119,6 @@ TerrainPatch::~TerrainPatch() SAFE_DELETE(_dataSplatmap[i]); } #endif -#if TERRAIN_USE_PHYSICS_DEBUG - SAFE_DELETE_GPU_RESOURCE(_debugLines); -#endif -#if USE_EDITOR - SAFE_DELETE_GPU_RESOURCE(_collisionTrianglesBuffer); -#endif } RawDataAsset* TerrainPatch::GetHeightfield() const From c61392c72286fad2a614e31b66989b3fb0e361be Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 11 Aug 2026 12:45:00 +0300 Subject: [PATCH 11/13] Fix terrain patch add mode not picking patches in scaled terrain --- Source/Editor/Tools/Terrain/TerrainTools.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Tools/Terrain/TerrainTools.cpp b/Source/Editor/Tools/Terrain/TerrainTools.cpp index 8e83e77cf..9914c0bac 100644 --- a/Source/Editor/Tools/Terrain/TerrainTools.cpp +++ b/Source/Editor/Tools/Terrain/TerrainTools.cpp @@ -21,7 +21,7 @@ bool TerrainTools::TryGetPatchCoordToAdd(Terrain* terrain, const Ray& ray, Int2& { CHECK_RETURN(terrain, true); result = Int2::Zero; - const float patchSize = terrain->GetChunkSize() * TERRAIN_UNITS_PER_VERTEX * Terrain::ChunksCountEdge; + const auto patchSize = terrain->GetChunkSize() * TERRAIN_UNITS_PER_VERTEX * Terrain::ChunksCountEdge * terrain->GetScale(); // Try to pick any of the patch edges for (int32 patchIndex = 0; patchIndex < terrain->GetPatchesCount(); patchIndex++) @@ -36,7 +36,7 @@ bool TerrainTools::TryGetPatchCoordToAdd(Terrain* terrain, const Ray& ray, Int2& #define CHECK_EDGE(dx, dz) \ if (terrain->GetPatch(x + dx, z + dz) == nullptr) \ { \ - if (bounds.MakeOffsetted(Vector3(patchSize * dx, 0, patchSize * dz)).Intersects(ray)) \ + if (bounds.MakeOffsetted(Vector3(patchSize.X * dx, 0, patchSize.Z * dz)).Intersects(ray)) \ { \ result = Int2(x + dx, z + dz); \ return true; \ From 782e7415a73ffa574c39997210af6777a948e5a9 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 13 Aug 2026 06:01:55 +0200 Subject: [PATCH 12/13] Add auto-select of newly copied/moved content items --- Source/Editor/Windows/ContentWindow.cs | 27 ++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs index b08faeec9..eca4e5be6 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -928,15 +928,20 @@ namespace FlaxEditor.Windows /// Whether a cutting action is occuring. public void Paste(string[] files, bool isCutting) { + var folder = CurrentViewFolder; + + // Copy or move assets var importFiles = new List(); + var pastedFiles = new List(); foreach (var sourcePath in files) { var item = Editor.ContentDatabase.Find(sourcePath); if (item != null) { - var newPath = StringUtils.NormalizePath(Path.Combine(CurrentViewFolder.Path, item.FileName)); + var newPath = StringUtils.NormalizePath(Path.Combine(folder.Path, item.FileName)); if (sourcePath.Equals(newPath)) newPath = GetClonedAssetPath(item); + pastedFiles.Add(newPath); if (isCutting) Editor.ContentDatabase.Move(item, newPath); else @@ -945,7 +950,25 @@ namespace FlaxEditor.Windows else importFiles.Add(sourcePath); } - Editor.ContentImporting.Import(importFiles, CurrentViewFolder); + + // Import any new files + Editor.ContentImporting.Import(importFiles, folder); + + // Auto-select pasted files + if (pastedFiles.Count != 0 && importFiles.Count == 0) + { + Editor.ContentDatabase.RefreshFolder(folder, false); + bool additive = false; + foreach (var pastedFile in pastedFiles) + { + var pastedItem = folder.FindChild(pastedFile); + if (pastedItem != null) + { + Select(pastedItem, true, additive); + additive = true; // Clear selection on first item + } + } + } } /// From 3f43c9622bd6b13fe77f3f4f35029adec2f78a62 Mon Sep 17 00:00:00 2001 From: Jake Young Date: Mon, 10 Aug 2026 11:55:14 -0400 Subject: [PATCH 13/13] Disable eye adaptation and motion blur by default --- Source/Engine/Graphics/Enums.h | 2 +- Source/Engine/Graphics/PostProcessSettings.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Graphics/Enums.h b/Source/Engine/Graphics/Enums.h index 0e174c67e..339fc0f77 100644 --- a/Source/Engine/Graphics/Enums.h +++ b/Source/Engine/Graphics/Enums.h @@ -1152,7 +1152,7 @@ API_ENUM(Attributes="Flags") enum class ViewFlags : uint64 /// /// Default flags for materials/models previews generating. /// - DefaultAssetPreview = Reflections | Decals | DirectionalLights | PointLights | SpotLights | SkyLights | SpecularLight | AntiAliasing | Bloom | ToneMapping | EyeAdaptation | CameraArtifacts | LensFlares | ContactShadows | Sky | Particles, + DefaultAssetPreview = Reflections | Decals | DirectionalLights | PointLights | SpotLights | SkyLights | SpecularLight | AntiAliasing | Bloom | ToneMapping | CameraArtifacts | LensFlares | ContactShadows | Sky | Particles, /// /// All flags enabled. diff --git a/Source/Engine/Graphics/PostProcessSettings.h b/Source/Engine/Graphics/PostProcessSettings.h index eb705eb58..b4d6ec14b 100644 --- a/Source/Engine/Graphics/PostProcessSettings.h +++ b/Source/Engine/Graphics/PostProcessSettings.h @@ -986,7 +986,7 @@ API_STRUCT() struct FLAXENGINE_API EyeAdaptationSettings : ISerializable /// The effect rendering mode used for the exposure processing. /// API_FIELD(Attributes="EditorOrder(0), PostProcessSetting((int)EyeAdaptationSettingsOverride.Mode)") - EyeAdaptationMode Mode = EyeAdaptationMode::AutomaticHistogram; + EyeAdaptationMode Mode = EyeAdaptationMode::None; /// /// The speed at which the exposure changes when the scene brightness moves from a dark area to a bright area (brightness goes up). @@ -1616,7 +1616,7 @@ API_STRUCT() struct FLAXENGINE_API MotionBlurSettings : ISerializable /// If checked, the motion blur effect will be rendered. /// API_FIELD(Attributes="EditorOrder(0), PostProcessSetting((int)MotionBlurSettingsOverride.Enabled)") - bool Enabled = true; + bool Enabled = false; /// /// The blur effect strength. A value of 0 disables it, while higher values increase the effect.