433 Commits

Author SHA1 Message Date
f5974a7448 Merge remote-tracking branch 'origin/1.10' into sdl_platform_1.10 2025-03-13 18:43:06 +02:00
Wojtek Figat
5d3da8a8d0 Merge remote-tracking branch 'origin/master' into 1.10
# Conflicts:
#	Source/Editor/SceneGraph/Actors/StaticModelNode.cs
#	Source/Engine/Graphics/Models/Mesh.cs
#	Source/Engine/Graphics/Models/ModelData.h
2025-03-13 11:23:01 +01:00
Wojtek Figat
2cf30c27eb Fix .NET libs deploy regression 2025-03-13 11:19:09 +01:00
Wojtek Figat
5d32bb962f Add warning when cloth paint is incorrect size 2025-03-11 23:09:47 +01:00
Wojtek Figat
477c979cdd Merge branch 'Tryibion-local-origin-multi-mesh' 2025-03-11 23:02:39 +01:00
Wojtek Figat
9d46626641 Fix new rubberband selection when using arc cam via alt key 2025-03-11 22:58:01 +01:00
Wojtek Figat
e7824d6d9b Merge branch 'local-origin-multi-mesh' of https://github.com/Tryibion/FlaxEngine into Tryibion-local-origin-multi-mesh 2025-03-11 22:28:48 +01:00
Wojtek Figat
7120ac4f10 Merge branch 'xxSeys1-TypoFix' 2025-03-11 22:12:49 +01:00
Wojtek Figat
f5751254d6 Merge branch 'TypoFix' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-TypoFix 2025-03-11 22:12:43 +01:00
Wojtek Figat
f11349f16c Fix compilation 2025-03-11 22:09:19 +01:00
xxSeys1
862c2db11a fix some typos 2025-03-11 21:18:23 +01:00
Wojtek Figat
2af6bdc283 Fix audio artifacts when importing 32-bit IEE wav files 2025-03-11 18:46:25 +01:00
Wojtek Figat
3c303514a4 Fix crash when using audio playback and playing editor meanwhile 2025-03-11 18:10:48 +01:00
Wojtek Figat
a3cc3c79e2 Another fix for spatial and non-spatial, mono and multi-channel audio sourcs playback on OpenAL
#3206
2025-03-11 18:10:19 +01:00
Wojtek Figat
cab0f92da8 Fix crash when importing large audio file 2025-03-11 17:01:33 +01:00
Wojtek Figat
21c07b7bf3 Fix regression from f256b0670f
#3277
2025-03-11 16:41:27 +01:00
Wojtek Figat
0b85438b20 Merge branch 'Zode-absolutesnap' 2025-03-11 14:05:30 +01:00
Wojtek Figat
9c15094855 Minor tweaks
#2722
2025-03-11 14:05:18 +01:00
Wojtek Figat
9e9b255c00 Merge branch 'absolutesnap' of https://github.com/Zode/FlaxEngine into Zode-absolutesnap 2025-03-11 13:28:01 +01:00
Wojtek Figat
1a5874e425 Merge branch 'Tryibion-scene-actor-multi-select' 2025-03-11 13:09:01 +01:00
Wojtek Figat
f256b0670f Add mouse capture usage for new rubber band selection
#3151
2025-03-11 13:07:53 +01:00
Wojtek Figat
a54299a560 Optimize ViewportRubberBandSelector
#3151
2025-03-11 13:05:15 +01:00
Wojtek Figat
273b366f44 Merge branch 'scene-actor-multi-select' of https://github.com/Tryibion/FlaxEngine into Tryibion-scene-actor-multi-select 2025-03-11 10:24:00 +01:00
Wojtek Figat
131d2fa4f1 Merge branch 'Tryibion-control-type-search' 2025-03-11 10:15:01 +01:00
Wojtek Figat
08a43b93f4 Merge branch 'control-type-search' of https://github.com/Tryibion/FlaxEngine into Tryibion-control-type-search 2025-03-11 10:14:55 +01:00
Wojtek Figat
47b004a4aa Merge branch 'Tryibion-multi-axis-select-box' 2025-03-11 10:14:30 +01:00
Wojtek Figat
f7e5bcb058 Merge branch 'multi-axis-select-box' of https://github.com/Tryibion/FlaxEngine into Tryibion-multi-axis-select-box 2025-03-11 10:14:24 +01:00
Wojtek Figat
e30647b675 Merge branch 'Tryibion-scale-gizmo-fix' 2025-03-11 00:09:36 +01:00
Wojtek Figat
f8e6e09717 Merge branch 'scale-gizmo-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-scale-gizmo-fix 2025-03-11 00:08:19 +01:00
Wojtek Figat
b8ae066542 Merge branch 'Tryibion-remove-obj-dropdown' 2025-03-11 00:06:19 +01:00
Wojtek Figat
b96ff56043 Merge branch 'remove-obj-dropdown' of https://github.com/Tryibion/FlaxEngine into Tryibion-remove-obj-dropdown 2025-03-11 00:06:15 +01:00
Wojtek Figat
2b0dc8b16d Merge branch 'Tryibion-lock-scene-change' 2025-03-11 00:05:38 +01:00
Wojtek Figat
3c7d88663a Merge branch 'lock-scene-change' of https://github.com/Tryibion/FlaxEngine into Tryibion-lock-scene-change 2025-03-11 00:05:33 +01:00
Wojtek Figat
cd72f4f19b Add Edit GUI option to Game Window
#3269
2025-03-11 00:04:57 +01:00
Wojtek Figat
897e451ab6 Restore shadows on Switch after refactor into Shadow Atlas 2025-03-10 21:00:49 +01:00
Chandler Cox
7a83bce996 Add using c: in search filtering to find control types. 2025-03-10 12:46:30 -05:00
Wojtek Figat
48343897cd Fix .NET files deploy regression on AOT platforms 2025-03-10 18:46:15 +01:00
Wojtek Figat
52c09b95ca Add Base Model to Animation Window to preview animation via a different base skeleton with retargetting
#3072
2025-03-09 23:35:24 +01:00
Wojtek Figat
09b23e2376 Minor fixes 2025-03-09 23:02:06 +01:00
72ef6f92ae Update SDL3 to 3.2.6 2025-03-09 22:47:17 +02:00
45c388c92d Merge remote-tracking branch 'origin/1.10' into sdl_platform
# Conflicts:
#	Source/Editor/GUI/ContextMenu/ContextMenuBase.cs
#	Source/Engine/Platform/Linux/LinuxPlatform.cpp
2025-03-09 22:47:12 +02:00
Chandler Cox
0abd953ded Better selection bounds for multi axis transform gizmo 2025-03-09 15:29:01 -05:00
Wojtek Figat
7f8729451c Fix regression/crash in new World Triplanar node
#3214
2025-03-09 20:39:13 +01:00
Chandler Cox
5340eac14a Small fixes. 2025-03-09 13:14:26 -05:00
83d6f9fcf3 Avoid showing tooltips in inactive windows 2025-03-09 13:05:03 +02:00
4d3588d09e Update SDL3 to 3.2.4 2025-03-09 13:05:02 +02:00
d72f8a61cb Fix window dragging when not supported by Wayland compositor
(cherry picked from commit 3554747a67)
2025-03-09 13:05:02 +02:00
0e173de542 Show current display server in Editor window tooltip
(cherry picked from commit 62968dd437)
2025-03-09 13:05:01 +02:00
8aa0aa4292 Properly mark floating windows with transparency support
(cherry picked from commit c660fac524)
2025-03-09 13:05:01 +02:00
26f8aa9985 Enable transparency support in Vulkan swapchains
(cherry picked from commit 431a69e357)
2025-03-09 13:05:00 +02:00
24c62e2a8d Fix compilation for game builds
(cherry picked from commit f4fcc07288)
2025-03-09 13:05:00 +02:00
91c1d3ce0a Fix cloning SDL repository 2025-03-09 13:04:59 +02:00
93aba7b959 Fix text input not working on X11 2025-03-09 13:04:59 +02:00
fbe61eee9e Fix button latching on Windows after drag and drop operation 2025-03-09 13:04:58 +02:00
12bb3f3a22 Implement new window dragging system 2025-03-09 13:04:58 +02:00
713c4f5d1d Fix mouse resetting issues after ending relative mode 2025-03-09 13:04:57 +02:00
2fe286eed0 Fix frame stutter when window is focused 2025-03-09 13:04:56 +02:00
4539ec4dcf Fix error when docking to sides of tabbed panel 2025-03-09 13:04:56 +02:00
17714c52e0 Cleanup Linux SDL implementation 2025-03-09 13:04:55 +02:00
8810a98c28 Support compiling third party library C files as C code 2025-03-09 13:04:55 +02:00
1da6ffe920 Implement Wayland protocols module and file generation 2025-03-09 13:04:54 +02:00
f966f92583 Fix mouse warping after ending relative mode 2025-03-09 13:04:54 +02:00
ca17bc501f Add git fetch method for dependencies 2025-03-09 13:04:53 +02:00
2e866aa156 Fix window ShowInTaskbar setting 2025-03-09 13:04:53 +02:00
696be807bd Fix various issues with child window positioning 2025-03-09 13:04:52 +02:00
ed63f47620 Add Window.IsAlwaysOnTop property 2025-03-09 13:04:52 +02:00
0d546a82c7 Use SDL locale 2025-03-09 13:04:51 +02:00
9a6c0dd5f4 Allow window with single tab to be dragged from tab area 2025-03-09 13:04:50 +02:00
a00342b1c3 Fix ValueBox mouse position resetting after releasing the button 2025-03-09 13:04:50 +02:00
a798965d9a Fix SDL build process on Linux 2025-03-09 13:04:49 +02:00
d0925b82df Update SDL to 3.2.0 2025-03-09 13:04:49 +02:00
0c535d5a33 Force cursor to center of Game Window when tab handle is clicked 2025-03-09 13:04:48 +02:00
Chandler Cox
05cf5a4d7a Fix rotation using SDL 2025-03-09 13:04:48 +02:00
da59713152 Fix Linux compilation without SDL 2025-03-09 13:04:47 +02:00
8510fd237f Fix compilation 2025-03-09 13:04:46 +02:00
3dc2fe0558 Update SDL3 2025-03-09 13:04:46 +02:00
716f76dca4 Fix compilation issues 2025-03-09 13:04:45 +02:00
29e732c783 Fix windows not being hidden initially 2025-03-09 13:04:45 +02:00
53862298b6 Fix parent window position handling with popup/tooltip windows 2025-03-09 13:04:44 +02:00
4464555dcc Fix compilation errors in other platforms 2025-03-09 13:04:44 +02:00
ec383ffb1d Fix CI for Linux 2025-03-09 13:04:43 +02:00
909ba336b0 Prevent building with SDL in unsupported platforms 2025-03-09 13:04:43 +02:00
ecaa03365f Fallback to X11 message box implementation when SDL fails 2025-03-09 13:04:42 +02:00
fb88460903 Fix popup and context menus not working on Wayland 2025-03-09 13:04:42 +02:00
db840ebef9 Hide warnings for unsupported SDL operations on Wayland 2025-03-09 13:04:41 +02:00
3f303a7a77 Log a warning for not implemented Wayland functionality 2025-03-09 13:04:40 +02:00
848d8e35e5 Fix compilation in Linux 2025-03-09 13:04:40 +02:00
2f3b45ae82 Enable warning sound in question dialogs 2025-03-09 13:04:39 +02:00
48600c6ac5 Enable modern Windows dialog boxes 2025-03-09 13:04:39 +02:00
bb132305e3 Implement relative mouse mode (raw input) for SDL platform 2025-03-09 13:04:38 +02:00
769823ddf5 Add flag for Window types 2025-03-09 13:04:38 +02:00
8a0ce55fec Enable native windowing system settings with SDL platform 2025-03-09 13:04:37 +02:00
832d902699 Add command-line switches to force X11 and Wayland SDL drivers 2025-03-09 13:04:37 +02:00
6843205ec9 Implement SDL platform, windowing and input handling 2025-03-09 13:04:36 +02:00
74fb1a74a6 Refactor application window class name 2025-03-09 13:04:35 +02:00
29c3a9e4bf Move Window related enums to separate header file 2025-03-09 13:04:35 +02:00
6f55b5452f Refactor Windows drag and drop implementation 2025-03-09 13:04:34 +02:00
716ae95630 Refactor ScreenUtilities 2025-03-09 13:04:34 +02:00
02e9d60c5b Add more helper methods for managing Git repos 2025-03-09 13:04:33 +02:00
a1b7666c1c Fix centered window location on X11 2025-03-09 13:04:33 +02:00
1b9663a390 Fix initial position of Tooltips 2025-03-09 13:04:32 +02:00
Wojtek Figat
bc4f3668fe Merge remote-tracking branch 'origin/master' into 1.10
# Conflicts:
#	Source/Engine/Core/Math/Vector3.cpp
#	Source/Engine/Core/Math/Vector3.h
#	Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp
#	Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp
#	Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.h
2025-03-09 09:23:42 +01:00
Wojtek Figat
a93085d6d6 Redo 7d79dbac40 2025-03-09 09:15:49 +01:00
Wojtek Figat
34dcbc0445 Add Vector3.SignedAngle utility method
Merge 072f7c7e45 and c1bd42ff7e
2025-03-09 09:10:15 +01:00
Wojtek Figat
3643ec7a58 Fix crash when loading old triplanar node 2025-03-09 09:09:45 +01:00
Wojtek Figat
1e2e613a78 Fix rich textbox carret placement regressions
#3118 #2964
2025-03-08 23:49:12 +01:00
Wojtek Figat
fe95ac96af Rename param 2025-03-08 21:09:48 +01:00
Wojtek Figat
3b7c90644e Merge branch 'Muzz-Advanced-Bloom' into 1.10 2025-03-08 20:29:57 +01:00
Wojtek Figat
5e8f9e357a Reorganize code 2025-03-08 20:25:03 +01:00
Wojtek Figat
4c9d51f0ef Code style cleanup
#3250
2025-03-08 20:18:38 +01:00
Wojtek Figat
f7c6d34f59 Merge branch 'Advanced-Bloom' of https://github.com/Muzz/FlaxEngine into Muzz-Advanced-Bloom 2025-03-08 19:47:22 +01:00
Wojtek Figat
7808c65dd3 Update engine asset 2025-03-08 19:47:04 +01:00
Wojtek Figat
baf28382a8 Disable contact shadows on low shadows quality mode and fix step count for high setting 2025-03-08 19:46:35 +01:00
Chandler Cox
e9f2d94a2e Remove object editor drop down if disabled. 2025-03-08 11:07:07 -06:00
Chandler Cox
837a4927c1 Try fix build issues. 2025-03-08 10:50:46 -06:00
Chandler Cox
1ece21e25c Deselect locked object on scene change. 2025-03-08 10:46:11 -06:00
Chandler Cox
54dc66d22e Add base check to control and canvas nodes. 2025-03-08 09:41:00 -06:00
Chandler Cox
5ea6e7b49d Refactor to ViewportRubberBandSelector class and use actor node virtual methods. 2025-03-08 09:38:01 -06:00
Wojtek Figat
8a52fa257b Add logging draw event into in Vulkan error 2025-03-08 14:29:36 +01:00
Wojtek Figat
7d79dbac40 Fix shadows sampling error in shader due to incorrect sampler used
#3000
2025-03-08 14:29:17 +01:00
Wojtek Figat
fef967d4a0 Fix crash on Vulkan when binding dummy buffer as missing uniform buffer
#3000
2025-03-08 14:28:47 +01:00
Wojtek Figat
679d56d7a3 Fix regression error on duplicated scene objects in registry 2025-03-08 13:31:01 +01:00
Wojtek Figat
e760e5cc97 Fix particle sim shader compilation warning on Vulkan
#https://github.com/KhronosGroup/glslang/issues/2066
2025-03-08 13:23:08 +01:00
Wojtek Figat
5bdbbb6d38 Merge remote-tracking branch 'origin/master' into 1.10 2025-03-07 23:41:02 +01:00
Wojtek Figat
0c0f128585 Fix collision proxy not updating on sequential mesh changes
#2920
2025-03-07 23:39:01 +01:00
Wojtek Figat
ca153e70ab Fix crash when loading cloth that has different paint data size than mesh
#3264
2025-03-07 21:23:54 +01:00
Wojtek Figat
bc6f4f50cb Fix serialization of ControlReference when used in prefabs
#3262
2025-03-07 18:55:03 +01:00
Wojtek Figat
84f6667105 Fix missing MoltenVK error to be logged only once 2025-03-07 12:52:45 +01:00
Wojtek Figat
5d80cb03f1 Fix compilation issues 2025-03-07 12:35:54 +01:00
Wojtek Figat
4fada6ba40 Add logging CPU name on Windows 2025-03-07 12:06:15 +01:00
Wojtek Figat
0fa88b23c6 Add DriverVersion to GPUAdapter for checking on old GPU drivers 2025-03-07 11:39:54 +01:00
Wojtek Figat
301491bcde Fix Linux platform init to correctly calculate device id and add missing change 2025-03-07 11:39:15 +01:00
Wojtek Figat
5f57286cdb Fix Windows detection to use correct system version it was build for (eg. Win10 or Win7) 2025-03-07 11:09:32 +01:00
Wojtek Figat
7135eb3591 Add SystemName and SystemVersion to Platform api 2025-03-07 11:06:10 +01:00
Wojtek Figat
cc7d88d4a9 Fix Platform::GetCacheLineSize to be deprecated in favor of existing CPUInfo.CacheLineSize` 2025-03-06 09:08:00 +01:00
Wojtek Figat
772f7f7fd2 Move GPUDeviceDX::UpdateOutputs to cpp file 2025-03-06 09:00:33 +01:00
Wojtek Figat
8e2f3ec0c0 Fix Version marshaling as parameter 2025-03-06 00:36:39 +01:00
Wojtek Figat
196ada5710 Add Extra Development Memory access and log on start 2025-03-05 13:43:15 +01:00
Wojtek Figat
06729f6b62 Add Program Size Memory access and log on start 2025-03-05 12:10:17 +01:00
Wojtek Figat
7809007a13 Fix deprecation api usage on game exit 2025-03-05 12:09:32 +01:00
Wojtek Figat
06de1c0041 Add logging memoery usage by external apps on crash
Game crash on out of memory might be caused by user opening too many external apps that use most of memory.
2025-03-05 10:51:29 +01:00
Wojtek Figat
06665734e7 Fix Platform::GetCacheLineSize to be deprecated in favor of CPUInfo 2025-03-04 22:57:58 +01:00
Wojtek Figat
668511a727 Fix error in XML docs processing
#2724
2025-03-04 22:37:05 +01:00
Wojtek Figat
5ffa3eb837 Fix getting Control from null ControlReference
#3123
2025-03-04 22:12:35 +01:00
Wojtek Figat
00202b06a4 Merge branch 'Tryibion-control-reference' 2025-03-04 22:04:28 +01:00
Wojtek Figat
93442ec8fa Refactor ControlReference to use FlaxObjectRefPickerControl as a base class
#3123
2025-03-04 20:32:06 +01:00
Wojtek Figat
520bab7463 Refactor serialziation of ControlReference into a string with ID of actor for simplicity
#3123
2025-03-04 17:14:21 +01:00
Wojtek Figat
35fa63852c Format code and simplify IControlReference a little bit
#3123
2025-03-04 16:06:48 +01:00
Wojtek Figat
fee54f0f39 Merge branch 'control-reference' of https://github.com/Tryibion/FlaxEngine into Tryibion-control-reference 2025-03-04 14:03:56 +01:00
Wojtek Figat
e66ae2ee74 Merge branch 'Tryibion-android-emulate' 2025-03-04 10:58:01 +01:00
Wojtek Figat
30e9fe2371 Merge branch 'android-emulate' of https://github.com/Tryibion/FlaxEngine into Tryibion-android-emulate 2025-03-04 10:49:58 +01:00
Chandler Cox
a5e8f7d405 Move to custom tool method within platform 2025-03-03 21:42:54 -06:00
Wojtek Figat
a3822b6669 Fix spline node to support prefab editor
#3257
2025-03-03 23:38:41 +01:00
Wojtek Figat
819ce2222d Refactor ISceneContextWindow into ISceneEditingContext with more utilities
#3257
2025-03-03 23:32:27 +01:00
Wojtek Figat
e82bb639ed Fix objects creation to ensure managed object ctor is always executed
#3245
2025-03-03 19:12:29 +01:00
Wojtek Figat
3200fc1570 Fix new terrain debug drawing of collision lines
#3227
2025-03-03 12:03:38 +01:00
Wojtek Figat
54ad9a7629 Fix error when connecting nodes in Visject 2025-03-03 09:54:30 +01:00
Wojtek Figat
6f28302fd1 Merge branch 'xxSeys1-DebugDrawClearInEditor' 2025-03-03 09:52:43 +01:00
Wojtek Figat
47b22b305d Add conditional showing of Clear Debug Draw buttons only if there is anything to clear
#2989
2025-03-03 09:51:05 +01:00
Wojtek Figat
6ad20b222d Merge branch 'DebugDrawClearInEditor' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-DebugDrawClearInEditor
# Conflicts:
#	Source/Editor/Windows/GameWindow.cs
2025-03-03 09:40:01 +01:00
Wojtek Figat
68b21652bb Merge branch 'Tryibion-input-helpers' 2025-03-02 23:06:35 +01:00
Wojtek Figat
5fe9108803 Merge branch 'input-helpers' of https://github.com/Tryibion/FlaxEngine into Tryibion-input-helpers 2025-03-02 23:06:31 +01:00
Wojtek Figat
02ecfad428 Merge branch 'xxSeys1-ShowInContentPanel' 2025-03-02 23:05:31 +01:00
Wojtek Figat
25b51cf9c4 Merge branch 'ShowInContentPanel' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-ShowInContentPanel 2025-03-02 23:05:27 +01:00
Wojtek Figat
b2c5b4c2e5 Merge branch 'anton-makarenko-DebugLog-documentation-fix' 2025-03-02 22:54:32 +01:00
Wojtek Figat
379c31ca49 Merge branch 'DebugLog-documentation-fix' of https://github.com/anton-makarenko/FlaxEngine into anton-makarenko-DebugLog-documentation-fix 2025-03-02 22:54:26 +01:00
Wojtek Figat
383df75a81 Merge branch 'xxSeys1-GridPanelFillSliderSens' 2025-03-02 22:52:52 +01:00
Wojtek Figat
0ff19e9c95 Merge branch 'GridPanelFillSliderSens' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-GridPanelFillSliderSens 2025-03-02 22:52:44 +01:00
Wojtek Figat
cbe96252f6 Update assets 2025-03-02 11:38:25 +01:00
Wojtek Figat
4846852762 Fix crash when spline actor gets removed
(speculative fix)

#3180
2025-03-02 10:45:51 +01:00
Wojtek Figat
72c3d2b94c Update engine materials 2025-02-28 15:19:47 +01:00
Wojtek Figat
7ccae0140b Fix regression from #3214 on Deformable shader 2025-02-28 15:18:29 +01:00
Muzz
7885590593 Merge branch 'Muzz-Triplanar-Features' into 1.10 2025-02-28 14:56:45 +01:00
Wojtek Figat
dad8c0cd6b Merge remote-tracking branch 'origin/master' into 1.10
# Conflicts:
#	Source/Engine/Level/Prefabs/Prefab.Apply.cpp
2025-02-27 17:17:02 +01:00
Wojtek Figat
7410b506e3 Merge branch 'GoaLitiuM-csharp_mainproj_fix' 2025-02-27 16:22:09 +01:00
Wojtek Figat
dec9905bd3 Merge branch 'csharp_mainproj_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-csharp_mainproj_fix 2025-02-27 15:43:25 +01:00
Wojtek Figat
bb35d9f811 Add improved AndroidNdk detection to handle versions folder in env var location and fallback to automatic
#2893
2025-02-27 15:34:29 +01:00
Wojtek Figat
b2c8c4018c Fix scripting bindings codegen for SoftTypeReference and SceneReference
#2761
2025-02-26 22:43:30 +01:00
Wojtek Figat
809fd2653a Fix game viewport size to not include DPI scale (screen-space uses it)
#2976
2025-02-26 20:55:57 +01:00
Wojtek Figat
2d956ebb36 Fix error when applying prefab changes with missing (deleted) nested prefabs
#3244
2025-02-26 17:46:22 +01:00
Wojtek Figat
33dd47c169 Merge branch 'MrCapy0-Level' 2025-02-25 22:37:04 +01:00
Wojtek Figat
e101048c71 Merge branch 'Level' of https://github.com/MrCapy0/FlaxEngine into MrCapy0-Level
# Conflicts:
#	Source/Engine/Level/Level.cpp
2025-02-25 22:33:12 +01:00
Wojtek Figat
aaad2face2 Fix HRTF audio to be disabled due to common audio problems
#3225
2025-02-25 22:19:26 +01:00
Wojtek Figat
8f1a1827f2 Fix crash in OpenAL audio backend on context rebuild
#3225
2025-02-25 22:17:18 +01:00
Muzz
1fac78f48f attributes fix 2025-02-25 14:49:59 +10:00
Muzz
953cbb6e40 Advanced Bloom commit. 2025-02-25 14:02:15 +10:00
Wojtek Figat
21047ac8ac Upgrade CollisionCooking to use new MeshAccessor 2025-02-24 23:46:44 +01:00
Wojtek Figat
754d321ef0 Fix crash on incorrect index buffer size when building mesh buffers via MeshAccessor
#3246
2025-02-24 23:28:35 +01:00
Wojtek Figat
2ab9adab24 Merge remote-tracking branch 'origin/master' into 1.10 2025-02-24 23:27:56 +01:00
xxSeys1
0d5534c445 decrease grid panel fill slider sensitivity 2025-02-24 17:43:32 +01:00
Chandler Cox
ef8612fb59 Merge branch 'master' into android-emulate 2025-02-20 21:19:32 -06:00
Wojtek Figat
ce335a0fe4 Use new api for span from stream 2025-02-18 09:52:49 +01:00
Wojtek Figat
4aab1be3d6 Bump up materials version after merge with master 2025-02-18 09:20:48 +01:00
Wojtek Figat
6b6d808698 Fix warning 2025-02-18 09:20:06 +01:00
Wojtek Figat
a6fb651ff4 Merge remote-tracking branch 'origin/master' into 1.10
# Conflicts:
#	Source/Engine/Graphics/Materials/MaterialShader.h
2025-02-18 09:19:59 +01:00
Chandler Cox
25b8939aff Update to include presenter context. 2025-02-16 18:05:25 -06:00
Chandler Cox
e4d2e429a0 Merge branch 'master' into control-reference 2025-02-16 17:40:38 -06:00
xxSeys1
054d06f49e add rmb menu entry to show item in Content Panel 2025-02-15 17:38:03 +01:00
Anton Makarenko
9e25714338 Changes text of documentation above static Log method from warning to info to better reflect method's purpose and avoid possible confusion 2025-02-05 16:24:55 +02:00
Chandler Cox
898295e9d4 Small code cleanup. 2025-02-03 22:20:51 -06:00
Chandler Cox
a17c15ae96 Add missing return comments for get methods. 2025-02-03 22:11:07 -06:00
Chandler Cox
be6a258846 Add runtime input mapping helpers. 2025-02-03 21:57:14 -06:00
0764ff6cb7 Fix C# projects not compiling in VS with native code plugins present 2025-01-31 23:58:23 +02:00
Chandler Cox
45a24a05c5 Add check for if static model has a model. 2025-01-28 16:22:02 -06:00
Chandler Cox
16ed7272a7 Skip not active actors. 2025-01-28 16:05:19 -06:00
Chandler Cox
6461ffbd0d Skip selecting scene actor. 2025-01-28 15:58:18 -06:00
Chandler Cox
abe2482a01 Use mesh collision proxy if available. 2025-01-27 18:28:06 -06:00
Chandler Cox
fc4c2c53fc select parent of prefab if it has a prefab link. 2025-01-26 13:50:07 -06:00
Chandler Cox
fa06a8cc16 Fix rubberband taking over when tyring to move objects. Move rubberband out of update method. 2025-01-26 13:45:31 -06:00
Chandler Cox
4d4c046556 small cleanup with uicanvas searching. 2025-01-25 15:35:07 -06:00
Chandler Cox
4598cdb2d0 Fix check for control parent. 2025-01-25 15:32:18 -06:00
Chandler Cox
eb43d4813d Faster selection, select while dragging, only select if actor box is in rect. 2025-01-25 15:30:22 -06:00
Wojtek Figat
d501018feb Add improved GPU crashes reporting 2025-01-24 22:56:52 +01:00
Wojtek Figat
d4c72487cd Fix various asset windows shutdown when editor is disposing during crash 2025-01-24 22:55:21 +01:00
Wojtek Figat
0b48a274e5 Fix compilation 2025-01-24 22:54:56 +01:00
Wojtek Figat
342f3543ca Fix LOG_FLUSH to flush only when automatic mode is disabled 2025-01-24 20:15:32 +01:00
Wojtek Figat
b36e55446f Add Engine::ReportCrash event for custom crash reporting or handling 2025-01-24 20:15:17 +01:00
Wojtek Figat
cf40facefe Add engine fatal error types handling
Add general out-of-memory handling
Add safety memory buffer for crash or out of memory handling
Refactor Globals exit/error state to be in Engine class
2025-01-24 20:07:12 +01:00
Wojtek Figat
fa2f2e3104 Fix Linux build 2025-01-24 12:53:56 +01:00
Wojtek Figat
ae74d49b09 Fix bug 2025-01-24 12:24:52 +01:00
Wojtek Figat
80a44b5f5c Remove old code 2025-01-24 11:08:31 +01:00
Wojtek Figat
dffc6ea24d Move hash set related configs into proper header file and rename those 2025-01-24 00:05:07 +01:00
Wojtek Figat
38f74c8cf7 Refactor Dictionary and HashSet to use shared base class
Add const iterators
2025-01-23 23:59:31 +01:00
Wojtek Figat
61a731704d Fix const-correctness in dictionary iterator access 2025-01-23 21:40:52 +01:00
Wojtek Figat
c1339765b7 Fix parsing nested template types in scripting type inheritance 2025-01-23 21:32:09 +01:00
Wojtek Figat
f5280eab74 Refactor and improve collections code
#3043
2025-01-23 14:44:11 +01:00
Wojtek Figat
af416fe0c8 Fix packaging issues to properly read asset data after it's serialized with a new format 2025-01-22 21:24:49 +01:00
Wojtek Figat
326bc498b8 Add more logging for cooking process 2025-01-22 00:01:25 +01:00
Wojtek Figat
d1cc8da841 Remove not needed warning log in Editor on fresh project 2025-01-21 23:46:32 +01:00
Wojtek Figat
4cf22c3a1f Fix material to run shader generation when using null rendering backend 2025-01-21 23:14:00 +01:00
Wojtek Figat
8736d4c91a Remove not needed warning log in Editor on fresh project 2025-01-21 22:47:44 +01:00
Wojtek Figat
682ca9e953 Add progress indicator in editor for assets loading 2025-01-21 21:38:02 +01:00
Wojtek Figat
344d17714c Fix crash when using ref struct reflection in managed api 2025-01-21 15:39:21 +01:00
Wojtek Figat
b247070840 Fix regression in Dictionary capacity and use similar improvement in HashSet 2025-01-21 15:38:14 +01:00
Wojtek Figat
236b8d5667 Add failing Windows Test CI if FlaxTests.exe fails 2025-01-21 14:01:23 +01:00
Wojtek Figat
c3ad937d3f Add failing Windows Test CI if FlaxTests.exe fails 2025-01-21 13:12:04 +01:00
Wojtek Figat
d8dcec42d5 Add failing Windows Test CI if FlaxTests.exe fails 2025-01-21 12:28:35 +01:00
Wojtek Figat
3b5f953b3d Add failing Windows Test CI if FlaxTests.exe fails 2025-01-21 11:52:27 +01:00
Wojtek Figat
9fd98c8e12 Optimize blend weights to use 8-bit per bone (instead of 16-bit) 2025-01-21 11:40:01 +01:00
Wojtek Figat
0b24c50161 Expose ContentDeprecated to scripting (editor-only) 2025-01-21 10:18:57 +01:00
Wojtek Figat
fe8f862b16 Update engine assets 2025-01-21 00:04:03 +01:00
Wojtek Figat
7d0804af91 Add content deprecation upgrades support to prefabs and scenes when loading levels 2025-01-20 23:53:13 +01:00
Wojtek Figat
67f12596e2 Fix LoadAssetTask to properly dereference asset loading task pointer when asset init fails 2025-01-20 23:52:12 +01:00
Wojtek Figat
6a66a944d2 Add total mesh vertex stride display in editor panel 2025-01-20 23:51:35 +01:00
Wojtek Figat
65a689f8ab Add logging first scene asset id in cooked game 2025-01-20 23:51:08 +01:00
Wojtek Figat
18fd68db25 Add SpawnOptions container for more robust prefabs spawning 2025-01-20 23:50:47 +01:00
Wojtek Figat
86444aa5f3 Fix TypeUtils.GetTypeName for nested generic types 2025-01-20 23:49:40 +01:00
Wojtek Figat
011abe4ac0 Fix error when connecting nodes in Visject 2025-01-20 23:49:17 +01:00
Wojtek Figat
f4c07388d9 Restore old upgrader for skinned models from 9f648caac8 2025-01-20 23:49:00 +01:00
Wojtek Figat
eaf48bb176 Fix regression in dynamic mesh bounds and triangles setup after refactor 2025-01-20 23:48:25 +01:00
Wojtek Figat
d4a5c76c82 Add serialization of game settings for proper upgrade when loading deprecated data 2025-01-20 23:47:51 +01:00
Wojtek Figat
8a7ceef288 Add content deprecation system that auto-saves assets in Editor that use old data format 2025-01-20 23:46:49 +01:00
Wojtek Figat
1497acef58 SImplify capacity presetting for Dictionary to handle memory slack scale internally as suers care about items count only 2025-01-16 17:42:01 +01:00
Wojtek Figat
6111f67e33 Add ToSpan for MemoryWriteStream and simplify code with it 2025-01-16 17:35:28 +01:00
Wojtek Figat
39419787fa Another compilation fix 2025-01-15 08:48:03 +01:00
Wojtek Figat
e02f2990d9 Another compilation fix 2025-01-14 23:43:31 +01:00
Wojtek Figat
d0a6edbb2c Another compilation fix 2025-01-14 23:26:26 +01:00
Wojtek Figat
be8686bbb2 Fix new code on non-windows editor platforms 2025-01-14 22:45:03 +01:00
Wojtek Figat
59061c01d3 Fix compilation error 2025-01-14 22:29:06 +01:00
Wojtek Figat
90ba7f4a92 Mark CommonValue as deprecated to generate warnings in old code 2025-01-13 18:25:26 +01:00
Wojtek Figat
754e0c4e29 Update build number 2025-01-13 18:09:19 +01:00
Wojtek Figat
addc6d5216 Merge remote-tracking branch 'origin/master' into 1.10
# Conflicts:
#	Content/Editor/Gizmo/Material.flax
#	Content/Engine/DefaultTerrainMaterial.flax
#	Source/Editor/Windows/Assets/ModelWindow.cs
#	Source/Editor/Windows/Assets/SkinnedModelWindow.cs
#	Source/Engine/Core/Types/Variant.cpp
2025-01-13 18:07:54 +01:00
Chandler Cox
3b7cb00af2 Add shift to continue selection 2025-01-12 21:41:24 -06:00
Chandler Cox
d0d5ad4657 Add rubber band select to scene editor viewport for selecting multiple actors. 2025-01-12 21:33:01 -06:00
Wojtek Figat
ea96418764 Update old Float1010102 to FloatR10G10B10A2 2025-01-12 21:22:53 +01:00
Wojtek Figat
d751c6a6c6 Add PackNormal/UnpackNormal and GetInt/SetInt to MeshAccessor 2025-01-12 21:22:35 +01:00
Wojtek Figat
344d342610 Update assets 2025-01-12 20:31:00 +01:00
Wojtek Figat
e75d7ad257 Fix compilation warnings 2025-01-12 20:30:43 +01:00
Wojtek Figat
54869f1da0 Adjust label height 2025-01-12 17:59:08 +01:00
Wojtek Figat
02df6bafac Update engine assets 2025-01-12 01:33:18 +01:00
Wojtek Figat
d60f3bdfb1 Add mesh vertex layout and GPU memory size display in model window 2025-01-12 01:30:58 +01:00
Wojtek Figat
506efb7538 Merge model and skinned model windows code into shared base class 2025-01-12 01:04:56 +01:00
Wojtek Figat
1b97e49ed9 Fix shadow maps rendering regression bug 2025-01-11 22:45:18 +01:00
Wojtek Figat
b71f803554 Fix regression in particles 2025-01-11 22:45:04 +01:00
Wojtek Figat
647d74af0d Fixes for vertex layouts binding into graphics backend 2025-01-11 22:44:38 +01:00
Wojtek Figat
237ea121be Add vertex colors to skinned meshes 2025-01-11 22:43:15 +01:00
Wojtek Figat
a1c46d2e6e Add support for up to 4 texture channels when importing meshes
#2667
2025-01-11 22:40:20 +01:00
Wojtek Figat
756ba0a533 Fix crash on shadows when using D3D10 2025-01-09 21:46:41 +01:00
Wojtek Figat
99788e4743 More fixes for Vulkan rendering to be on pair with DirectX when it comes to accessing missing vertex buffer components 2025-01-09 21:46:22 +01:00
Wojtek Figat
3505b8971b Add support for up to 65536 skeleton bones in skinned meshes
https://forum.flaxengine.com/t/import-fbx-with-bones-more-than-256/1196
2025-01-08 18:48:50 +01:00
Wojtek Figat
1f294605a3 Add more Vulkan memory layout safety stages 2025-01-08 18:11:47 +01:00
Wojtek Figat
9264db8317 Simplify vertex colors debug draw mode 2025-01-08 18:10:48 +01:00
Wojtek Figat
2b2ace0d00 Fixes for Vulkan backend after recent changes 2025-01-08 18:09:45 +01:00
Wojtek Figat
7e165d6127 Allow vertex colors on skinned meshes
#3044
2025-01-08 09:39:19 +01:00
Chandler Cox
e1dbaebe8e Add instructions for list populating. 2025-01-07 21:40:05 -06:00
Chandler Cox
21f1a46c05 Small wording changes 2025-01-07 21:29:27 -06:00
Chandler Cox
6fbb5548b9 Small code clean up. 2025-01-07 21:15:35 -06:00
Chandler Cox
fa17c49eb1 Add starting adb log collecting button. 2025-01-07 21:11:37 -06:00
Wojtek Figat
7aa240e5eb Add vertex shader input layout reading via shader compiler reflection to handle missing vertex elements binding when explicit layout got deprecated 2025-01-07 23:26:06 +01:00
Wojtek Figat
7f0d852f49 Fix minor shader compilation warnings 2025-01-07 21:55:31 +01:00
Wojtek Figat
edaed7bda1 Add missing layout for ribbon vertex buffer 2025-01-07 16:12:11 +01:00
Wojtek Figat
3b4d4d234d Fix LOD Preview regression due to new instancing logic 2025-01-06 22:49:27 +01:00
Wojtek Figat
bc73d38d34 Reseve engine materials and models 2025-01-06 22:47:44 +01:00
Wojtek Figat
db4d7d2a05 **Refactor meshes format to support custom vertex layouts and new flexible api to access mesh data**
#3044 #2667
2025-01-06 22:47:19 +01:00
Wojtek Figat
29bfef677f Add PixelFormatSampler utility to quick read/write operations on various data formats
Moved from `TextureTool` to be used in runtime and with more generic use cases (including C# scripting).
2025-01-05 23:49:44 +01:00
Wojtek Figat
933fac6c13 Add Slice to Span and sue it to make code cleaner 2025-01-05 17:41:27 +01:00
Wojtek Figat
78cf1a4948 Use MeshDataCache in vertex painting tool 2025-01-05 16:45:30 +01:00
Wojtek Figat
792d322818 Missing change for 6f04231b31 2025-01-05 00:17:52 +01:00
Wojtek Figat
6f04231b31 Rename Vertex Shader input semantic ofBLENDWEIGHT to BLENDWEIGHTS 2025-01-04 21:04:18 +01:00
Chandler Cox
04fc118ddf Small fixes. 2025-01-04 11:45:08 -06:00
MrCapy0
5aa5c97e4c Add "root" parameter to Level.GetScripts() 2025-01-04 09:43:33 -04:00
Wojtek Figat
4f42fb2302 Update other graphics apis to match missing vertex shader inputs merging 2025-01-04 10:55:55 +01:00
Wojtek Figat
ea5cb5d83a Minor fixes and improvements 2025-01-03 01:10:31 +01:00
Wojtek Figat
7b7dd9d142 Improve GPU vertex layout binding in case of missing element from the mesh 2025-01-03 01:09:25 +01:00
Wojtek Figat
348f17479d Fix name of BlendWeight to BlendWeights for vertex input to match BlendIndices 2025-01-03 01:07:33 +01:00
Wojtek Figat
1e262b69cc Add Task::WaitAll with a span of tasks and wrap around profiler macro 2025-01-03 01:05:56 +01:00
Chandler Cox
97184c87af Add android emulation options to game cooker android tab. 2025-01-01 23:05:15 -06:00
Chandler Cox
757b8ff855 Fix local origin option with multi-mesh import. 2024-12-31 00:50:42 -06:00
Chandler Cox
c79cd82fd4 Fix code warnings. 2024-12-30 18:59:45 -06:00
Chandler Cox
711fc80d8c Fix comment. 2024-12-30 16:46:42 -06:00
Chandler Cox
9219b34dc3 Shorten picker control name. 2024-12-30 16:43:06 -06:00
Chandler Cox
e6450bfc7a Add ControlReference for easier UI referencing. 2024-12-30 16:36:10 -06:00
Wojtek Figat
3151e47722 Fix missing material instance load failure when parameters load fails 2024-12-29 23:21:26 +01:00
Wojtek Figat
ab99a25cee Update mesh config defines to match a single format 2024-12-29 23:03:09 +01:00
Wojtek Figat
e7132086a5 Add displaying asset failed text if it occurs 2024-12-29 23:01:25 +01:00
Wojtek Figat
668f3fa68d Update read and write streaming api to use the newest format 2024-12-29 23:00:40 +01:00
Wojtek Figat
fee0ab74ff Update old doc comments 2024-12-28 21:31:21 +01:00
Wojtek Figat
723a882824 Merge more code together for meshes 2024-12-23 23:28:01 +01:00
Wojtek Figat
9f648caac8 Remove deprecated asset data upgrades and old model vertex structures 2024-12-20 00:48:01 +01:00
Wojtek Figat
1bf29c042b Refactor models and meshes to share more code in a base class 2024-12-19 00:20:08 +01:00
Wojtek Figat
8eaa906e0c Remove some redundant code 2024-12-18 18:39:58 +01:00
Wojtek Figat
5b98603c16 Fix incorrect vertex layout stride calculation 2024-12-18 18:38:47 +01:00
Wojtek Figat
80299c8552 Add stride to GPUVertexLayout 2024-12-17 15:58:26 +01:00
Wojtek Figat
d1ac9cd2bc Minor fixes 2024-12-16 20:07:53 +01:00
Wojtek Figat
59b4755379 Move mesh code to shared base class and reordanize files 2024-12-16 20:07:42 +01:00
Wojtek Figat
b3f37ca041 Refactor Vertex Shader input vertex layout to use GPUVertexLayout defined on Vertex Buffer rather than Vertex Shader
#3044 #2667
2024-12-15 22:10:45 +01:00
Wojtek Figat
666efb7675 Fix incorrect dummy GPU Buffer format when binding missing resource to Vulkan descriptor 2024-12-13 14:56:20 +01:00
Wojtek Figat
fc4e6f4972 Add GPUVertexLayout to graphics backends 2024-12-13 09:20:01 +01:00
Wojtek Figat
cedf4b1eb5 Remove GPUShaderProgramsContainer to simplify GPUShader 2024-12-11 15:08:13 +01:00
Wojtek Figat
35e9e048f2 Merge remote-tracking branch 'origin/master' into 1.10 2024-12-10 11:07:31 +01:00
Wojtek Figat
ab78314a01 Revert part of 9870d162e4 to support prefab variants creation 2024-11-25 22:39:02 +01:00
Wojtek Figat
0e13173119 Fix actor reference select in prefab editor 2024-11-25 22:13:46 +01:00
Wojtek Figat
a7061a7524 Fix raw scripting object pointers auto-serialization 2024-11-25 22:13:21 +01:00
Wojtek Figat
344595e171 Don't mark surface as edited if none of the nodes were pasted 2024-11-23 20:31:17 +01:00
Wojtek Figat
9d70fd82d6 Merge remote-tracking branch 'origin/master' into 1.10
# Conflicts:
#	Source/Engine/Networking/NetworkReplicator.cpp
2024-11-22 16:31:18 +01:00
Wojtek Figat
914d82a087 Fix Variant enum casting 2024-11-22 16:04:34 +01:00
Wojtek Figat
74993dcf9e Fix animation retargetting to properly handle different skeleton nodes orientation 2024-11-22 12:29:05 +01:00
Wojtek Figat
f8f4edfa76 Fix variious issues 2024-11-21 23:42:05 +01:00
Wojtek Figat
826d37c513 Add option to copy/paste skeleton retargetting between models 2024-11-21 23:40:25 +01:00
Wojtek Figat
377eb78020 Fix output log command history popup to return focus back to input field on arrow left 2024-11-21 23:22:08 +01:00
Wojtek Figat
3de3c1f2c6 Add debug drawing tangent frame of the selected skeleton node 2024-11-06 15:38:27 +01:00
Wojtek Figat
246944f688 Merge remote-tracking branch 'origin/master' into 1.10 2024-11-06 09:29:48 +01:00
Wojtek Figat
e9dcb8a8bb Add option to build editor without profiler 2024-11-06 09:29:26 +01:00
Wojtek Figat
3f50625cc3 Fix proper handling of Scripting.InvokeOnUpdate if called within that callback 2024-10-30 17:26:06 +01:00
Wojtek Figat
35c44d60a4 Add AutoGravity option to CharacterController for logic from 4de9e9d918 2024-10-30 17:25:17 +01:00
Wojtek Figat
6e598ae9f6 Refactor Multi Blend animations sampling length to fix blend spaces with anims of different length 2024-10-30 17:24:47 +01:00
Wojtek Figat
4de9e9d918 Add gravity to CharacterController::AddMovement for proper movement when using Root Motion 2024-10-30 00:01:54 +01:00
Wojtek Figat
c1bd42ff7e Add Vector3.SignedAngle utility method 2024-10-29 23:55:42 +01:00
Wojtek Figat
b1a54d2967 Missing change in 072f7c7e45 2024-10-29 23:34:10 +01:00
Wojtek Figat
2288684950 Fix pasting or duplicating Multi Blend nodes 2024-10-29 23:08:50 +01:00
Wojtek Figat
0c645e8b0c Fix root animation in blend spaces when one of the animations doesn't use root motion but animated root node channel 2024-10-29 21:59:21 +01:00
Wojtek Figat
072f7c7e45 Fix C++ Vector3::Angle to return value in degrees just like C# API (instead of radians) 2024-10-29 20:36:01 +01:00
Wojtek Figat
41a0ccb218 Fix Visject Surface search to check nested surfaces (such as State Machine graphs) 2024-10-28 20:32:17 +01:00
Wojtek Figat
f88eeeb313 Fix missing casting from scalar Variant types to Enum 2024-10-28 14:32:19 +01:00
Wojtek Figat
082d97248d Add unit test for DebugCommands 2024-10-27 15:22:57 +01:00
Wojtek Figat
d88c5f3063 Merge branch 'mtszkarbowiak-fix/nullable' into 1.10 2024-10-25 15:59:44 +02:00
Wojtek Figat
fa9ce1d346 Code formatting
#2969
2024-10-25 15:59:38 +02:00
Wojtek Figat
1c2c010ddc Merge branch 'fix/nullable' of https://github.com/mtszkarbowiak/FlaxEngine into mtszkarbowiak-fix/nullable 2024-10-25 15:38:44 +02:00
Wojtek Figat
46c1cc9a49 Add nested variant printing in debug command output 2024-10-25 13:25:15 +02:00
Wojtek Figat
dcd7b4b6c3 Fix crash when boxing native non-POD structure into managed data 2024-10-25 13:21:40 +02:00
Wojtek Figat
2d371fd05f Fix DebugCommands::InitAsync when called every frame 2024-10-24 23:38:36 +02:00
Wojtek Figat
62ece0d92e Fix crash when using attributes cache after hot-reload in editor 2024-10-24 23:38:25 +02:00
Wojtek Figat
8338ec6076 Fix regression 2024-10-24 22:32:02 +02:00
Wojtek Figat
86e21a53ff Add improved value printing of debug command result 2024-10-24 22:31:07 +02:00
Wojtek Figat
c3e31baa7a Merge remote-tracking branch 'origin/master' into 1.10 2024-10-24 19:35:43 +02:00
Wojtek Figat
302fc2feb1 Add various engine systems to debug commands 2024-10-24 19:35:24 +02:00
Wojtek Figat
e324d32769 Add async init and tint coloring based on type to debug commands 2024-10-24 19:34:42 +02:00
Wojtek Figat
5d7eba05ea Add GetFields and GetMethods to binary module api 2024-10-24 19:33:38 +02:00
Wojtek Figat
9a654f729f Fix context menu to resize instead of flash when showing while already visible 2024-10-24 19:27:53 +02:00
Wojtek Figat
87d35f0314 Add debug commands search popup to Output Log 2024-10-24 19:26:11 +02:00
Wojtek Figat
5904c0eea5 Add debug command history to Output Log in Editor 2024-10-22 21:59:06 +02:00
Wojtek Figat
e5289931c6 Add Alignment option to Vertical and Horizonal Panels
#2599
2024-10-22 21:55:25 +02:00
Wojtek Figat
0b1263a9e2 Disable VK_EXT_tooling_info check for debugger on Linux 2024-10-22 21:54:38 +02:00
Wojtek Figat
16235c21c0 Add optional direction option to context menu 2024-10-22 21:34:28 +02:00
Wojtek Figat
2127961069 Add printing debug command upon execute 2024-10-21 13:05:26 +02:00
Wojtek Figat
b681a03bfb Fix output log window to properly handle copy and other input events 2024-10-21 13:03:40 +02:00
Wojtek Figat
449e988a59 Add workaround for debug command text memory bug due to managed handles gc 2024-10-20 23:25:38 +02:00
Wojtek Figat
a2693fa354 Ignore non-public debug commands from marked classes 2024-10-20 23:24:26 +02:00
Wojtek Figat
5328ea891d Add command line input to Output Log in Editor 2024-10-20 23:23:54 +02:00
Wojtek Figat
91d86552cd Minor cleanup 2024-10-17 23:43:07 +02:00
Mateusz Karbowiak
14a615cd7c Merge branch 'FlaxEngine:master' into fix/nullable 2024-10-17 20:34:32 +02:00
Wojtek Figat
c94052513e Add object replication data cache and send via Reliable channel to reduce data transfer 2024-10-15 19:47:09 +02:00
xxSeys1
7e1d6679ce add debug draw clear to game and editor panel 2024-10-15 19:43:08 +02:00
Wojtek Figat
60ed23105d Fix typo 2024-10-15 12:33:51 +02:00
Wojtek Figat
ac832a0e81 Optimize network transform replication 2024-10-15 11:24:10 +02:00
Wojtek Figat
c202a639cf Fix linux 2024-10-15 00:01:10 +02:00
Wojtek Figat
b957733150 Fixes 2024-10-14 23:35:41 +02:00
Wojtek Figat
7e4d7743a4 Add Quaternion quantization for network stream
Reduced send rate by 56% in average. Identity quat is just 8-bits (flags)
Added tests with full-sphere rotation to ensure this works correctly.
2024-10-14 22:32:29 +02:00
Wojtek Figat
a6f1dbbf32 Fix Quaternion error tolerance to be more reasonable due to math optimization enabled in compiler 2024-10-14 22:16:08 +02:00
Wojtek Figat
b38af8fd00 Format code and add debug cmd attributes 2024-10-14 12:12:48 +02:00
Wojtek Figat
4ddf1a2cc8 Another fix for network profiler to properly handle stats updating when recording is disabled
#2815
2024-10-14 12:12:06 +02:00
Wojtek Figat
443fe5dbcb Add network keys table to optimize ids and names sending over network
#2815
2024-10-14 12:11:20 +02:00
Wojtek Figat
23ad24751a Fix editor tables rows coloring to start with darker one 2024-10-12 00:00:02 +02:00
Wojtek Figat
f8371d037b Refactor old ContentLoadingManager into Content for simplicity 2024-10-11 23:05:09 +02:00
Wojtek Figat
ff495e1319 Add safety check to exit game in Release mode when running with graphics debugger attached 2024-10-11 20:15:17 +02:00
Wojtek Figat
575a286e1e Add editor windows to quick actions via Content Finder tool 2024-10-11 20:06:20 +02:00
Wojtek Figat
a72e8f2f65 Merge remote-tracking branch 'origin/master' into 1.10
# Conflicts:
#	Source/Engine/Platform/StringUtils.h
2024-10-11 18:07:41 +02:00
Mateusz Karbowiak
863afc065d Merge branch 'FlaxEngine:master' into fix/nullable 2024-10-07 16:34:37 +02:00
Mateusz Karbowiak
eda4f433d0 Update TestNullable.cpp 2024-10-07 12:24:09 +02:00
Mateusz Karbowiak
f56207f1a4 Nullable.Reset fix, killing inlining 2024-10-07 12:17:23 +02:00
Mateusz Karbowiak
541ca67a06 Nullable sfinae fix 2024-10-07 03:59:58 +02:00
Mateusz Karbowiak
44dad402f6 Nullable dependency headers fix 2024-10-07 02:41:07 +02:00
Mateusz Karbowiak
1a588eb9f7 Merge branch 'FlaxEngine:master' into fix/nullable 2024-10-07 01:11:51 +02:00
Mateusz Karbowiak
cda74f5cc4 Nullable tests 2024-10-06 13:50:03 +02:00
Mateusz Karbowiak
077ececcf8 Nullable match 2024-10-06 13:20:00 +02:00
Mateusz Karbowiak
d48a4c4483 Merge branch 'FlaxEngine:master' into fix/nullable 2024-10-06 13:01:16 +02:00
Mateusz Karbowiak
6f6348508a Nullable implicit cast fix 2024-10-06 03:09:04 +02:00
Mateusz Karbowiak
23624aa7f8 Fix type constraints 2024-10-06 02:23:21 +02:00
Mateusz Karbowiak
c9b1f6f516 Nullable fixes 2024-10-06 01:57:12 +02:00
Mateusz Karbowiak
a2874a189e Nullable docs 2024-10-05 23:51:54 +02:00
Mateusz Karbowiak
edfbeea0e6 Nullable utility functions 2024-10-05 23:10:30 +02:00
Mateusz Karbowiak
db06f4f72e Fixed implicit type conversion for type specialization 2024-10-05 21:22:36 +02:00
Mateusz Karbowiak
32b09538ba Hard Nullable<T> refactor * 2024-10-05 21:21:51 +02:00
Wojtek Figat
c6958357c3 Allow placing DebugCommand attribute on fields and properties 2024-10-04 15:58:47 +02:00
Wojtek Figat
74d2f5d115 Fix parsing numbers to support sign 2024-10-04 15:58:27 +02:00
Wojtek Figat
777e65c170 Fix crash when setting static dotnet field from unmanaged code 2024-10-04 15:58:05 +02:00
Wojtek Figat
adbe578aa1 Add attributes support for dotnet interop for methods, fields and properties 2024-10-04 15:57:41 +02:00
Wojtek Figat
85915d787a Add Variant enum parsing by name and fix enum printing to string 2024-10-03 17:10:34 +02:00
Wojtek Figat
2f0518a348 Fix managed interop bug 2024-10-03 17:10:01 +02:00
Wojtek Figat
7f5f1ba938 Merge remote-tracking branch 'origin/1.10' into 1.10 2024-10-03 12:37:00 +02:00
Wojtek Figat
a932d549f4 Debug Commands work in progress 2024-10-03 10:24:15 +02:00
Wojtek Figat
791435ba76 Merge remote-tracking branch 'origin/master' into 1.10 2024-10-03 10:23:13 +02:00
Wojtek Figat
0b3a95e551 Merge commit 'f74694048575160067734cbe27a023ad78a2c727' into 1.10 2024-10-03 10:23:07 +02:00
Wojtek Figat
f746940485 Fix typo 2024-10-03 10:04:18 +02:00
Wojtek Figat
1161a4114d Minor tweaks to simd codebase 2024-09-26 18:56:22 +02:00
Zode
7ede250403 absolute snapping: actually fix large world this time 2024-06-17 22:59:19 +03:00
Zode
5780fb7392 absolute snapping: large worlds fix 2024-06-17 22:16:10 +03:00
Zode
840abf8cdb absolute snap only in world space 2024-06-17 21:27:13 +03:00
Zode
b57e847916 Add absolute snapping 2024-06-17 21:19:31 +03:00
Chandler Cox
c858b67f2e Try and fix large world issue. 2024-05-13 16:48:45 -05:00
Chandler Cox
6d77d45529 use var and real for sign 2024-03-06 06:42:20 -06:00
Chandler Cox
eed44c14df Simplify code 2024-02-17 19:47:18 -06:00
Chandler Cox
af63858d80 Fix Scale gizmo for multiple directions. 2024-02-17 19:42:38 -06:00
710 changed files with 22210 additions and 16947 deletions

View File

@@ -73,8 +73,11 @@ jobs:
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -dotnet=8 -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxTestsTarget
dotnet msbuild Source\Tools\Flax.Build.Tests\Flax.Build.Tests.csproj /m /t:Restore,Build /p:Configuration=Debug /p:Platform=AnyCPU /nologo
- name: Test
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
.\Binaries\Editor\Win64\Development\FlaxTests.exe
if(!$?) { Write-Host "Tests failed with exit code $LastExitCode" -ForegroundColor Red; Exit $LastExitCode }
dotnet test -f net8.0 Binaries\Tests\Flax.Build.Tests.dll
xcopy /y Binaries\Editor\Win64\Development\FlaxEngine.CSharp.dll Binaries\Tests
xcopy /y Binaries\Editor\Win64\Development\FlaxEngine.CSharp.runtimeconfig.json Binaries\Tests

View File

@@ -1,4 +1,4 @@
# Redirect to our own Git LFS server
[lfs]
#url="https://gitlab.flaxengine.com/flax/flaxengine.git/info/lfs"
locksverify = false
url="https://gitlab.flaxengine.com/flax/flaxengine.git/info/lfs"
locksverify = false

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

Binary file not shown.

BIN
Content/Editor/Camera/O_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.

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

Binary file not shown.

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

Binary file not shown.

Binary file not shown.

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

Binary file not shown.

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

Binary file not shown.

View File

@@ -83,6 +83,12 @@ float3 GetObjectSize(MaterialInput input)
return float3(1, 1, 1);
}
// Gets the current object scale (supports instancing)
float3 GetObjectScale(MaterialInput input)
{
return float3(1, 1, 1);
}
// Get the current object random value supports instancing)
float GetPerInstanceRandom(MaterialInput input)
{

View File

@@ -207,6 +207,20 @@ float3 GetObjectSize(MaterialInput input)
return GeometrySize * float3(world._m00, world._m11, world._m22);
}
// Gets the current object scale (supports instancing)
float3 GetObjectScale(MaterialInput input)
{
float4x4 world = WorldMatrix;
// Extract scale from the world matrix
float3 scale;
scale.x = length(float3(world._11, world._12, world._13));
scale.y = length(float3(world._21, world._22, world._23));
scale.z = length(float3(world._31, world._32, world._33));
return scale;
}
// Get the current object random value
float GetPerInstanceRandom(MaterialInput input)
{
@@ -297,7 +311,7 @@ VertexOutput VS_SplineModel(ModelInput input)
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
// Pass vertex attributes
output.Geometry.TexCoord = input.TexCoord;
output.Geometry.TexCoord = input.TexCoord0;
#if USE_VERTEX_COLOR
output.Geometry.VertexColor = input.Color;
#endif

View File

@@ -140,7 +140,7 @@ void SetParticleVec4(uint particleIndex, int offset, float4 value)
bool AddParticle(out uint dstIndex)
{
// Acquire the particle index in the destination buffer
DstParticlesData.InterlockedAdd(ParticleCounterOffset, 1, dstIndex);
DstParticlesData.InterlockedAdd(ParticleCounterOffset, 1u, dstIndex);
// Prevent overflow
return dstIndex >= PARTICLE_CAPACITY;

View File

@@ -163,6 +163,12 @@ float3 GetObjectSize(MaterialInput input)
return float3(1, 1, 1);
}
// Gets the current object scale (supports instancing)
float3 GetObjectScale(MaterialInput input)
{
return float3(1, 1, 1);
}
// Get the current object random value supports instancing)
float GetPerInstanceRandom(MaterialInput input)
{

View File

@@ -299,24 +299,22 @@ half3x3 CalcTangentToLocal(ModelInput input)
float3 normal = input.Normal.xyz * 2.0 - 1.0;
float3 tangent = input.Tangent.xyz * 2.0 - 1.0;
float3 bitangent = cross(normal, tangent) * bitangentSign;
return float3x3(tangent, bitangent, normal);
return (half3x3)float3x3(tangent, bitangent, normal);
}
half3x3 CalcTangentToWorld(in float4x4 world, in half3x3 tangentToLocal)
{
half3x3 localToWorld = RemoveScaleFromLocalToWorld((float3x3)world);
half3x3 localToWorld = (half3x3)RemoveScaleFromLocalToWorld((float3x3)world);
return mul(tangentToLocal, localToWorld);
}
float3 GetParticlePosition(uint ParticleIndex)
float3 GetParticlePosition(uint particleIndex)
{
return TransformParticlePosition(GetParticleVec3(ParticleIndex, PositionOffset));
return TransformParticlePosition(GetParticleVec3(particleIndex, PositionOffset));
}
// Vertex Shader function for Sprite Rendering
META_VS(true, FEATURE_LEVEL_ES2)
META_VS_IN_ELEMENT(POSITION, 0, R32G32_FLOAT, 0, 0, PER_VERTEX, 0, true)
META_VS_IN_ELEMENT(TEXCOORD, 0, R32G32_FLOAT, 0, ALIGN, PER_VERTEX, 0, true)
VertexOutput VS_Sprite(SpriteInput input, uint particleIndex : SV_InstanceID)
{
VertexOutput output;
@@ -407,7 +405,7 @@ VertexOutput VS_Sprite(SpriteInput input, uint particleIndex : SV_InstanceID)
output.InstanceParams = PerInstanceRandom;
// Calculate tanget space to world space transformation matrix for unit vectors
half3x3 tangentToLocal = float3x3(axisX, axisY, axisZ);
half3x3 tangentToLocal = half3x3(axisX, axisY, axisZ);
half3x3 tangentToWorld = CalcTangentToWorld(world, tangentToLocal);
output.TBN = tangentToWorld;
@@ -516,7 +514,7 @@ VertexOutput VS_Model(ModelInput input, uint particleIndex : SV_InstanceID)
output.Position = mul(float4(output.WorldPosition, 1), ViewProjectionMatrix);
// Pass vertex attributes
output.TexCoord = input.TexCoord;
output.TexCoord = input.TexCoord0;
output.ParticleIndex = particleIndex;
#if USE_VERTEX_COLOR
output.VertexColor = input.Color;
@@ -612,7 +610,7 @@ VertexOutput VS_Ribbon(RibbonInput input, uint vertexIndex : SV_VertexID)
{
output.TexCoord.x = (float)input.Order / (float)RibbonSegmentCount;
}
output.TexCoord.y = (vertexIndex + 1) & 0x1;
output.TexCoord.y = (float)((vertexIndex + 1) & 0x1);
output.TexCoord = output.TexCoord * RibbonUVScale + RibbonUVOffset;
// Compute world space vertex position
@@ -631,7 +629,7 @@ VertexOutput VS_Ribbon(RibbonInput input, uint vertexIndex : SV_VertexID)
output.InstanceParams = PerInstanceRandom;
// Calculate tanget space to world space transformation matrix for unit vectors
half3x3 tangentToLocal = float3x3(tangentRight, tangentUp, cross(tangentRight, tangentUp));
half3x3 tangentToLocal = half3x3(tangentRight, tangentUp, cross(tangentRight, tangentUp));
half3x3 tangentToWorld = CalcTangentToWorld(world, tangentToLocal);
output.TBN = tangentToWorld;

View File

@@ -2,6 +2,7 @@
// Version: @0
#define MATERIAL 1
#define MATERIAL_TEXCOORDS 4
#define USE_PER_VIEW_CONSTANTS 1
#define USE_PER_DRAW_CONSTANTS 1
@3
@@ -24,21 +25,29 @@ Buffer<float4> BoneMatrices : register(t1);
Buffer<float4> PrevBoneMatrices : register(t2);
#endif
#endif
// Geometry data passed though the graphics rendering stages up to the pixel shader
struct GeometryData
{
float3 WorldPosition : TEXCOORD0;
float2 TexCoord : TEXCOORD1;
float2 LightmapUV : TEXCOORD2;
float4 TexCoords01 : TEXCOORD1;
float4 TexCoords23 : TEXCOORD2;
float2 LightmapUV : TEXCOORD3;
#if USE_VERTEX_COLOR
half4 VertexColor : COLOR;
#endif
float3 WorldNormal : TEXCOORD3;
float4 WorldTangent : TEXCOORD4;
float3 WorldNormal : TEXCOORD4;
float4 WorldTangent : TEXCOORD5;
float3 PrevWorldPosition : TEXCOORD7;
nointerpolation uint ObjectIndex : TEXCOORD8;
};
float3 DecodeNormal(float4 normalMap)
{
float2 xy = normalMap.rg * 2.0 - 1.0;
return float3(xy, sqrt(1.0 - saturate(dot(xy, xy))));
}
// Interpolants passed from the vertex shader
struct VertexOutput
{
@@ -68,7 +77,7 @@ struct MaterialInput
{
float3 WorldPosition;
float TwoSidedSign;
float2 TexCoord;
float2 TexCoords[MATERIAL_TEXCOORDS];
#if USE_LIGHTMAP
float2 LightmapUV;
#endif
@@ -86,12 +95,18 @@ struct MaterialInput
#endif
};
// Map access to the main texure coordinate channel as UV0
#define TexCoord TexCoords[0]
// Extracts geometry data to the material input
MaterialInput GetGeometryMaterialInput(GeometryData geometry)
{
MaterialInput output = (MaterialInput)0;
output.WorldPosition = geometry.WorldPosition;
output.TexCoord = geometry.TexCoord;
output.TexCoords[0] = geometry.TexCoords01.xy;
output.TexCoords[1] = geometry.TexCoords01.zw;
output.TexCoords[2] = geometry.TexCoords23.xy;
output.TexCoords[3] = geometry.TexCoords23.zw;
#if USE_LIGHTMAP
output.LightmapUV = geometry.LightmapUV;
#endif
@@ -126,8 +141,8 @@ MaterialInput GetGeometryMaterialInput(GeometryData geometry)
GeometryData InterpolateGeometry(GeometryData p0, float w0, GeometryData p1, float w1, GeometryData p2, float w2)
{
GeometryData output = (GeometryData)0;
output.TexCoord = p0.TexCoord * w0 + p1.TexCoord * w1 + p2.TexCoord * w2;
output.LightmapUV = p0.LightmapUV * w0 + p1.LightmapUV * w1 + p2.LightmapUV * w2;
output.TexCoords01 = p0.TexCoords01 * w0 + p1.TexCoords01 * w1 + p2.TexCoords01 * w2;
output.TexCoords23 = p0.TexCoords23 * w0 + p1.TexCoords23 * w1 + p2.TexCoords23 * w2;
#if USE_VERTEX_COLOR
output.VertexColor = p0.VertexColor * w0 + p1.VertexColor * w1 + p2.VertexColor * w2;
#endif
@@ -223,6 +238,24 @@ float3 GetObjectSize(MaterialInput input)
return input.Object.GeometrySize * float3(world._m00, world._m11, world._m22);
}
// Gets the current object scale (supports instancing)
float3 GetObjectScale(MaterialInput input)
{
float4x4 world = input.Object.WorldMatrix;
// Get the squares of the scale factors
float scaleXSquared = dot(world[0].xyz, world[0].xyz);
float scaleYSquared = dot(world[1].xyz, world[1].xyz);
float scaleZSquared = dot(world[2].xyz, world[2].xyz);
// Take square root to get actual scales
return float3(
sqrt(scaleXSquared),
sqrt(scaleYSquared),
sqrt(scaleZSquared)
);
}
// Get the current object random value (supports instancing)
float GetPerInstanceRandom(MaterialInput input)
{
@@ -312,14 +345,15 @@ VertexOutput VS(ModelInput input)
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
// Pass vertex attributes
output.Geometry.TexCoord = input.TexCoord;
output.Geometry.TexCoords01 = float4(input.TexCoord0, input.TexCoord1);
output.Geometry.TexCoords23 = float4(input.TexCoord2, input.TexCoord3);
#if USE_VERTEX_COLOR
output.Geometry.VertexColor = input.Color;
#endif
#if CAN_USE_LIGHTMAP
output.Geometry.LightmapUV = input.LightmapUV * object.LightmapArea.zw + object.LightmapArea.xy;
#else
output.Geometry.LightmapUV = input.LightmapUV;
output.Geometry.LightmapUV = float2(0, 0);
#endif
// Calculate tanget space to world space transformation matrix for unit vectors
@@ -459,7 +493,7 @@ META_VS_IN_ELEMENT(TEXCOORD, 0, R16G16_FLOAT, 0, ALIGN, PER_VERTEX, 0,
META_VS_IN_ELEMENT(NORMAL, 0, R10G10B10A2_UNORM, 0, ALIGN, PER_VERTEX, 0, true)
META_VS_IN_ELEMENT(TANGENT, 0, R10G10B10A2_UNORM, 0, ALIGN, PER_VERTEX, 0, true)
META_VS_IN_ELEMENT(BLENDINDICES, 0, R8G8B8A8_UINT, 0, ALIGN, PER_VERTEX, 0, true)
META_VS_IN_ELEMENT(BLENDWEIGHT, 0, R16G16B16A16_FLOAT,0, ALIGN, PER_VERTEX, 0, true)
META_VS_IN_ELEMENT(BLENDWEIGHTS, 0, R16G16B16A16_FLOAT,0, ALIGN, PER_VERTEX, 0, true)
VertexOutput VS_Skinned(ModelInput_Skinned input)
{
VertexOutput output;
@@ -486,9 +520,10 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
// Pass vertex attributes
output.Geometry.TexCoord = input.TexCoord;
output.Geometry.TexCoords01 = float4(input.TexCoord0, input.TexCoord1);
output.Geometry.TexCoords23 = float4(input.TexCoord2, input.TexCoord3);
#if USE_VERTEX_COLOR
output.Geometry.VertexColor = float4(0, 0, 0, 1);
output.Geometry.VertexColor = input.Color;
#endif
output.Geometry.LightmapUV = float2(0, 0);

View File

@@ -236,6 +236,12 @@ float3 GetObjectSize(MaterialInput input)
return float3(1, 1, 1);
}
// Gets the current object scale (supports instancing)
float3 GetObjectScale(MaterialInput input)
{
return float3(1, 1, 1);
}
// Get the current object random value
float GetPerInstanceRandom(MaterialInput input)
{
@@ -319,8 +325,6 @@ struct TerrainVertexInput
// Vertex Shader function for terrain rendering
META_VS(true, FEATURE_LEVEL_ES2)
META_VS_IN_ELEMENT(TEXCOORD, 0, R32G32_FLOAT, 0, ALIGN, PER_VERTEX, 0, true)
META_VS_IN_ELEMENT(TEXCOORD, 1, R8G8B8A8_UNORM, 0, ALIGN, PER_VERTEX, 0, true)
VertexOutput VS(TerrainVertexInput input)
{
VertexOutput output;

Binary file not shown.

Binary file not shown.

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

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/Models/Box.flax (Stored with Git LFS)

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

BIN
Content/Engine/Models/SphereLowPoly.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/Engine/WhiteMaterial.flax (Stored with Git LFS)

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

Binary file not shown.

BIN
Content/Shaders/GI/GlobalSurfaceAtlas.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/Quad.flax (Stored with Git LFS)

Binary file not shown.

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

Binary file not shown.

View File

@@ -2,9 +2,9 @@
"Name": "Flax",
"Version": {
"Major": 1,
"Minor": 9,
"Minor": 10,
"Revision": 0,
"Build": 6606
"Build": 6702
},
"Company": "Flax",
"Copyright": "Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.",

View File

@@ -237,6 +237,7 @@
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/GrammarAndSpelling/GrammarChecking/Exceptions/=Try_0020to_0020scripting/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/GrammarAndSpelling/GrammarChecking/RulesStates/=LanguageTool_002EEN_002EE_005FG/@EntryIndexedValue">DisabledByUser</s:String>
<s:Boolean x:Key="/Default/PatternsAndTemplates/Todo/TodoPatterns/=EEA05B0ED8200E4BA9D2D3F1052EBFFD/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/Todo/TodoPatterns/=EEA05B0ED8200E4BA9D2D3F1052EBFFD/Color/@EntryValue">Blue</s:String>

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

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

View File

@@ -14,4 +14,4 @@ bash ./Development/Scripts/Linux/CallBuildTool.sh --genproject "$@"
# Build bindings for all editor configurations
echo Building C# bindings...
# TODO: Detect the correct architecture here
Binaries/Tools/Flax.Build -build -BuildBindingsOnly -arch=x64 -platform=Linux --buildTargets=FlaxEditor,FlaxGame
Binaries/Tools/Flax.Build -build -BuildBindingsOnly -arch=x64 -platform=Linux --buildTargets=FlaxEditor

View File

@@ -8,6 +8,7 @@
#include "Engine/Core/Math/Color32.h"
#include "Engine/Core/Config/GameSettings.h"
#include "Editor/Utilities/EditorUtilities.h"
#include "Engine/Graphics/PixelFormatSampler.h"
#include "Engine/Graphics/Textures/TextureData.h"
#include "Engine/Tools/TextureTool/TextureTool.h"
#include "Engine/Content/Content.h"
@@ -240,7 +241,7 @@ void UpdateIconData(uint8* iconData, const TextureData* icon)
const TextureMipData* srcPixels = icon->GetData(0, srcPixelsMip);
const Color32* srcPixelsData = (Color32*)srcPixels->Data.Get();
const Int2 srcPixelsSize(Math::Max(1, icon->Width >> srcPixelsMip), Math::Max(1, icon->Height >> srcPixelsMip));
const auto sampler = TextureTool::GetSampler(icon->Format);
const auto sampler = PixelFormatSampler::Get(icon->Format);
ASSERT_LOW_LAYER(sampler);
// Write colors
@@ -252,7 +253,7 @@ void UpdateIconData(uint8* iconData, const TextureData* icon)
for (uint32 x = 0; x < width; x++)
{
float u = (float)x / width;
const Color c = TextureTool::SampleLinear(sampler, Float2(u, v), srcPixelsData, srcPixelsSize, srcPixels->RowPitch);
const Color c = sampler->SampleLinear(srcPixelsData, Float2(u, v), srcPixelsSize, srcPixels->RowPitch);
colorData[idx++] = Color32(c).GetAsBGRA();
}
}
@@ -271,7 +272,7 @@ void UpdateIconData(uint8* iconData, const TextureData* icon)
{
uint32 x = packedX * 8 + pixelIdx;
float u = (float)x / width;
const Color c = TextureTool::SampleLinear(sampler, Float2(u, v), srcPixelsData, srcPixelsSize, srcPixels->RowPitch);
const Color c = sampler->SampleLinear(srcPixelsData, Float2(u, v), srcPixelsSize, srcPixels->RowPitch);
if (c.A < 0.25f)
mask |= 1 << (7 - pixelIdx);
}
@@ -322,7 +323,7 @@ bool UpdateExeIcon(const String& path, const TextureData& icon)
const TextureData* iconRGBA8 = &icon;
TextureData tmpData1;
//if (icon.Format != PixelFormat::R8G8B8A8_UNorm)
if (TextureTool::GetSampler(icon.Format) == nullptr)
if (PixelFormatSampler::Get(icon.Format) == nullptr)
{
if (TextureTool::Convert(tmpData1, *iconRGBA8, PixelFormat::R8G8B8A8_UNorm))
{

View File

@@ -137,10 +137,7 @@ void CookAssetsStep::CacheData::Load(CookingData& data)
if (!FileSystem::DirectoryExists(CacheFolder))
FileSystem::CreateDirectory(CacheFolder);
if (!FileSystem::FileExists(HeaderFilePath))
{
LOG(Warning, "Missing incremental build cooking assets cache.");
return;
}
auto file = FileReadStream::Open(HeaderFilePath);
if (file == nullptr)
@@ -158,7 +155,7 @@ void CookAssetsStep::CacheData::Load(CookingData& data)
LOG(Info, "Loading incremental build cooking cache (entries count: {0})", entriesCount);
file->ReadBytes(&Settings, sizeof(Settings));
Entries.EnsureCapacity(Math::RoundUpToPowerOf2(static_cast<int32>(entriesCount * 3.0f)));
Entries.EnsureCapacity(entriesCount);
Array<Pair<String, DateTime>> fileDependencies;
for (int32 i = 0; i < entriesCount; i++)
@@ -166,7 +163,7 @@ void CookAssetsStep::CacheData::Load(CookingData& data)
Guid id;
file->Read(id);
String typeName;
file->ReadString(&typeName);
file->Read(typeName);
DateTime fileModified;
file->Read(fileModified);
int32 fileDependenciesCount;
@@ -176,7 +173,7 @@ void CookAssetsStep::CacheData::Load(CookingData& data)
for (int32 j = 0; j < fileDependenciesCount; j++)
{
Pair<String, DateTime>& f = fileDependencies[j];
file->ReadString(&f.First, 10);
file->Read(f.First, 10);
file->Read(f.Second);
}
@@ -311,9 +308,9 @@ void CookAssetsStep::CacheData::Save(CookingData& data)
{
auto& e = i->Value;
file->Write(e.ID);
file->WriteString(e.TypeName);
file->Write(e.TypeName);
file->Write(e.FileModified);
file->WriteInt32(e.FileDependencies.Count());
file->Write(e.FileDependencies.Count());
for (auto& f : e.FileDependencies)
{
file->Write(f.First, 10);
@@ -365,17 +362,27 @@ bool CookAssetsStep::ProcessDefaultAsset(AssetCookData& options)
bool CookAssetsStep::Process(CookingData& data, CacheData& cache, Asset* asset)
{
// Validate asset
PROFILE_CPU_ASSET(asset);
if (asset->IsVirtual())
{
// Virtual assets are not included into the build
return false;
}
const bool wasLoaded = asset->IsLoaded();
if (asset->WaitForLoaded())
{
LOG(Error, "Failed to load asset \'{0}\'", asset->ToString());
return true;
}
if (!wasLoaded)
{
// HACK: give some time to resave any old assets in Asset::onLoad after it's loaded
// This assumes that if Load Thread enters Asset::Save then it will get asset lock and hold it until asset is saved
// So we can take the same lock to wait for save end but first we need to wait for it to get that lock
// (in future try to handle it in a better way)
Platform::Sleep(5);
}
ScopeLock lock(asset->Locker);
// Switch based on an asset type
const auto asBinaryAsset = dynamic_cast<BinaryAsset*>(asset);
@@ -793,7 +800,10 @@ bool CookAssetsStep::Process(CookingData& data, CacheData& cache, BinaryAsset* a
// Prepare asset data
AssetInitData initData;
if (asset->Storage->LoadAssetHeader(asset->GetID(), initData))
{
LOG(Warning, "Failed to load asset {} header from storage '{}'", asset->GetID(), asset->Storage->GetPath());
return true;
}
initData.Header.UnlinkChunks();
initData.Metadata.Release();
for (auto& e : initData.Dependencies)
@@ -1165,7 +1175,7 @@ bool CookAssetsStep::Perform(CookingData& data)
assetRef = Content::LoadAsync<Asset>(assetId);
if (assetRef == nullptr)
{
data.Error(TEXT("Failed to load asset included in build."));
LOG(Error, "Failed to load asset {} included in build", assetId);
return true;
}
e.Info.TypeName = assetRef->GetTypeName();
@@ -1173,6 +1183,7 @@ bool CookAssetsStep::Perform(CookingData& data)
// Cook asset
if (Process(data, cache, assetRef.Get()))
{
LOG(Error, "Failed to process asset {}", assetRef->ToString());
cache.Save(data);
return true;
}
@@ -1205,10 +1216,17 @@ bool CookAssetsStep::Perform(CookingData& data)
// Copy file
if (!FileSystem::FileExists(cookedPath) || FileSystem::GetFileLastEditTime(cookedPath) >= FileSystem::GetFileLastEditTime(filePath))
{
if (FileSystem::CreateDirectory(StringUtils::GetDirectoryName(cookedPath)))
const String cookedFolder = StringUtils::GetDirectoryName(cookedPath);
if (FileSystem::CreateDirectory(cookedFolder))
{
LOG(Error, "Failed to create directory '{}'", cookedFolder);
return true;
}
if (FileSystem::CopyFile(cookedPath, filePath))
{
LOG(Error, "Failed to copy file from '{}' to '{}'", filePath, cookedPath);
return true;
}
}
// Count stats of file extension
@@ -1249,7 +1267,7 @@ bool CookAssetsStep::Perform(CookingData& data)
*(int32*)(bytes.Get() + 804) = contentKey;
*(Guid*)(bytes.Get() + 808) = gameSettings->SplashScreen;
Encryption::EncryptBytes(bytes.Get(), bytes.Count());
stream->WriteArray(bytes);
stream->Write(bytes);
Delete(stream);
}
@@ -1277,8 +1295,6 @@ bool CookAssetsStep::Perform(CookingData& data)
assetStats.Count++;
assetStats.ContentSize += FileSystem::GetFileSize(cookedFilePath);
LOG(Info, "Cooked size of {0}: {1}KB", assetId, (FileSystem::GetFileSize(cookedFilePath) / (1024)));
if (packageBuilder.Add(data, i->Value, cookedFilePath))
return true;
}

View File

@@ -213,38 +213,59 @@ bool DeployDataStep::Perform(CookingData& data)
}
FileSystem::NormalizePath(srcDotnet);
LOG(Info, "Using .NET Runtime {} at {}", TEXT("Host"), srcDotnet);
const bool srcDotnetFromEngine = srcDotnet.Contains(TEXT("Source/Platforms"));
String packFolder = srcDotnet / TEXT("../../../");
// Get major Version
Array<String> pathParts;
srcDotnet.Split('/', pathParts);
// Get .NET runtime version
String version;
for (int i = 0; i < pathParts.Count(); i++)
{
if (pathParts[i] == TEXT("runtimes"))
// Detect from path provided by build tool
Array<String> pathParts;
srcDotnet.Split('/', pathParts);
for (int32 i = 1; i < pathParts.Count(); i++)
{
Array<String> versionParts;
pathParts[i - 1].Split('.', versionParts);
if (!versionParts.IsEmpty())
if (pathParts[i] == TEXT("runtimes"))
{
const String majorVersion = versionParts[0].TrimTrailing();
int32 versionNum;
StringUtils::Parse(*majorVersion, majorVersion.Length(), &versionNum);
if (Math::IsInRange(versionNum, GAME_BUILD_DOTNET_RUNTIME_MIN_VER, GAME_BUILD_DOTNET_RUNTIME_MAX_VER)) // Check for major part
version = majorVersion;
Array<String> versionParts;
pathParts[i - 1].Split('.', versionParts);
if (!versionParts.IsEmpty())
{
const String majorVersion = versionParts[0].TrimTrailing();
int32 versionNum;
StringUtils::Parse(*majorVersion, majorVersion.Length(), &versionNum);
if (Math::IsInRange(versionNum, GAME_BUILD_DOTNET_RUNTIME_MIN_VER, GAME_BUILD_DOTNET_RUNTIME_MAX_VER)) // Check for major part
version = majorVersion;
}
}
}
if (version.IsEmpty())
{
if (srcDotnetFromEngine)
{
// Detect version from runtime files inside Engine Platform folder
for (int32 i = GAME_BUILD_DOTNET_RUNTIME_MAX_VER; i >= GAME_BUILD_DOTNET_RUNTIME_MIN_VER; i--)
{
// Check runtime files inside Engine Platform folder
String testPath1 = srcDotnet / String::Format(TEXT("lib/net{}.0"), i);
String testPath2 = packFolder / String::Format(TEXT("Dotnet/lib/net{}.0"), i);
if ((FileSystem::DirectoryExists(testPath1) && FileSystem::GetDirectorySize(testPath1) > 0) ||
(FileSystem::DirectoryExists(testPath2) && FileSystem::GetDirectorySize(testPath2) > 0))
{
version = StringUtils::ToString(i);
break;
}
}
}
if (version.IsEmpty())
{
data.Error(TEXT("Failed to find supported .NET version for the current host platform."));
return true;
}
}
}
if (version.IsEmpty())
{
data.Error(TEXT("Failed to find supported .NET version for the current host platform."));
return true;
}
// Deploy runtime files
const Char* corlibPrivateName = TEXT("System.Private.CoreLib.dll");
const bool srcDotnetFromEngine = srcDotnet.Contains(TEXT("Source/Platforms"));
String packFolder = srcDotnet / TEXT("../../../");
String dstDotnetLibs = dstDotnet, srcDotnetLibs = srcDotnet;
StringUtils::PathRemoveRelativeParts(packFolder);
if (usAOT)
@@ -415,9 +436,9 @@ bool DeployDataStep::Perform(CookingData& data)
data.AddRootEngineAsset(TEXT("Engine/Textures/NormalTexture"));
data.AddRootEngineAsset(TEXT("Engine/Textures/BlackTexture"));
data.AddRootEngineAsset(TEXT("Engine/Textures/WhiteTexture"));
//data.AddRootEngineAsset(TEXT("Engine/Textures/DefaultLensStarburst"));
//data.AddRootEngineAsset(TEXT("Engine/Textures/DefaultLensColor"));
//data.AddRootEngineAsset(TEXT("Engine/Textures/DefaultLensDirt"));
data.AddRootEngineAsset(TEXT("Engine/Textures/DefaultLensStarburst"));
data.AddRootEngineAsset(TEXT("Engine/Textures/DefaultLensColor"));
data.AddRootEngineAsset(TEXT("Engine/Textures/DefaultLensDirt"));
data.AddRootEngineAsset(TEXT("Engine/Textures/Bokeh/Circle"));
data.AddRootEngineAsset(TEXT("Engine/Textures/Bokeh/Hexagon"));
data.AddRootEngineAsset(TEXT("Engine/Textures/Bokeh/Octagon"));

View File

@@ -195,15 +195,6 @@ namespace FlaxEditor.CustomEditors
Presenter.AfterLayout?.Invoke(layout);
}
/// <inheritdoc />
protected override void Deinitialize()
{
Editor = null;
_overrideEditor = null;
base.Deinitialize();
}
/// <inheritdoc />
protected override void OnModified()
{

View File

@@ -39,14 +39,9 @@ CustomEditorsUtilService CustomEditorsUtilServiceInstance;
struct Entry
{
MClass* DefaultEditor;
MClass* CustomEditor;
Entry()
{
DefaultEditor = nullptr;
CustomEditor = nullptr;
}
MClass* DefaultEditor = nullptr;
MClass* CustomEditor = nullptr;
MType* CustomEditorType = nullptr;
};
Dictionary<MType*, Entry> Cache(512);
@@ -63,11 +58,11 @@ MTypeObject* CustomEditorsUtil::GetCustomEditor(MTypeObject* refType)
Entry result;
if (Cache.TryGet(type, result))
{
if (result.CustomEditorType)
return INTERNAL_TYPE_GET_OBJECT(result.CustomEditorType);
MClass* editor = result.CustomEditor ? result.CustomEditor : result.DefaultEditor;
if (editor)
{
return MUtils::GetType(editor);
}
}
return nullptr;
}
@@ -157,7 +152,7 @@ void OnAssemblyLoaded(MAssembly* assembly)
else if (typeClass)
{
auto& entry = Cache[mclass->GetType()];
entry.CustomEditor = typeClass;
entry.CustomEditorType = type;
//LOG(Info, "Custom Editor {0} for type {1}", String(typeClass->GetFullName()), String(mclass->GetFullName()));
}

View File

@@ -69,8 +69,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
Values.SetReferenceValue(prefabInstance);
// Display prefab UI (when displaying object inside Prefab Window then display only nested prefabs)
var prefabId = prefab.ID;
Editor.GetPrefabNestedObject(ref prefabId, ref 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.CustomContainer<UniformGridPanel>();
panel.CustomControl.Height = 20.0f;
@@ -206,7 +205,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
if (_linkedPrefabId != Guid.Empty)
{
_linkedPrefabId = Guid.Empty;
Editor.Instance.Prefabs.PrefabApplying -= OnPrefabApplying;
Editor.Instance.Prefabs.PrefabApplied -= OnPrefabApplying;
Editor.Instance.Prefabs.PrefabApplied -= OnPrefabApplied;
}
}

View File

@@ -1057,7 +1057,6 @@ namespace FlaxEditor.CustomEditors.Dedicated
protected override void Deinitialize()
{
_scriptToggles = null;
_scripts.Clear();
base.Deinitialize();
}

View File

@@ -92,7 +92,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
{
if (IsLinearTangentMode(spline, index) || IsSmoothInTangentMode(spline, index) || IsSmoothOutTangentMode(spline, index))
{
SetPointSmooth(spline, index);
SetPointSmooth(Editor, spline, index);
}
}
}
@@ -145,7 +145,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
{
if (!IsAlignedTangentMode(spline, index))
{
SetPointSmooth(spline, index);
SetPointSmooth(Editor, spline, index);
}
}
@@ -176,7 +176,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
/// <inheritdoc/>
public override void OnSetMode(Spline spline, int index)
{
SetTangentSmoothIn(spline, index);
SetTangentSmoothIn(Editor, spline, index);
Editor.SetSelectTangentIn(spline, index);
}
}
@@ -190,7 +190,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
/// <inheritdoc/>
public override void OnSetMode(Spline spline, int index)
{
SetTangentSmoothOut(spline, index);
SetTangentSmoothOut(Editor, spline, index);
Editor.SetSelectTangentOut(spline, index);
}
}
@@ -756,14 +756,15 @@ namespace FlaxEditor.CustomEditors.Dedicated
spline.UpdateSpline();
}
private static void SetTangentSmoothIn(Spline spline, int index)
private static void SetTangentSmoothIn(SplineEditor editor, Spline spline, int index)
{
var keyframe = spline.GetSplineKeyframe(index);
// Auto smooth tangent if's linear
if (keyframe.TangentIn.Translation.Length == 0)
{
var smoothRange = SplineNode.NodeSizeByDistance(spline.GetSplineTangent(index, false).Translation, 10f);
var cameraTransform = editor.Presenter.Owner.PresenterViewport.ViewTransform.Translation;
var smoothRange = SplineNode.NodeSizeByDistance(spline.GetSplineTangent(index, false).Translation, 10f, cameraTransform);
var previousKeyframe = spline.GetSplineKeyframe(index - 1);
var tangentDirection = keyframe.Value.WorldToLocalVector(previousKeyframe.Value.Translation - keyframe.Value.Translation);
tangentDirection = tangentDirection.Normalized * smoothRange;
@@ -775,14 +776,15 @@ namespace FlaxEditor.CustomEditors.Dedicated
spline.UpdateSpline();
}
private static void SetTangentSmoothOut(Spline spline, int index)
private static void SetTangentSmoothOut(SplineEditor editor, Spline spline, int index)
{
var keyframe = spline.GetSplineKeyframe(index);
// Auto smooth tangent if's linear
if (keyframe.TangentOut.Translation.Length == 0)
{
var smoothRange = SplineNode.NodeSizeByDistance(spline.GetSplineTangent(index, false).Translation, 10f);
var cameraTransform = editor.Presenter.Owner.PresenterViewport.ViewTransform.Translation;
var smoothRange = SplineNode.NodeSizeByDistance(spline.GetSplineTangent(index, false).Translation, 10f, cameraTransform);
var nextKeyframe = spline.GetSplineKeyframe(index + 1);
var tangentDirection = keyframe.Value.WorldToLocalVector(nextKeyframe.Value.Translation - keyframe.Value.Translation);
tangentDirection = tangentDirection.Normalized * smoothRange;
@@ -795,7 +797,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
spline.UpdateSpline();
}
private static void SetPointSmooth(Spline spline, int index)
private static void SetPointSmooth(SplineEditor editor, Spline spline, int index)
{
var keyframe = spline.GetSplineKeyframe(index);
var tangentInSize = keyframe.TangentIn.Translation.Length;
@@ -803,7 +805,8 @@ namespace FlaxEditor.CustomEditors.Dedicated
var isLastKeyframe = index >= spline.SplinePointsCount - 1;
var isFirstKeyframe = index <= 0;
var smoothRange = SplineNode.NodeSizeByDistance(spline.GetSplinePoint(index), 10f);
var cameraTransform = editor.Presenter.Owner.PresenterViewport.ViewTransform.Translation;
var smoothRange = SplineNode.NodeSizeByDistance(spline.GetSplinePoint(index), 10f, cameraTransform);
// Force smooth it's linear point
if (tangentInSize == 0f)

View File

@@ -95,7 +95,7 @@ namespace FlaxEditor.CustomEditors.Editors
if (assetReference != null)
{
if (assetReference.UseSmallPicker)
height = 32;
height = 36;
if (string.IsNullOrEmpty(assetReference.TypeName))
{
}

View File

@@ -0,0 +1,84 @@
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.CustomEditors.Elements;
using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.GUI;
using Object = FlaxEngine.Object;
namespace FlaxEditor.CustomEditors.Editors;
/// <summary>
/// The reference picker control used for UIControls using ControlReference.
/// </summary>
internal class UIControlRefPickerControl : FlaxObjectRefPickerControl
{
/// <summary>
/// Type of the control to pick.
/// </summary>
public Type ControlType;
/// <inheritdoc />
protected override bool IsValid(Object obj)
{
return obj == null || (obj is UIControl control && control.Control.GetType() == ControlType);
}
}
/// <summary>
/// ControlReferenceEditor class.
/// </summary>
[CustomEditor(typeof(ControlReference<>)), DefaultEditor]
internal class ControlReferenceEditor : CustomEditor
{
private CustomElement<UIControlRefPickerControl> _element;
/// <inheritdoc />
public override DisplayStyle Style => DisplayStyle.Inline;
/// <inheritdoc />
public override void Initialize(LayoutElementsContainer layout)
{
if (!HasDifferentTypes)
{
_element = layout.Custom<UIControlRefPickerControl>();
if (ValuesTypes == null || ValuesTypes[0] == null)
{
Editor.LogWarning("ControlReference needs to be assigned in code.");
return;
}
Type genType = ValuesTypes[0].GetGenericArguments()[0];
if (typeof(Control).IsAssignableFrom(genType))
{
_element.CustomControl.PresenterContext = Presenter.Owner;
_element.CustomControl.ControlType = genType;
_element.CustomControl.Type = new ScriptType(typeof(UIControl));
}
_element.CustomControl.ValueChanged += () =>
{
Type genericType = ValuesTypes[0].GetGenericArguments()[0];
if (typeof(Control).IsAssignableFrom(genericType))
{
Type t = typeof(ControlReference<>);
Type tw = t.MakeGenericType(new Type[] { genericType });
var instance = Activator.CreateInstance(tw);
((IControlReference)instance).UIControl = (UIControl)_element.CustomControl.Value;
SetValue(instance);
}
};
}
}
/// <inheritdoc />
public override void Refresh()
{
base.Refresh();
if (!HasDifferentValues)
{
if (Values[0] is IControlReference cr)
_element.CustomControl.Value = cr.UIControl;
}
}
}

View File

@@ -48,7 +48,7 @@ namespace FlaxEditor.CustomEditors.Editors
public IPresenterOwner PresenterContext;
/// <summary>
/// Gets or sets the allowed objects type (given type and all sub classes). Must be <see cref="Object"/> type of any subclass.
/// Gets or sets the allowed objects type (given type and all subclasses). Must be <see cref="Object"/> type of any subclass.
/// </summary>
public ScriptType Type
{
@@ -61,7 +61,8 @@ namespace FlaxEditor.CustomEditors.Editors
throw new ArgumentException(string.Format("Invalid type for FlaxObjectRefEditor. Input type: {0}", value != ScriptType.Null ? value.TypeName : "null"));
_type = value;
_supportsPickDropDown = new ScriptType(typeof(Actor)).IsAssignableFrom(value) || new ScriptType(typeof(Script)).IsAssignableFrom(value);
_supportsPickDropDown = new ScriptType(typeof(Actor)).IsAssignableFrom(value) ||
new ScriptType(typeof(Script)).IsAssignableFrom(value);
// Deselect value if it's not valid now
if (!IsValid(_value))
@@ -80,7 +81,7 @@ namespace FlaxEditor.CustomEditors.Editors
if (_value == value)
return;
if (!IsValid(value))
throw new ArgumentException("Invalid object type.");
value = null;
// Special case for missing objects (eg. referenced actor in script that is deleted in editor)
if (value != null && (Object.GetUnmanagedPtr(value) == IntPtr.Zero || value.ID == Guid.Empty))
@@ -91,27 +92,17 @@ namespace FlaxEditor.CustomEditors.Editors
// Get name to display
if (_value is Script script)
{
_valueName = script.Actor ? $"{type.Name} ({script.Actor.Name})" : type.Name;
}
else if (_value != null)
{
_valueName = _value.ToString();
}
else
{
_valueName = string.Empty;
}
// Update tooltip
if (_value is SceneObject sceneObject)
{
TooltipText = Utilities.Utils.GetTooltip(sceneObject);
}
else
{
TooltipText = string.Empty;
}
OnValueChanged();
}
@@ -150,7 +141,12 @@ namespace FlaxEditor.CustomEditors.Editors
_type = ScriptType.Object;
}
private bool IsValid(Object obj)
/// <summary>
/// Object validation check routine.
/// </summary>
/// <param name="obj">Input object to check.</param>
/// <returns>True if it can be assigned, otherwise false.</returns>
protected virtual bool IsValid(Object obj)
{
var type = TypeUtils.GetObjectType(obj);
return obj == null || _type.IsAssignableFrom(type) && (CheckValid == null || CheckValid(obj, type));
@@ -168,6 +164,15 @@ namespace FlaxEditor.CustomEditors.Editors
Focus();
}, PresenterContext);
}
else if (new ScriptType(typeof(Control)).IsAssignableFrom(_type))
{
ActorSearchPopup.Show(this, new Float2(0, Height), IsValid, actor =>
{
Value = actor as UIControl;
RootWindow.Focus();
Focus();
}, PresenterContext);
}
else
{
ScriptSearchPopup.Show(this, new Float2(0, Height), IsValid, script =>
@@ -199,7 +204,7 @@ namespace FlaxEditor.CustomEditors.Editors
var frameRect = new Rectangle(0, 0, Width, 16);
if (isSelected)
frameRect.Width -= 16;
if (_supportsPickDropDown)
if (_supportsPickDropDown && isEnabled)
frameRect.Width -= 16;
var nameRect = new Rectangle(2, 1, frameRect.Width - 4, 14);
var button1Rect = new Rectangle(nameRect.Right + 2, 1, 14, 14);
@@ -235,7 +240,7 @@ namespace FlaxEditor.CustomEditors.Editors
}
// Draw picker button
if (_supportsPickDropDown)
if (_supportsPickDropDown && isEnabled)
{
var pickerRect = isSelected ? button2Rect : button1Rect;
Render2D.DrawSprite(style.ArrowDown, pickerRect, isEnabled && pickerRect.Contains(_mousePos) ? style.Foreground : style.ForegroundGrey);
@@ -400,20 +405,9 @@ namespace FlaxEditor.CustomEditors.Editors
// Select object
if (_value is Actor actor)
{
if (PresenterContext is PropertiesWindow)
Editor.Instance.SceneEditing.Select(actor);
else if (PresenterContext is PrefabWindow prefabWindow)
prefabWindow.Select(prefabWindow.Graph.Root.Find(actor));
}
Select(actor);
else if (_value is Script script && script.Actor)
{
var a = script.Actor;
if (PresenterContext is PropertiesWindow)
Editor.Instance.SceneEditing.Select(a);
else if (PresenterContext is PrefabWindow prefabWindow)
prefabWindow.Select(prefabWindow.Graph.Root.Find(a));
}
Select(script.Actor);
else if (_value is Asset asset)
Editor.Instance.Windows.ContentWin.Select(asset);
}
@@ -431,6 +425,14 @@ namespace FlaxEditor.CustomEditors.Editors
ShowDropDownMenu();
}
private void Select(Actor actor)
{
if (PresenterContext is PropertiesWindow)
Editor.Instance.SceneEditing.Select(actor);
else if (PresenterContext is PrefabWindow prefabWindow)
prefabWindow.Select(prefabWindow.Graph.Root.Find(actor));
}
private void DoDrag()
{
// Do the drag drop operation if has selected element

View File

@@ -819,15 +819,6 @@ namespace FlaxEditor.CustomEditors.Editors
OnGroupsEnd();
}
/// <inheritdoc />
protected override void Deinitialize()
{
_visibleIfCaches = null;
_visibleIfPropertiesListsCache = null;
base.Deinitialize();
}
/// <inheritdoc />
public override void Refresh()
{

View File

@@ -36,7 +36,7 @@ namespace FlaxEditor.CustomEditors.Editors
float height = 48;
if (assetReference.UseSmallPicker)
height = 32;
height = 36;
if (string.IsNullOrEmpty(assetReference.TypeName))
{

View File

@@ -41,6 +41,9 @@ public class Editor : EditorModule
options.ScriptingAPI.SystemReferences.Add("System.Xml.ReaderWriter");
options.ScriptingAPI.SystemReferences.Add("System.Text.RegularExpressions");
options.ScriptingAPI.SystemReferences.Add("System.IO.Compression.ZipFile");
options.ScriptingAPI.SystemReferences.Add("System.Diagnostics.Process");
if (Profiler.Use(options))
options.ScriptingAPI.Defines.Add("USE_PROFILER");
// Enable optimizations for Editor, disable this for debugging the editor
if (options.Configuration == TargetConfiguration.Development)

View File

@@ -79,10 +79,6 @@ bool Editor::CheckProjectUpgrade()
Delete(file);
}
}
else
{
LOG(Warning, "Missing version cache file");
}
// Check if project is in the old, deprecated layout
if (EditorImpl::IsOldProjectXmlFormat)
@@ -403,7 +399,7 @@ int32 Editor::LoadProduct()
}
// Create new project option
if (CommandLine::Options.NewProject)
if (CommandLine::Options.NewProject.IsTrue())
{
Array<String> projectFiles;
FileSystem::DirectoryGetFiles(projectFiles, projectPath, TEXT("*.flaxproj"), DirectorySearchOption::TopDirectoryOnly);
@@ -428,7 +424,7 @@ int32 Editor::LoadProduct()
}
}
}
if (CommandLine::Options.NewProject)
if (CommandLine::Options.NewProject.IsTrue())
{
if (projectPath.IsEmpty())
projectPath = Platform::GetWorkingDirectory();
@@ -529,7 +525,7 @@ int32 Editor::LoadProduct()
if (projectPath.IsEmpty())
{
#if PLATFORM_HAS_HEADLESS_MODE
if (CommandLine::Options.Headless)
if (CommandLine::Options.Headless.IsTrue())
{
Platform::Fatal(TEXT("Missing project path."));
return -1;
@@ -612,7 +608,7 @@ int32 Editor::LoadProduct()
// Validate project min supported version (older engine may try to load newer project)
// Special check if project specifies only build number, then major/minor fields are set to 0
const auto engineVersion = FLAXENGINE_VERSION;
for (auto e : projects)
for (const auto& e : projects)
{
const auto project = e.Item;
if (project->MinEngineVersion > engineVersion ||
@@ -657,7 +653,7 @@ Window* Editor::CreateMainWindow()
bool Editor::Init()
{
// Scripts project files generation from command line
if (CommandLine::Options.GenProjectFiles)
if (CommandLine::Options.GenProjectFiles.IsTrue())
{
const String customArgs = TEXT("-verbose -log -logfile=\"Cache/Intermediate/ProjectFileLog.txt\"");
const bool failed = ScriptsBuilder::GenerateProject(customArgs);

View File

@@ -1550,9 +1550,9 @@ namespace FlaxEditor
// Handle case when Game window is not selected in tab view
var dockedTo = gameWin.ParentDockPanel;
if (dockedTo != null && dockedTo.SelectedTab != gameWin && dockedTo.SelectedTab != null)
result = dockedTo.SelectedTab.Size * root.DpiScale;
result = dockedTo.SelectedTab.Size;
else
result = gameWin.Viewport.Size * root.DpiScale;
result = gameWin.Viewport.Size;
result = Float2.Round(result);
}

View File

@@ -355,14 +355,14 @@ namespace FlaxEditor.GUI.ContextMenu
}
/// <inheritdoc />
public override void Show(Control parent, Float2 location)
public override void Show(Control parent, Float2 location, ContextMenuDirection? direction = null)
{
// Remove last separator to make context menu look better
int lastIndex = _panel.Children.Count - 1;
if (lastIndex >= 0 && _panel.Children[lastIndex] is ContextMenuSeparator separator)
separator.Dispose();
base.Show(parent, location);
base.Show(parent, location, direction);
}
/// <inheritdoc />

View File

@@ -101,6 +101,16 @@ namespace FlaxEditor.GUI.ContextMenu
/// </summary>
public List<Window> ExternalPopups = new List<Window>();
/// <summary>
/// Optional flag that can disable popup visibility based on window focus and use external control via Hide.
/// </summary>
public bool UseVisibilityControl = true;
/// <summary>
/// Optional flag that can disable popup input capturing. Useful for transparent or visual-only popups.
/// </summary>
public bool UseInput = true;
/// <summary>
/// Initializes a new instance of the <see cref="ContextMenuBase"/> class.
/// </summary>
@@ -137,21 +147,26 @@ namespace FlaxEditor.GUI.ContextMenu
/// </summary>
/// <param name="parent">Parent control to attach to it.</param>
/// <param name="location">Popup menu origin location in parent control coordinates.</param>
public virtual void Show(Control parent, Float2 location)
/// <param name="direction">The custom popup direction. Null to use automatic direction.</param>
public virtual void Show(Control parent, Float2 location, ContextMenuDirection? direction = null)
{
Assert.IsNotNull(parent);
// Ensure to be closed
Hide();
bool isAlreadyVisible = Visible && _window;
if (!isAlreadyVisible)
Hide();
// Peek parent control window
var parentWin = parent.RootWindow;
if (parentWin == null)
{
Hide();
return;
}
// Check if show menu inside the other menu - then link as a child to prevent closing the calling menu window on lost focus
if (_parentCM == null && parentWin.ChildrenCount == 1 && parentWin.Children[0] is ContextMenuBase parentCM)
{
Hide();
parentCM.ShowChild(this, parentCM.PointFromScreen(parent.PointToScreen(location)), false);
return;
}
@@ -169,7 +184,7 @@ namespace FlaxEditor.GUI.ContextMenu
var monitorBounds = Platform.GetMonitorBounds(locationSS);
var rightBottomLocationSS = locationSS + dpiSize;
bool isUp = false, isLeft = false;
if (UseAutomaticDirectionFix)
if (UseAutomaticDirectionFix && direction == null)
{
var parentMenu = parent as ContextMenu;
if (monitorBounds.Bottom < rightBottomLocationSS.Y)
@@ -196,6 +211,26 @@ namespace FlaxEditor.GUI.ContextMenu
locationSS.X -= dpiSize.X;
}
}
else if (direction.HasValue)
{
switch (direction.Value)
{
case ContextMenuDirection.RightUp:
isUp = true;
break;
case ContextMenuDirection.LeftDown:
isLeft = true;
break;
case ContextMenuDirection.LeftUp:
isLeft = true;
isUp = true;
break;
}
if (isLeft)
locationSS.X -= dpiSize.X;
if (isUp)
locationSS.Y -= dpiSize.Y;
}
// Update direction flag
if (isUp)
@@ -203,47 +238,62 @@ namespace FlaxEditor.GUI.ContextMenu
else
_direction = isLeft ? ContextMenuDirection.LeftDown : ContextMenuDirection.RightDown;
// Create window
var desc = CreateWindowSettings.Default;
desc.Position = locationSS;
desc.StartPosition = WindowStartPosition.Manual;
desc.Size = dpiSize;
desc.Fullscreen = false;
desc.HasBorder = false;
desc.SupportsTransparency = false;
desc.ShowInTaskbar = false;
desc.ActivateWhenFirstShown = true;
desc.AllowInput = true;
desc.AllowMinimize = false;
desc.AllowMaximize = false;
desc.AllowDragAndDrop = false;
desc.IsTopmost = true;
desc.Type = WindowType.Popup;
desc.Parent = parentWin.Window;
desc.Title = "ContextMenu";
desc.HasSizingFrame = false;
OnWindowCreating(ref desc);
_window = Platform.CreateWindow(ref desc);
_window.GotFocus += OnWindowGotFocus;
_window.LostFocus += OnWindowLostFocus;
if (isAlreadyVisible)
{
_window.ClientBounds = new Rectangle(locationSS, dpiSize);
}
else
{
// Create window
var desc = CreateWindowSettings.Default;
desc.Position = locationSS;
desc.StartPosition = WindowStartPosition.Manual;
desc.Size = dpiSize;
desc.Fullscreen = false;
desc.HasBorder = false;
desc.SupportsTransparency = false;
desc.ShowInTaskbar = false;
desc.ActivateWhenFirstShown = UseInput;
desc.AllowInput = UseInput;
desc.AllowMinimize = false;
desc.AllowMaximize = false;
desc.AllowDragAndDrop = false;
desc.IsTopmost = true;
desc.Type = WindowType.Popup;
desc.Parent = parentWin.Window;
desc.Title = "ContextMenu";
desc.HasSizingFrame = false;
OnWindowCreating(ref desc);
_window = Platform.CreateWindow(ref desc);
if (UseVisibilityControl)
{
_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;
_window.Closed += () => parentWin.Window.MouseDown -= OnWindowMouseDown;
// The focus between popup and parent windows doesn't change, force hide the popup when clicked on parent
parentWin.Window.MouseDown += OnWindowMouseDown;
_window.Closed += () => parentWin.Window.MouseDown -= OnWindowMouseDown;
#endif
// Attach to the window
_parentCM = parent as ContextMenuBase;
Parent = _window.GUI;
// Attach to the window
_parentCM = parent as ContextMenuBase;
Parent = _window.GUI;
}
// Show
Visible = true;
if (_window == null)
return;
_window.Show();
PerformLayout();
_previouslyFocused = parentWin.FocusedControl;
Focus();
OnShow();
if (UseVisibilityControl)
{
_previouslyFocused = parentWin.FocusedControl;
Focus();
OnShow();
}
}
/// <summary>
@@ -508,7 +558,7 @@ namespace FlaxEditor.GUI.ContextMenu
base.Update(deltaTime);
// Let root context menu to check if none of the popup windows
if (_parentCM == null && !IsForeground)
if (_parentCM == null && UseVisibilityControl && !IsForeground)
{
#if USE_SDL_WORKAROUNDS
if (!IsMouseOver)

View File

@@ -486,7 +486,7 @@ namespace FlaxEditor.GUI.Docking
{
base.Focus();
SelectTab(false);
SelectTab();
BringToFront();
}

View File

@@ -56,6 +56,11 @@ namespace FlaxEditor.GUI
/// </summary>
public event Action<Item> Clicked;
/// <summary>
/// Occurs when items gets focused.
/// </summary>
public event Action<Item> Focused;
/// <summary>
/// The tint color of the text.
/// </summary>
@@ -141,6 +146,10 @@ namespace FlaxEditor.GUI
protected virtual void GetTextRect(out Rectangle rect)
{
rect = new Rectangle(2, 0, Width - 4, Height);
// Indent for drop panel items is handled by drop panel margin
if (Parent is not DropPanel)
rect.Location += new Float2(Editor.Instance.Icons.ArrowRight12.Size.X + 2, 0);
}
/// <inheritdoc />
@@ -155,10 +164,6 @@ namespace FlaxEditor.GUI
if (IsMouseOver || IsFocused)
Render2D.FillRectangle(new Rectangle(Float2.Zero, Size), style.BackgroundHighlighted);
// Indent for drop panel items is handled by drop panel margin
if (Parent is not DropPanel)
textRect.Location += new Float2(Editor.Instance.Icons.ArrowRight12.Size.X + 2, 0);
// Draw all highlights
if (_highlights != null)
{
@@ -207,6 +212,14 @@ namespace FlaxEditor.GUI
base.OnMouseLeave();
}
/// <inheritdoc />
public override void OnGotFocus()
{
base.OnGotFocus();
Focused?.Invoke(this);
}
/// <inheritdoc />
public override int Compare(Control other)
{
@@ -227,6 +240,7 @@ namespace FlaxEditor.GUI
private readonly Panel _scrollPanel;
private List<DropPanel> _categoryPanels;
private bool _waitingForInput;
private string _customSearch;
/// <summary>
/// Event fired when any item in this popup menu gets clicked.
@@ -248,26 +262,30 @@ namespace FlaxEditor.GUI
/// </summary>
/// <param name="width">The control width.</param>
/// <param name="height">The control height.</param>
public ItemsListContextMenu(float width = 320, float height = 220)
/// <param name="withSearch">Enables search field.</param>
public ItemsListContextMenu(float width = 320, float height = 220, bool withSearch = true)
{
// Context menu dimensions
Size = new Float2(width, height);
// Search box
_searchBox = new SearchBox(false, 1, 1)
if (withSearch)
{
Parent = this,
Width = Width - 3,
};
_searchBox.TextChanged += OnSearchFilterChanged;
_searchBox.ClearSearchButton.Clicked += () => PerformLayout();
// Search box
_searchBox = new SearchBox(false, 1, 1)
{
Parent = this,
Width = Width - 3,
};
_searchBox.TextChanged += OnSearchFilterChanged;
_searchBox.ClearSearchButton.Clicked += () => PerformLayout();
}
// Panel with scrollbar
_scrollPanel = new Panel(ScrollBars.Vertical)
{
Parent = this,
AnchorPreset = AnchorPresets.StretchAll,
Bounds = new Rectangle(0, _searchBox.Bottom + 1, Width, Height - _searchBox.Bottom - 2),
Bounds = withSearch ? new Rectangle(0, _searchBox.Bottom + 1, Width, Height - _searchBox.Bottom - 2) : new Rectangle(Float2.Zero, Size),
};
// Items list panel
@@ -286,12 +304,13 @@ namespace FlaxEditor.GUI
LockChildrenRecursive();
var searchText = _searchBox?.Text ?? _customSearch;
var items = ItemsPanel.Children;
for (int i = 0; i < items.Count; i++)
{
if (items[i] is Item item)
{
item.UpdateFilter(_searchBox.Text);
item.UpdateFilter(searchText);
item.UpdateScore();
}
}
@@ -305,13 +324,13 @@ namespace FlaxEditor.GUI
{
if (category.Children[j] is Item item2)
{
item2.UpdateFilter(_searchBox.Text);
item2.UpdateFilter(searchText);
item2.UpdateScore();
anyVisible |= item2.Visible;
}
}
category.Visible = anyVisible;
if (string.IsNullOrEmpty(_searchBox.Text))
if (string.IsNullOrEmpty(searchText))
category.Close(false);
else
category.Open(false);
@@ -322,8 +341,8 @@ namespace FlaxEditor.GUI
UnlockChildrenRecursive();
PerformLayout(true);
_searchBox.Focus();
TextChanged?.Invoke(_searchBox.Text);
_searchBox?.Focus();
TextChanged?.Invoke(searchText);
}
/// <summary>
@@ -355,6 +374,14 @@ namespace FlaxEditor.GUI
}
}
/// <summary>
/// Removes all added items.
/// </summary>
public void ClearItems()
{
ItemsPanel.DisposeChildren();
}
/// <summary>
/// Sorts the items list (by item name by default).
/// </summary>
@@ -368,6 +395,34 @@ namespace FlaxEditor.GUI
}
}
/// <summary>
/// Focuses and scroll to the given item to be selected.
/// </summary>
/// <param name="item">The item to select.</param>
public void SelectItem(Item item)
{
item.Focus();
ScrollViewTo(item);
}
/// <summary>
/// Applies custom search text query on the items list. Works even if search field is disabled
/// </summary>
/// <param name="text">The custom search text. Null to clear search.</param>
public void Search(string text)
{
if (_searchBox != null)
{
_searchBox.SetText(text);
}
else
{
_customSearch = text;
if (VisibleInHierarchy)
OnSearchFilterChanged();
}
}
/// <summary>
/// Adds the item to the view and registers for the click event.
/// </summary>
@@ -446,9 +501,11 @@ namespace FlaxEditor.GUI
}
}
_searchBox.Clear();
_searchBox?.Clear();
UnlockChildrenRecursive();
PerformLayout(true);
if (_customSearch != null)
OnSearchFilterChanged();
}
private List<Item> GetVisibleItems()
@@ -510,7 +567,7 @@ namespace FlaxEditor.GUI
if (RootWindow.FocusedControl == null)
{
// Focus search box if nothing is focused
_searchBox.Focus();
_searchBox?.Focus();
return true;
}
@@ -536,7 +593,7 @@ namespace FlaxEditor.GUI
var focusedIndex = items.IndexOf(focusedItem);
if (focusedIndex == 0)
{
_searchBox.Focus();
_searchBox?.Focus();
}
else if (focusedIndex > 0)
{
@@ -556,7 +613,7 @@ namespace FlaxEditor.GUI
break;
}
if (_waitingForInput)
if (_waitingForInput && _searchBox != null)
{
_waitingForInput = false;
_searchBox.Focus();

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