365 Commits

Author SHA1 Message Date
fd5c50635c some mac changes?
Some checks are pending
Build Android / Game (Android, Release ARM64) (push) Waiting to run
Build iOS / Game (iOS, Release ARM64) (push) Waiting to run
Build Linux / Editor (Linux, Development x64) (push) Waiting to run
Build Linux / Game (Linux, Release x64) (push) Waiting to run
Build macOS / Editor (Mac, Development ARM64) (push) Waiting to run
Build macOS / Game (Mac, Release ARM64) (push) Waiting to run
Build Windows / Editor (Windows, Development x64) (push) Waiting to run
Build Windows / Game (Windows, Release x64) (push) Waiting to run
Cooker / Cook (Mac) (push) Waiting to run
Tests / Tests (Linux) (push) Waiting to run
Tests / Tests (Windows) (push) Waiting to run
2026-02-12 18:40:05 +02:00
Wojtek Figat
07f031e4c5 Merge branch 'GoaLitiuM-sdl_platform' into 1.12 2026-02-12 16:26:05 +01:00
Wojtek Figat
06c31a39f2 Don't bring the main window to the front while dragging as it can cover up floating windows there 2026-02-12 16:24:15 +01:00
Wojtek Figat
2a6e38e020 Fix Editor floating windows to have link to the main window while still be in taskbar
#2800
2026-02-12 16:23:42 +01:00
Wojtek Figat
cc69e5d966 Minor fixes 2026-02-12 16:22:51 +01:00
Wojtek Figat
d68969dbe2 Move SupportsNativeDecorations/SupportsNativeDecorationDragging to SDLPlatform
#2800
2026-02-12 09:24:48 +01:00
Wojtek Figat
c4d20f06ee Move GetDisplayServer to LinuxPlatform (add support for custom platform scripting api)
#2800
2026-02-12 09:24:11 +01:00
Wojtek Figat
3c5c6f9883 Fix new window docking system to match the old one hints placement and enlarge hint spots
#2800
2026-02-11 23:56:35 +01:00
Wojtek Figat
8e7dc2a91e Fix using new window docking system with old non-SDL platform
#2800
2026-02-11 23:55:18 +01:00
Wojtek Figat
4ddbc8ba5c Fix floating dock window title to update when selected tab gets changed
#2800
2026-02-11 23:32:53 +01:00
Wojtek Figat
15f379e87f Fix memory leak in Editor when using material parameter query 2026-02-11 23:29:36 +01:00
Wojtek Figat
d4a7b3074e Fix old windows code to use new window type
#2800
2026-02-11 23:29:13 +01:00
Wojtek Figat
a3492e59ef Use CreateWindow/GetBatteryInfo/GetUserLocaleName from Windows instead of SDL for now
#2800
2026-02-11 23:28:44 +01:00
Wojtek Figat
515ad56fa2 Silence warning in game builds 2026-02-11 18:06:07 +01:00
Wojtek Figat
ebd20dd816 Fix Android compilation since .c files are now compiled 2026-02-11 18:05:56 +01:00
Wojtek Figat
019a9f6089 Merge ScreenUtilities into Platform for simplicity and make it Editor-only
#2800
2026-02-11 17:59:11 +01:00
Wojtek Figat
273b110db4 Code style formatting and minor tweaks
#2800
2026-02-11 17:15:15 +01:00
Wojtek Figat
0bea701a83 Build SDL for Windows 2026-02-11 15:23:42 +01:00
Wojtek Figat
ee22b9dc25 Merge branch 'sdl_platform' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-sdl_platform
# Conflicts:
#	Source/Editor/GUI/Dialogs/ColorPickerDialog.cs
#	Source/Editor/Modules/UIModule.cs
2026-02-11 14:08:57 +01:00
Wojtek Figat
a1096aaf92 Fix crash when MultiScaler shader is not yet loaded on first frame 2026-02-11 13:32:41 +01:00
Wojtek Figat
885ee15767 Update engine assets 2026-02-11 00:25:41 +01:00
Wojtek Figat
c978ab2b84 Fix missing changes from e851efa0a8 and ef551c36ae on ForwardShading 2026-02-11 00:25:00 +01:00
Wojtek Figat
f045b5b6b6 Merge remote-tracking branch 'origin/master' into 1.12
# Conflicts:
#	Content/Editor/Camera/M_Camera.flax
#	Content/Editor/CubeTexturePreviewMaterial.flax
#	Content/Editor/DebugMaterials/DDGIDebugProbes.flax
#	Content/Editor/DebugMaterials/SingleColor/Decal.flax
#	Content/Editor/DebugMaterials/SingleColor/Particle.flax
#	Content/Editor/DebugMaterials/SingleColor/Surface.flax
#	Content/Editor/DebugMaterials/SingleColor/SurfaceAdditive.flax
#	Content/Editor/DebugMaterials/SingleColor/Terrain.flax
#	Content/Editor/DefaultFontMaterial.flax
#	Content/Editor/Gizmo/FoliageBrushMaterial.flax
#	Content/Editor/Gizmo/Material.flax
#	Content/Editor/Gizmo/MaterialWire.flax
#	Content/Editor/Gizmo/SelectionOutlineMaterial.flax
#	Content/Editor/Gizmo/VertexColorsPreviewMaterial.flax
#	Content/Editor/Highlight Material.flax
#	Content/Editor/Icons/IconsMaterial.flax
#	Content/Editor/IesProfilePreviewMaterial.flax
#	Content/Editor/MaterialTemplates/Features/ForwardShading.hlsl
#	Content/Editor/Particles/Particle Material Color.flax
#	Content/Editor/Particles/Smoke Material.flax
#	Content/Editor/SpriteMaterial.flax
#	Content/Editor/Terrain/Circle Brush Material.flax
#	Content/Editor/Terrain/Highlight Terrain Material.flax
#	Content/Editor/TexturePreviewMaterial.flax
#	Content/Editor/Wires Debug Material.flax
#	Content/Engine/DefaultDeformableMaterial.flax
#	Content/Engine/DefaultMaterial.flax
#	Content/Engine/DefaultRadialMenu.flax
#	Content/Engine/DefaultTerrainMaterial.flax
#	Content/Engine/SingleColorMaterial.flax
#	Content/Engine/SkyboxMaterial.flax
#	Flax.flaxproj
#	Source/Engine/Graphics/Materials/MaterialShader.h
#	Source/Engine/Graphics/Materials/MaterialShaderFeatures.cpp
#	Source/Engine/Renderer/RenderList.h
#	Source/Shaders/Reflections.shader
#	Source/Shaders/ReflectionsCommon.hlsl
#	Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs
2026-02-11 00:20:38 +01:00
Wojtek Figat
c51a023e61 Merge branch 'GoaLitiuM-dotnet10_fixes' 2026-02-11 00:08:48 +01:00
Wojtek Figat
645df4fb06 Merge branch 'dotnet10_fixes' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-dotnet10_fixes 2026-02-11 00:08:37 +01:00
Wojtek Figat
b53028782f Update engine assets 2026-02-11 00:07:44 +01:00
Wojtek Figat
ef551c36ae Fix Forward shading to match Deferred in fog and reflections rendering
#3717
2026-02-11 00:06:44 +01:00
Wojtek Figat
e851efa0a8 Fix applying AO twice for lighting in Forward shading and use correct specular occlusion on reflections
#3717
2026-02-10 22:50:32 +01:00
0084bc051c Merge branch 'master' into sdl_platform 2026-02-10 23:05:19 +02:00
Wojtek Figat
9c8023d64f Merge branch 'Menotdan-network-replication-fix-1' 2026-02-10 15:50:05 +01:00
Wojtek Figat
6d02f5d9da Merge branch 'network-replication-fix-1' of https://github.com/Menotdan/FlaxEngine into Menotdan-network-replication-fix-1 2026-02-10 15:50:01 +01:00
Wojtek Figat
1f9f281c31 Fix regression from 7b7a92758f for Visual Scripts 2026-02-10 15:02:05 +01:00
Wojtek Figat
846b64048f Update build number 2026-02-10 11:42:17 +01:00
Wojtek Figat
55f73b6cf7 Optimize Animated Models bones updating with a batches memory pass and manual resource transitions batch
#3917 #3827
2026-02-09 23:03:25 +01:00
Wojtek Figat
0f6c1aea62 Fix various material nodes to work on D3D12 2026-02-09 18:40:39 +01:00
Wojtek Figat
d2ee61ef8d Fix GetNodesPose issue when 2 threads call it at once 2026-02-09 18:06:57 +01:00
Wojtek Figat
a1399c5157 Optimize Anim Graph retarget to use cached pose to avoid dynamic memory allocation
#3827
2026-02-09 18:02:58 +01:00
Wojtek Figat
7b7a92758f Optimize VariantType to use static type name in game or from non-reloadable assemblies
This avoids many dynamic memory allocations in Visual Scripts and Anim Graph.

#
2026-02-09 18:01:47 +01:00
Wojtek Figat
bd300651ec Fix Job System regression bug with incorrect initialization of job context 2026-02-09 15:04:19 +01:00
Wojtek Figat
a2b0d0714e Add more docs about new ConcurrentDictionary 2026-02-09 15:03:54 +01:00
Wojtek Figat
3d66316716 Optimize animations retargeting between skeletons
Cuts down `RetargetSkeletonPose` time down by over 80%.

#3827
2026-02-09 15:03:42 +01:00
Wojtek Figat
9c32f978fb Fix regression from 73c19b278f to fix missing skeleton bones on start in Editor 2026-02-08 00:22:37 +01:00
Wojtek Figat
ed5ad91a32 Optimize SkinnedModel::GetSkeletonMapping to not use locking for better perf when multi-threading
#3827
2026-02-07 00:46:32 +01:00
Wojtek Figat
ecddb8aae5 Optimize GPUVertexLayout caches with ConcurrentDictionary 2026-02-07 00:45:14 +01:00
Wojtek Figat
a855b17cc0 Add new collection type ConcurrentDictionary
#3917 #3827
2026-02-07 00:44:51 +01:00
Wojtek Figat
27dd1bda25 Optimize GPUVertexLayout::Get to not use mutex on lookup read
#3917
2026-02-06 21:57:16 +01:00
Wojtek Figat
4afd9fd8df Optimize Animated Model bones buffer flushing with delayed draw action to reduce lock contention
#3917 #3827
2026-02-06 13:27:53 +01:00
Wojtek Figat
73c19b278f Optimize updating Animated Model bones buffer when it's not dirty
#3827
2026-02-06 12:47:34 +01:00
Wojtek Figat
b4cb1028ed Fix typos 2026-02-06 12:47:07 +01:00
Wojtek Figat
4a7f1a5fde Fix various issues 2026-02-06 10:37:52 +01:00
Wojtek Figat
5d0fdc8313 Add info about skinned model skeleton size 2026-02-06 09:28:06 +01:00
Wojtek Figat
70b324cdec Optimize included header usage 2026-02-06 09:11:55 +01:00
Wojtek Figat
20516bb8bc Fix foliage dithered LOD transitions when using shadows 2026-02-06 09:11:45 +01:00
Wojtek Figat
c18b9163ca Refactor Job System to reduce mutex usage with more atomic operations
#3917
2026-02-06 09:11:12 +01:00
Menotdan
db5b65beac Merge branch 'FlaxEngine:master' into network-replication-fix-1 2026-02-05 19:19:45 -05:00
Menotdan
78e5baf6a5 Fix replicating changes from one client to another 2026-02-05 19:12:21 -05:00
Wojtek Figat
4833c19366 Fix build regression 2026-02-05 15:45:02 +01:00
Wojtek Figat
65fd22f5b6 Add Triangles to MeshAccessor for easy index buffer access
#3918
2026-02-05 13:00:49 +01:00
Phantom
f57df83d26 Add Slerp methods on Vectors
#3682
2026-02-05 12:43:29 +01:00
Wojtek Figat
66894b71fa Add utility to get loaded assets 2026-02-05 12:37:03 +01:00
Wojtek Figat
7e9ee0610a Fix missing audio on OpenAL when changing active device
#3621
2026-02-04 23:43:06 +01:00
Wojtek Figat
f733611213 Fix various issues with audio and video playback
#3716
2026-02-04 21:48:02 +01:00
Wojtek Figat
780e78f056 Another compilation fix attempt 2026-02-03 23:33:24 +01:00
Wojtek Figat
4d447b7544 Fix very rare race condition when waiting for an asset to load 2026-02-03 23:33:09 +01:00
Wojtek Figat
9a44902949 Optimize e84b5410ec to use faster code path on common math types
#3499
2026-02-03 23:00:36 +01:00
Wojtek Figat
e84b5410ec Fix C# Json serialization to use proper value comparison for structures with Scene Object references
#3499
2026-02-03 22:59:35 +01:00
Wojtek Figat
9ac19cbd2f Fix build regression on Clang 2026-02-03 22:58:09 +01:00
Wojtek Figat
39a2bc2535 Fix build regression on Clang 2026-02-03 22:11:15 +01:00
Wojtek Figat
15771355cb Add ShouldSerialize to ISerializable to properly handle serialization of custom C++ types in prefabs
#3499
2026-02-03 22:09:41 +01:00
Wojtek Figat
f3111e855d Fix showing C++ structures inlined in collection editor when they have a single property/field 2026-02-03 19:48:57 +01:00
Wojtek Figat
3c6838ee35 Fix error in reparent action when scene is missing (eg. in prefab editor) 2026-02-03 19:13:31 +01:00
Wojtek Figat
36ab08e60d Fix build regression on Clang 2026-02-03 18:28:25 +01:00
Phantom
834c4553b2 Add Missing functions on Vector4
#3715
2026-02-03 17:57:31 +01:00
Wojtek Figat
5a95336601 Merge branch 'Tryibion-ui-raycast-cull' 2026-02-03 17:49:08 +01:00
Wojtek Figat
f26fae2daf Merge branch 'ui-raycast-cull' of https://github.com/Tryibion/FlaxEngine into Tryibion-ui-raycast-cull 2026-02-03 17:49:04 +01:00
Wojtek Figat
20df4289c2 Merge branch 'xxSeys1-UnifyAudioListenerWarnings' 2026-02-03 17:48:37 +01:00
Wojtek Figat
217701ae05 Adjust error in case we support more listeners
#3686
2026-02-03 17:48:30 +01:00
Wojtek Figat
f1509bab28 Merge branch 'UnifyAudioListenerWarnings' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-UnifyAudioListenerWarnings 2026-02-03 17:45:52 +01:00
Wojtek Figat
30fdd7336e Merge branch 'xxSeys1-VisjectMoveNodeSmallerIncrements' 2026-02-03 17:44:51 +01:00
Wojtek Figat
3b120cc5a4 Merge branch 'VisjectMoveNodeSmallerIncrements' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-VisjectMoveNodeSmallerIncrements 2026-02-03 17:44:41 +01:00
Wojtek Figat
4cf0c38940 Merge branch 'xxSeys1-PressGToGameModeAndPToNavigate' 2026-02-03 16:46:49 +01:00
Wojtek Figat
0f383d2fc6 Move transform gizmo visibility to the base class
#3692
2026-02-03 16:46:46 +01:00
483df22929 Fix building SDL dependencies 2026-02-03 17:46:41 +02:00
Wojtek Figat
07f21a1520 Merge branch 'PressGToGameModeAndPToNavigate' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-PressGToGameModeAndPToNavigate
# Conflicts:
#	Source/Engine/Graphics/Enums.h
2026-02-03 16:39:57 +01:00
f870fc3ae2 Merge remote-tracking branch 'origin/master' into sdl_platform
# Conflicts:
#	Source/Editor/Viewport/MainEditorGizmoViewport.cs
2026-02-03 17:39:43 +02:00
Wojtek Figat
bbb5354e9c Fix potential crash on out of bounds access 2026-02-03 16:32:34 +01:00
Wojtek Figat
21e2c830e5 Refactor Animation editor to use cloned asset for live preview of nested animations editing
#3773
2026-02-03 16:32:22 +01:00
Wojtek Figat
c828c90161 Add Set Parameter node to Anim Graph
#2162
2026-02-03 15:42:26 +01:00
Wojtek Figat
f725f4c0b9 Add saving viewport icons scale (global) within Editor window layout
#3820
2026-02-03 13:24:13 +01:00
Wojtek Figat
1535f95cf1 Fix mesh collision proxy setup for meshes using packed positions format
#3791
2026-02-03 13:18:02 +01:00
Wojtek Figat
b1f85b7462 Add Auto collision option to handle imported or created model collider asset
#3792
2026-02-03 09:23:50 +01:00
Wojtek Figat
3a0af54f48 Add Collision Meshes Postfix to filter collision meshes inside imported model via ending
#3792
2026-02-03 09:23:19 +01:00
Wojtek Figat
4e3e9386cc Fix restoring Min Screen Size of the model on reimport
#3807
2026-02-02 22:25:08 +01:00
Wojtek Figat
449fc597b5 Fix crash when using overlapping instances
#3899
2026-02-02 19:21:45 +01:00
Wojtek Figat
0e91a2d25b Merge branch 'Tryibion-fix-view-band-sel' 2026-02-01 23:33:09 +01:00
Wojtek Figat
aba995a42f Merge branch 'fix-view-band-sel' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-view-band-sel 2026-02-01 23:33:04 +01:00
Wojtek Figat
bf0c7fe0dc Fix timescale in FixedTimestep particles update and when using Editor preview
#3811
2026-02-01 23:32:00 +01:00
Wojtek Figat
2ab8b9dd55 Add Texture Group option for triplanar and procedural samplers
#3904
2026-02-01 23:11:44 +01:00
Chandler Cox
e1ffdee57a If UI is culling children, dont return children outside of client area for raycast. 2026-01-30 15:51:53 -06:00
Chandler Cox
7c44767d4d Fix viewport rubberban selector. 2026-01-30 12:07:36 -06:00
Wojtek Figat
87ccaa9dd8 Add keyboard navgation to context menu child menus
#3676
2026-01-30 18:00:16 +01:00
Wojtek Figat
e8c2f18a4d Add tab navigation to Editor context menus and popups
#3676
2026-01-30 17:50:24 +01:00
Wojtek Figat
6b36543717 Merge branch 'xxSeys1-CurvePresets' 2026-01-30 17:41:13 +01:00
Wojtek Figat
bb2a883dc7 Merge branch 'CurvePresets' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-CurvePresets 2026-01-30 17:39:09 +01:00
Wojtek Figat
be7e88de36 Merge branch 'xxSeys1-VisjectResizeCurveNodes' 2026-01-30 17:32:03 +01:00
Wojtek Figat
4a1490f0b1 Follow up on #3642 and move node resizing code to shared code 2026-01-30 17:31:59 +01:00
Wojtek Figat
e0d0acc33c Merge branch 'VisjectResizeCurveNodes' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-VisjectResizeCurveNodes 2026-01-30 16:58:01 +01:00
Wojtek Figat
e2f2d3e6f6 Merge branch 'Tryibion-fix-terrain-closest-point' 2026-01-30 16:43:52 +01:00
Wojtek Figat
afc04dc41c Minor cleanup and fix
#3733
2026-01-30 16:43:48 +01:00
Wojtek Figat
bdfa503c05 Merge branch 'fix-terrain-closest-point' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-terrain-closest-point 2026-01-30 16:38:50 +01:00
Wojtek Figat
205a8b2ebe Fix GPU Vertex Layout usage with explicit offsets to properly hash and calculates stride
#3625
2026-01-30 15:10:31 +01:00
Wojtek Figat
d18c245730 Fix rare async task crash when it's canceled while dequeuing 2026-01-30 13:14:36 +01:00
Wojtek Figat
e4eb064562 Add bake button to nav mesh bounds and minor improvements 2026-01-30 13:12:45 +01:00
Wojtek Figat
9fc9382e58 Refactor navmesh building to support updating all scenes automatically without specifying one
#3744
2026-01-30 13:11:56 +01:00
Wojtek Figat
2bf9efaf30 Fix rebuilding navmesh data for multiple scenes at once that share the same navmesh runtime
#3744
2026-01-29 17:28:34 +01:00
Wojtek Figat
528b4c89ce Add memory profiler category for engine debug data 2026-01-29 17:15:04 +01:00
Wojtek Figat
277dabc8b4 Fix documentation typos 2026-01-29 13:07:59 +01:00
Wojtek Figat
9a5bc444ba Fix build issues on MSVC on Windows 2026-01-29 12:38:23 +01:00
Wojtek Figat
e834fc5a42 Add more profiler categories for navigation 2026-01-29 12:35:36 +01:00
Wojtek Figat
6b87985a44 Merge branch 'Tryibion-fix-drag-tree-open' 2026-01-29 11:00:37 +01:00
Wojtek Figat
a65a74b866 Merge branch 'fix-drag-tree-open' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-drag-tree-open 2026-01-29 11:00:34 +01:00
Wojtek Figat
b2124201d5 Merge branch 'Tryibion-fix-tabs-panel2' 2026-01-29 10:58:51 +01:00
Wojtek Figat
29b8326042 Merge branch 'fix-tabs-panel2' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-tabs-panel2 2026-01-29 10:58:48 +01:00
Wojtek Figat
81bfa6edc9 Merge branch 'Tryibion-fix-scaling-issue' 2026-01-29 10:58:06 +01:00
Wojtek Figat
8ed6a92022 Merge branch 'fix-scaling-issue' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-scaling-issue 2026-01-29 10:58:03 +01:00
Wojtek Figat
c9d16e16cc Fix Rich Text Box vertical alignment of the inlined images and whole contents
#3502 ae4ae7a638 7ee2e66881
2026-01-29 10:55:10 +01:00
Chandler Cox
d9f9401c5a Fix tree node not expanding on drag over arrow. 2026-01-28 20:04:39 -06:00
Wojtek Figat
1e9918b9cc Add CPU profiler events to texture and buffer creation 2026-01-28 21:46:42 +01:00
Wojtek Figat
6c84b7a259 Update engine assets 2026-01-28 21:38:55 +01:00
Wojtek Figat
43b337e163 Fix Vulkan synchronization between CPU and GPU to prevent running over frames in flight 2026-01-28 20:43:01 +01:00
Wojtek Figat
45306ca20e Minor Vulkan fixes 2026-01-28 20:35:42 +01:00
Wojtek Figat
259d93f95c Fix RenderDoc detection on Vulkan 2026-01-28 17:08:00 +01:00
Wojtek Figat
61b6aeb252 Fix missing DDGI on D3D11 when object counter readback buffer doesn't have data on time
(eg. during very fast rendering)
2026-01-28 14:04:43 +01:00
Wojtek Figat
d694c35db4 Bump up version 2026-01-28 13:20:09 +01:00
Wojtek Figat
f105d6f84f Fix SSR artifacts when ray goes towards the screen 2026-01-28 09:22:48 +01:00
Wojtek Figat
b1b6953200 Optimize Volumetric Fog on 2k/4k displays by limiting res to 1080p 2026-01-28 08:53:15 +01:00
Wojtek Figat
fa428e343b Add dithering to Volumetric Fog to reduce aliasing 2026-01-28 08:39:56 +01:00
Wojtek Figat
dbbb67f398 Cleanup old Volumetric Fog pass code 2026-01-27 23:32:13 +01:00
Wojtek Figat
a9bddfa784 Fix Volumetric Fog sampling to use the same code path for depth slices conversion 2026-01-27 23:24:47 +01:00
Wojtek Figat
f9b784a42a Add improvements to Volumetric Fog quality and performance 2026-01-27 22:20:48 +01:00
Wojtek Figat
d47bd5d6e7 Fix small lights and small particles rasterization into Volumetric Fog 2026-01-27 21:00:20 +01:00
Wojtek Figat
e1013aec94 Add using medium shadow quality in Volumetric Fog for smoother shadowed lights scattering 2026-01-27 20:52:41 +01:00
Wojtek Figat
1c294059df Fix volume particles to apply opacity/mask into emission for proper shape 2026-01-27 14:12:48 +01:00
Wojtek Figat
305296883d Fix Volumetric Fog to not flicker on temporal blend when resizing the screen or changing quality 2026-01-27 13:56:26 +01:00
Chandler Cox
a7016d1186 Fix issue with tabs not collapsing panel 1 if no tabs on panel 1 2026-01-26 21:56:30 -06:00
Chandler Cox
004e02af73 Fix double scaling in canvas scalar. 2026-01-26 20:46:49 -06:00
Wojtek Figat
143d714037 Optimize Screen Space Reflections tracing with Hierarchical Z-Buffer
Improve SSR resolve filter quality and adjust scalability.
2026-01-26 15:22:39 +01:00
Wojtek Figat
da8376bba1 Fix NaN artifacts after TAA 2026-01-26 13:51:50 +01:00
Wojtek Figat
f773a0755d Merge branch 'Tryibion-fix-missing-light-serialize' 2026-01-22 23:40:22 +01:00
Wojtek Figat
d8343dae8e Merge branch 'fix-missing-light-serialize' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-missing-light-serialize 2026-01-22 23:40:16 +01:00
Wojtek Figat
b09fbe2d9b Fix deploying NuGet packages to include dependencies (recursive)
#3900
2026-01-22 23:39:38 +01:00
Wojtek Figat
6dbfd25bdb Fix deploying NuGet packages to include correct library file name
#3900
2026-01-22 19:57:16 +01:00
Wojtek Figat
ecfd03f79c Fix restoring NuGet packages for target with multiple projects
Fix restoring `NuGet` packages to run before project build to ensure files are downloaded

#3900
2026-01-22 18:49:47 +01:00
Wojtek Figat
66a295d5af Optimize reflections combine with depth bounds test 2026-01-20 22:41:59 +01:00
Wojtek Figat
d7458d81a5 Optimize SSR a bit more 2026-01-20 22:05:52 +01:00
Wojtek Figat
cc5e4c19e1 Fixes for SSAO and SSR 2026-01-20 18:19:34 +01:00
Wojtek Figat
0c5cb59875 Fix precision print in profile gpu dump command 2026-01-20 13:23:11 +01:00
Wojtek Figat
85ed0ecb06 Optimize ASSAO perf by using half pixels and less processing for similar visuals 2026-01-20 13:22:01 +01:00
Wojtek Figat
95b9392f51 Fix render target pool pink clear on consoles and mobile 2026-01-20 12:07:20 +01:00
Wojtek Figat
c7c1bbe35f Fix half res depth buffer regression from 192d3d1a8e 2026-01-20 12:01:03 +01:00
Wojtek Figat
192d3d1a8e Optimize SSAO rendering with depth bounds and half-res depth buffer 2026-01-20 00:22:27 +01:00
Wojtek Figat
877d57681d Optimize reflection probes, lights and shadow projections rendering with depth bounds test 2026-01-19 22:14:59 +01:00
Wojtek Figat
0a9bc084f4 Fix deprecated macro usage 2026-01-19 17:45:30 +01:00
Wojtek Figat
ec4f8ce239 Optimize RenderTargetWriteMask on depth pass for transparency and terrain materials 2026-01-19 17:45:18 +01:00
Wojtek Figat
d049a16882 Add support for Depth Bounds test in all graphics APIs 2026-01-19 17:44:45 +01:00
Wojtek Figat
ee75cab73e Add DirectX12 Agility SDK to third-party includes 2026-01-19 17:41:47 +01:00
Wojtek Figat
0072e21ffa Add ProfilerGPU.Dump command for GPU frame profiling log 2026-01-18 16:38:15 +01:00
Wojtek Figat
f44dde89db Fix missing vertex counting in draws (use index count to approx) 2026-01-18 16:24:15 +01:00
Chandler Cox
e6fd761b80 Fix missing light shadow resolution serialization. 2026-01-17 14:09:13 -06:00
Wojtek Figat
62a378e01a Update engine assets 2026-01-16 13:47:44 +01:00
Wojtek Figat
e67b705397 Deprecate GPUTimerQuery in favor of new queries API 2026-01-16 13:39:28 +01:00
Wojtek Figat
847f6411e7 Migrate ProfilerGPU to new lightweight queries API 2026-01-16 13:24:56 +01:00
Wojtek Figat
0d7c04682d Fix parsing else preprocessor and && conditions in bindings generator 2026-01-16 12:48:58 +01:00
Wojtek Figat
baf068330c Add Graphics.TestValue general purpose utility for A/B testing features and perf in shaders during development 2026-01-16 12:48:05 +01:00
Wojtek Figat
593646061e Mark TemporalScale in SSR settings as deprecated and add a minor sharpening to SSR temporal filter 2026-01-16 11:20:06 +01:00
Wojtek Figat
9ac231c403 Add new GPU Query API that is lightweight and supports occlusion queries 2026-01-16 10:40:30 +01:00
Wojtek Figat
d2d7a871ce Add sharpening and better AABB history clamp to Screen Space Reflections temporal filter 2026-01-14 14:00:54 +01:00
Wojtek Figat
b172b08782 Fix dark Screen Space Reflections in some spots when using Software Tracing 2026-01-14 13:26:26 +01:00
Wojtek Figat
18778aa511 **Add Box Projection to Environment Probe** for better indoor areas 2026-01-14 09:49:01 +01:00
Wojtek Figat
b7e32e13ab Add CaptureOffset to Environment Probe 2026-01-13 14:53:48 +01:00
Wojtek Figat
610c76578b Merge remote-tracking branch 'origin/master' into 1.12
# Conflicts:
#	Flax.flaxproj
2026-01-13 14:29:44 +01:00
Wojtek Figat
e721fbd89f Add editor status message about amount of selected actors 2026-01-13 14:21:32 +01:00
Wojtek Figat
ff2c5290b5 Fix Volumetric Fog rasterization on Vulkan 2026-01-13 13:21:32 +01:00
Wojtek Figat
2b4dc97a97 Fix yellowish artifacts due to quantization error in TAA and composite image output
#3318 #3254
2026-01-13 13:12:33 +01:00
Wojtek Figat
14842183f2 Fix sky, skylight and reflections banding artifacts with a random noise
#3254 #3318
2026-01-13 13:12:19 +01:00
Wojtek Figat
b4b13d8dd4 Fix crash when showing cube or volume texture in GPUTextureBrush 2026-01-13 10:36:26 +01:00
Wojtek Figat
e3d1e8a5ea Add View button to edit Environment Probe texture asset 2026-01-13 10:36:07 +01:00
Wojtek Figat
d9f90f726b Optimize reflection probes rendering by using depth test to reject occluded pixels early 2026-01-13 10:35:29 +01:00
Wojtek Figat
e0062a6ff1 Add RenderColorFormat option to graphics settings for rendering pipeline buffer format
#3618
2026-01-13 09:07:22 +01:00
Wojtek Figat
e494c9ec76 Add small scale for color grading LUT 2026-01-12 23:56:31 +01:00
Wojtek Figat
2501095500 Add screen vignette to Eye Adaptation histogram for more accurate exposure 2026-01-12 23:47:15 +01:00
Wojtek Figat
3cfc5db54a Merge branch 'xxSeys1-ArrayEditorHideSize' 2026-01-12 21:34:57 +01:00
Wojtek Figat
840835fad2 Merge branch 'ArrayEditorHideSize' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-ArrayEditorHideSize 2026-01-12 21:34:52 +01:00
Wojtek Figat
41f136ce0f Merge branch 'xxSeys1-UiClippingFixes' 2026-01-12 21:33:43 +01:00
Wojtek Figat
32cae3aacd Merge branch 'UiClippingFixes' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-UiClippingFixes 2026-01-12 21:33:03 +01:00
Wojtek Figat
832c524c3c Merge branch 'xxSeys1-DirtyEditorSettingsStar' 2026-01-12 21:30:07 +01:00
Wojtek Figat
a18ca9a4ad Merge branch 'DirtyEditorSettingsStar' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-DirtyEditorSettingsStar 2026-01-12 21:30:00 +01:00
Wojtek Figat
05e7e6630c Fix missing material graph references
#3839
2026-01-12 21:28:45 +01:00
Wojtek Figat
788d8660b8 Fix transparent materials flickering without DDGI 2026-01-12 20:47:03 +01:00
Wojtek Figat
ab806b2a9b Add checkerboard pattern to part of the alpha slider background in color picker 2026-01-12 18:53:56 +01:00
Wojtek Figat
610ba00915 Add support for picking colors in linear color space (with toggle for special cases like UI) 2026-01-12 18:50:44 +01:00
Wojtek Figat
e60bd165f4 Disable Linear color space until it's ready for production 2026-01-12 18:50:19 +01:00
Wojtek Figat
223d4f64eb Add GammaColorSpace to Graphics for simplicity 2026-01-12 18:49:10 +01:00
Wojtek Figat
827ad85651 Fix sRGB between Linear conversion to remain Alpha unchanged 2026-01-12 16:08:50 +01:00
Wojtek Figat
69c5d65318 Add Linear to sRGB and sRGB to Linear nodes to materials 2026-01-12 15:54:52 +01:00
Wojtek Figat
b834dddb11 **Refactor sRGB import option on textures** to actually handle image contents with gamma 2026-01-12 15:50:24 +01:00
Wojtek Figat
baddfec6d1 Merge branch 'GoaLitiuM-build_deps_fixes' 2026-01-12 00:32:07 +01:00
Wojtek Figat
fc2f56aca6 Fix missing console platforms
#3746
2026-01-12 00:31:59 +01:00
Wojtek Figat
0364fd629b Merge branch 'build_deps_fixes' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-build_deps_fixes 2026-01-11 23:31:09 +01:00
Wojtek Figat
5dbaf3f94e Fix to not crash after unhandled exception
#3570
2026-01-11 23:23:04 +01:00
Wojtek Figat
c5b7ea9c44 Merge branch 'xxSeys1-ArrowKeyValueBoxIncrement' 2026-01-11 22:37:19 +01:00
Wojtek Figat
7b856fdc95 Merge branch 'ArrowKeyValueBoxIncrement' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-ArrowKeyValueBoxIncrement 2026-01-11 22:36:09 +01:00
Wojtek Figat
890df65970 Add input GamepadButtonDown and GamepadButtonUp events
#3626
2026-01-11 22:34:57 +01:00
Wojtek Figat
ab6dfca36e Fix broken DrawWireTriangles
#3650
2026-01-11 22:23:49 +01:00
Wojtek Figat
72bb2dd932 Fix Resize to Fit to properly dirty state of level editor
#3670 #3735
2026-01-11 22:17:50 +01:00
Wojtek Figat
ca09852898 Merge branch 'xxSeys1-QuickOpenProductLocalFolder' 2026-01-11 22:11:24 +01:00
Wojtek Figat
e21cb9154a Adjust #3677 to evaluate product local path in lazy 2026-01-11 22:11:16 +01:00
Wojtek Figat
af124ce163 Merge branch 'QuickOpenProductLocalFolder' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-QuickOpenProductLocalFolder 2026-01-11 22:09:43 +01:00
Wojtek Figat
c28381fb09 Merge branch 'xxSeys1-UnderscoreNumberSeparator' 2026-01-11 22:07:57 +01:00
Wojtek Figat
973ff0efa0 Merge branch 'UnderscoreNumberSeparator' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-UnderscoreNumberSeparator 2026-01-11 22:07:51 +01:00
Wojtek Figat
27896b6410 Add view flag to hide particles drawing
#3840
2026-01-11 22:06:30 +01:00
Wojtek Figat
4bb9de21b4 Merge branch 'Tryibion-update-mesh-optimizer' 2026-01-11 21:55:08 +01:00
Wojtek Figat
890538c667 Merge branch 'update-mesh-optimizer' of https://github.com/Tryibion/FlaxEngine into Tryibion-update-mesh-optimizer 2026-01-11 21:54:43 +01:00
Wojtek Figat
4b9fa0dcf5 Add OnSerializing/OnSerialized/OnDeserializing/OnDeserialized callbacks to auto serialization code-gen 2026-01-09 10:24:38 +01:00
Wojtek Figat
14d1b7dd24 Fix name collision on new Focused event in control 2026-01-07 23:22:45 +01:00
Wojtek Figat
6788844270 Merge remote-tracking branch 'origin/1.12' into 1.12 2026-01-07 23:21:22 +01:00
Wojtek Figat
b2f2537338 Update version and year 2026-01-07 23:17:40 +01:00
Wojtek Figat
450b998a29 Merge branch 'master' into 1.12 2026-01-07 23:15:13 +01:00
Wojtek Figat
688d9c77cb Fix rendering postfx with color grading only in use and optimize color grading LUT to be skipped when unsued 2026-01-07 18:24:48 +01:00
Wojtek Figat
d71ea5a72b DIsable temporal jitter in debug views of Vertex Colors and Quad Overdraw 2026-01-07 17:57:03 +01:00
Wojtek Figat
01e3ece2af Remove leftover debug 2026-01-06 23:31:32 +01:00
Wojtek Figat
afc65f7557 Update engine materials after version change 2026-01-06 23:31:18 +01:00
Wojtek Figat
d60484b917 Merge remote-tracking branch 'origin/master' 2026-01-06 14:35:58 +01:00
feceb4e00f Update SDL to 3.4.0 2026-01-06 03:02:58 +02:00
67b33a575a Merge branch 'master' into sdl_platform
# Conflicts:
#	.github/workflows/build_linux.yml
#	.github/workflows/tests.yml
#	Source/Tools/Flax.Build/Projects/VisualStudio/VCProjectGenerator.cs
2026-01-06 02:57:52 +02:00
Wojtek Figat
76b869146d Fix missing scripting api tag on MeshAccessor::Stream 2026-01-06 00:03:35 +01:00
Wojtek Figat
32e725392b Optimize inactive probes update in DDGI with faster Jump Flood instead of Flood Fill 2026-01-06 00:01:17 +01:00
Wojtek Figat
0975ac2a25 Fix odd typo in DDGI inactive probes flood fill 2026-01-05 18:02:05 +01:00
Wojtek Figat
cf3bcc4549 Fix DDGI flickering on floors aligned to world axes
Apply a small bias to sample location and dither it a bit to smooth out.
2026-01-05 17:19:16 +01:00
Wojtek Figat
11ea889fa9 Refactor DDGI fallback radiance to use alpha for blending between fixed color and color at snapped location of the last cascade
This means artists don't need to adjust the value anymore as it can cover vista geometry with GI at last cascade borders.
2026-01-05 16:22:00 +01:00
Wojtek Figat
c5a28a5734 Refactor DDGI irradiance sampling when nearby probe is missing to use precomputed fallback probes
Also, insert fallback/dummy probes when there is no SDF nearby to have lighting in all cases.
This both improves sampling performance and fixes issues when sampling in areas far away from valid GI.
2026-01-05 12:04:02 +01:00
Wojtek Figat
6c79a17c7a Fix DDGI cascade placement when using large probes spacing
Revert fa38f0ac91 after b24d98df9e fixed the source of the problem
2026-01-03 20:57:17 +01:00
Wojtek Figat
b24d98df9e Fix DDGI cascades blending to be smoother 2026-01-03 00:48:36 +01:00
Wojtek Figat
400e2f1b0e Fix DDGI flickering on floors aligned to axis on value 0 (eg. floor) 2026-01-02 21:30:14 +01:00
Wojtek Figat
22e6139ca3 Merge branch 'fibref-asset-upgrader-fix' 2026-01-02 17:06:37 +01:00
Wojtek Figat
859fa16a74 Merge branch 'asset-upgrader-fix' of https://github.com/fibref/FlaxEngine into fibref-asset-upgrader-fix 2026-01-02 17:06:33 +01:00
Wojtek Figat
8facb46def Fix regression from 6f6dd2f4a3 on script interface vtable setup 2026-01-02 17:06:27 +01:00
fibref
b87f8b96e1 fix crash on asset auto-upgrade 2026-01-01 17:49:33 +08:00
Wojtek Figat
37df16a3e4 Refactor DDGI irradiance filtering for smoother and more accurate lighting 2025-12-31 00:19:51 +01:00
Wojtek Figat
ce45fa3d54 Fix crash on Global Surface Atlas objects buffer building 2025-12-30 23:41:49 +01:00
Wojtek Figat
7f56d9456b Fix bindings warning when using curve property/field 2025-12-30 22:51:37 +01:00
Wojtek Figat
1cad2489a3 Merge branch 'ThePhantomMask-fix-linuxCICD' 2025-12-29 22:53:44 +01:00
Wojtek Figat
7cdc2456cd Clone #3878 into more usages 2025-12-29 22:53:37 +01:00
Wojtek Figat
6b0ee3eeed Merge branch 'fix-linuxCICD' of https://github.com/ThePhantomMask/FlaxEngine into ThePhantomMask-fix-linuxCICD 2025-12-29 22:51:57 +01:00
Wojtek Figat
57330e39ca Merge branch 'GoaLitiuM-bindings_namespace_fix' 2025-12-29 22:29:34 +01:00
Wojtek Figat
af29f2f3dc Merge branch 'bindings_namespace_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-bindings_namespace_fix 2025-12-29 22:29:29 +01:00
Wojtek Figat
1bdb577b60 Fix engine services before exit event order 2025-12-29 22:24:55 +01:00
Wojtek Figat
329ea1c9b4 Merge branch 'GoaLitiuM-rider_cpp_project_launch' 2025-12-29 22:21:16 +01:00
Wojtek Figat
728da6354f Merge branch 'rider_cpp_project_launch' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-rider_cpp_project_launch 2025-12-29 22:21:13 +01:00
Wojtek Figat
d5456d6eb3 Merge branch 'GoaLitiuM-launchsettings_configuration' 2025-12-29 22:18:40 +01:00
Wojtek Figat
e65714988f Merge branch 'launchsettings_configuration' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-launchsettings_configuration 2025-12-29 22:14:00 +01:00
Wojtek Figat
4e4df736f9 Merge branch 'Tryibion-fix-unused-include' 2025-12-29 22:09:43 +01:00
Wojtek Figat
5bfe5b0035 Merge branch 'fix-unused-include' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-unused-include 2025-12-29 22:09:38 +01:00
Wojtek Figat
b30553ea65 Merge branch 'GoaLitiuM-vs_conformance' 2025-12-29 22:08:59 +01:00
Wojtek Figat
2550763808 Merge branch 'vs_conformance' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-vs_conformance 2025-12-29 22:08:54 +01:00
Wojtek Figat
6f6dd2f4a3 Fix crash on script VTable setup due to async
#3580
2025-12-29 22:06:55 +01:00
Wojtek Figat
c30d457b1c Add unit test of code from #3858 to ensure stability 2025-12-29 22:05:01 +01:00
Wojtek Figat
b786fa1c22 Merge branch 'GoaLitiuM-bindings_gen_fixes' 2025-12-29 22:03:46 +01:00
Wojtek Figat
bbcbe305a8 Merge branch 'bindings_gen_fixes' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-bindings_gen_fixes 2025-12-29 22:02:47 +01:00
Wojtek Figat
222df16f11 Merge branch 'Tryibion-fix-blend-shape-weight' 2025-12-28 00:32:38 +01:00
Wojtek Figat
8b924d13c1 Merge branch 'fix-blend-shape-weight' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-blend-shape-weight 2025-12-28 00:32:21 +01:00
Wojtek Figat
66e25c81b0 Merge branch 'GoaLitiuM-cmake_vs2026' 2025-12-27 22:07:23 +01:00
Wojtek Figat
e12f99ee53 Merge branch 'cmake_vs2026' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-cmake_vs2026 2025-12-27 22:07:17 +01:00
Wojtek Figat
387f0cf457 Merge branch 'GoaLitiuM-bytescontainer_codegen_fix' 2025-12-27 21:26:56 +01:00
Wojtek Figat
f11acdf5db Merge branch 'bytescontainer_codegen_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-bytescontainer_codegen_fix 2025-12-27 21:26:52 +01:00
Wojtek Figat
3af7dddcc2 Merge branch 'Tryibion-fix-compute-dist' 2025-12-27 21:22:32 +01:00
Wojtek Figat
543e2ecd13 Merge branch 'fix-compute-dist' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-compute-dist 2025-12-27 21:22:27 +01:00
35f8051a62 Fix managed boolean array conversion to native array 2025-12-23 01:37:53 +02:00
4453453d46 Fix managed wrapper function parameter handling for BytesContainer 2025-12-23 00:37:25 +02:00
Phantom
23f5f4d85f Add fix-missing 2025-12-21 16:41:51 +01:00
Phantom
90a21696f6 Fix Linux Dependencies error 2025-12-21 15:47:52 +01:00
Wojtek Figat
fa38f0ac91 Fix DDGI cascade offset towards bottom that was too intense making probes flicker 2025-12-20 23:44:56 +01:00
e3f5af530b Fix incorrect class namespace in bindings class name lookups 2025-12-19 23:57:41 +02:00
Chandler Cox
38d8832468 Update meshoptimizer library to 1.0 2025-12-19 11:46:47 -06:00
Chandler Cox
c68aa3b371 Remove not needed include that produces ambiguity for the Label class. 2025-12-19 08:13:24 -06:00
d031649bbd Fix warnings 2025-12-19 13:17:15 +02:00
21b8d1838d Fix command-line parsing for SDL CreateProcess arguments 2025-12-19 13:17:15 +02:00
c8ee2fc155 Add function for parsing command-line arguments into argument list 2025-12-19 13:17:15 +02:00
Chandler Cox
dc22fa4061 Fix blend shape always applying zero weight if default weight is zero. 2025-12-18 21:49:03 -06:00
3eb690fe58 Ensure managed converter functions are exported with optimizations 2025-12-19 01:08:45 +02:00
52e2327527 Add USED attribute for forcing compiler to emit the symbol 2025-12-19 01:08:45 +02:00
f95cbb0e52 Fix missing exports for managed converter structures 2025-12-19 01:08:44 +02:00
518a19c857 Expose RenderContext to scripting API 2025-12-19 01:08:44 +02:00
c0b54be692 Fix clang bindings code generation for non-const ref parameters 2025-12-19 01:08:44 +02:00
Wojtek Figat
c2c92eba82 Adjust 0e76585709 to not affect depth 2025-12-19 00:08:24 +01:00
d64c28f672 Fix compilation errors with /permissive- standard conformance mode 2025-12-19 00:03:48 +02:00
2a959d0531 Support Visual Studio 2026 as a generator for CMake dependencies 2025-12-18 18:05:45 +02:00
Chandler Cox
4504d0ae96 Fix compute distance crash if no closest point param is defined. 2025-12-16 18:22:26 -06:00
f14ba6ace6 Fix Flax C#-project launchSettings.json to launch without project 2025-12-17 02:19:38 +02:00
518f9dc9dc Launch editor when debugging VC++ projects in Rider Linux/macOS 2025-12-17 02:19:38 +02:00
8db29a30e0 Fix VC++ project file building on macOS Rider 2025-12-17 02:18:45 +02:00
Wojtek Figat
0e76585709 Fix DDGI iradiance to use debanding by applying quantization error to reduce yellowish artifacts due to R11G11B10 format 2025-12-16 23:56:45 +01:00
Wojtek Figat
8bf51512ac Fix Global SDF trace loop limit down to prevent too long shader execution in extreme scenarios 2025-12-16 16:08:20 +01:00
Wojtek Figat
779e8e7169 Optimize Global SDF tracing to not scale steps nearby geometry and properly trace mip cascade 2025-12-16 16:07:46 +01:00
Wojtek Figat
3c8b80152b Fix sampling Global SDF gradient at lower border 2025-12-16 16:05:49 +01:00
Wojtek Figat
f280412ef4 Remove NeedsHitNormal/HitNormal feature from GlobalSDFTrace to simplify code 2025-12-16 16:04:56 +01:00
1327fa40cb Run editor with selected project configuration in launchSettings.json 2025-12-16 01:37:51 +02:00
b70ab01308 Fix duplicate properties for default configuration in C# projects 2025-12-16 01:37:51 +02:00
ae03bc2dd2 Improve Linux .NET runtime identifier detection
Use the runtime identifier detected during runtime instead of
calling the dotnet tool in order to query it.
2025-12-14 20:25:33 +02:00
5cd27032b4 Set C# language version to 14 with .NET 10 2025-12-14 20:25:33 +02:00
7445064d97 Improve installed .NET runtime version detection 2025-12-14 20:25:33 +02:00
Saas
e47fc5a54a Merge branch 'master' into PressGToGameModeAndPToNavigate 2025-12-11 21:04:00 +01:00
Saas
26e24769be actually set things to the right thing
How the hell did this happen??
2025-12-11 20:44:40 +01:00
Wojtek Figat
394860656a Add FPS limit and pause option when game is unfocused 2025-11-27 10:55:02 +01:00
Wojtek Figat
b07d74d28d Add option to skip loading Model SDFs in game if disabled in Graphics Settings 2025-11-25 10:39:15 +01:00
Wojtek Figat
dacb3b0891 Fix rendering on Intel-based macOS to use integrated GPU primarly 2025-11-25 10:30:53 +01:00
Wojtek Figat
a8db0086b1 Fix shader compilation without HLSL 2021 on Vulkan 2025-11-20 13:07:28 +01:00
Wojtek Figat
e46b6d5b06 Restore Global Surface Atlas and DDGI on Apple platforms
#3797
2025-11-20 10:44:47 +01:00
Wojtek Figat
dfc8c1fac2 Fix GPU BVH shader compilation for macOS/iOS 2025-11-20 10:39:16 +01:00
Wojtek Figat
f8de118288 Merge remote-tracking branch 'origin/master' into 1.12 2025-11-20 10:15:07 +01:00
Saas
887311d1f1 replace raw data with (a) struct(s) 2025-11-13 23:00:09 +01:00
Wojtek Figat
f8e4f54c77 Fix animation state transition inputs when using other surface context 2025-11-02 22:12:53 +01:00
ea20dc6da0 Fix wrong build configuration used in ogg and vorbis for Windows 2025-10-31 02:38:09 +02:00
9becddd84f Add dependency build script for Visual Studio EnvDTE 2025-10-31 02:38:09 +02:00
b08c765400 Add dependency build script for WinPixEventRuntime 2025-10-31 02:38:09 +02:00
afd59d7eb3 Fix building vorbis on Windows 2025-10-31 02:38:09 +02:00
47cdd0582c Check VS2026 toolset before trying to compile PhysX 2025-10-31 02:38:09 +02:00
af54d04f9d Fix building ogg+vorbis on macOS 2025-10-31 02:38:09 +02:00
1d2b3bc858 Fix NvCloth compilation on Linux and macOS 2025-10-31 02:32:06 +02:00
4b552563be Fix PhysX compilation on Linux and macOS 2025-10-31 02:32:06 +02:00
ebd929176c Fix python tool call on macOS for glslang 2025-10-31 02:32:06 +02:00
430e685a7c Fix building PhysX on Linux and macOS 2025-10-31 02:32:05 +02:00
d5bd857c45 Support building OpenAL from Git repository in other platforms 2025-10-31 02:32:05 +02:00
b8b9ba3069 Fix building curl on Linux 2025-10-31 02:32:05 +02:00
84c79d5192 Fix building Assimp on Linux
Versioned clang++ symlinks are not available on Arch
2025-10-31 02:32:05 +02:00
028f3a7871 Add support for building dependencies with specific architecture 2025-10-31 02:32:05 +02:00
0c462315f0 Fix CMake compatibility errors with dependencies 2025-10-31 02:21:23 +02:00
26261a2090 Support Visual Studio 2026 as a generator for CMake dependencies 2025-10-31 02:18:00 +02:00
Wojtek Figat
b5de4d78ad Fix editing InputEvent that is null 2025-10-30 11:57:47 +01:00
Wojtek Figat
0913e6f738 Fix error when focus changes during focus change xd 2025-10-30 10:39:46 +01:00
Wojtek Figat
99c26ff9af Fix crash when control reference gets invalid in Editor 2025-10-21 15:54:37 +02:00
Wojtek Figat
a2d91d989d Add Focused event to control 2025-10-21 15:54:20 +02:00
Wojtek Figat
881154e9f4 Fix missing parent tags when creating nested ones from code 2025-10-21 15:54:03 +02:00
Saas
5ec2476aec add "*" to editor settings window title when settings are dirty 2025-10-16 21:05:10 +02:00
Saas
79351f0c4d Hide array editor "Size" text when array title overlaps it 2025-10-15 21:09:24 +02:00
Chandler Cox
25744986a3 Special query for closest point on height field. 2025-10-13 20:40:16 -05:00
Saas
48100cf9fc fix group element text clipping
fixes group element header text clipping outside of the header and into the settings icon (if there is one).
Also some extra code to handle script editor, as that displays some extra icons in the header.
2025-10-13 11:16:07 +02:00
Saas
76f0768b99 float 2025-10-12 16:14:07 +02:00
Saas
b2b855200f allow entering numbers with digit separator into value boxes (f.e. 1_000) 2025-10-11 22:02:14 +02:00
Saas
241a8bc764 add incrementing/ decrementing value boxe's value with arrow keys 2025-10-11 20:30:51 +02:00
Saas
13dd80d429 add changing and caching Debug ViewMode for Game View 2025-09-21 16:57:38 +02:00
Saas
6e9902a966 use DefaultGame ViewFlag and some fixes 2025-09-21 16:49:07 +02:00
Saas
fd1e0a4e80 add game view to "View" menu, add keyboard new keyboard shortcuts to menu and extra options for view flags and view layers 2025-09-20 16:12:04 +02:00
Saas
b130b81863 add game view and show/ hiding navigation similar to unreal engine 2025-09-20 15:08:03 +02:00
Saas
b38a7e6eb2 unify both "too many audio listeners"- warnings 2025-09-18 17:54:21 +02:00
Saas
4f3f1cd163 make changing selected box with arrow up/ down loop 2025-09-15 23:09:07 +02:00
Saas
4d77646f26 fix error when changing selected box with arrow keys 2025-09-15 22:46:56 +02:00
Saas
187592b673 add moving visject nodes in smaller increments when holding shift and alt 2025-09-15 22:37:31 +02:00
Saas
215467ae42 add ribbon menu buttons to quick open product local folder 2025-09-14 18:14:38 +02:00
Saas
facd7d39dc return true if handled 2025-09-14 16:02:48 +02:00
Saas
6810e5f2a4 add moving selected keyframes with arrow keys 2025-09-14 16:00:07 +02:00
Saas
ee6fae8956 small polish stuff
- Fix keyframe edit popup height
- Make keyframe mouse hover color more intense
- Increase keyframe size by 1 to prevent accidental miss clicks, resulting in a new keyframe added, when trying to double click to edit a keyframe
2025-09-14 14:15:35 +02:00
Saas
bb6c3233d2 method placement 2025-09-13 19:22:37 +02:00
Saas
499228cc98 add curve editor presets 2025-09-13 19:07:41 +02:00
Saas
f2699892e0 add support for resizing visject curve nodes 2025-08-17 15:42:54 +02:00
738 changed files with 87203 additions and 14012 deletions

View File

@@ -16,7 +16,8 @@ jobs:
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev libwayland-dev
sudo apt-get update
sudo apt-get install -y --fix-missing libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev libwayland-dev
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET

View File

@@ -87,7 +87,8 @@ jobs:
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
- name: Install dependencies
run: |
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
sudo apt-get update
sudo apt-get install -y --fix-missing libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
@@ -118,7 +119,8 @@ jobs:
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
- name: Install dependencies
run: |
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
sudo apt-get update
sudo apt-get install -y --fix-missing libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET

View File

@@ -28,7 +28,8 @@ jobs:
git lfs pull
- name: Install dependencies
run: |
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev libwayland-dev
sudo apt-get update
sudo apt-get install -y --fix-missing libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev libwayland-dev
- name: Build
run: |
./GenerateProjectFiles.sh -vs2022 -log -verbose -printSDKs -dotnet=8

BIN
Content/Editor/Camera/M_Camera.flax (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Editor/DefaultFontMaterial.flax (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

BIN
Content/Editor/Gizmo/Material.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Editor/Gizmo/MaterialWire.flax (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Editor/Highlight Material.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Editor/Icons/IconsMaterial.flax (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

View File

@@ -4,8 +4,8 @@
#define MAX_LOCAL_LIGHTS 4
@1// Forward Shading: Includes
#include "./Flax/LightingCommon.hlsl"
#if USE_REFLECTIONS
#include "./Flax/ReflectionsCommon.hlsl"
#if USE_REFLECTIONS
#define MATERIAL_REFLECTIONS_SSR 1
#if MATERIAL_REFLECTIONS == MATERIAL_REFLECTIONS_SSR
#include "./Flax/SSR.hlsl"
@@ -14,11 +14,13 @@
#include "./Flax/Lighting.hlsl"
#include "./Flax/ShadowsSampling.hlsl"
#include "./Flax/ExponentialHeightFog.hlsl"
#include "./Flax/VolumetricFog.hlsl"
@2// Forward Shading: Constants
LightData DirectionalLight;
LightData SkyLight;
ProbeData EnvironmentProbe;
EnvProbeData EnvironmentProbe;
ExponentialHeightFogData ExponentialHeightFog;
VolumetricFogData VolumetricFog;
float3 Dummy2;
uint LocalLightsCount;
LightData LocalLights[MAX_LOCAL_LIGHTS];
@@ -28,12 +30,14 @@ TextureCube SkyLightTexture : register(t__SRV__);
Buffer<float4> ShadowsBuffer : register(t__SRV__);
Texture2D<float> ShadowMap : register(t__SRV__);
Texture3D VolumetricFogTexture : register(t__SRV__);
Texture2D PreIntegratedGF : register(t__SRV__);
@4// Forward Shading: Utilities
// Public accessors for lighting data, use them as data binding might change but those methods will remain.
LightData GetDirectionalLight() { return DirectionalLight; }
LightData GetSkyLight() { return SkyLight; }
ProbeData GetEnvironmentProbe() { return EnvironmentProbe; }
EnvProbeData GetEnvironmentProbe() { return EnvironmentProbe; }
ExponentialHeightFogData GetExponentialHeightFog() { return ExponentialHeightFog; }
VolumetricFogData GetVolumetricFog() { return VolumetricFog; }
uint GetLocalLightsCount() { return LocalLightsCount; }
LightData GetLocalLight(uint i) { return LocalLights[i]; }
@5// Forward Shading: Shaders
@@ -108,7 +112,8 @@ void PS_Forward(
// Calculate reflections
#if USE_REFLECTIONS
float3 reflections = SampleReflectionProbe(ViewPos, EnvProbe, EnvironmentProbe, gBuffer.WorldPos, gBuffer.Normal, gBuffer.Roughness).rgb;
float4 reflections = SampleReflectionProbe(ViewPos, EnvProbe, EnvironmentProbe, gBuffer.WorldPos, gBuffer.Normal, gBuffer.Roughness);
reflections.rgb *= reflections.a;
#if MATERIAL_REFLECTIONS == MATERIAL_REFLECTIONS_SSR
// Screen Space Reflections
@@ -116,7 +121,7 @@ void PS_Forward(
Texture2D sceneColorTexture = MATERIAL_REFLECTIONS_SSR_COLOR;
float2 screenUV = materialInput.SvPosition.xy * ScreenSize.zw;
float stepSize = ScreenSize.z; // 1 / screenWidth
float maxSamples = 48;
float maxSamples = 50;
float worldAntiSelfOcclusionBias = 0.1f;
float brdfBias = 0.82f;
float drawDistance = 5000.0f;
@@ -124,7 +129,7 @@ void PS_Forward(
if (hit.z > 0)
{
float3 screenColor = sceneColorTexture.SampleLevel(SamplerPointClamp, hit.xy, 0).rgb;
reflections = lerp(reflections, screenColor, hit.z);
reflections.rgb = lerp(reflections.rgb, screenColor, hit.z);
}
// Fallback to software tracing if possible
@@ -136,17 +141,17 @@ void PS_Forward(
if (TraceSDFSoftwareReflections(gBuffer, reflectWS, surfaceAtlas))
{
float3 screenColor = sceneColorTexture.SampleLevel(SamplerPointClamp, hit.xy, 0).rgb;
reflections = lerp(surfaceAtlas, float4(screenColor, 1), hit.z);
reflections.rgb = lerp(surfaceAtlas, float4(screenColor, 1), hit.z);
}
}
#endif
#endif
light.rgb += reflections * GetReflectionSpecularLighting(ViewPos, gBuffer) * light.a;
light.rgb += reflections.rgb * GetReflectionSpecularLighting(PreIntegratedGF, ViewPos, gBuffer);
#endif
// Add lighting (apply ambient occlusion)
output.rgb += light.rgb * gBuffer.AO;
// Add lighting
output.rgb += light.rgb;
#endif
@@ -158,17 +163,13 @@ void PS_Forward(
#else
float fogSceneDistance = gBuffer.ViewPos.z;
#endif
float4 fog = GetExponentialHeightFog(ExponentialHeightFog, materialInput.WorldPosition, ViewPos, 0, fogSceneDistance);
float fogSkipDistance = max(ExponentialHeightFog.VolumetricFogMaxDistance - 100, 0);
float4 fog = GetExponentialHeightFog(ExponentialHeightFog, materialInput.WorldPosition, ViewPos, fogSkipDistance, fogSceneDistance);
if (ExponentialHeightFog.VolumetricFogMaxDistance > 0)
{
// Sample volumetric fog and mix it in
float2 screenUV = materialInput.SvPosition.xy * ScreenSize.zw;
float3 viewVector = materialInput.WorldPosition - ViewPos;
float sceneDepth = length(viewVector);
float depthSlice = sceneDepth / ExponentialHeightFog.VolumetricFogMaxDistance;
float3 volumeUV = float3(screenUV, depthSlice);
float4 volumetricFog = VolumetricFogTexture.SampleLevel(SamplerLinearClamp, volumeUV, 0);
float4 volumetricFog = SampleVolumetricFog(VolumetricFogTexture, VolumetricFog, materialInput.WorldPosition - ViewPos, screenUV, TemporalAAJitter);
fog = CombineVolumetricFog(fog, volumetricFog);
}

View File

@@ -38,6 +38,7 @@ struct VertexOutput
#endif
float4 ClipExtents : TEXCOORD3;
float2 ClipOrigin : TEXCOORD4;
float2 CustomData : TEXCOORD5; // x-per-geometry type, y-features mask
#if USE_CUSTOM_VERTEX_INTERPOLATORS
float4 CustomVSToPS[CUSTOM_VERTEX_INTERPOLATORS_COUNT] : TEXCOORD9;
#endif
@@ -55,6 +56,7 @@ struct PixelInput
#endif
float4 ClipExtents : TEXCOORD3;
float2 ClipOrigin : TEXCOORD4;
float2 CustomData : TEXCOORD5; // x-per-geometry type, y-features mask
#if USE_CUSTOM_VERTEX_INTERPOLATORS
float4 CustomVSToPS[CUSTOM_VERTEX_INTERPOLATORS_COUNT] : TEXCOORD9;
#endif
@@ -67,6 +69,7 @@ struct MaterialInput
float3 WorldPosition;
float TwoSidedSign;
float2 TexCoord;
float2 CustomData; // x-per-geometry type, y-features mask
#if USE_VERTEX_COLOR
half4 VertexColor;
#endif
@@ -84,6 +87,7 @@ MaterialInput GetMaterialInput(Render2DVertex input, VertexOutput output)
MaterialInput result;
result.WorldPosition = output.WorldPosition;
result.TexCoord = output.TexCoord;
result.CustomData = input.CustomDataAndClipOrigin.xy;
#if USE_VERTEX_COLOR
result.VertexColor = output.VertexColor;
#endif
@@ -103,6 +107,7 @@ MaterialInput GetMaterialInput(PixelInput input)
MaterialInput result;
result.WorldPosition = input.WorldPosition;
result.TexCoord = input.TexCoord;
result.CustomData = input.CustomData;
#if USE_VERTEX_COLOR
result.VertexColor = input.VertexColor;
#endif
@@ -229,6 +234,7 @@ VertexOutput VS_GUI(Render2DVertex input)
#if USE_VERTEX_COLOR
output.VertexColor = input.Color;
#endif
output.CustomData = input.CustomDataAndClipOrigin.xy;
output.ClipOrigin = input.CustomDataAndClipOrigin.zw;
output.ClipExtents = input.ClipExtents;

View File

@@ -8,6 +8,7 @@
#include "./Flax/Common.hlsl"
#include "./Flax/MaterialCommon.hlsl"
#include "./Flax/GBufferCommon.hlsl"
#include "./Flax/VolumetricFog.hlsl"
@7
// Primary constant buffer (with additional material parameters)
@@ -21,6 +22,7 @@ float Dummy0;
float VolumetricFogMaxDistance;
int ParticleStride;
int ParticleIndex;
float4 GridSliceParameters;
@1META_CB_END
// Particles attributes buffer
@@ -202,19 +204,19 @@ Material GetMaterialPS(MaterialInput input)
META_PS(true, FEATURE_LEVEL_SM5)
void PS_VolumetricFog(Quad_GS2PS input, out float4 VBufferA : SV_Target0, out float4 VBufferB : SV_Target1)
{
// Reproject grid position back to the screen and world space
uint3 gridCoordinate = uint3(input.Vertex.Position.xy, input.LayerIndex);
float3 cellOffset = 0.5f;
float2 volumeUV = (gridCoordinate.xy + cellOffset.xy) / GridSize.xy;
float zSlice = gridCoordinate.z + cellOffset.z;
float sceneDepth = (zSlice / GridSize.z) * VolumetricFogMaxDistance / ViewFar;
float sceneDepth = GetDepthFromSlice(GridSliceParameters, gridCoordinate.z + cellOffset.z) / ViewFar;
float deviceDepth = (ViewInfo.w / sceneDepth) + ViewInfo.z;
float4 clipPos = float4(volumeUV * float2(2.0, -2.0) + float2(-1.0, 1.0), deviceDepth, 1.0);
float4 wsPos = mul(clipPos, InverseViewProjectionMatrix);
float3 positionWS = wsPos.xyz / wsPos.w;
wsPos.xyz /= wsPos.w;
// Get material parameters
MaterialInput materialInput = (MaterialInput)0;
materialInput.WorldPosition = positionWS;
materialInput.WorldPosition = wsPos.xyz;
materialInput.TexCoord = input.Vertex.TexCoord;
materialInput.ParticleIndex = ParticleIndex;
materialInput.TBN = float3x3(float3(1, 0, 0), float3(0, 1, 0), float3(0, 0, 1));
@@ -225,9 +227,10 @@ void PS_VolumetricFog(Quad_GS2PS input, out float4 VBufferA : SV_Target0, out fl
Material material = GetMaterialPS(materialInput);
// Compute fog properties
material.Opacity *= material.Mask;
float3 albedo = material.Color;
float extinction = material.Opacity * material.Mask * 0.001f;
float3 emission = material.Emissive;
float extinction = material.Opacity * 0.001f;
float3 emission = material.Emissive * material.Opacity;
float3 scattering = albedo * extinction;
float absorption = max(0.0f, extinction - Luminance(scattering));

Binary file not shown.

Binary file not shown.

BIN
Content/Editor/SpriteMaterial.flax (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Editor/TexturePreviewMaterial.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Editor/Wires Debug Material.flax (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

BIN
Content/Engine/DefaultMaterial.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Engine/DefaultRadialMenu.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Engine/DefaultTerrainMaterial.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Engine/SingleColorMaterial.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Engine/SkyboxMaterial.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/ColorGrading.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/Fog.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/GI/DDGI.flax (Stored with Git LFS)

Binary file not shown.

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0f34bf867df5f4296ca66ac691c2bca4efa168fb9e21ca4e613e8086669575cf
size 13296
oid sha256:615dff65b01507be6c4de722e126324aba20fc197f8e12dafaa94a05e46cba6e
size 13222

BIN
Content/Shaders/GUI.flax (Stored with Git LFS)

Binary file not shown.

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:064f54786958f109222c49cbc0358ff4f345b30010fcd5e8cc1fab7bdc68c4fe
size 13349
oid sha256:1f07ebb16820897e8598ae7a0627cb75b3d28e9dceea3ad4bd9ff543d5cdd01c
size 13979

BIN
Content/Shaders/Histogram.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/Lights.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/MultiScaler.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/PostProcessing.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/Reflections.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/SSAO.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/SSR.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/Sky.flax (Stored with Git LFS)

Binary file not shown.

BIN
Content/Shaders/TAA.flax (Stored with Git LFS)

Binary file not shown.

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:872ac3560279bfd0aeb989ebac1b49750dd142b985bc40058888dfd2b63fe9b2
size 13214
oid sha256:706adde844360c2b0e65ecabaf1d2e2cc4eb4ac7ca9d483d0dd04ec8163b3d97
size 13081

View File

@@ -2,12 +2,12 @@
"Name": "Flax",
"Version": {
"Major": 1,
"Minor": 11,
"Minor": 12,
"Revision": 0,
"Build": 6805
"Build": 6905
},
"Company": "Flax",
"Copyright": "Copyright (c) 2012-2025 Wojciech Figat. All rights reserved.",
"Copyright": "Copyright (c) 2012-2026 Wojciech Figat. All rights reserved.",
"GameTarget": "FlaxGame",
"EditorTarget": "FlaxEditor",
"Configuration": {

View File

@@ -188,7 +188,7 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_CASE_STATEMENT_ON_SAME_LINE/@EntryValue">ALWAYS</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_EMBEDDED_STATEMENT_ON_SAME_LINE/@EntryValue">NEVER</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_CASE_STATEMENT_STYLE/@EntryValue">ON_SINGLE_LINE</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean>

View File

@@ -15,7 +15,7 @@ if errorlevel 1 goto BuildToolFailed
:: Build bindings for all editor configurations
echo Building C# bindings...
Binaries\Tools\Flax.Build.exe -build -BuildBindingsOnly -arch=x64 -platform=Windows --buildTargets=FlaxEditor,FlaxGame
Binaries\Tools\Flax.Build.exe -build -BuildBindingsOnly -arch=x64 -platform=Windows --buildTargets=FlaxEditor
popd
echo Done!

View File

@@ -12,6 +12,6 @@ cd "`dirname "$0"`"
bash ./Development/Scripts/Mac/CallBuildTool.sh --genproject "$@"
# Build bindings for all editor configurations
echo Building C# bindings...
#echo Building C# bindings...
# TODO: Detect the correct architecture here
Binaries/Tools/Flax.Build -build -BuildBindingsOnly -arch=ARM64 -platform=Mac --buildTargets=FlaxEditor
#Binaries/Tools/Flax.Build -build -BuildBindingsOnly -arch=ARM64 -platform=Mac --buildTargets=FlaxEditor

View File

@@ -187,6 +187,11 @@ namespace FlaxEditor.Content.Import
// Glossiness, metalness, ambient occlusion, displacement, height, cavity or specular
_settings.Settings.Type = TextureFormatType.GrayScale;
}
else if (_settings.Settings.Type == TextureFormatType.ColorRGB)
{
// Blind guess that common color texture is sRGB
_settings.Settings.sRGB = true;
}
// Try to restore target asset texture import options (useful for fast reimport)
Editor.TryRestoreImportOptions(ref _settings.Settings, ResultUrl);

View File

@@ -749,7 +749,7 @@ namespace FlaxEditor.Content
}
// Draw short name
Render2D.PushClip(textRect);
Render2D.PushClip(ref textRect);
var scale = 0.95f * view.ViewScale;
Render2D.DrawText(style.FontMedium, ShowFileExtension || view.ShowFileExtensions ? FileName : ShortName, textRect, style.Foreground, nameAlignment, TextAlignment.Center, TextWrapping.WrapWords, 1f, scale);
Render2D.PopClip();

View File

@@ -263,7 +263,7 @@ namespace FlaxEditor.Content.Thumbnails
// Create render task but disabled for now
_output = GPUDevice.Instance.CreateTexture("ThumbnailsOutput");
var desc = GPUTextureDescription.New2D(PreviewsCache.AssetIconSize, PreviewsCache.AssetIconSize, PreviewsCache.AssetIconsAtlasFormat);
_output.Init(desc);
_output.Init(ref desc);
_task = Object.New<RenderTask>();
_task.Order = 50; // Render this task later
_task.Enabled = false;

View File

@@ -139,7 +139,7 @@ namespace FlaxEditor.CustomEditors
return new GenericEditor();
}
[LibraryImport("FlaxEngine", EntryPoint = "CustomEditorsUtilInternal_GetCustomEditor", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
[LibraryImport("FlaxEngine", EntryPoint = "CustomEditorsUtilInternal_GetCustomEditor", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalUsing(typeof(SystemTypeMarshaller))]
internal static partial Type Internal_GetCustomEditor([MarshalUsing(typeof(SystemTypeMarshaller))] Type targetType);
}

View File

@@ -60,14 +60,14 @@ namespace FlaxEditor.CustomEditors.Dedicated
if (prefab && !prefab.WaitForLoaded())
{
var prefabObjectId = actor.PrefabObjectID;
var prefabInstance = prefab.GetDefaultInstance(prefabObjectId);
var prefabInstance = prefab.GetDefaultInstance(ref prefabObjectId);
if (prefabInstance != null)
{
// Use default prefab instance as a reference for the editor
Values.SetReferenceValue(prefabInstance);
// Display prefab UI (when displaying object inside Prefab Window then display only nested prefabs)
prefab.GetNestedObject(prefabObjectId, out var nestedPrefabId, out var nestedPrefabObjectId);
prefab.GetNestedObject(ref prefabObjectId, out var nestedPrefabId, out var nestedPrefabObjectId);
var nestedPrefab = FlaxEngine.Content.Load<Prefab>(nestedPrefabId);
var panel = layout.UniformGrid();
panel.CustomControl.Height = 20.0f;
@@ -207,7 +207,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
{
var actor = (Actor)Values[0];
var prefabObjectId = actor.PrefabObjectID;
var prefabInstance = prefab.GetDefaultInstance(prefabObjectId);
var prefabInstance = prefab.GetDefaultInstance(ref prefabObjectId);
if (prefabInstance != null)
{
Values.SetReferenceValue(prefabInstance);
@@ -525,7 +525,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
var restored = actor.AddScript(removed.PrefabObject.GetType());
var prefabId = actor.PrefabID;
var prefabObjectId = restored.PrefabObjectID;
Script.Internal_LinkPrefab(FlaxEngine.Object.GetUnmanagedPtr(restored), prefabId, prefabObjectId);
Script.Internal_LinkPrefab(FlaxEngine.Object.GetUnmanagedPtr(restored), ref prefabId, ref prefabObjectId);
string data = JsonSerializer.Serialize(removed.PrefabObject);
JsonSerializer.Deserialize(restored, data);
@@ -547,7 +547,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
string data = JsonSerializer.Serialize(removedActor.PrefabObject);
JsonSerializer.Deserialize(restored, data);
Presenter.Owner.SceneContext.Spawn(restored, parentActor, removedActor.OrderInParent);
Actor.Internal_LinkPrefab(FlaxEngine.Object.GetUnmanagedPtr(restored), prefabId, prefabObjectId);
Actor.Internal_LinkPrefab(FlaxEngine.Object.GetUnmanagedPtr(restored), ref prefabId, ref prefabObjectId);
return;
}

View File

@@ -21,10 +21,12 @@ namespace FlaxEditor.CustomEditors.Dedicated
if (Values.HasDifferentTypes == false)
{
var group = layout.Group("Bake");
var group = layout.Group("Probe");
group.Panel.ItemsMargin = new Margin(Utilities.Constants.UIMargin * 2);
_bake = group.Button("Bake").Button;
_bake.Clicked += BakeButtonClicked;
var view = group.Button("View", "Opens the probe texture viewer");
view.Button.Clicked += OnViewButtonClicked;
}
}
@@ -50,5 +52,14 @@ namespace FlaxEditor.CustomEditors.Dedicated
}
}
}
private void OnViewButtonClicked()
{
foreach (var value in Values)
{
if (value is EnvironmentProbe probe && probe.ProbeAsset)
Editor.Instance.ContentEditing.Open(probe.ProbeAsset);
}
}
}
}

View File

@@ -195,7 +195,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
filesCount += files.Length;
foreach (var file in files)
FindNewKeysCpp(file, newKeys, allKeys);
files = Directory.GetFiles(Globals.ProjectSourceFolder, "*.h", SearchOption.AllDirectories).Concat(Directory.GetFiles(Globals.ProjectSourceFolder, "*.hpp", SearchOption.AllDirectories)).ToArray();;
files = Directory.GetFiles(Globals.ProjectSourceFolder, "*.h", SearchOption.AllDirectories).Concat(Directory.GetFiles(Globals.ProjectSourceFolder, "*.hpp", SearchOption.AllDirectories)).ToArray();
filesCount += files.Length;
foreach (var file in files)
FindNewKeysCpp(file, newKeys, allKeys);

View File

@@ -164,11 +164,11 @@ namespace FlaxEditor.CustomEditors.Dedicated
var button2Rect = new Rectangle(button1Rect.Right + 2, 1, 14, 14);
// Deselect
if (isSelected && button1Rect.Contains(location))
if (isSelected && button1Rect.Contains(ref location))
Value = new ModelInstanceActor.MeshReference { Actor = null, LODIndex = -1, MeshIndex = -1 };
// Picker dropdown menu
if ((isSelected ? button2Rect : button1Rect).Contains(location))
if ((isSelected ? button2Rect : button1Rect).Contains(ref location))
ShowDropDownMenu();
return base.OnMouseUp(location, button);

View File

@@ -40,7 +40,7 @@ public class ModelPrefabEditor : GenericEditor
if (prefab)
{
var prefabObjectId = modelPrefab.PrefabObjectID;
var prefabObject = prefab.GetDefaultInstance(prefabObjectId);
var prefabObject = prefab.GetDefaultInstance(ref prefabObjectId);
if (prefabObject.PrefabID == _prefabId)
break;
_prefabId = prefabObject.PrefabID;

View File

@@ -0,0 +1,38 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using FlaxEngine;
namespace FlaxEditor.CustomEditors.Dedicated
{
/// <summary>
/// Custom editor for <see cref="NavMeshBoundsVolume"/>.
/// </summary>
/// <seealso cref="ActorEditor" />
[CustomEditor(typeof(NavMeshBoundsVolume)), DefaultEditor]
internal class NavMeshBoundsVolumeEditor : ActorEditor
{
/// <inheritdoc />
public override void Initialize(LayoutElementsContainer layout)
{
base.Initialize(layout);
if (Values.HasDifferentTypes == false)
{
var button = layout.Button("Build");
button.Button.Clicked += OnBuildClicked;
}
}
private void OnBuildClicked()
{
foreach (var value in Values)
{
if (value is NavMeshBoundsVolume volume)
{
Navigation.BuildNavMesh(volume.Box, volume.Scene);
Editor.Instance.Scene.MarkSceneEdited(volume.Scene);
}
}
}
}
}

View File

@@ -1,7 +1,6 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.Reflection.Emit;
using FlaxEditor.CustomEditors.GUI;
using FlaxEngine;
using FlaxEngine.GUI;

View File

@@ -909,7 +909,8 @@ namespace FlaxEditor.CustomEditors.Dedicated
settingsButton.Tag = script;
settingsButton.Clicked += OnSettingsButtonClicked;
group.Panel.HeaderTextMargin = new Margin(scriptDrag.Right - 12, 15, 2, 2);
// Adjust margin to not overlap with other ui elements in the header
group.Panel.HeaderTextMargin = group.Panel.HeaderTextMargin with { Left = scriptDrag.Right - 12, Right = settingsButton.Width + Utilities.Constants.UIMargin };
group.Object(values, editor);
// Remove drop down arrows and containment lines if no objects in the group
if (group.Children.Count == 0)

View File

@@ -192,7 +192,7 @@ namespace FlaxEditor.CustomEditors.Editors
public override bool OnMouseDown(Float2 location, MouseButton button)
{
if (DropdownRect.Contains(location))
if (DropdownRect.Contains(ref location))
{
Focus();
ShowPicker();
@@ -206,7 +206,7 @@ namespace FlaxEditor.CustomEditors.Editors
{
base.OnMouseMove(location);
if (DropdownRect.Contains(location))
if (DropdownRect.Contains(ref location))
Cursor = CursorType.Default;
else
Cursor = CursorType.IBeam;

View File

@@ -155,7 +155,7 @@ namespace FlaxEditor.CustomEditors.Editors
/// <inheritdoc />
public override bool OnMouseDown(Float2 location, MouseButton button)
{
if (button == MouseButton.Left && _arrangeButtonRect.Contains(location))
if (button == MouseButton.Left && _arrangeButtonRect.Contains(ref location))
{
_arrangeButtonInUse = true;
Focus();
@@ -371,7 +371,7 @@ namespace FlaxEditor.CustomEditors.Editors
/// <inheritdoc />
public override bool OnMouseDown(Float2 location, MouseButton button)
{
if (button == MouseButton.Left && _arrangeButtonRect.Contains(location))
if (button == MouseButton.Left && _arrangeButtonRect.Contains(ref location))
{
_arrangeButtonInUse = true;
Focus();
@@ -450,6 +450,7 @@ namespace FlaxEditor.CustomEditors.Editors
protected bool NotNullItems;
private IntValueBox _sizeBox;
private Label _label;
private Color _background;
private int _elementsCount, _minCount, _maxCount;
private bool _readOnly;
@@ -566,7 +567,7 @@ namespace FlaxEditor.CustomEditors.Editors
Parent = dropPanel,
};
var label = new Label
_label = new Label
{
Text = "Size",
AnchorPreset = AnchorPresets.TopRight,
@@ -592,11 +593,12 @@ namespace FlaxEditor.CustomEditors.Editors
panel.Panel.Offsets = new Margin(7, 7, 0, 0);
panel.Panel.BackgroundColor = _background;
var elementType = ElementType;
var bindingAttr = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public;
bool single = elementType.IsPrimitive ||
elementType.Equals(new ScriptType(typeof(string))) ||
elementType.IsEnum ||
(elementType.GetFields().Length == 1 && elementType.GetProperties().Length == 0) ||
(elementType.GetProperties().Length == 1 && elementType.GetFields().Length == 0) ||
(elementType.GetFields(bindingAttr).Length == 1 && elementType.GetProperties(bindingAttr).Length == 0) ||
(elementType.GetProperties(bindingAttr).Length == 1 && elementType.GetFields(bindingAttr).Length == 0) ||
elementType.Equals(new ScriptType(typeof(JsonAsset))) ||
elementType.Equals(new ScriptType(typeof(SettingsBase)));
if (_cachedDropPanels == null)
@@ -672,8 +674,10 @@ namespace FlaxEditor.CustomEditors.Editors
Resize(Count + 1);
};
}
}
Layout.ContainerControl.SizeChanged += OnLayoutSizeChanged;
}
private void OnSetupContextMenu(ContextMenu menu, DropPanel panel)
{
if (menu.Items.Any(x => x is ContextMenuButton b && b.Text.Equals("Open All", StringComparison.Ordinal)))
@@ -696,10 +700,24 @@ namespace FlaxEditor.CustomEditors.Editors
});
}
private void OnLayoutSizeChanged(Control control)
{
if (Layout.ContainerControl is DropPanel dropPanel)
{
// Hide "Size" text when array editor title overlaps
var headerTextSize = dropPanel.HeaderTextFont.GetFont().MeasureText(dropPanel.HeaderText);
if (headerTextSize.X + DropPanel.DropDownIconSize >= _label.Left)
_label.TextColor = _label.TextColorHighlighted = Color.Transparent;
else
_label.TextColor = _label.TextColorHighlighted = FlaxEngine.GUI.Style.Current.Foreground;
}
}
/// <inheritdoc />
protected override void Deinitialize()
{
_sizeBox = null;
Layout.ContainerControl.SizeChanged -= OnLayoutSizeChanged;
base.Deinitialize();
}

View File

@@ -321,11 +321,11 @@ namespace FlaxEditor.CustomEditors.Editors
var button2Rect = new Rectangle(button1Rect.Right + 2, 1, 14, 14);
// Deselect
if (_value != null && button1Rect.Contains(location))
if (_value != null && button1Rect.Contains(ref location))
Value = null;
// Picker dropdown menu
if (_supportsPickDropDown && (isSelected ? button2Rect : button1Rect).Contains(location))
if (_supportsPickDropDown && (isSelected ? button2Rect : button1Rect).Contains(ref location))
{
ShowDropDownMenu();
return true;

View File

@@ -247,7 +247,7 @@ namespace FlaxEditor.CustomEditors.Editors
/// <returns>The items.</returns>
protected virtual List<ItemInfo> GetItemsForType(ScriptType type)
{
return GetItemsForType(type, type.IsClass, true, true);
return GetItemsForType(type, type.IsClass, true);
}
/// <summary>
@@ -273,14 +273,10 @@ namespace FlaxEditor.CustomEditors.Editors
var attributes = p.GetAttributes(true);
var showInEditor = attributes.Any(x => x is ShowInEditorAttribute);
// Skip properties without getter
// Skip properties without getter or setter
if (!p.HasGet || (!p.HasSet && !showInEditor && !usePropertiesWithoutSetter))
continue;
// Skip getter-only properties declared in built-in types
if (!p.HasSet && usePropertiesWithoutSetter && p.Type.DeclaringType.Assembly == typeof(Editor).Assembly)
continue;
// Skip hidden fields, handle special attributes
if ((!p.IsPublic && !showInEditor) || attributes.Any(x => x is HideInEditorAttribute))
continue;

View File

@@ -47,6 +47,8 @@ namespace FlaxEditor.CustomEditors.Editors
return inputEvent;
if (Values[0] is string str)
return str;
if (Values.Type.Type == typeof(InputEvent))
return new InputEvent();
if (Values.Type.Type == typeof(string))
return string.Empty;
return null;

View File

@@ -219,11 +219,11 @@ namespace FlaxEditor.CustomEditors.Editors
var button2Rect = new Rectangle(button1Rect.Right + 2, 1, 14, 14);
// Deselect
if (_value && button1Rect.Contains(location) && _type == ScriptType.Null)
if (_value && button1Rect.Contains(ref location) && _type == ScriptType.Null)
Value = ScriptType.Null;
// Picker dropdown menu
if ((isSelected && _type == ScriptType.Null ? button2Rect : button1Rect).Contains(location))
if ((isSelected && _type == ScriptType.Null ? button2Rect : button1Rect).Contains(ref location))
ShowDropDownMenu();
return base.OnMouseUp(location, button);

View File

@@ -44,7 +44,8 @@ namespace FlaxEditor.CustomEditors.Elements
{
var style = Style.Current;
var settingsButtonSize = Panel.HeaderHeight;
return new Image
Panel.HeaderTextMargin = Panel.HeaderTextMargin with { Right = settingsButtonSize + Utilities.Constants.UIMargin };
; return new Image
{
TooltipText = "Settings",
AutoFocus = true,

View File

@@ -526,23 +526,6 @@ int32 Editor::LoadProduct()
return 12;
}
// Get the last opened project path
String localCachePath;
FileSystem::GetSpecialFolderPath(SpecialFolder::AppData, localCachePath);
String editorConfigPath = localCachePath / TEXT("Flax");
String lastProjectSettingPath = editorConfigPath / TEXT("LastProject.txt");
if (!FileSystem::DirectoryExists(editorConfigPath))
FileSystem::CreateDirectory(editorConfigPath);
String lastProjectPath;
if (FileSystem::FileExists(lastProjectSettingPath))
File::ReadAllText(lastProjectSettingPath, lastProjectPath);
if (!FileSystem::DirectoryExists(lastProjectPath))
lastProjectPath = String::Empty;
// Try to open the last project when requested
if (projectPath.IsEmpty() && CommandLine::Options.LastProject.IsTrue() && !lastProjectPath.IsEmpty())
projectPath = lastProjectPath;
// Missing project case
if (projectPath.IsEmpty())
{
@@ -558,7 +541,7 @@ int32 Editor::LoadProduct()
Array<String> files;
if (FileSystem::ShowOpenFileDialog(
nullptr,
lastProjectPath,
StringView::Empty,
TEXT("Project files (*.flaxproj)\0*.flaxproj\0All files (*.*)\0*.*\0"),
false,
TEXT("Select project to open in Editor"),
@@ -642,10 +625,6 @@ int32 Editor::LoadProduct()
}
}
// Update the last opened project path
if (lastProjectPath.Compare(Project->ProjectFolderPath) != 0)
File::WriteAllText(lastProjectSettingPath, Project->ProjectFolderPath, Encoding::UTF8);
return 0;
}

View File

@@ -23,6 +23,7 @@ using FlaxEngine.Assertions;
using FlaxEngine.GUI;
using FlaxEngine.Interop;
using FlaxEngine.Json;
using FlaxEngine.Utilities;
#pragma warning disable CS1591
@@ -69,18 +70,18 @@ namespace FlaxEditor
/// <summary>
/// Gets a value indicating whether this Editor is running a dev instance of the engine.
/// </summary>
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_IsDevInstance")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_IsDevInstance", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool IsDevInstance();
/// <summary>
/// Gets a value indicating whether this Editor is running as official build (distributed via Flax services).
/// </summary>
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_IsOfficialBuild")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_IsOfficialBuild", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool IsOfficialBuild();
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_IsPlayMode")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_IsPlayMode", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool Internal_IsPlayMode();
@@ -1056,7 +1057,7 @@ namespace FlaxEditor
if (actor)
{
Internal_GetEditorBoxWithChildren(FlaxEngine.Object.GetUnmanagedPtr(actor), out var box);
BoundingSphere.FromBox(box, out sphere);
BoundingSphere.FromBox(ref box, out sphere);
if (sphere == BoundingSphere.Empty)
sphere = new BoundingSphere(actor.Position, sphere.Radius);
sphere.Radius = Math.Max(sphere.Radius, 15.0f);
@@ -1370,7 +1371,7 @@ namespace FlaxEditor
public void BuildCSG()
{
var scenes = Level.Scenes;
scenes.ToList().ForEach(x => x.BuildCSG(0));
scenes.ForEach(x => x.BuildCSG(0));
Scene.MarkSceneEdited(scenes);
}
@@ -1380,7 +1381,7 @@ namespace FlaxEditor
public void BuildNavMesh()
{
var scenes = Level.Scenes;
scenes.ToList().ForEach(x => Navigation.BuildNavMesh(x, 0));
Navigation.BuildNavMesh();
Scene.MarkSceneEdited(scenes);
}
@@ -1647,103 +1648,96 @@ namespace FlaxEditor
}
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_ReadOutputLogs", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
internal static partial int Internal_ReadOutputLogs([MarshalUsing(typeof(FlaxEngine.Interop.NativeArrayMarshaller<string, FlaxEngine.Interop.NativeString>), CountElementName = "outCapacity")] ref string[] outMessages, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 3)] ref byte[] outLogTypes, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I8, SizeParamIndex = 3)] ref long[] outLogTimes, int outCapacity);
internal static partial int Internal_ReadOutputLogs([MarshalUsing(typeof(FlaxEngine.Interop.ArrayMarshaller<,>), CountElementName = "outCapacity")] ref string[] outMessages, [MarshalUsing(typeof(FlaxEngine.Interop.ArrayMarshaller<,>), CountElementName = "outCapacity")] ref byte[] outLogTypes, [MarshalUsing(typeof(FlaxEngine.Interop.ArrayMarshaller<,>), CountElementName = "outCapacity")] ref long[] outLogTimes, int outCapacity);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_SetPlayMode")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_SetPlayMode", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
internal static partial void Internal_SetPlayMode([MarshalAs(UnmanagedType.U1)] bool value);
internal static string Internal_GetProjectPath()
{
Internal_GetProjectPath(out string projectPath);
return projectPath;
}
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetProjectPath", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial string Internal_GetProjectPath();
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetProjectPath", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
internal static partial void Internal_GetProjectPath([MarshalUsing(typeof(FlaxEngine.Interop.StringViewMarshaller))] out string projectPath);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CloneAssetFile", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CloneAssetFile", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool Internal_CloneAssetFile(string dstPath, string srcPath, ref Guid dstId);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetAudioClipMetadata")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetAudioClipMetadata", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial void Internal_GetAudioClipMetadata(IntPtr obj, out int originalSize, out int importedSize);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_SaveJsonAsset", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_SaveJsonAsset", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool Internal_SaveJsonAsset(string outputPath, string data, string typename);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CopyCache")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CopyCache", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial void Internal_CopyCache(ref Guid dstId, ref Guid srcId);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_BakeLightmaps")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_BakeLightmaps", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial void Internal_BakeLightmaps([MarshalAs(UnmanagedType.U1)] bool cancel);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetShaderAssetSourceCode", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
[return: MarshalUsing(typeof(FlaxEngine.Interop.StringViewMarshaller))]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetShaderAssetSourceCode", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial string Internal_GetShaderAssetSourceCode(IntPtr obj);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CookMeshCollision", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CookMeshCollision", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool Internal_CookMeshCollision(string path, CollisionDataType type, IntPtr model, int modelLodIndex, uint materialSlotsMask, ConvexMeshGenerationFlags convexFlags, int convexVertexLimit);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetCollisionWires")]
internal static partial void Internal_GetCollisionWires(IntPtr collisionData, [MarshalUsing(typeof(FlaxEngine.Interop.NativeArrayMarshaller<,>), CountElementName = "trianglesCount")] out Float3[] triangles, [MarshalUsing(typeof(FlaxEngine.Interop.ArrayMarshaller<,>), CountElementName = "indicesCount")] out int[] indices, out int trianglesCount, out int indicesCount);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetCollisionWires", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial void Internal_GetCollisionWires(IntPtr collisionData, [MarshalUsing(typeof(FlaxEngine.Interop.ArrayMarshaller<,>), CountElementName = "trianglesCount")] out Float3[] triangles, [MarshalUsing(typeof(FlaxEngine.Interop.ArrayMarshaller<,>), CountElementName = "indicesCount")] out int[] indices, out int trianglesCount, out int indicesCount);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetEditorBoxWithChildren")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetEditorBoxWithChildren", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial void Internal_GetEditorBoxWithChildren(IntPtr obj, out BoundingBox resultAsRef);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_SetOptions")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_SetOptions", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial void Internal_SetOptions(ref InternalOptions options);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_DrawNavMesh")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_DrawNavMesh", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial void Internal_DrawNavMesh();
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CloseSplashScreen")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CloseSplashScreen", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial void Internal_CloseSplashScreen();
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CreateVisualScript", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CreateVisualScript", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool Internal_CreateVisualScript(string outputPath, string baseTypename);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CanImport", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CanImport", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial string Internal_CanImport(string extension);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CanExport", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CanExport", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool Internal_CanExport(string path);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_Export", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_Export", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool Internal_Export(string inputPath, string outputFolder);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetIsEveryAssemblyLoaded")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetIsEveryAssemblyLoaded", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool Internal_GetIsEveryAssemblyLoaded();
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetLastProjectOpenedEngineBuild")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetLastProjectOpenedEngineBuild", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial int Internal_GetLastProjectOpenedEngineBuild();
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetIsCSGActive")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetIsCSGActive", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool Internal_GetIsCSGActive();
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_RunVisualScriptBreakpointLoopTick")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_RunVisualScriptBreakpointLoopTick", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial void Internal_RunVisualScriptBreakpointLoopTick(float deltaTime);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_DeserializeSceneObject", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(FlaxEngine.Interop.StringMarshaller))]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_DeserializeSceneObject", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial void Internal_DeserializeSceneObject(IntPtr sceneObject, string json);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_LoadAsset")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_LoadAsset", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial void Internal_LoadAsset(ref Guid id);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CanSetToRoot")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_CanSetToRoot", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool Internal_CanSetToRoot(IntPtr prefab, IntPtr newRoot);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetAnimationTime")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_GetAnimationTime", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial float Internal_GetAnimationTime(IntPtr animatedModel);
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_SetAnimationTime")]
[LibraryImport("FlaxEngine", EntryPoint = "EditorInternal_SetAnimationTime", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
internal static partial void Internal_SetAnimationTime(IntPtr animatedModel, float time);
#endregion

View File

@@ -96,7 +96,7 @@ namespace FlaxEditor.GUI
private void DoDrag()
{
// Do the drag drop operation if has selected element
if (new Rectangle(Float2.Zero, Size).Contains(_mouseDownPos))
if (new Rectangle(Float2.Zero, Size).Contains(ref _mouseDownPos))
{
if (Validator.SelectedAsset != null)
DoDragDrop(DragAssets.GetDragData(Validator.SelectedAsset));

View File

@@ -502,6 +502,7 @@ namespace FlaxEditor.GUI.ContextMenu
if (base.OnKeyDown(key))
return true;
// Keyboard navigation around the menu
switch (key)
{
case KeyboardKeys.ArrowDown:
@@ -526,6 +527,20 @@ namespace FlaxEditor.GUI.ContextMenu
}
}
break;
case KeyboardKeys.ArrowRight:
for (int i = 0; i < _panel.Children.Count; i++)
{
if (_panel.Children[i] is ContextMenuChildMenu item && item.Visible && item.IsFocused && !item.ContextMenu.IsOpened)
{
item.ShowChild(this);
item.ContextMenu._panel.Children.FirstOrDefault(x => x is ContextMenuButton && x.Visible)?.Focus();
break;
}
}
break;
case KeyboardKeys.ArrowLeft:
ParentCM?.RootWindow.Focus();
break;
}
return false;

View File

@@ -75,6 +75,11 @@ namespace FlaxEditor.GUI.ContextMenu
/// </summary>
public bool HasChildCMOpened => _childCM != null;
/// <summary>
/// Gets the parent context menu (if exists).
/// </summary>
public ContextMenuBase ParentCM => _parentCM;
/// <summary>
/// Gets the topmost context menu.
/// </summary>
@@ -84,9 +89,7 @@ namespace FlaxEditor.GUI.ContextMenu
{
var cm = this;
while (cm._parentCM != null && cm._isSubMenu)
{
cm = cm._parentCM;
}
return cm;
}
}
@@ -111,6 +114,11 @@ namespace FlaxEditor.GUI.ContextMenu
/// </summary>
public bool UseInput = true;
/// <summary>
/// Optional flag that can disable UI navigation (tab/enter).
/// </summary>
public bool UseNavigation = true;
/// <summary>
/// Initializes a new instance of the <see cref="ContextMenuBase"/> class.
/// </summary>
@@ -271,7 +279,7 @@ namespace FlaxEditor.GUI.ContextMenu
_window.GotFocus += OnWindowGotFocus;
_window.LostFocus += OnWindowLostFocus;
}
#if USE_IS_FOREGROUND && USE_SDL_WORKAROUNDS
// The focus between popup and parent windows doesn't change, force hide the popup when clicked on parent
parentWin.Window.MouseDown += OnWindowMouseDown;
@@ -622,6 +630,21 @@ namespace FlaxEditor.GUI.ContextMenu
case KeyboardKeys.Escape:
Hide();
return true;
case KeyboardKeys.Return:
if (UseNavigation && Root?.FocusedControl != null)
{
Root.SubmitFocused();
return true;
}
break;
case KeyboardKeys.Tab:
if (UseNavigation && Root != null)
{
bool shiftDown = Root.GetKey(KeyboardKeys.Shift);
Root.Navigate(shiftDown ? NavDirection.Previous : NavDirection.Next);
return true;
}
break;
}
return false;
}

View File

@@ -29,7 +29,7 @@ namespace FlaxEditor.GUI.ContextMenu
CloseMenuOnClick = false;
}
private void ShowChild(ContextMenu parentContextMenu)
internal void ShowChild(ContextMenu parentContextMenu)
{
// Hide parent CM popups and set itself as child
var vAlign = parentContextMenu.ItemsAreaMargin.Top;

View File

@@ -62,7 +62,7 @@ namespace FlaxEditor.GUI
for (int i = 0; i < children.Count; i++)
{
if (children[i] is KeyframePoint p)
p.IsSelected = p.Bounds.Intersects(selectionRect);
p.IsSelected = p.Bounds.Intersects(ref selectionRect);
}
_editor.UpdateTangents();
}
@@ -85,7 +85,7 @@ namespace FlaxEditor.GUI
internal void OnMove(Float2 location)
{
// Skip updating keyframes until move actual starts to be meaningful
if (Float2.Distance(_movingSelectionStartPosLock, location) < 1.5f)
if (Float2.Distance(ref _movingSelectionStartPosLock, ref location) < 1.5f)
return;
_movingSelectionStartPosLock = Float2.Minimum;
@@ -522,6 +522,16 @@ namespace FlaxEditor.GUI
cm.AddButton("Show whole curve", _editor.ShowWholeCurve);
cm.AddButton("Reset view", _editor.ResetView);
}
cm.AddSeparator();
var presetCm = cm.AddChildMenu("Apply preset");
foreach (var value in Enum.GetValues(typeof(CurvePreset)))
{
CurvePreset preset = (CurvePreset)value;
string name = Utilities.Utils.GetPropertyNameUI(preset.ToString());
var b = presetCm.ContextMenu.AddButton(name, () => _editor.ApplyPreset(preset));
b.Enabled = !(_editor is LinearCurveEditor<T> && (preset != CurvePreset.Constant && preset != CurvePreset.Linear));
}
_editor.OnShowContextMenu(cm, selectionCount);
cm.Show(this, location);
}
@@ -619,6 +629,33 @@ namespace FlaxEditor.GUI
}
}
/// <summary>
/// A list of avaliable curve presets for the <see cref="CurveEditor{T}"/>.
/// </summary>
public enum CurvePreset
{
/// <summary>
/// A curve where every point has the same value.
/// </summary>
Constant,
/// <summary>
/// A curve linear curve.
/// </summary>
Linear,
/// <summary>
/// A curve that starts a slowly and then accelerates until the end.
/// </summary>
EaseIn,
/// <summary>
/// A curve that starts a steep and then flattens until the end.
/// </summary>
EaseOut,
/// <summary>
/// A combination of the <see cref="CurvePreset.EaseIn"/> and <see cref="CurvePreset.EaseOut"/> preset.
/// </summary>
Smoothstep
}
/// <inheritdoc />
public override void OnKeyframesDeselect(IKeyframesEditor editor)
{

View File

@@ -19,6 +19,48 @@ namespace FlaxEditor.GUI
/// <seealso cref="CurveEditorBase" />
public abstract partial class CurveEditor<T> : CurveEditorBase where T : new()
{
/// <summary>
/// Represents a single point in a <see cref="CurveEditorPreset"/>.
/// </summary>
protected struct CurvePresetPoint
{
/// <summary>
/// The time.
/// </summary>
public float Time;
/// <summary>
/// The value.
/// </summary>
public float Value;
/// <summary>
/// The in tangent. Will be ignored in <see cref="LinearCurveEditor{T}"/>
/// </summary>
public float TangentIn;
/// <summary>
/// The out tangent. Will be ignored in <see cref="LinearCurveEditor{T}"/>
/// </summary>
public float TangentOut;
}
/// <summary>
/// A curve preset.
/// </summary>
protected struct CurveEditorPreset()
{
/// <summary>
/// If the tangents will be linear or smooth.
/// </summary>
public bool LinearTangents;
/// <summary>
/// The points of the preset.
/// </summary>
public List<CurvePresetPoint> Points;
}
private class Popup : ContextMenuBase
{
private CustomEditorPresenter _presenter;
@@ -26,11 +68,12 @@ namespace FlaxEditor.GUI
private List<int> _keyframeIndices;
private bool _isDirty;
public Popup(CurveEditor<T> editor, object[] selection, List<int> keyframeIndices = null, float height = 140.0f)
: this(editor, height)
public Popup(CurveEditor<T> editor, object[] selection, List<int> keyframeIndices = null, float maxHeight = 140.0f)
: this(editor, maxHeight)
{
_presenter.Select(selection);
_presenter.OpenAllGroups();
Size = new Float2(Size.X, Mathf.Min(_presenter.ContainerControl.Size.Y, maxHeight));
_keyframeIndices = keyframeIndices;
if (keyframeIndices != null && selection.Length != keyframeIndices.Count)
throw new Exception();
@@ -169,7 +212,7 @@ namespace FlaxEditor.GUI
if (IsSelected)
color = Editor.ContainsFocus ? style.SelectionBorder : Color.Lerp(style.ForegroundDisabled, style.SelectionBorder, 0.4f);
if (IsMouseOver)
color *= 1.1f;
color *= 1.5f;
Render2D.FillRectangle(rect, color);
}
@@ -285,7 +328,7 @@ namespace FlaxEditor.GUI
/// <summary>
/// The keyframes size.
/// </summary>
protected static readonly Float2 KeyframesSize = new Float2(7.0f);
protected static readonly Float2 KeyframesSize = new Float2(8.0f);
/// <summary>
/// The colors for the keyframe points.
@@ -326,6 +369,63 @@ namespace FlaxEditor.GUI
private Color _labelsColor;
private Font _labelsFont;
/// <summary>
/// Preset values for <see cref="CurvePreset"/> to be applied to a <see cref="CurveEditor{T}"/>.
/// </summary>
protected Dictionary<CurvePreset, CurveEditorPreset> Presets = new Dictionary<CurvePreset, CurveEditorPreset>
{
{ CurvePreset.Constant, new CurveEditorPreset
{
LinearTangents = true,
Points = new List<CurvePresetPoint>
{
new CurvePresetPoint { Time = 0f, Value = 0.5f, TangentIn = 0f, TangentOut = 0f },
new CurvePresetPoint { Time = 1f, Value = 0.5f, TangentIn = 0f, TangentOut = 0f },
}
}
},
{ CurvePreset.EaseIn, new CurveEditorPreset
{
LinearTangents = false,
Points = new List<CurvePresetPoint>
{
new CurvePresetPoint { Time = 0f, Value = 0f, TangentIn = 0f, TangentOut = 0f },
new CurvePresetPoint { Time = 1f, Value = 1f, TangentIn = -1.4f, TangentOut = 0f },
}
}
},
{ CurvePreset.EaseOut, new CurveEditorPreset
{
LinearTangents = false,
Points = new List<CurvePresetPoint>
{
new CurvePresetPoint { Time = 1f, Value = 1f, TangentIn = 0f, TangentOut = 0f },
new CurvePresetPoint { Time = 0f, Value = 0f, TangentIn = 0f, TangentOut = 1.4f },
}
}
},
{ CurvePreset.Linear, new CurveEditorPreset
{
LinearTangents = true,
Points = new List<CurvePresetPoint>
{
new CurvePresetPoint { Time = 0f, Value = 0f, TangentIn = 0f, TangentOut = 0f },
new CurvePresetPoint { Time = 1f, Value = 1f, TangentIn = 0f, TangentOut = 0f },
}
}
},
{ CurvePreset.Smoothstep, new CurveEditorPreset
{
LinearTangents = false,
Points = new List<CurvePresetPoint>
{
new CurvePresetPoint { Time = 0f, Value = 0f, TangentIn = 0f, TangentOut = 0f },
new CurvePresetPoint { Time = 1f, Value = 1f, TangentIn = 0f, TangentOut = 0f },
}
}
},
};
/// <summary>
/// The keyframe UI points.
/// </summary>
@@ -568,6 +668,28 @@ namespace FlaxEditor.GUI
/// <param name="indicesToRemove">The list of indices of the keyframes to remove.</param>
protected abstract void RemoveKeyframesInternal(HashSet<int> indicesToRemove);
/// <summary>
/// Tries to convert a float to the type of the type wildcard of the curve editor.
/// </summary>
/// <param name="value">The float.</param>
/// <returns>The converted value.</returns>
public static object ConvertCurvePresetValueToCurveEditorType(float value)
{
if (typeof(T) == typeof(Float2))
return new Float2(value);
if (typeof(T) == typeof(Float3))
return new Float3(value);
if (typeof(T) == typeof(Float4))
return new Float4(value);
if (typeof(T) == typeof(Vector2))
return new Vector2(value);
if (typeof(T) == typeof(Vector3))
return new Vector3(value);
if (typeof(T) == typeof(Vector4))
return new Vector4(value);
return value;
}
/// <summary>
/// Called when showing a context menu. Can be used to add custom buttons with actions.
/// </summary>
@@ -689,8 +811,8 @@ namespace FlaxEditor.GUI
if (selectedOnly && !point.IsSelected)
continue;
var pos = point.Point;
Float2.Min(posMin, pos, out posMin);
Float2.Max(posMax, pos, out posMax);
Float2.Min(ref posMin, ref pos, out posMin);
Float2.Max(ref posMax, ref pos, out posMax);
}
// Apply margin around the area
@@ -703,16 +825,16 @@ namespace FlaxEditor.GUI
PointFromKeyframesToContents(ref posMin, ref viewRect);
PointFromKeyframesToContents(ref posMax, ref viewRect);
var tmp = posMin;
Float2.Min(posMin, posMax, out posMin);
Float2.Max(posMax, tmp, out posMax);
Float2.Min(ref posMin, ref posMax, out posMin);
Float2.Max(ref posMax, ref tmp, out posMax);
var contentsSize = posMax - posMin;
// Convert from Contents to Main Panel
posMin = _contents.PointToParent(posMin);
posMax = _contents.PointToParent(posMax);
tmp = posMin;
Float2.Min(posMin, posMax, out posMin);
Float2.Max(posMax, tmp, out posMax);
Float2.Min(ref posMin, ref posMax, out posMin);
Float2.Max(ref posMax, ref tmp, out posMax);
// Update zoom (leave unchanged when focusing a single point)
var zoomMask = EnableZoom;
@@ -752,6 +874,17 @@ namespace FlaxEditor.GUI
ShowCurve(false);
}
/// <summary>
/// Applies a <see cref="CurvePreset"/> to the curve editor.
/// </summary>
/// <param name="preset">The preset.</param>
public virtual void ApplyPreset(CurvePreset preset)
{
// Remove existing keyframes
SelectAll();
RemoveKeyframes();
}
/// <inheritdoc />
public override void Evaluate(out object result, float time, bool loop = false)
{
@@ -941,7 +1074,7 @@ namespace FlaxEditor.GUI
{
SetupGrid(out var min, out var max, out var pixelRange);
Render2D.PushClip(viewRect);
Render2D.PushClip(ref viewRect);
if ((ShowAxes & UseMode.Vertical) == UseMode.Vertical)
DrawAxis(Float2.UnitX, viewRect, min.X, max.X, pixelRange.X);
@@ -954,7 +1087,7 @@ namespace FlaxEditor.GUI
// Draw curve
if (!_showCollapsed)
{
Render2D.PushClip(rect);
Render2D.PushClip(ref rect);
DrawCurve(ref viewRect);
Render2D.PopClip();
}
@@ -1028,6 +1161,31 @@ namespace FlaxEditor.GUI
return true;
}
bool left = key == KeyboardKeys.ArrowLeft;
bool right = key == KeyboardKeys.ArrowRight;
bool up = key == KeyboardKeys.ArrowUp;
bool down = key == KeyboardKeys.ArrowDown;
if (left || right || up || down)
{
bool shift = Root.GetKey(KeyboardKeys.Shift);
bool alt = Root.GetKey(KeyboardKeys.Alt);
float deltaValue = 10f;
if (shift || alt)
deltaValue = shift ? 2.5f : 5f;
Float2 moveDelta = Float2.Zero;
if (left || right)
moveDelta.X = left ? -deltaValue : deltaValue;
if (up || down)
moveDelta.Y = up ? -deltaValue : deltaValue;
_contents.OnMoveStart(Float2.Zero);
_contents.OnMove(moveDelta);
_contents.OnMoveEnd(Float2.Zero);
return true;
}
return false;
}
@@ -1526,6 +1684,22 @@ namespace FlaxEditor.GUI
_tangents[i].Visible = false;
}
/// <inheritdoc />
public override void ApplyPreset(CurvePreset preset)
{
base.ApplyPreset(preset);
CurveEditorPreset data = Presets[preset];
foreach (var point in data.Points)
{
float time = point.Time;
object value = ConvertCurvePresetValueToCurveEditorType((float)point.Value);
AddKeyframe(time, value);
}
ShowWholeCurve();
}
/// <inheritdoc />
protected override void DrawCurve(ref Rectangle viewRect)
{
@@ -2312,6 +2486,30 @@ namespace FlaxEditor.GUI
}
}
/// <inheritdoc />
public override void ApplyPreset(CurvePreset preset)
{
base.ApplyPreset(preset);
CurveEditorPreset data = Presets[preset];
foreach (var point in data.Points)
{
float time = point.Time;
object value = ConvertCurvePresetValueToCurveEditorType((float)point.Value);
object tangentIn = ConvertCurvePresetValueToCurveEditorType((float)point.TangentIn);
object tangentOut = ConvertCurvePresetValueToCurveEditorType((float)point.TangentOut);
AddKeyframe(time, value, tangentIn, tangentOut);
}
SelectAll();
if (data.LinearTangents)
SetTangentsLinear();
ShowWholeCurve();
}
/// <inheritdoc />
protected override void SetScaleInternal(ref Float2 scale)
{

View File

@@ -41,6 +41,7 @@ namespace FlaxEditor.GUI.Dialogs
private bool _useDynamicEditing;
private bool _activeEyedropper;
private bool _canPassLastChangeEvent = true;
private bool _linear;
private ColorValueBox.ColorPickerEvent _onChanged;
private ColorValueBox.ColorPickerClosedEvent _onClosed;
@@ -56,6 +57,7 @@ namespace FlaxEditor.GUI.Dialogs
private Button _cCancel;
private Button _cOK;
private Button _cEyedropper;
private Button _cLinearSRGB;
private List<Color> _savedColors = new List<Color>();
private List<Button> _savedColorButtons = new List<Button>();
@@ -118,6 +120,7 @@ namespace FlaxEditor.GUI.Dialogs
_value = Color.Transparent;
_onChanged = colorChanged;
_onClosed = pickerClosed;
_linear = !Graphics.GammaColorSpace;
// Get saved colors if they exist
if (Editor.Instance.ProjectCache.TryGetCustomData("ColorPickerSavedColors", out string savedColors))
@@ -227,6 +230,25 @@ namespace FlaxEditor.GUI.Dialogs
_cEyedropper.Width = _cEyedropper.Height;
_cEyedropper.X -= _cEyedropper.Width;
// Linear/sRGB toggle button
_cLinearSRGB = new Button(_cOK.X - EyedropperMargin, _cHex.Bottom + PickerMargin)
{
TooltipText = "Toggles between color preview in Linear and sRGB",
BackgroundBrush = new SpriteBrush(Editor.Instance.Icons.SplineAligned64),
BackgroundColor = _cEyedropper.BackgroundColor,
BackgroundColorHighlighted = _cEyedropper.BackgroundColorHighlighted,
BorderColor = _linear ? Color.Transparent : style.Foreground,
BorderColorHighlighted = _cEyedropper.BorderColorHighlighted,
Size = _cEyedropper.Size,
Parent = this,
Location = _cEyedropper.BottomLeft + new Float2(0, 4),
};
_cLinearSRGB.Clicked += () =>
{
_linear = !_linear;
_cLinearSRGB.BorderColor = _linear ? Color.Transparent : style.Foreground;
};
// Set initial color
SelectedColor = initialValue;
}
@@ -281,16 +303,22 @@ namespace FlaxEditor.GUI.Dialogs
if (_activeEyedropper)
{
_activeEyedropper = false;
SelectedColor = colorPicked;
ScreenUtilities.PickColorDone -= OnColorPicked;
if (colorPicked != Color.Transparent)
{
Color color = colorPicked;
if (_linear)
color = color.ToLinear();
SelectedColor = color;
}
Platform.PickScreenColorDone -= OnColorPicked;
}
}
private void OnEyedropStart()
{
_activeEyedropper = true;
ScreenUtilities.PickColor();
ScreenUtilities.PickColorDone += OnColorPicked;
Platform.PickScreenColor();
Platform.PickScreenColorDone += OnColorPicked;
}
private void OnRGBAChanged()
@@ -328,9 +356,13 @@ namespace FlaxEditor.GUI.Dialogs
{
// Try reading the color under the cursor in realtime if supported by the platform
Float2 mousePosition = Platform.MousePosition;
Color color = ScreenUtilities.GetColorAt(mousePosition);
Color color = Platform.GetScreenColorAt(mousePosition);
if (color != Color.Transparent)
{
if (_linear)
color = color.ToLinear();
SelectedColor = color;
}
}
}
@@ -391,7 +423,7 @@ namespace FlaxEditor.GUI.Dialogs
}
}
}
Render2D.FillRectangle(newRect, _value);
Render2D.FillRectangle(newRect, _linear ? _value.ToSRgb() : _value);
}
/// <inheritdoc />
@@ -412,7 +444,7 @@ namespace FlaxEditor.GUI.Dialogs
{
// Cancel eye dropping
_activeEyedropper = false;
ScreenUtilities.PickColorDone -= OnColorPicked;
Platform.PickScreenColorDone -= OnColorPicked;
return true;
}

View File

@@ -310,6 +310,26 @@ namespace FlaxEditor.GUI.Dialogs
Render2D.DrawRectangle(_slider1Rect, _isMouseDownSlider1 ? style.BackgroundSelected : Color.Black);
Render2D.DrawRectangle(valueR, _isMouseDownSlider1 ? Color.White : Color.Gray);
// Draw checkerboard pattern to part of the alpha slider background
var alphaRect = _slider2Rect;
Render2D.FillRectangle(alphaRect, Color.White);
var smallRectSize = alphaRect.Width * 0.5f;
var numHor = Mathf.CeilToInt(alphaRect.Width / smallRectSize);
var numVer = Mathf.CeilToInt(alphaRect.Height / smallRectSize);
for (int i = 0; i < numHor; i++)
{
for (int j = 0; j < numVer; j++)
{
if ((i + j) % 2 == 0)
{
var rect = new Rectangle(alphaRect.X + smallRectSize * i, alphaRect.Y + smallRectSize * j, new Float2(smallRectSize));
Render2D.PushClip(alphaRect);
Render2D.FillRectangle(rect, Color.Gray);
Render2D.PopClip();
}
}
}
// Alpha
float alphaY = _slider2Rect.Height * (1 - _color.A);
var alphaR = new Rectangle(_slider2Rect.X - slidersOffset, _slider2Rect.Y + alphaY - slidersThickness / 2, _slider2Rect.Width + slidersOffset * 2, slidersThickness);

View File

@@ -469,7 +469,7 @@ namespace FlaxEditor.GUI.Docking
var childPanels = _childPanels.ToArray();
if (childPanels.Length != 0)
{
// Move tabs from child panels into this one
// Fallback: move tabs from child panels into this one.
DockWindow selectedTab = null;
foreach (var childPanel in childPanels)
{
@@ -490,7 +490,8 @@ namespace FlaxEditor.GUI.Docking
{
// Unlink splitter
var splitterParent = splitter.Parent;
Assert.IsNotNull(splitterParent);
if (splitterParent == null)
return;
splitter.Parent = null;
// Move controls from second split panel to the split panel parent
@@ -507,17 +508,63 @@ namespace FlaxEditor.GUI.Docking
splitter.Dispose();
}
}
else if (IsMaster && _childPanels.Count != 0)
{
if (TryCollapseSplitter(_tabsProxy?.Parent as Panel))
return;
}
else if (!IsMaster)
{
throw new InvalidOperationException();
}
}
else if (_childPanels.Count != 0)
{
if (TryCollapseSplitter(_tabsProxy?.Parent as Panel))
return;
}
else if (!IsMaster)
{
throw new InvalidOperationException();
}
}
internal bool CollapseEmptyTabsProxy()
{
if (TabsCount == 0 && ChildPanelsCount > 0)
{
return TryCollapseSplitter(_tabsProxy?.Parent as Panel);
}
return false;
}
private bool TryCollapseSplitter(Panel removedPanelParent)
{
if (removedPanelParent == null)
return false;
if (!(removedPanelParent.Parent is SplitPanel tabsSplitter))
return false;
var splitterParent = tabsSplitter.Parent;
if (splitterParent == null)
return false;
tabsSplitter.Parent = null;
var scrPanel = removedPanelParent == tabsSplitter.Panel2 ? tabsSplitter.Panel1 : tabsSplitter.Panel2;
var srcPanelChildrenCount = scrPanel.ChildrenCount;
for (int i = srcPanelChildrenCount - 1; i >= 0 && scrPanel.ChildrenCount > 0; i--)
{
scrPanel.GetChild(i).Parent = splitterParent;
}
Assert.IsTrue(scrPanel.ChildrenCount == 0);
Assert.IsTrue(splitterParent.ChildrenCount == srcPanelChildrenCount);
tabsSplitter.Dispose();
if (_tabsProxy != null && _tabsProxy.Parent == removedPanelParent)
_tabsProxy = null;
return true;
}
internal virtual void DockWindowInternal(DockState state, DockWindow window, bool autoSelect = true, float? splitterValue = null)
{
DockWindow(state, window, autoSelect, splitterValue);

View File

@@ -50,7 +50,7 @@ namespace FlaxEditor.GUI.Docking
/// The mouse position.
/// </summary>
public Float2 MousePosition = Float2.Minimum;
/// <summary>
/// The mouse position.
/// </summary>

View File

@@ -193,6 +193,7 @@ namespace FlaxEditor.GUI.Docking
{
CreateFloating(Float2.Zero, Float2.Zero);
}
/// <summary>
/// Creates the window in a floating state.
/// </summary>

View File

@@ -14,13 +14,13 @@ namespace FlaxEditor.GUI.Docking
private class FloatWindowDecorations : WindowDecorations
{
private FloatWindowDockPanel _panel;
public FloatWindowDecorations(FloatWindowDockPanel panel)
: base(panel.RootWindow)
{
_panel = panel;
}
/// <inheritdoc />
public override bool OnMouseDown(Float2 location, MouseButton button)
{
@@ -76,19 +76,19 @@ namespace FlaxEditor.GUI.Docking
Parent = window;
_window.Window.Closing += OnClosing;
_window.Window.LeftButtonHit += OnLeftButtonHit;
if (Utilities.Utils.UseCustomWindowDecorations())
{
var decorations = Parent.AddChild(new FloatWindowDecorations(this));
decorations.SetAnchorPreset(AnchorPresets.HorizontalStretchTop, false);
}
}
/// <inheritdoc />
protected override void PerformLayoutBeforeChildren()
{
base.PerformLayoutBeforeChildren();
var decorations = Parent.GetChild<FloatWindowDecorations>();
if (decorations != null)
{
@@ -108,7 +108,11 @@ namespace FlaxEditor.GUI.Docking
return;
// Create docking hint window
WindowDragHelper.StartDragging(this);
Window dragSourceWindow = null;
#if !PLATFORM_SDL
dragSourceWindow = _window?.Window;
#endif
WindowDragHelper.StartDragging(this, dragSourceWindow);
}
/// <summary>
@@ -127,11 +131,15 @@ namespace FlaxEditor.GUI.Docking
settings.Title = title;
settings.Size = size;
settings.Position = location;
settings.MinimumSize = new Float2(200, 150);
settings.MinimumSize = new Float2(100, 100);
settings.MaximumSize = Float2.Zero; // Unlimited size
settings.Fullscreen = false;
settings.HasBorder = true;
#if PLATFORM_SDL
settings.SupportsTransparency = true;
#else
settings.SupportsTransparency = false;
#endif
settings.ActivateWhenFirstShown = true;
settings.AllowInput = true;
settings.AllowMinimize = true;
@@ -143,7 +151,7 @@ namespace FlaxEditor.GUI.Docking
settings.ShowAfterFirstPaint = false;
settings.ShowInTaskbar = true;
settings.StartPosition = startPosition;
if (Utilities.Utils.UseCustomWindowDecorations())
{
settings.HasBorder = false;
@@ -213,7 +221,12 @@ namespace FlaxEditor.GUI.Docking
base.OnSelectedTabChanged();
if (_window != null && SelectedTab != null)
{
_window.Title = SelectedTab.Title;
var decorations = Parent.GetChild<FloatWindowDecorations>();
if (decorations != null)
decorations.PerformLayout();
}
}
/// <inheritdoc />

View File

@@ -26,7 +26,7 @@ namespace FlaxEditor.GUI.Docking
/// <summary>
/// The hint control size.
/// </summary>
public const float HintControlSize = 32.0f;
public const float HintControlSize = 48.0f;
/// <summary>
/// The opacity of the dragged window when hint controls are shown.
@@ -44,13 +44,33 @@ namespace FlaxEditor.GUI.Docking
_toMove = toMove;
_toSet = DockState.Float;
var window = toMove.Window.Window;
var mousePos = Platform.MousePosition;
// Check if window is maximized and restore window for correct dragging
if (window.IsMaximized)
{
var windowMousePos = mousePos - window.Position;
var previousSize = window.Size;
window.Restore();
window.Position = mousePos - windowMousePos * window.Size / previousSize;
}
// When drag starts from a tabs the window might not be shown yet
if (!window.IsVisible)
{
window.Show();
window.Position = mousePos - new Float2(40, 10);
}
// Bind events
FlaxEngine.Scripting.Update += OnUpdate;
window.MouseUp += OnMouseUp;
#if !PLATFORM_SDL
window.StartTrackingMouse(false);
#endif
// Update rectangles
UpdateRects(Platform.MousePosition);
UpdateRects(mousePos);
// Ensure the dragged window stays on top of every other window
window.IsAlwaysOnTop = true;
@@ -58,13 +78,21 @@ namespace FlaxEditor.GUI.Docking
_dragSourceWindow = dragSourceWindow;
if (_dragSourceWindow != null) // Detaching a tab from existing window
{
#if PLATFORM_SDL
_dragOffset = new Float2(window.Size.X / 2, 10.0f);
_dragSourceWindow.MouseUp += OnMouseUp; // The mouse up event is sent to the source window on Windows
#else
_dragOffset = mousePos - window.Position;
#endif
// The mouse up event is sent to the source window on Windows
_dragSourceWindow.MouseUp += OnMouseUp;
// TODO: when detaching tab in floating window (not main window), the drag source window is still main window?
var dragSourceWindowWayland = toMove.MasterPanel?.RootWindow.Window ?? Editor.Instance.Windows.MainWindow;
window.DoDragDrop(window.Title, _dragOffset, dragSourceWindowWayland);
#if !PLATFORM_SDL
_dragSourceWindow.BringToFront();
#endif
}
else
{
@@ -84,7 +112,12 @@ namespace FlaxEditor.GUI.Docking
// Unbind events
FlaxEngine.Scripting.Update -= OnUpdate;
if (window != null)
{
window.MouseUp -= OnMouseUp;
#if !PLATFORM_SDL
window.EndTrackingMouse();
#endif
}
if (_dragSourceWindow != null)
_dragSourceWindow.MouseUp -= OnMouseUp;
@@ -160,13 +193,14 @@ namespace FlaxEditor.GUI.Docking
/// Start dragging a floating dock panel.
/// </summary>
/// <param name="toMove">Floating dock panel to move.</param>
/// <param name="dragSourceWindow">The window where dragging started from.</param>
/// <returns>The window drag helper object.</returns>
public static WindowDragHelper StartDragging(FloatWindowDockPanel toMove)
public static WindowDragHelper StartDragging(FloatWindowDockPanel toMove, Window dragSourceWindow = null)
{
if (toMove == null)
throw new ArgumentNullException();
return new WindowDragHelper(toMove, null);
return new WindowDragHelper(toMove, dragSourceWindow);
}
/// <summary>
@@ -268,7 +302,8 @@ namespace FlaxEditor.GUI.Docking
}
// Prefer panel in the same window we hit earlier
if (dockPanel?.RootWindow != _toDock?.RootWindow)
// TODO: this doesn't allow docking window into another floating window over the main window
/*if (dockPanel?.RootWindow != _toDock?.RootWindow)
{
foreach (var hit in hitResults)
{
@@ -278,7 +313,7 @@ namespace FlaxEditor.GUI.Docking
break;
}
}
}
}*/
}
if (dockPanel != _toDock)
@@ -288,19 +323,29 @@ namespace FlaxEditor.GUI.Docking
AddDockHints();
// Make sure the all the dock hint areas are not under other windows
_toDock?.RootWindow.Window.BringToFront();
if (_toDock != Editor.Instance.UI.MasterPanel)
_toDock?.RootWindow.Window.BringToFront();
//_toDock?.RootWindow.Window.Focus();
#if PLATFORM_SDL
// Make the dragged window transparent when dock hints are visible
_toMove.Window.Window.Opacity = _toDock == null ? 1.0f : DragWindowOpacity;
#else
// Bring the drop source always to the top
if (_dragSourceWindow != null)
_dragSourceWindow.BringToFront();
#endif
}
// Check dock state to use
bool showProxyHints = _toDock != null;
bool showBorderHints = showProxyHints;
bool showCenterHint = showProxyHints;
Control hoveredHintControl = null;
Float2 hoveredLocationOffset = Float2.Zero;
Float2 hoveredSizeOverride = Float2.Zero;
DockState prevToSet = _toSet;
float hoveredMargin = 1.0f;
if (showProxyHints)
{
// If moved window has not only tabs but also child panels disable docking as tab
@@ -317,7 +362,7 @@ namespace FlaxEditor.GUI.Docking
// Cache dock rectangles
var size = _rectDock.Size / Platform.DpiScale;
var offset = _toDock.PointFromScreen(_rectDock.Location);
var borderMargin = 4.0f;
var borderMargin = 10.0f;
var hintWindowsSize = HintControlSize;
var hintWindowsSize2 = hintWindowsSize * 0.5f;
var hintPreviewSize = new Float2(Math.Max(HintControlSize * 2, size.X * 0.5f), Math.Max(HintControlSize * 2, size.Y * 0.5f));
@@ -330,35 +375,40 @@ namespace FlaxEditor.GUI.Docking
_rCenter = new Rectangle(centerX - hintWindowsSize2, centerY - hintWindowsSize2, hintWindowsSize, hintWindowsSize) + offset;
// Hit test, and calculate the approximation for filled area when hovered over the hint
DockState toSet = DockState.Float;
var toSet = DockState.Float;
var hintTestPoint = _toDock.PointFromScreen(_mouse);
if (showBorderHints)
{
if (_rUpper.Contains(_toDock.PointFromScreen(_mouse)))
if (_rUpper.Contains(ref hintTestPoint))
{
toSet = DockState.DockTop;
hoveredHintControl = _dockHintUp;
hoveredSizeOverride = new Float2(size.X, hintPreviewSize.Y);
hoveredSizeOverride = new Float2(size.X, size.Y * DockPanel.DefaultSplitterValue);
hoveredLocationOffset.Y -= borderMargin - hoveredMargin;
}
else if (_rBottom.Contains(_toDock.PointFromScreen(_mouse)))
else if (_rBottom.Contains(ref hintTestPoint))
{
toSet = DockState.DockBottom;
hoveredHintControl = _dockHintDown;
hoveredSizeOverride = new Float2(size.X, hintPreviewSize.Y);
hoveredSizeOverride = new Float2(size.X, size.Y * DockPanel.DefaultSplitterValue);
hoveredLocationOffset.Y += borderMargin - hoveredMargin;
}
else if (_rLeft.Contains(_toDock.PointFromScreen(_mouse)))
else if (_rLeft.Contains(ref hintTestPoint))
{
toSet = DockState.DockLeft;
hoveredHintControl = _dockHintLeft;
hoveredSizeOverride = new Float2(hintPreviewSize.X, size.Y);
hoveredSizeOverride = new Float2(size.X * DockPanel.DefaultSplitterValue, size.Y);
hoveredLocationOffset.X -= borderMargin - hoveredMargin;
}
else if (_rRight.Contains(_toDock.PointFromScreen(_mouse)))
else if (_rRight.Contains(ref hintTestPoint))
{
toSet = DockState.DockRight;
hoveredHintControl = _dockHintRight;
hoveredSizeOverride = new Float2(hintPreviewSize.X, size.Y);
hoveredSizeOverride = new Float2(size.X * DockPanel.DefaultSplitterValue, size.Y);
hoveredLocationOffset.X += borderMargin - hoveredMargin;
}
}
if (showCenterHint && _rCenter.Contains(_toDock.PointFromScreen(_mouse)))
if (showCenterHint && _rCenter.Contains(ref hintTestPoint))
{
toSet = DockState.DockFill;
hoveredHintControl = _dockHintCenter;
@@ -375,38 +425,41 @@ namespace FlaxEditor.GUI.Docking
// Update sizes and opacity of hint controls
if (_toDock != null)
{
var mainColor = Style.Current.Selection;
if (hoveredHintControl != _dockHintDown)
{
_dockHintDown.Size = new Float2(HintControlSize);
_dockHintDown.BackgroundColor = Style.Current.Selection.AlphaMultiplied(0.6f);
_dockHintDown.BackgroundColor = mainColor.AlphaMultiplied(0.6f);
}
if (hoveredHintControl != _dockHintLeft)
{
_dockHintLeft.Size = new Float2(HintControlSize);
_dockHintLeft.BackgroundColor = Style.Current.Selection.AlphaMultiplied(0.6f);
_dockHintLeft.BackgroundColor = mainColor.AlphaMultiplied(0.6f);
}
if (hoveredHintControl != _dockHintRight)
{
_dockHintRight.Size = new Float2(HintControlSize);
_dockHintRight.BackgroundColor = Style.Current.Selection.AlphaMultiplied(0.6f);
_dockHintRight.BackgroundColor = mainColor.AlphaMultiplied(0.6f);
}
if (hoveredHintControl != _dockHintUp)
{
_dockHintUp.Size = new Float2(HintControlSize);
_dockHintUp.BackgroundColor = Style.Current.Selection.AlphaMultiplied(0.6f);
_dockHintUp.BackgroundColor = mainColor.AlphaMultiplied(0.6f);
}
if (hoveredHintControl != _dockHintCenter)
{
_dockHintCenter.Size = new Float2(HintControlSize);
_dockHintCenter.BackgroundColor = Style.Current.Selection.AlphaMultiplied(0.6f);
_dockHintCenter.BackgroundColor = mainColor.AlphaMultiplied(0.6f);
}
if (_toSet != DockState.Float)
{
if (hoveredHintControl != null)
{
hoveredHintControl.BackgroundColor = Style.Current.Selection.AlphaMultiplied(1.0f);
hoveredHintControl.Size = hoveredSizeOverride;
hoveredHintControl.BackgroundColor = mainColor;
if (_toSet != prevToSet)
hoveredHintControl.Location += hoveredLocationOffset;
hoveredHintControl.Size = hoveredSizeOverride - hoveredMargin;
}
}
}
@@ -441,18 +494,21 @@ namespace FlaxEditor.GUI.Docking
private void OnUpdate()
{
// If the engine lost focus during dragging, end the action
if (!Engine.HasFocus)
{
Dispose();
return;
}
var mousePos = Platform.MousePosition;
if (_mouse != mousePos)
OnMouseMove(mousePos);
}
private void OnMouseMove(Float2 mousePos)
{
if (_dragSourceWindow != null)
_toMove.Window.Window.Position = mousePos - _dragOffset;
{
if (_dragSourceWindow != null)
_toMove.Window.Window.Position = mousePos - _dragOffset;
UpdateRects(mousePos);
UpdateRects(mousePos);
}
}
}
}

View File

@@ -242,6 +242,15 @@ namespace FlaxEditor.GUI
{
FieldInfo[] fields = type.GetFields();
entries.Capacity = Mathf.Max(fields.Length - 1, entries.Capacity);
if (formatMode == EnumDisplayAttribute.FormatMode.Default)
{
// Override display mode from enum itself
var attr = type.GetCustomAttribute<EnumDisplayAttribute>();
if (attr != null)
{
formatMode = attr.Mode;
}
}
for (int i = 0; i < fields.Length; i++)
{
var field = fields[i];

View File

@@ -15,6 +15,7 @@ namespace FlaxEditor.GUI.Input
public class ColorValueBox : Control
{
private bool _isMouseDown;
private bool _linear;
/// <summary>
/// Delegate function used for the color picker events handling.
@@ -101,6 +102,7 @@ namespace FlaxEditor.GUI.Input
public ColorValueBox()
: base(0, 0, 32, 18)
{
_linear = !Graphics.GammaColorSpace;
}
/// <summary>
@@ -113,6 +115,7 @@ namespace FlaxEditor.GUI.Input
: base(x, y, 32, 18)
{
_value = value;
_linear = !Graphics.GammaColorSpace;
}
/// <summary>
@@ -129,8 +132,10 @@ namespace FlaxEditor.GUI.Input
{
base.Draw();
bool isTransparent = _value.A < 1;
var value = _value;
if (_linear)
value = value.ToSRgb();
var isTransparent = value.A < 1;
var style = Style.Current;
var fullRect = new Rectangle(0, 0, Width, Height);
var colorRect = new Rectangle(0, 0, isTransparent ? Width * 0.7f : Width, Height);
@@ -157,10 +162,10 @@ namespace FlaxEditor.GUI.Input
}
}
}
Render2D.FillRectangle(alphaRect, _value);
Render2D.FillRectangle(alphaRect, value);
}
Render2D.FillRectangle(colorRect, _value with { A = 1 });
Render2D.FillRectangle(colorRect, value with { A = 1 });
Render2D.DrawRectangle(fullRect, IsMouseOver || IsNavFocused ? style.BackgroundSelected : Color.Black);
}

View File

@@ -180,7 +180,7 @@ namespace FlaxEditor.GUI.Input
Focus();
float mousePosition = location.X;
if (_thumbRect.Contains(location))
if (_thumbRect.Contains(ref location))
{
// Start sliding
_isSliding = true;

View File

@@ -99,6 +99,11 @@ namespace FlaxEditor.GUI.Input
/// </summary>
public event Action SlidingEnd;
/// <summary>
/// If enabled, pressing the arrow up or down key increments/ decrements the value.
/// </summary>
public bool ArrowKeysIncrement = true;
/// <summary>
/// Gets or sets the slider speed. Use value 0 to disable and hide slider UI.
/// </summary>
@@ -239,6 +244,27 @@ namespace FlaxEditor.GUI.Input
ResetViewOffset();
}
/// <inheritdoc />
public override bool OnKeyDown(KeyboardKeys key)
{
if (ArrowKeysIncrement && (key == KeyboardKeys.ArrowUp || key == KeyboardKeys.ArrowDown))
{
bool altDown = Root.GetKey(KeyboardKeys.Alt);
bool shiftDown = Root.GetKey(KeyboardKeys.Shift);
bool controlDown = Root.GetKey(KeyboardKeys.Control);
float deltaValue = altDown ? 0.1f : (shiftDown ? 10f : (controlDown ? 100f : 1f));
float slideDelta = key == KeyboardKeys.ArrowUp ? deltaValue : -deltaValue;
_startSlideValue = Value;
ApplySliding(slideDelta);
EndSliding();
Focus();
return true;
}
return base.OnKeyDown(key);
}
/// <inheritdoc />
public override bool OnMouseDown(Float2 location, MouseButton button)
{
@@ -296,7 +322,7 @@ namespace FlaxEditor.GUI.Input
#else
/// <inheritdoc />
public override void OnMouseMoveRelative(Float2 mouseMotion)
public override void OnMouseMoveRelative(Float2 motion)
{
var location = Root.TrackingMouseOffset;
if (_isSliding)
@@ -318,7 +344,7 @@ namespace FlaxEditor.GUI.Input
_cursorChanged = false;
}
base.OnMouseMoveRelative(mouseMotion);
base.OnMouseMoveRelative(motion);
}
#endif

View File

@@ -59,12 +59,12 @@ namespace FlaxEditor.GUI
/// <summary>
/// Occurs when items gets clicked by the user.
/// </summary>
public event Action<Item> Clicked;
public event Action<Item> ItemClicked;
/// <summary>
/// Occurs when items gets focused.
/// </summary>
public event Action<Item> Focused;
public event Action<Item> ItemFocused;
/// <summary>
/// The tint color of the text.
@@ -203,7 +203,7 @@ namespace FlaxEditor.GUI
if (button == MouseButton.Left && _isMouseDown)
{
_isMouseDown = false;
Clicked?.Invoke(this);
ItemClicked?.Invoke(this);
}
return base.OnMouseUp(location, button);
@@ -222,7 +222,7 @@ namespace FlaxEditor.GUI
{
base.OnGotFocus();
Focused?.Invoke(this);
ItemFocused?.Invoke(this);
}
/// <inheritdoc />
@@ -434,7 +434,7 @@ namespace FlaxEditor.GUI
/// <param name="item">The item.</param>
public void AddItem(Item item)
{
item.Clicked += OnClickItem;
item.ItemClicked += OnClickItem;
ContainerControl parent = ItemsPanel;
if (!string.IsNullOrEmpty(item.Category))
{

View File

@@ -144,7 +144,7 @@ namespace FlaxEditor.GUI.Timeline
var k = keyframes[i];
var sphere = new BoundingSphere(k.Value, KeyframeSize);
if (sphere.Intersects(selectRay))
if (sphere.Intersects(ref selectRay))
{
SelectKeyframe(_track, i, 0);
return;
@@ -154,7 +154,7 @@ namespace FlaxEditor.GUI.Timeline
{
var t = k.Value + k.TangentIn;
var box = BoundingBox.FromSphere(new BoundingSphere(t, TangentSize));
if (box.Intersects(selectRay))
if (box.Intersects(ref selectRay))
{
SelectKeyframe(_track, i, 1);
return;
@@ -165,7 +165,7 @@ namespace FlaxEditor.GUI.Timeline
{
var t = k.Value + k.TangentOut;
var box = BoundingBox.FromSphere(new BoundingSphere(t, TangentSize));
if (box.Intersects(selectRay))
if (box.Intersects(ref selectRay))
{
SelectKeyframe(_track, i, 2);
return;

View File

@@ -115,7 +115,7 @@ namespace FlaxEditor.GUI.Timeline.GUI
/// <inheritdoc />
public override void OnMouseMove(Float2 location)
{
if (_isMoving && Float2.DistanceSquared(location, _startMovePos) > 25.0f)
if (_isMoving && Float2.DistanceSquared(ref location, ref _startMovePos) > 25.0f)
{
_startMovePos = Float2.Minimum;
var x = PointToParent(location).X;
@@ -387,7 +387,7 @@ namespace FlaxEditor.GUI.Timeline.GUI
{
// Push clipping mask
GetDesireClientArea(out var clientArea);
Render2D.PushClip(clientArea);
Render2D.PushClip(ref clientArea);
var style = Style.Current;
var bounds = new Rectangle(Float2.Zero, Size);

View File

@@ -115,7 +115,7 @@ namespace FlaxEditor.GUI
{
if (Children[i] is KeyframePoint p)
{
p.IsSelected = p.Bounds.Intersects(selectionRect);
p.IsSelected = p.Bounds.Intersects(ref selectionRect);
}
}
}
@@ -401,7 +401,7 @@ namespace FlaxEditor.GUI
Cursor = CursorType.Default;
// Check if no move has been made at all
if (Float2.Distance(location, _rightMouseDownPos) < 2.0f)
if (Float2.Distance(ref location, ref _rightMouseDownPos) < 2.0f)
{
var selectionCount = _editor.SelectionCount;
var point = GetChildAt(location) as KeyframePoint;

View File

@@ -50,14 +50,14 @@ namespace FlaxEditor.GUI.Timeline.GUI
var color = (_timeline.IsMovingPositionHandle ? style.SelectionBorder : style.Foreground).AlphaMultiplied(0.6f);
Matrix3x3.RotationZ(Mathf.PiOverTwo, out var m1);
var m2 = Matrix3x3.Translation2D(0, timeAxisHeaderOffset);
Matrix3x3.Multiply(m1, m2, out var m3);
Render2D.PushTransform(m3);
Matrix3x3.Multiply(ref m1, ref m2, out var m3);
Render2D.PushTransform(ref m3);
// TODO: Convert to its own sprite or 9 slice
Render2D.DrawSprite(icon, new Rectangle(new Float2(10, -icon.Size.X * 0.5f - 1), Size + new Float2(0, 1)), color);
Render2D.FillRectangle(new Rectangle(new Float2(-6, -icon.Size.Y * 0.5f + 7), new Float2(timeAxisOverlap, 5)), color);
Render2D.PopTransform();
var textMatrix = Matrix3x3.Translation2D(12, timeAxisHeaderOffset);
Render2D.PushTransform(textMatrix);
Render2D.PushTransform(ref textMatrix);
Render2D.DrawText(style.FontSmall, labelText, style.Foreground, new Float2(2, -6));
Render2D.PopTransform();

View File

@@ -356,7 +356,7 @@ namespace FlaxEditor.GUI.Timeline
{
Render2D.DrawLine(bounds.UpperLeft, bounds.BottomLeft, moveColor, moveThickness);
}
else if (IsMouseOver && CanResize && MoveLeftEdgeRect.Contains(_mouseLocation))
else if (IsMouseOver && CanResize && MoveLeftEdgeRect.Contains(ref _mouseLocation))
{
Render2D.DrawLine(bounds.UpperLeft, bounds.BottomLeft, Color.Yellow);
}
@@ -364,7 +364,7 @@ namespace FlaxEditor.GUI.Timeline
{
Render2D.DrawLine(bounds.UpperRight, bounds.BottomRight, moveColor, moveThickness);
}
else if (IsMouseOver && CanResize && MoveRightEdgeRect.Contains(_mouseLocation))
else if (IsMouseOver && CanResize && MoveRightEdgeRect.Contains(ref _mouseLocation))
{
Render2D.DrawLine(bounds.UpperRight, bounds.BottomRight, Color.Yellow);
}
@@ -384,8 +384,8 @@ namespace FlaxEditor.GUI.Timeline
_startMoveLocation = Root.MousePosition;
_startMoveStartFrame = StartFrame;
_startMoveDuration = DurationFrames;
_startMoveLeftEdge = MoveLeftEdgeRect.Contains(location) && CanResize;
_startMoveRightEdge = MoveRightEdgeRect.Contains(location) && CanResize;
_startMoveLeftEdge = MoveLeftEdgeRect.Contains(ref location) && CanResize;
_startMoveRightEdge = MoveRightEdgeRect.Contains(ref location) && CanResize;
StartMouseCapture(true);
if (_startMoveLeftEdge || _startMoveRightEdge)
return true;

Some files were not shown because too many files have changed in this diff Show More