Merge remote-tracking branch 'origin/master' into 1.13

# Conflicts:
#	Content/Shaders/GI/DDGI.flax
This commit is contained in:
2026-08-13 11:46:40 +02:00
14 changed files with 57 additions and 20 deletions
@@ -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)
+2 -2
View File
@@ -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; \
@@ -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);
}
}
@@ -224,6 +224,17 @@ namespace FlaxEditor.Viewport.Previews
}
}
/// <summary>
/// Draws the bounds of object.
/// </summary>
/// <param name="box">Object bounding box.</param>
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);
}
/// <summary>
/// Called when drawing debug shapes with <see cref="DebugDraw"/> for this viewport.
/// </summary>
@@ -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);
@@ -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
+25 -2
View File
@@ -928,15 +928,20 @@ namespace FlaxEditor.Windows
/// <param name="isCutting">Whether a cutting action is occuring.</param>
public void Paste(string[] files, bool isCutting)
{
var folder = CurrentViewFolder;
// Copy or move assets
var importFiles = new List<string>();
var pastedFiles = new List<string>();
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
}
}
}
}
/// <summary>
@@ -1007,6 +1007,9 @@ 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
+1 -1
View File
@@ -1195,7 +1195,7 @@ API_ENUM(Attributes="Flags") enum class ViewFlags : uint64
/// <summary>
/// Default flags for materials/models previews generating.
/// </summary>
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,
/// <summary>
/// All flags enabled.
+2 -2
View File
@@ -1046,7 +1046,7 @@ API_STRUCT() struct FLAXENGINE_API EyeAdaptationSettings : ISerializable
/// The effect rendering mode used for the exposure processing.
/// </summary>
API_FIELD(Attributes="EditorOrder(0), PostProcessSetting((int)EyeAdaptationSettingsOverride.Mode)")
EyeAdaptationMode Mode = EyeAdaptationMode::AutomaticHistogram;
EyeAdaptationMode Mode = EyeAdaptationMode::None;
/// <summary>
/// The speed at which the exposure changes when the scene brightness moves from a dark area to a bright area (brightness goes up).
@@ -1676,7 +1676,7 @@ API_STRUCT() struct FLAXENGINE_API MotionBlurSettings : ISerializable
/// If checked, the motion blur effect will be rendered.
/// </summary>
API_FIELD(Attributes="EditorOrder(0), PostProcessSetting((int)MotionBlurSettingsOverride.Enabled)")
bool Enabled = true;
bool Enabled = false;
/// <summary>
/// The blur effect strength. A value of 0 disables it, while higher values increase the effect.
@@ -301,6 +301,8 @@ namespace WaylandImpl
auto dragStartWindow = DragSourceWindow != nullptr ? DragSourceWindow->GetSDLWindow() : draggedWindow;
wl_surface* originSurface = static_cast<wl_surface*>(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);
+2 -6
View File
@@ -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
+2 -2
View File
@@ -223,9 +223,9 @@ namespace FlaxEngine.GUI
public bool IsScrollable { get; set; } = true;
/// <summary>
/// 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.
/// </summary>
[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;
@@ -1365,7 +1365,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();