Compare commits

...

260 Commits

Author SHA1 Message Date
mafiesto4 b84ccc2cbc **Update to .NET 10** 2026-06-04 11:37:53 +02:00
mafiesto4 775e978fed Merge remote-tracking branch 'origin/master' into 1.13
# Conflicts:
#	Flax.flaxproj
#	Source/Engine/Level/Actors/StaticModel.cpp
#	Source/Engine/Level/Prefabs/Prefab.cpp
#	Source/Engine/Tools/ModelTool/ModelTool.cpp
2026-06-03 17:15:38 +02:00
mafiesto4 e450658834 Remove deprecated mono runtime backend
Old `mono` backend was not maintained for since 1.7 (July 2023)
`dotnet` backend still can run `mono` on AOT platforms but with the latest .NET features.
2026-06-03 16:35:06 +02:00
mafiesto4 1a8827ba76 Fix Web build when python is installed in folder with whitespaces in path 2026-06-03 14:21:38 +02:00
mafiesto4 eed227aa79 Add distance-scale to vertex paint vertices
Add vertex paint brush size changing with shift+scroll
Fix vertex paint brush size to match the highlight sphere
2026-06-03 14:15:40 +02:00
mafiesto4 27ee42b0a1 Bump up build number 2026-06-03 13:01:26 +02:00
mafiesto4 fd8ae9bc2b Rename SceneRenderTask::RenderingPercentage to RenderScale 2026-06-03 13:01:11 +02:00
mafiesto4 e0f234c667 Add enum serialization as string via EnumString attribute 2026-06-03 13:00:43 +02:00
mafiesto4 bdeb89538c Optimize auto generated Variant Types in bindings to reduce dynamic memory allocs in game builds 2026-06-03 11:05:17 +02:00
mafiesto4 0f86537099 Add simpler Variant::Enum that auto-setups variant type from enum scripting info 2026-06-03 11:01:14 +02:00
mafiesto4 f6f7bbb3d0 Fix Variant static typenames caching bug in Editor 2026-06-03 10:58:17 +02:00
mafiesto4 422300adbd Add VariantType::GetScriptingType for easier type information access 2026-06-03 10:57:51 +02:00
mafiesto4 89a1f00c57 Fix Guid diff serialization and loading invalid values 2026-06-03 05:11:53 +02:00
mafiesto4 f4be035f04 Add Physics::DeleteScene 2026-06-03 05:03:32 +02:00
mafiesto4 c2ec3fe2cb Simplify async render flushing code 2026-06-03 05:03:22 +02:00
mafiesto4 fca6ed43cc Fix compilation regression 2026-06-02 19:17:40 +02:00
Murry Lancashire 84ccb9df0c Add more LOD Generation options to model import settings (eg. borders lock, preserve UVs)
https://github.com/LOOPDISK/FlaxEngine/commit/1cfd4634727055c2a7249dff447528877332beab
2026-06-02 16:42:30 +02:00
mafiesto4 777602fee6 Fix asset storage handling when file is locked
https://github.com/LOOPDISK/FlaxEngine/pull/45
2026-06-02 15:54:36 +02:00
mafiesto4 24654e5b02 Add CHECK_NO_RETURN for checks in code that should continue function execution 2026-06-02 15:54:00 +02:00
Murry Lancashire 44117084c8 Fix asset cache eviction for locked files to retain cached info
https://github.com/LOOPDISK/FlaxEngine/pull/45
2026-06-02 15:53:35 +02:00
mafiesto4 2531a4b918 Fix asset 'Reload' option to be available when asset failed to load for manual load 2026-06-02 15:51:46 +02:00
mafiesto4 9ce6026192 Optimize model actors entries serialization 2026-06-02 14:07:28 +02:00
mafiesto4 a12c5e2203 Add more profiler events to assets code 2026-06-02 13:24:10 +02:00
mafiesto4 ff526ecafb Fix nested prefab stack overflow when adding new object to nested prefabs hierarchy
https://github.com/LOOPDISK/FlaxEngine/pull/44
2026-06-02 13:23:21 +02:00
mafiesto4 1badeda31c Fix error when drawing animated model thumbnail 2026-06-01 19:20:00 +02:00
mafiesto4 018c7cf33d Update editor icons atlas with new folder color and add original .psd file 2026-06-01 19:19:50 +02:00
mafiesto4 a544cbcfde Add mesh index buffer optimization based on meshoptimizer library
Work similar to existing impl but yields better results with even less overdraw.
2026-06-01 18:41:45 +02:00
mafiesto4 45f7c1f0a0 Add detecting Vulkan SDK version 2026-06-01 16:39:11 +02:00
mafiesto4 13aa6ce4a0 Another attempt to fix new Vulkan SDK install on macOS 2026-06-01 16:25:02 +02:00
mafiesto4 c2b2d6973b Merge branch '1.13' of https://gitlab.flaxengine.com/flax/flaxengine into 1.13 2026-06-01 16:19:30 +02:00
mafiesto4 96835b856d Fix StringViewAnsi substring to not allocate 2026-06-01 16:19:28 +02:00
mafiesto4 caeecf2aea Update Vulkan API to 1.4 on macOS and iOS 2026-06-01 16:19:04 +02:00
mafiesto4 db963f9191 Another attempt to fix new Vulkan SDK install on macOS 2026-06-01 16:10:00 +02:00
mafiesto4 4b6c22c43f Fix game build regression from f55ac81fe4 2026-06-01 15:52:18 +02:00
mafiesto4 d3be79fdc4 Fix missing SDK print for ones from modules or plugins 2026-06-01 15:50:25 +02:00
mafiesto4 8231bae16b Fix new Vulkan SDK install 2026-06-01 15:19:41 +02:00
mafiesto4 f55ac81fe4 Update to the latest Vulkan SDK 1.4.350
Update Vulkan API to `1.2` on Windows
Update Vulkan API to `1.1` on Android
2026-06-01 14:19:09 +02:00
mafiesto4 d181f8d726 Fix DDGI sampling when using non-directional lighting (eg. smoke particles or volumetric fog) 2026-05-31 12:29:52 +02:00
mafiesto4 2a37a529b9 Fix missing Debug module headers from exception helper folder 2026-05-31 12:29:14 +02:00
mafiesto4 7f370a7c5b Add improvements to DDGI sampling and filtering in areas far from probes 2026-05-31 12:28:56 +02:00
mafiesto4 0f38fca0b1 Minor fixes 2026-05-30 14:28:28 +02:00
mafiesto4 0b47e63ba3 Fix regression from 0a39d88221 to display selected enum properly 2026-05-30 13:36:48 +02:00
mafiesto4 a0663666bb Disable recurring editor build verbose log to be used once 2026-05-30 13:35:49 +02:00
mafiesto4 6daec81db1 Fix crash when using curves inside Anim Graph
https://forum.flaxengine.com/t/bug-report-v1-12-using-curves-in-the-animation-graph-causes-a-crash/2594
2026-05-28 13:30:40 +02:00
mafiesto4 c36c39df37 Add auto focus on model when changing Base Model in Anim Graph 2026-05-28 11:38:34 +02:00
mafiesto4 b7a59447a3 Fix Web build files location to properly exist in final package
https://forum.flaxengine.com/t/web-build-issue-with-c-script/2590
2026-05-28 11:32:24 +02:00
mafiesto4 6fa38b75d5 Add material instance creation out of other instance
#4063
2026-05-28 10:40:51 +02:00
mafiesto4 de1b515f1e Merge branch 'xxSeys1-SkeletonAndSkeletonDebugDrawImprovements' 2026-05-28 10:32:22 +02:00
mafiesto4 b004e90606 Adjust category names #4014 2026-05-28 10:32:16 +02:00
mafiesto4 b7185bfe72 Merge branch 'SkeletonAndSkeletonDebugDrawImprovements' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-SkeletonAndSkeletonDebugDrawImprovements 2026-05-28 10:10:19 +02:00
mafiesto4 7a41e7d6d8 Merge branch 'xxSeys1-ScrollToNewOnAnimTrackAdd' 2026-05-28 10:07:19 +02:00
mafiesto4 3e670f5e80 Remove not needed line
#4013
2026-05-28 10:07:16 +02:00
mafiesto4 7e19ffbe40 Merge branch 'ScrollToNewOnAnimTrackAdd' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-ScrollToNewOnAnimTrackAdd 2026-05-28 10:04:45 +02:00
mafiesto4 80e20744aa Merge branch 'Duroxxigar-show-debug-draw-default' 2026-05-28 09:59:03 +02:00
mafiesto4 16effd8328 Merge branch 'show-debug-draw-default' of https://github.com/Duroxxigar/FlaxEngine into Duroxxigar-show-debug-draw-default 2026-05-28 09:58:57 +02:00
mafiesto4 e7c5f257e9 Minor fixes and improvements 2026-05-28 09:54:35 +02:00
mafiesto4 320d37d9a2 Fix MeshAccessor triangle count calculation bug
#4121
2026-05-28 09:54:18 +02:00
mafiesto4 791fb785cf Revert "Simplify apple platform include defines"
This reverts commit 3140c711a4.
2026-05-27 17:54:06 +02:00
mafiesto4 ab6b5927f8 Fix missing Int2/Int3/Int4 in Variant support implementation parts
#4114
2026-05-27 17:23:22 +02:00
mafiesto4 7c1df5c980 Fix crash when loading invalid VisjectMeta
#4114
2026-05-27 17:22:22 +02:00
mafiesto4 14ad3f892e Merge branch 'xxSeys1-DirectionGizmoRotation' 2026-05-27 15:01:43 +02:00
mafiesto4 bd3129e9e7 Merge branch 'DirectionGizmoRotation' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-DirectionGizmoRotation 2026-05-27 14:59:55 +02:00
mafiesto4 45cc04d434 Merge branch 'GoaLitiuM-decorations_dpi_fix' 2026-05-27 14:55:13 +02:00
mafiesto4 f78954c174 Merge branch 'decorations_dpi_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-decorations_dpi_fix 2026-05-27 14:52:58 +02:00
mafiesto4 e43a12a9a8 Merge branch 'GoaLitiuM-windows_cursor_pos_fix' 2026-05-27 14:45:32 +02:00
mafiesto4 1e6fdb7f02 Merge branch 'windows_cursor_pos_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-windows_cursor_pos_fix 2026-05-27 14:45:11 +02:00
mafiesto4 067c8ae5b8 Bump up build number 2026-05-27 14:40:41 +02:00
mafiesto4 95aa04c334 Merge branch 'ifromstone-dev/MacOSVulkanTimestampQueries' 2026-05-27 14:39:58 +02:00
mafiesto4 efd6bc27b8 Merge branch 'dev/MacOSVulkanTimestampQueries' of https://github.com/ifromstone/FlaxEngine into ifromstone-dev/MacOSVulkanTimestampQueries 2026-05-27 14:39:52 +02:00
mafiesto4 3140c711a4 Simplify apple platform include defines 2026-05-27 14:39:45 +02:00
mafiesto4 848e9c92aa Merge branch 'ifromstone-dev/MacOSRiderSearch' 2026-05-27 14:28:09 +02:00
mafiesto4 6dad8259d6 Merge branch 'dev/MacOSRiderSearch' of https://github.com/ifromstone/FlaxEngine into ifromstone-dev/MacOSRiderSearch 2026-05-27 14:28:05 +02:00
mafiesto4 9f72c465fe Merge branch 'GoaLitiuM-winsdk_28000' 2026-05-27 14:27:39 +02:00
Andrei Gagua 285762bfdb Fix Vulkan Tracy timestamp queries on MoltenVK
Disable Vulkan Tracy GPU profiling when Vulkan timer queries are disabled.
Apple platforms already set VULKAN_USE_TIMER_QUERIES to 0
2026-05-24 11:13:41 +03:00
Andrei Gagua 571821bf3d Fix Rider detection on macOS when installed in the user Applications folder 2026-05-23 21:09:37 +03:00
Saas 96a081bf93 use mouse wrapping and rename mouse wrapping function parameter 2026-05-21 21:43:26 +02:00
Saas 637f3dc176 make code a bit nicer 2026-05-21 00:26:45 +02:00
Saas 5010597bd2 add being able to rotate view with direction gizmo 2026-05-21 00:20:52 +02:00
mafiesto4 17ff4623e7 Fix DDGI cascade movement to be less vertical along the view 2026-05-20 23:20:30 +02:00
mafiesto4 0a39d88221 Fix editing flag enum to properly toggle bits incl. bit masks 2026-05-20 18:18:25 +02:00
mafiesto4 92a0a40d16 Add Global SDF Overdraw debug mode for content optimizations 2026-05-20 16:20:45 +02:00
Ari Vuollet 4d4d1a589f Fix mouse position in events reported from caption area on Windows 2026-05-19 23:46:32 +03:00
Ari Vuollet 1176dc515d Fix window decoration buttons not clickable with DPI scale 2026-05-19 23:44:46 +03:00
Ari Vuollet 96d670efb7 Add support for Windows 11 SDK version 28000 2026-05-19 22:49:58 +03:00
mafiesto4 8d8d69b847 Add Optimization sub-group in view modes list 2026-05-19 21:19:32 +02:00
mafiesto4 5dac5d3f2d Refactor GPU Debug Layers to be manually activated with -gpudebug
Debug builds don't activate it by default. Can be sued in both Debug and Development builds.
`GPU_ENABLE_DIAGNOSTICS` renamed to `GPU_ENABLE_DEBUG_LAYER`
`GPU_ENABLE_WINDOW_SRV` renamed to `GPU_ENABLE_WINDOW_SRV`
`GPU_USE_SHADERS_DEBUG_LAYER` renamed to `GPU_ENABLE_SHADERS_DEBUG_LAYER`
2026-05-19 15:26:01 +02:00
mafiesto4 03126e1840 Fix missing objects when performing Global Surface Atlas defragmentation after failed insert 2026-05-19 14:02:35 +02:00
mafiesto4 9e96206d67 Merge remote-tracking branch 'origin/master' into 1.13 2026-05-19 10:55:14 +02:00
mafiesto4 00e4b09e7e Migrate to a new LFS server
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled
2026-05-17 11:53:08 +02:00
mafiesto4 3bf3264f48 Fix compilation with the latest GDK 2026-05-14 18:28:17 +02:00
mafiesto4 ec73cc6b0d Merge branch '1.12' 2026-05-14 15:32:53 +02:00
mafiesto4 b043490413 Merge remote-tracking branch 'origin/master' into 1.13 2026-05-13 18:20:30 +02:00
mafiesto4 3542f20787 Merge branch '1.12' 2026-05-13 18:17:53 +02:00
mafiesto4 43511a96b0 Fix Editor build in Release 2026-05-13 17:06:06 +02:00
mafiesto4 48f302b4fd Fix rare asset loading problems 2026-05-13 16:05:03 +02:00
mafiesto4 d9c787a661 Merge remote-tracking branch 'origin/master' into 1.13
# Conflicts:
#	Source/Editor/SceneGraph/GUI/ActorTreeNode.cs
#	Source/Engine/Graphics/Graphics.h
#	Source/Engine/Renderer/ShadowsPass.cpp
2026-05-13 16:03:53 +02:00
mafiesto4 97bcdacd9a Fix minor doc issues 2026-05-13 15:43:44 +02:00
mafiesto4 253442abd1 Add filtering whitespaces to Xml doc comments of type members and optimize filtering 2026-05-13 10:58:50 +02:00
mafiesto4 c8912ad100 Add help support to Debug Commands via XML docs parsing 2026-05-13 10:47:21 +02:00
mafiesto4 40413edbab Fix property get/set function name length in dotnet bindings 2026-05-13 10:43:03 +02:00
mafiesto4 c10cfc8e45 Fix output log history popup management to smoother usage 2026-05-13 10:42:56 +02:00
mafiesto4 5739c0bef4 Fix assertion on shader load failure
#2702
2026-05-12 22:53:29 +02:00
mafiesto4 4f97225c46 Merge branch 'GoaLitiuM-xmldoc_optimizations' 2026-05-12 22:45:27 +02:00
mafiesto4 2c8da4ea04 Merge branch 'xmldoc_optimizations' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-xmldoc_optimizations 2026-05-12 22:32:28 +02:00
mafiesto4 d697bd7402 Update old API usage
#4080 #4081
2026-05-12 18:40:21 +02:00
mafiesto4 0bcc01c3c7 Merge branch 'Tryibion-blackboard-utils' 2026-05-12 18:25:03 +02:00
mafiesto4 de76d3623e Fix BehaviorKnowledge of object type casting
#4072
2026-05-12 18:24:59 +02:00
mafiesto4 33caae6935 Merge branch 'blackboard-utils' of https://github.com/Tryibion/FlaxEngine into Tryibion-blackboard-utils 2026-05-12 18:22:30 +02:00
mafiesto4 75d9e36bd2 Merge branch 'Duroxxigar-change-lookingatdirection-name' 2026-05-12 18:21:34 +02:00
mafiesto4 72f2c8f5cd Merge branch 'change-lookingatdirection-name' of https://github.com/Duroxxigar/FlaxEngine into Duroxxigar-change-lookingatdirection-name 2026-05-12 18:21:31 +02:00
mafiesto4 9cfb3dd220 Merge branch 'Duroxxigar-change-direction-naming' 2026-05-12 18:20:59 +02:00
mafiesto4 62d6658444 Merge branch 'change-direction-naming' of https://github.com/Duroxxigar/FlaxEngine into Duroxxigar-change-direction-naming 2026-05-12 18:20:51 +02:00
mafiesto4 66818802b1 Merge branch 'Tryibion-gameplayglobal-getval' 2026-05-12 18:20:27 +02:00
mafiesto4 cc4fdf5cc2 Merge branch 'gameplayglobal-getval' of https://github.com/Tryibion/FlaxEngine into Tryibion-gameplayglobal-getval 2026-05-12 18:20:24 +02:00
mafiesto4 fde40949b2 Merge branch 'ThePhantomMask-AddVideoPlayerStatus' 2026-05-12 18:19:52 +02:00
mafiesto4 65c1a8258e Merge branch 'AddVideoPlayerStatus' of https://github.com/ThePhantomMask/FlaxEngine into ThePhantomMask-AddVideoPlayerStatus 2026-05-12 18:19:49 +02:00
mafiesto4 6e89f152ef Merge branch 'xxSeys1-ViewportZoomInOutFOV' 2026-05-12 18:19:17 +02:00
mafiesto4 e71f43ea79 Fix additional FOV to be included in Direction Gizmo
#4016
2026-05-12 18:19:10 +02:00
mafiesto4 d33ebc3105 Merge branch 'ViewportZoomInOutFOV' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-ViewportZoomInOutFOV 2026-05-12 18:15:00 +02:00
mafiesto4 0de61ba218 Merge branch 'xxSeys1-SphereMaskNames' 2026-05-12 18:13:59 +02:00
mafiesto4 283a3e6bf9 Merge branch 'SphereMaskNames' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-SphereMaskNames 2026-05-12 18:13:50 +02:00
mafiesto4 ec9f05fe11 Fix memory alloc when renaming GPU resource on Vulkan 2026-05-12 17:10:28 +02:00
mafiesto4 b039e3779d Fix Global Surface Atlas tiles padding and position precision to have proper stability 2026-05-12 17:10:02 +02:00
mafiesto4 fc8a9b69d2 Move new Temporal AA code to shared header 2026-05-12 17:09:21 +02:00
mafiesto4 b38f6c5721 Merge branch 'HydrogenC-reverse-z' into 1.13 2026-05-12 17:07:50 +02:00
Saas 8281e743cd rename Sphere Mask node A and B inputs 2026-05-12 14:05:04 +02:00
mafiesto4 0c1af2f243 Fix various rendering elements with Reversed Z enabled and simplify code
#2684
2026-05-11 18:26:21 +02:00
Jake Young ba48b2e4f3 Deprecate the Direction properties and replace with forward. Also give more descriptive description of what they do. 2026-05-08 13:48:28 -04:00
Jake Young 64708a14d9 Update LookingAt to be a more descriptive name. 2026-05-08 13:47:59 -04:00
mafiesto4 7f2ba7a81e Fix shaders cache to be invalidated when changing ReverseZ option
#2684
2026-05-08 10:53:40 +02:00
mafiesto4 fb21ffd3be Rename FLAX_REVERSE_Z macro to REVERSE_Z
#2684
2026-05-08 10:52:46 +02:00
mafiesto4 7127ccda37 Fix depth bounds in reversed Z
#2684
2026-05-08 09:02:17 +02:00
Tryibion af3836d611 Add GetValue by type in c# for gameplay globals 2026-05-07 18:04:50 -05:00
mafiesto4 ead71e6836 Add support for using macros in scripting function parameter default values 2026-05-07 23:01:16 +02:00
Phantom a421effd1b Add Video playback value 2026-05-07 20:53:35 +02:00
mafiesto4 241441d5b9 Merge branch 'reverse-z' of https://github.com/HydrogenC/FlaxEngine into HydrogenC-reverse-z
# Conflicts:
#	Source/Engine/Graphics/GPUDevice.cpp
#	Source/Engine/Graphics/Materials/DeferredMaterialShader.cpp
#	Source/Engine/Graphics/Materials/ForwardMaterialShader.cpp
#	Source/Engine/Graphics/Materials/TerrainMaterialShader.cpp
#	Source/Engine/Renderer/LightPass.cpp
#	Source/Engine/Renderer/ReflectionsPass.cpp
#	Source/Engine/Renderer/ShadowsPass.cpp
#	Source/Shaders/SSR.hlsl
#	Source/Shaders/ShadowsSampling.hlsl
#	Source/Shaders/Sky.shader
2026-05-07 19:55:03 +02:00
mafiesto4 14b0fb355a Fix compilation with Large Worlds 2026-05-07 18:27:36 +02:00
mafiesto4 4489f43777 Add DefaultProbeCubemapFormat to Graphics Settings with option to compress env probe textures 2026-05-07 18:20:34 +02:00
mafiesto4 c17a9f653e Add minor improvements and adjust 3rd DDGI cascade for better world coverage 2026-05-07 16:38:15 +02:00
mafiesto4 e7fd901807 Add improved fallback GI outside the DDGI range to use a special ambient probe for stability 2026-05-07 16:21:17 +02:00
mafiesto4 bdabcd5e43 Fix regression to properly resume render pass when flushing barriers mid-pass
141a8de0da
2026-05-07 09:03:22 +02:00
mafiesto4 6cc8f693f3 Fix directional light rendering to be skipped when color alpha is zero 2026-05-07 08:41:48 +02:00
Jake Young 811bf0d630 Change the default for showing debug draw to be on by default. 2026-05-07 01:56:09 -04:00
mafiesto4 1079791bed Add rendering stats for Data Upload 2026-05-07 00:02:33 +02:00
mafiesto4 627f3a2dec Show full timespan in editor incl. seconds 2026-05-06 17:31:27 +02:00
mafiesto4 2f05a0987e Add ShowInPlayMode to HideInEditor attribute for properties/fields that should display in editor only during play mode 2026-05-06 16:54:34 +02:00
mafiesto4 6335bcdc93 Add in-built editors for DateTime and TimeSpan 2026-05-06 16:42:38 +02:00
mafiesto4 650fa781d3 Simplify shader code for point/spot lights to use permutations instead 2026-05-06 12:59:35 +02:00
mafiesto4 000d786d49 Add Temporal Antialiasing as default AA method 2026-05-06 12:39:49 +02:00
mafiesto4 3eb85000aa Fix error when drag&drop new actor on Windows in Editor 2026-05-06 12:39:32 +02:00
mafiesto4 9c5daf419b Fix default shadow depth bias values and control them based on shadow resolution/quality mix 2026-05-06 12:39:15 +02:00
mafiesto4 9a85ae7142 Add soft PCSS shadows on Ultra quality
Add new `SourceAngle` property to Directional light that controls PCSS penumbra size
2026-05-06 12:37:42 +02:00
mafiesto4 fad0f7a345 Compact PCF shadow sampling code 2026-05-05 08:47:57 +02:00
mafiesto4 aac399c6a1 Add CascadeBlendSize to Directional Light and fix sun shadow fade at distance 2026-05-04 23:41:00 +02:00
mafiesto4 4c5035e433 Fix scene search performance regression 2026-05-04 23:05:25 +02:00
mafiesto4 b14c2cfc74 Optimize Global Surface Atlas full direct lighting redraw to copy whole emissive atlas at once 2026-05-04 18:11:01 +02:00
mafiesto4 cbcfa4013b Add Graphics::MotionVectors::MinObjectScreenSize to skip too small objects from drawing motion vectors 2026-05-04 17:29:58 +02:00
mafiesto4 429f8e5336 Add highlight to Motion Vectors Debug view for better content optimizing 2026-05-04 16:43:41 +02:00
mafiesto4 6cc0edf0eb Optimize shadows and depth rendering with instancing support for transparent shaders 2026-05-04 15:12:40 +02:00
mafiesto4 f7d8f36add Optimize draw calls batching and instancing with better sort keys generation and processing 2026-05-04 12:34:29 +02:00
mafiesto4 2e98300693 Add minor changes 2026-05-04 08:47:21 +02:00
mafiesto4 83de99877c Fix directional light cascaded shadow maps rendering stability 2026-05-04 08:46:43 +02:00
Tryibion 94e529e801 Add way to get blackboard by type. 2026-05-01 16:27:15 -05:00
mafiesto4 7a569d4f14 Add selection drawing and picking gizmo to Foliage Types editing tab 2026-04-30 18:19:12 +02:00
mafiesto4 24675ace93 Refactor Temporal Anti-Aliasing shader to have less ghosting and quality scalability
Fix lots of ghosting artifacts.
Fix aliasing on small cables/lines during camera movement.
Add scalability via AA Quality setting for TAA.
2026-04-30 17:58:19 +02:00
mafiesto4 3a5d831e71 Minor changes 2026-04-29 18:34:39 +02:00
mafiesto4 0aecb35ab1 Fix Global Surface Atlas rasterization of objects with negative scale 2026-04-29 18:34:14 +02:00
mafiesto4 c4bb39aeac Improve Global Surface Atlas objects dirtying limit to pick the largers objects first 2026-04-29 17:52:51 +02:00
mafiesto4 61431a6400 Optimize Global Surface Atlas defragmentation with copying old atlas to avoid redrawing all objects 2026-04-29 17:19:40 +02:00
mafiesto4 d4da1d80d0 Optimize Global Surface Atlas with object draws limit per frame 2026-04-29 17:05:17 +02:00
mafiesto4 3bede1d6bc Optimize Global Surface Atlas updates distribution for subobjects (eg. foliage instances) 2026-04-28 22:21:38 +02:00
mafiesto4 ce4ad8aa71 Optimize RendererAllocation by reducing fragmentation with operating on power-of-2 blocks 2026-04-28 21:55:52 +02:00
mafiesto4 75bd206416 Fix regression crash on Vulkan when clearing many textures at once 2026-04-28 20:19:35 +02:00
mafiesto4 578af12f2b Optimize Global Surface Atlas objects to cache shader data 2026-04-28 20:18:18 +02:00
mafiesto4 acbbd34ecf Optimize scene rendering async job to use interleaved ranges instead of fighting for a shared index 2026-04-28 13:16:44 +02:00
mafiesto4 c8b06ba7ec Optimize scene rendering loop to cache more data on stack 2026-04-28 13:07:19 +02:00
mafiesto4 ad46b74f6a Optimize foliage drawing by caching per-instance world matrix 2026-04-28 12:50:19 +02:00
mafiesto4 47a9d76938 Optimize foliage drawing memory access a bit more 2026-04-28 11:48:52 +02:00
mafiesto4 442cb8f2dd Minor improvements 2026-04-28 00:25:31 +02:00
mafiesto4 45e121bf77 Fix Guid diff serialization and loading invalid values 2026-04-28 00:24:57 +02:00
mafiesto4 8e76d0d9d8 Fix GPUTexture.DownloadData to use correct bindings api 2026-04-28 00:24:34 +02:00
mafiesto4 f4905cfccc Optimize foliage rendering with less cache misses 2026-04-28 00:24:05 +02:00
mafiesto4 bf9a015959 Optimize FoliageInstance size to cut down memory by and reduce cache misses when drawing foliage 2026-04-27 22:54:11 +02:00
mafiesto4 4fd7f51fdf Optimize LightmapUVs to be stored already as Half4 to avoid runtime conversions during rendering 2026-04-27 21:53:11 +02:00
mafiesto4 f5e483069d Optimize CPU rendering of shadowed foliage by splitting draw contexts into separate async jobs 2026-04-27 17:14:56 +02:00
mafiesto4 0bd28ecb65 Fix compilation 2026-04-27 16:09:28 +02:00
mafiesto4 9eec54171c Fix compilation on Linux 2026-04-27 14:37:00 +02:00
mafiesto4 486781661e Optimize foliage instance bounds calculations 2026-04-27 14:32:19 +02:00
mafiesto4 b201897ae6 Optimize foliage serialization by batching instance data, performing quantization, and LZ4 compression
Cuts down foliage data size by over 50% and improves load times.
2026-04-27 14:30:19 +02:00
mafiesto4 c33ada2715 Fix unnecessary memory allocations within D3D object debug name assignment 2026-04-27 14:27:32 +02:00
mafiesto4 dcb9b5150f Optimize large scene/prefa/json assets metadata loading by avoiding parsing full contents 2026-04-27 14:27:00 +02:00
mafiesto4 f905b4013b Optimize large scene files loading by aligning json pool allocator pages to 64kB 2026-04-27 14:26:12 +02:00
mafiesto4 b0033a35b7 Improve foliage count display in editor tab 2026-04-27 14:25:23 +02:00
mafiesto4 f47a2909fe Update LZ4 library to v1.10 2026-04-27 14:24:56 +02:00
mafiesto4 b1c76ec7f9 Merge remote-tracking branch 'origin/1.12' into 1.13 2026-04-25 10:31:41 +02:00
mafiesto4 db2130f340 Add No parameters text to material instance panel with base material that doesn't have parameters 2026-04-24 23:49:40 +02:00
mafiesto4 edb3badcb3 Optimize content modifications watching events processing in large projects 2026-04-24 23:47:22 +02:00
mafiesto4 c33b2cc11e Optimize first scene startup by preloading it during loading screen 2026-04-24 17:56:12 +02:00
mafiesto4 135110387d Fix loading SceneReference property in Visual Script 2026-04-24 17:55:07 +02:00
mafiesto4 6b3502675a Fix deprecated flag usage when loading scenes over multiple frames 2026-04-24 17:54:40 +02:00
mafiesto4 615e847e01 Add new Level.PreloadSceneAsync for streaming levels before they need to be loaded in 2026-04-24 17:54:25 +02:00
mafiesto4 468e05c6e8 Fix crash on Vulkan when constant buffer is missing 2026-04-24 12:20:32 +02:00
mafiesto4 a46402df6b Merge remote-tracking branch 'origin/1.12' into 1.13 2026-04-24 11:50:19 +02:00
mafiesto4 1fa9aadebd Fix crash on cursor changes regression 2026-04-24 11:50:15 +02:00
mafiesto4 c0f52235c6 Fix compilation on Xbox with new D3D12MA lib used 2026-04-24 11:21:42 +02:00
mafiesto4 c782f07b76 Add GetTextureData function to texture API in C# 2026-04-24 11:21:18 +02:00
mafiesto4 dc9a8a2f84 Fix editor shutdown error when script compilation fails 2026-04-24 11:21:02 +02:00
mafiesto4 49943e13de Fix various API issues 2026-04-24 11:20:45 +02:00
mafiesto4 1988fae929 Add support for loading custom mouse cursor images 2026-04-24 11:20:04 +02:00
mafiesto4 804315bb3e Add VSync support to Vulkan 2026-04-23 20:25:36 +02:00
mafiesto4 0cacc58b53 Fix minor issues in D3D12 2026-04-23 18:39:09 +02:00
mafiesto4 7437b69d52 Add GPUMemoryStats for GPU video memory stats
Add new `Total/GPU` category to memory profiler.
Implement for D3D12 and Vulkan with allocators.
2026-04-23 18:38:47 +02:00
mafiesto4 f5f4fb29f2 Cleanup code and disable unused Json/Dump features from D3D12MA 2026-04-23 17:13:30 +02:00
mafiesto4 33617a702a Add D3D12MemoryAllocator for resource allocations on DX12
v3.1.0
2026-04-23 17:12:26 +02:00
mafiesto4 84b53bb9c8 Optimize various rendering effects with GPUDrawPass 2026-04-23 14:30:02 +02:00
mafiesto4 c3ea883b21 Fix crash on Android when mouse device is not connected 2026-04-23 10:18:43 +02:00
mafiesto4 f41d01f4a9 Optimize Vulkan render passes with a new GPUDrawPass to manually control attachment operations in higher-level API 2026-04-23 10:18:13 +02:00
mafiesto4 141a8de0da Optimize Vulkan texture clears with render pass attachments clear operation 2026-04-23 09:44:31 +02:00
mafiesto4 63b6fafa1b Add Escape key to deselect in Editor 2026-04-23 09:14:19 +02:00
mafiesto4 2ce1103530 Add VersionControlInfo to output game build info and log game version with branch/commit info 2026-04-22 23:11:29 +02:00
mafiesto4 6121a6fadf Merge remote-tracking branch 'origin/1.12' into 1.13 2026-04-22 17:56:23 +02:00
mafiesto4 145134f145 Add 1.13 for future update 2026-04-16 14:31:32 +02:00
Saas a7c9eff959 add zooming in and out (FOV) in editor viewport using C and Z 2026-03-21 14:49:34 +01:00
Saas a831e15bf7 fix rare bug where tracks pannel wouldn't scroll all the way through 2026-03-19 20:47:34 +01:00
Saas d77e1e9a53 wrap GetShowDebugDrawOptions() with USE_EDITOR preprocessor 2026-03-19 18:25:00 +01:00
Saas 699fb12604 improve Properties Panel layout for SkinnedModel 2026-03-19 17:35:57 +01:00
Saas 9505be310f fix spelling in ShowBitDepth 2026-03-19 17:34:01 +01:00
Saas 503a0e6763 add slider to adjust skeleton name font size 2026-03-19 17:33:45 +01:00
Saas 65b35a4b8a auto scroll to new track when adding track to timeline 2026-03-18 21:40:22 +01:00
Ari Vuollet c2e8e492d7 Defer loading XML documentation during while loading the editor 2025-05-02 14:03:53 +03:00
Ari Vuollet c916fb1844 Avoid clearing cached XML documentation data for Editor assembly 2025-05-02 14:03:52 +03:00
Ari Vuollet 004339b81e Improve XML documentation reference parsing and overall performance 2025-05-02 14:03:52 +03:00
ExMatics HydrogenC 3f78e47918 Fix for shadow atlas not being cleared correctly 2024-10-10 22:13:43 +08:00
ExMatics HydrogenC 7b4a9f1a63 Fix depth function 2024-10-10 21:15:46 +08:00
ExMatics HydrogenC 561d40fd71 Merge remote-tracking branch 'upstream/master' into reverse-z 2024-10-10 17:42:43 +08:00
ExMatics HydrogenC 133340b2ea Fix sky color being too dark 2024-06-06 12:56:32 +08:00
ExMatics HydrogenC 344665e34f Merge branch 'reverse-z' of https://github.com/HydrogenC/FlaxEngine into reverse-z 2024-06-06 12:13:51 +08:00
ExMatics HydrogenC 5d188c8c2d Simplify SetMatrix code 2024-06-06 12:13:32 +08:00
ExMatics HydrogenC 9447f3d569 Fix build tool command line 2024-06-06 11:16:00 +08:00
ExMatics HydrogenC df8dc9173a Add command line controls for reverse z 2024-06-06 00:07:28 +08:00
ExMatics HydrogenC b186d19faa Fix typo 2024-06-05 23:37:10 +08:00
ExMatics HydrogenC ea749f12a3 Add depth function to conditional compiling 2024-06-05 23:36:41 +08:00
ExMatics HydrogenC 74750fd604 Fix spot light 2024-06-05 23:09:43 +08:00
ExMatics HydrogenC b52e8bad4c Fix shadow casting 2024-06-05 23:02:21 +08:00
ExMatics HydrogenC 44f8e86245 Fix code depth sampling for unreversed z 2024-06-05 22:39:20 +08:00
ExMatics HydrogenC b036692154 Fix shadow bias and unify indent 2024-06-05 22:36:15 +08:00
ExMatics HydrogenC 5d050ca020 Make reverse z define dynamic 2024-06-05 21:51:07 +08:00
ExMatics HydrogenC 1b6a31b6e5 Finish conditional compiling 2024-06-05 21:15:08 +08:00
ExMatics HydrogenC ab4743fdb1 Add more comditional compiling 2024-06-05 18:20:38 +08:00
ExMatics HydrogenC 49629222c1 Revert VolumeParticle.shader 2024-06-05 07:41:40 +08:00
ExMatics HydrogenC 9d6778ff1e Add a bit conditional compiling 2024-06-05 07:40:03 +08:00
ExMatics HydrogenC ce73394531 add todo in BoundingFrustrum 2024-06-04 23:24:28 +08:00
ExMatics HydrogenC 463c8dba0d fix depth function 2024-06-04 23:22:41 +08:00
ExMatics HydrogenC 9bb6104cf7 Merge remote-tracking branch 'upstream/master' into reverse-z 2024-06-04 12:08:07 +08:00
ExMatics HydrogenC 151f4a4923 Merge branch 'reverse-z' of https://github.com/HydrogenC/FlaxEngine into reverse-z 2024-06-04 12:07:53 +08:00
ExMatics HydrogenC 36f588a792 Fix more shaders 2024-06-04 12:07:50 +08:00
ExMatics HydrogenC 07c7a250cc Revert unexpected deletions 2024-06-04 09:55:06 +08:00
ExMatics HydrogenC eab4a8c404 Fix shaders for reverse z 2024-06-04 09:30:26 +08:00
ExMatics HydrogenC cde3e3d710 Fix editor raycast 2024-06-04 08:39:14 +08:00
ExMatics HydrogenC a8dc67a1b2 Implement reverse z 2024-06-03 22:02:35 +08:00
647 changed files with 24273 additions and 48736 deletions
+5 -5
View File
@@ -3,7 +3,7 @@ description: Downloads and installs Vulkan SDK.
inputs:
vulkan-version:
description: 'Vulkan SDK release version (e.g. 1.2.198.1).'
default: '1.3.290.0'
default: '1.4.350.0'
required: false
runs:
using: "composite"
@@ -24,13 +24,13 @@ runs:
;;
Darwin)
export VULKAN_SDK_ROOT=`pwd`/../VulkanSDK
curl -LO "https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/mac/vulkan-sdk.dmg"
hdiutil attach vulkan-sdk.dmg -mountpoint /Volumes/vulkan-sdk
sudo "/Volumes/vulkan-sdk/InstallVulkan.app/Contents/MacOS/InstallVulkan" --root $VULKAN_SDK_ROOT --accept-licenses --default-answer --confirm-command install
curl -LO "https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/mac/vulkansdk-macos-$VULKAN_SDK_VER.zip"
unzip vulkansdk-macos-$VULKAN_SDK_VER.zip
sudo "vulkansdk-macos-$VULKAN_SDK_VER.app/Contents/MacOS/vulkansdk-macOS-$VULKAN_SDK_VER" --root $VULKAN_SDK_ROOT --accept-licenses --default-answer --confirm-command install
export VULKAN_SDK=$VULKAN_SDK_ROOT/macOS
;;
*) # Windows
curl -L -o vulkan-sdk.exe https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/windows/VulkanSDK-$VULKAN_SDK_VER-Installer.exe
curl -L -o vulkan-sdk.exe https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/windows/vulkansdk-windows-X64-$VULKAN_SDK_VER.exe
./vulkan-sdk.exe --root "C:\VulkanSDK" --accept-licenses --default-answer --confirm-command install
export VULKAN_SDK="C:\VulkanSDK"
;;
+2 -2
View File
@@ -20,7 +20,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.419
dotnet-version: 10.0.x
- name: Setup .NET Workload
run: |
dotnet workload install android
@@ -37,4 +37,4 @@ jobs:
PowerShell "(Get-Content global.json).Replace('latestMajor', 'minor') | Set-Content global.json"
PowerShell "(Get-Content Source/Tools/Flax.Build/global.json).Replace('latestMajor', 'minor') | Set-Content Source/Tools/Flax.Build/global.json"
PowerShell "(Get-Content Source/Tools/Flax.Build/Flax.Build.csproj).Replace('LatestMajor', 'Minor') | Set-Content Source/Tools/Flax.Build/Flax.Build.csproj"
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=8 -arch=ARM64 -platform=Android -configuration=Release -buildtargets=FlaxGame
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=10 -arch=ARM64 -platform=Android -configuration=Release -buildtargets=FlaxGame
+2 -2
View File
@@ -19,7 +19,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Setup .NET Workload
run: |
dotnet workload install ios
@@ -33,4 +33,4 @@ jobs:
git lfs pull
- name: Build
run: |
./Development/Scripts/Mac/CallBuildTool.sh -build -log -dotnet=9 -arch=ARM64 -platform=iOS -configuration=Release -buildtargets=FlaxGame
./Development/Scripts/Mac/CallBuildTool.sh -build -log -dotnet=10 -arch=ARM64 -platform=iOS -configuration=Release -buildtargets=FlaxGame
+4 -4
View File
@@ -23,7 +23,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
@@ -34,7 +34,7 @@ jobs:
git lfs pull
- name: Build
run: |
./Development/Scripts/Linux/CallBuildTool.sh -build -log -printSDKs -dotnet=8 -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxEditor
./Development/Scripts/Linux/CallBuildTool.sh -build -log -printSDKs -dotnet=10 -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxEditor
# Game
game-linux:
@@ -52,7 +52,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
@@ -63,4 +63,4 @@ jobs:
git lfs pull
- name: Build
run: |
./Development/Scripts/Linux/CallBuildTool.sh -build -log -printSDKs -dotnet=8 -arch=x64 -platform=Linux -configuration=Release -buildtargets=FlaxGame
./Development/Scripts/Linux/CallBuildTool.sh -build -log -printSDKs -dotnet=10 -arch=x64 -platform=Linux -configuration=Release -buildtargets=FlaxGame
+4 -4
View File
@@ -19,7 +19,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
@@ -30,7 +30,7 @@ jobs:
git lfs pull
- name: Build
run: |
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=8 -arch=ARM64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=10 -arch=ARM64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor
# Game
game-mac:
@@ -44,7 +44,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
@@ -55,4 +55,4 @@ jobs:
git lfs pull
- name: Build
run: |
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=8 -arch=ARM64 -platform=Mac -configuration=Release -buildtargets=FlaxGame
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=10 -arch=ARM64 -platform=Mac -configuration=Release -buildtargets=FlaxGame
+4 -4
View File
@@ -20,7 +20,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.419
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
@@ -34,7 +34,7 @@ jobs:
PowerShell "(Get-Content global.json).Replace('latestMajor', 'minor') | Set-Content global.json"
PowerShell "(Get-Content Source/Tools/Flax.Build/global.json).Replace('latestMajor', 'minor') | Set-Content Source/Tools/Flax.Build/global.json"
PowerShell "(Get-Content Source/Tools/Flax.Build/Flax.Build.csproj).Replace('LatestMajor', 'Minor') | Set-Content Source/Tools/Flax.Build/Flax.Build.csproj"
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=8 -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxEditor
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=10 -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxEditor
# Game
game-windows:
@@ -48,7 +48,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.419
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
@@ -62,4 +62,4 @@ jobs:
PowerShell "(Get-Content global.json).Replace('latestMajor', 'minor') | Set-Content global.json"
PowerShell "(Get-Content Source/Tools/Flax.Build/global.json).Replace('latestMajor', 'minor') | Set-Content Source/Tools/Flax.Build/global.json"
PowerShell "(Get-Content Source/Tools/Flax.Build/Flax.Build.csproj).Replace('LatestMajor', 'Minor') | Set-Content Source/Tools/Flax.Build/Flax.Build.csproj"
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=8 -arch=x64 -platform=Windows -configuration=Release -buildtargets=FlaxGame
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=10 -arch=x64 -platform=Windows -configuration=Release -buildtargets=FlaxGame
+12 -12
View File
@@ -28,7 +28,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.419
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
@@ -38,7 +38,7 @@ jobs:
PowerShell "(Get-Content global.json).Replace('latestMajor', 'minor') | Set-Content global.json"
PowerShell "(Get-Content Source/Tools/Flax.Build/global.json).Replace('latestMajor', 'minor') | Set-Content Source/Tools/Flax.Build/global.json"
PowerShell "(Get-Content Source/Tools/Flax.Build/Flax.Build.csproj).Replace('LatestMajor', 'Minor') | Set-Content Source/Tools/Flax.Build/Flax.Build.csproj"
.\PackageEditor.bat -arch=x64 -platform=Windows -deployOutput=Output -dotnet=8
.\PackageEditor.bat -arch=x64 -platform=Windows -deployOutput=Output -dotnet=10
- name: Upload
uses: actions/upload-artifact@v7
with:
@@ -64,7 +64,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.419
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
@@ -74,7 +74,7 @@ jobs:
PowerShell "(Get-Content global.json).Replace('latestMajor', 'minor') | Set-Content global.json"
PowerShell "(Get-Content Source/Tools/Flax.Build/global.json).Replace('latestMajor', 'minor') | Set-Content Source/Tools/Flax.Build/global.json"
PowerShell "(Get-Content Source/Tools/Flax.Build/Flax.Build.csproj).Replace('LatestMajor', 'Minor') | Set-Content Source/Tools/Flax.Build/Flax.Build.csproj"
.\PackagePlatforms.bat -arch=x64 -platform=Windows -deployOutput=Output -dotnet=8
.\PackagePlatforms.bat -arch=x64 -platform=Windows -deployOutput=Output -dotnet=10
- name: Upload
uses: actions/upload-artifact@v7
with:
@@ -101,14 +101,14 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Build
run: |
./PackageEditor.sh -arch=x64 -platform=Linux -deployOutput=Output -dotnet=8
./PackageEditor.sh -arch=x64 -platform=Linux -deployOutput=Output -dotnet=10
- name: Upload
uses: actions/upload-artifact@v7
with:
@@ -133,14 +133,14 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Build
run: |
./PackagePlatforms.sh -arch=x64 -platform=Linux -deployOutput=Output -dotnet=8
./PackagePlatforms.sh -arch=x64 -platform=Linux -deployOutput=Output -dotnet=10
- name: Upload
uses: actions/upload-artifact@v7
with:
@@ -163,14 +163,14 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Build
run: |
./PackageEditor.command -arch=ARM64 -platform=Mac -deployOutput=Output -dotnet=8
./PackageEditor.command -arch=ARM64 -platform=Mac -deployOutput=Output -dotnet=10
- name: Upload
uses: actions/upload-artifact@v7
with:
@@ -191,14 +191,14 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Build
run: |
./PackagePlatforms.command -arch=ARM64 -platform=Mac -deployOutput=Output -dotnet=8
./PackagePlatforms.command -arch=ARM64 -platform=Mac -deployOutput=Output -dotnet=10
- name: Upload
uses: actions/upload-artifact@v7
with:
+2 -2
View File
@@ -18,7 +18,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Setup .NET Workload
run: |
dotnet workload install ios
@@ -42,7 +42,7 @@ jobs:
cp ".github/data/Build Settings.json" "FlaxSamples/MaterialsFeaturesTour/Content/Settings"
- name: Build Editor
run: |
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=8 -arch=ARM64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=10 -arch=ARM64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor
- name: Cook Game (iOS)
run: |
./Binaries/Editor/Mac/Development/FlaxEditor -std -headless -mute -null -project "FlaxSamples/MaterialsFeaturesTour" -build "Development.iOS"
+10 -10
View File
@@ -18,7 +18,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
@@ -34,18 +34,18 @@ jobs:
chmod +x .github/data/bt.sh
- name: Build
run: |
./GenerateProjectFiles.sh -vs2022 -log -verbose -printSDKs -dotnet=8
./Development/Scripts/Linux/CallBuildTool.sh -build -log -dotnet=8 -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxTestsTarget -UseLargeWorlds=true
./GenerateProjectFiles.sh -vs2026 -log -verbose -printSDKs -dotnet=10
./Development/Scripts/Linux/CallBuildTool.sh -build -log -dotnet=10 -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxTestsTarget -UseLargeWorlds=true
dotnet msbuild Source/Tools/Flax.Build.Tests/Flax.Build.Tests.csproj /m /t:Restore,Build /p:Configuration=Debug /p:Platform=AnyCPU /nologo
dotnet msbuild Source/Tools/Flax.Build.Tests/Flax.Build.Tests.csproj /m /t:Restore,Build /p:Configuration=Debug /p:Platform=AnyCPU /nologo
- name: Test
run: |
${GITHUB_WORKSPACE}/.github/data/bt.sh ./Binaries/Editor/Linux/Development/FlaxTests -headless
dotnet test -f net8.0 Binaries/Tests/Flax.Build.Tests.dll
dotnet test -f net10.0 Binaries/Tests/Flax.Build.Tests.dll
cp Binaries/Editor/Linux/Development/FlaxEngine.CSharp.dll Binaries/Tests
cp Binaries/Editor/Linux/Development/FlaxEngine.CSharp.runtimeconfig.json Binaries/Tests
cp Binaries/Editor/Linux/Development/Newtonsoft.Json.dll Binaries/Tests
dotnet test -f net8.0 Binaries/Tests/FlaxEngine.CSharp.dll
dotnet test -f net10.0 Binaries/Tests/FlaxEngine.CSharp.dll
# Tests on Windows
tests-windows:
@@ -57,7 +57,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.419
dotnet-version: 10.0.x
- name: Print .NET info
run: |
dotnet --info
@@ -71,8 +71,8 @@ jobs:
PowerShell "(Get-Content global.json).Replace('latestMajor', 'minor') | Set-Content global.json"
PowerShell "(Get-Content Source/Tools/Flax.Build/global.json).Replace('latestMajor', 'minor') | Set-Content Source/Tools/Flax.Build/global.json"
PowerShell "(Get-Content Source/Tools/Flax.Build/Flax.Build.csproj).Replace('LatestMajor', 'Minor') | Set-Content Source/Tools/Flax.Build/Flax.Build.csproj"
.\GenerateProjectFiles.bat -vs2022 -log -verbose -printSDKs -dotnet=8
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -dotnet=8 -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxTestsTarget
.\GenerateProjectFiles.bat -vs2026 -log -verbose -printSDKs -dotnet=10
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -dotnet=10 -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
@@ -80,8 +80,8 @@ jobs:
$ErrorActionPreference = "Stop"
.\Binaries\Editor\Win64\Development\FlaxTests.exe -headless
if(!$?) { Write-Host "Tests failed with exit code $LastExitCode" -ForegroundColor Red; Exit $LastExitCode }
dotnet test -f net8.0 Binaries\Tests\Flax.Build.Tests.dll
dotnet test -f net10.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
xcopy /y Binaries\Editor\Win64\Development\Newtonsoft.Json.dll Binaries\Tests
dotnet test -f net8.0 Binaries\Tests\FlaxEngine.CSharp.dll
dotnet test -f net10.0 Binaries\Tests\FlaxEngine.CSharp.dll
+1 -1
View File
@@ -1,4 +1,4 @@
# Redirect to our own Git LFS server
[lfs]
url="https://gitlab.flaxengine.com/flax/flaxengine.git/info/lfs"
url="https://git.flaxengine.com/flax/flaxengine.git/info/lfs"
locksverify = false
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.
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-17
View File
@@ -1,17 +0,0 @@
## Mono
Custom fork: [https://github.com/FlaxEngine/mono](https://github.com/FlaxEngine/mono) with custom features for C# assemblies hot-reloading at runtime without domain unload (more: [https://flaxengine.com/blog/flax-facts-16-scripts-hot-reload/](https://flaxengine.com/blog/flax-facts-16-scripts-hot-reload/)).
Startup docs about building mono: [https://www.mono-project.com/docs/compiling-mono/](https://www.mono-project.com/docs/compiling-mono/)
### Notes
Some useful notes and tips for devs:
* Use `-monolog` to print Mono logs to Flax logs
* When working with mono fork set `localRepoPath` to local repo location in `Source\Tools\Flax.Build\Deps\Dependencies\mono.cs`
* To update mono deps when developing/updating use `.\Development\Scripts\Windows\CallBuildTool.bat -log -ReBuildDeps -verbose -depsToBuild=mono -platform=Windows`, then build engine and run it
* `MONO_GC_DEBUG=check-remset-consistency` - it will do additional checks at each collection to see if there are any missing write barriers
* `MONO_GC_DEBUG=nursery-canaries` - it might catch some buffer overflows in case of problems in code.
* `MONO_GC_DEBUG=<log-level>:<log-file>` - will print GC debug to the log file (eg. `4:sgen-gc`).
* Methods `mono_custom_attrs_from_property` and `mono_custom_attrs_get_attr` are internally cached
* If C++ mono call a method in c# that will throw an error, error will be handled but, not completly. Calling relase domain will return random `Access memory violation`. First search for error in c# code. No workaround yet.
@@ -34,7 +34,7 @@ goto Exit
echo CallBuildTool ERROR: The script is in invalid directory.
goto Exit
:Error_NoVisualStudioEnvironment
echo CallBuildTool ERROR: Missing Visual Studio 2022 or newer.
echo CallBuildTool ERROR: Missing Visual Studio 2026 or newer.
goto Exit
:Error_CompilationFailed
echo CallBuildTool ERROR: Failed to compile Flax.Build project.
+3 -3
View File
@@ -2,9 +2,9 @@
"Name": "Flax",
"Version": {
"Major": 1,
"Minor": 12,
"Minor": 13,
"Revision": 0,
"Build": 6912
"Build": 7005
},
"Company": "Flax",
"Copyright": "Copyright (c) 2012-2026 Wojciech Figat. All rights reserved.",
@@ -13,7 +13,7 @@
"Configuration": {
"UseCSharp": true,
"UseLargeWorlds": false,
"UseDotNet": true,
"UseReverseZ": true,
"Windows": {
"UseSDL": false,
},
+1
View File
@@ -257,6 +257,7 @@
<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:Boolean x:Key="/Default/GrammarAndSpelling/GrammarChecking/Exceptions/=will_0020fallback/@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>
+12 -12
View File
@@ -28,10 +28,10 @@ Follow the instructions below to compile and run the engine from source.
## Windows
* Install Visual Studio 2022 or newer
* Install Windows 8.1 SDK or newer (via Visual Studio Installer)
* Install Visual Studio 2026 or newer
* Install Windows 10 SDK or newer (via Visual Studio Installer)
* Install Microsoft Visual C++ 2015 v140 toolset or newer (via Visual Studio Installer)
* Install .NET 8 SDK (or newer) for **Windows x64** (via Visual Studio Installer or [from web](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
* Install .NET 10 SDK (or newer) for **Windows x64** (via Visual Studio Installer or [from web](https://dotnet.microsoft.com/en-us/download/dotnet/10.0))
* Install Git with LFS
* Clone repo (with LFS)
* Run **GenerateProjectFiles.bat**
@@ -44,10 +44,10 @@ Follow the instructions below to compile and run the engine from source.
## Linux
* Install Visual Studio Code
* Install .NET 8 or 9 SDK ([https://dotnet.microsoft.com/en-us/download/dotnet/8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
* Ubuntu: `sudo apt install dotnet-sdk-8.0`
* Fedora: `sudo dnf install dotnet-sdk-8.0`
* Arch: `sudo pacman -S dotnet-sdk-8.0 dotnet-runtime-8.0 dotnet-targeting-pack-8.0 dotnet-host`
* Install .NET 10 SDK (or newer) ([https://dotnet.microsoft.com/en-us/download/dotnet/10.0](https://dotnet.microsoft.com/en-us/download/dotnet/10.0))
* Ubuntu: `sudo apt install dotnet-sdk-10.0`
* Fedora: `sudo dnf install dotnet-sdk-10.0`
* Arch: `sudo pacman -S dotnet-sdk-10.0 dotnet-runtime-10.0 dotnet-targeting-pack-10.0 dotnet-host`
* Install Vulkan SDK ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/))
* Ubuntu: `sudo apt install vulkan-sdk` (deprecated, follow official docs)
* Fedora: `sudo dnf install vulkan-headers vulkan-tools vulkan-validation-layers`
@@ -73,7 +73,7 @@ Follow the instructions below to compile and run the engine from source.
## Mac
* Install XCode 16.4 (or newer)
* Install .NET 8 SDK (or newer) ([https://dotnet.microsoft.com/en-us/download/dotnet/8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
* Install .NET 10 SDK (or newer) ([https://dotnet.microsoft.com/en-us/download/dotnet/10.0](https://dotnet.microsoft.com/en-us/download/dotnet/10.0))
* Install Vulkan SDK ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/))
* Clone repo (with LFS)
* Run `GenerateProjectFiles.command`
@@ -86,17 +86,17 @@ Follow the instructions below to compile and run the engine from source.
Restart PC - ensure DotNet is added to PATH for command line tools execution.
* `Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 8.0`
* `Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 10.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 10.0`
Use Visual Studio 2022, older versions are not supported by .NET SDK 8.
Use Visual Studio 2026 (or newer), old Visual Studio versions are not supported by .NET SDK 10.
* `Building for Windows without Vulkan rendering backend (Vulkan SDK is missing)`
Install the Vulkan SDK then set an environment variable to provide the path to the SDK prior to running GenerateProjectFiles.bat: `set VULKAN_SDK=%sdk_path%`.
* `The NuGetSdkResolver did not resolve this SDK`
* `The NuGetSdkResolver did not resolve this SDK` / `Could not resolve SDK "Microsoft.NET.Sdk"`
Install `.NET SDK`, `NuGet package manager` and `NuGet targets and build tasks` in Visual Studio components.
Install `.NET SDK` 10, `NuGet package manager` and `NuGet targets and build tasks` in Visual Studio components.
## Workspace directory
@@ -12,7 +12,7 @@ namespace FlaxEngine.Tools
{
partial struct Options
{
private bool ShowBtiDepth => Format != AudioFormat.Vorbis;
private bool ShowBitDepth => Format != AudioFormat.Vorbis;
}
}
}
@@ -19,6 +19,7 @@ namespace FlaxEngine.Tools
private bool ShowRootMotion => ShowAnimation && RootMotion != RootMotionMode.None;
private bool ShowSmoothingNormalsAngle => ShowGeometry && CalculateNormals;
private bool ShowSmoothingTangentsAngle => ShowGeometry && CalculateTangents;
private bool ShowGenerateLODs => ShowGeometry && GenerateLODs;
private bool ShowFramesRange => ShowAnimation && Duration == AnimationDuration.Custom;
private bool ShowSplitting => Type != ModelType.Prefab;
}
+2 -2
View File
@@ -98,12 +98,12 @@ namespace FlaxEditor.Content
}
/// <summary>
/// Reloads the asset (if it's loaded).
/// Reloads the asset (if it's loaded or failed to load).
/// </summary>
public void Reload()
{
var asset = FlaxEngine.Content.GetAsset(ID);
if (asset != null && asset.IsLoaded)
if (asset != null && (asset.IsLoaded || asset.LastLoadFailed))
{
asset.Reload();
}
@@ -160,7 +160,7 @@ namespace FlaxEditor.Content
}
else
{
_parameters = Utils.GetEmptyArray<ScriptMemberInfo.Parameter>();
_parameters = Array.Empty<ScriptMemberInfo.Parameter>();
}
}
@@ -283,9 +283,9 @@ namespace FlaxEditor.Content
{
if (!_asset)
{
_parameters = Utils.GetEmptyArray<ScriptMemberInfo>();
_methods = Utils.GetEmptyArray<ScriptMemberInfo>();
_attributes = Utils.GetEmptyArray<Attribute>();
_parameters = Array.Empty<ScriptMemberInfo>();
_methods = Array.Empty<ScriptMemberInfo>();
_attributes = Array.Empty<Attribute>();
return;
}
if (_parameters != null)
@@ -303,7 +303,7 @@ namespace FlaxEditor.Content
_parameters[i] = new ScriptMemberInfo(new VisualScriptParameterInfo(this, parameters[i]));
}
else
_parameters = Utils.GetEmptyArray<ScriptMemberInfo>();
_parameters = Array.Empty<ScriptMemberInfo>();
// Cache Visual Script methods info
var methodsCount = _asset.GetMethodsCount();
@@ -314,7 +314,7 @@ namespace FlaxEditor.Content
_methods[i] = new ScriptMemberInfo(new VisualScriptMethodInfo(this, i));
}
else
_methods = Utils.GetEmptyArray<ScriptMemberInfo>();
_methods = Array.Empty<ScriptMemberInfo>();
// Cache Visual Script attributes
{
@@ -525,7 +525,7 @@ namespace FlaxEditor.Content
var baseType = BaseType;
if (baseType)
return baseType.GetProperties(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <inheritdoc />
@@ -0,0 +1,109 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using FlaxEditor.Content.Thumbnails;
using FlaxEditor.GUI.ContextMenu;
using FlaxEditor.Viewport.Previews;
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.Content
{
/// <summary>
/// A base class for <see cref="MaterialBase"/> asset proxy object.
/// </summary>
/// <seealso cref="FlaxEditor.Content.BinaryAssetProxy" />
public abstract class MaterialBaseProxy : BinaryAssetProxy
{
/// <summary>
/// The material preview drawer.
/// </summary>
protected MaterialPreview _preview;
/// <inheritdoc />
public override bool CanCreate(ContentFolder targetLocation)
{
return targetLocation.CanHaveAssets;
}
/// <inheritdoc />
public override void OnContentWindowContextMenu(ContextMenu menu, ContentItem item)
{
base.OnContentWindowContextMenu(menu, item);
if (item is BinaryAssetItem binaryAssetItem)
{
var button = menu.AddButton("Create Material Instance", CreateMaterialInstanceClicked);
button.Tag = binaryAssetItem;
}
}
private void CreateMaterialInstanceClicked(ContextMenuButton button)
{
var binaryAssetItem = (BinaryAssetItem)button.Tag;
CreateMaterialInstance(binaryAssetItem);
}
/// <summary>
/// Creates the material instance from the given material.
/// </summary>
/// <param name="materialItem">The material item to use as a base material.</param>
public static void CreateMaterialInstance(BinaryAssetItem materialItem)
{
var materialInstanceName = materialItem.ShortName + " Instance";
var materialInstanceProxy = Editor.Instance.ContentDatabase.GetProxy<MaterialInstance>();
Editor.Instance.Windows.ContentWin.NewItem(materialInstanceProxy, null, item => OnMaterialInstanceCreated(item, materialItem), materialInstanceName);
}
private static void OnMaterialInstanceCreated(ContentItem item, BinaryAssetItem materialItem)
{
var assetItem = (AssetItem)item;
var materialInstance = FlaxEngine.Content.LoadAsync<MaterialInstance>(assetItem.ID);
if (materialInstance == null || materialInstance.WaitForLoaded())
{
Editor.LogError("Failed to load created material instance.");
return;
}
materialInstance.BaseMaterial = FlaxEngine.Content.LoadAsync<MaterialBase>(materialItem.ID);
materialInstance.Save();
}
/// <inheritdoc />
public override void OnThumbnailDrawPrepare(ThumbnailRequest request)
{
if (_preview == null)
{
_preview = new MaterialPreview(false);
InitAssetPreview(_preview);
}
}
/// <inheritdoc />
public override void OnThumbnailDrawBegin(ThumbnailRequest request, ContainerControl guiRoot, GPUContext context)
{
_preview.Material = (MaterialBase)request.Asset;
_preview.Parent = guiRoot;
_preview.SyncBackbufferSize();
_preview.Task.OnDraw();
}
/// <inheritdoc />
public override void OnThumbnailDrawEnd(ThumbnailRequest request, ContainerControl guiRoot)
{
_preview.Material = null;
_preview.Parent = null;
}
/// <inheritdoc />
public override void Dispose()
{
if (_preview != null)
{
_preview.Dispose();
_preview = null;
}
base.Dispose();
}
}
}
@@ -2,23 +2,18 @@
using System;
using FlaxEditor.Content.Thumbnails;
using FlaxEditor.Viewport.Previews;
using FlaxEditor.Windows;
using FlaxEditor.Windows.Assets;
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.Content
{
/// <summary>
/// A <see cref="MaterialInstance"/> asset proxy object.
/// </summary>
/// <seealso cref="FlaxEditor.Content.BinaryAssetProxy" />
[ContentContextMenu("New/Material/Material Instance")]
public class MaterialInstanceProxy : BinaryAssetProxy
public class MaterialInstanceProxy : MaterialBaseProxy
{
private MaterialPreview _preview;
/// <inheritdoc />
public override string Name => "Material Instance";
@@ -34,12 +29,6 @@ namespace FlaxEditor.Content
/// <inheritdoc />
public override Type AssetType => typeof(MaterialInstance);
/// <inheritdoc />
public override bool CanCreate(ContentFolder targetLocation)
{
return targetLocation.CanHaveAssets;
}
/// <inheritdoc />
public override void Create(string outputPath, object arg)
{
@@ -47,49 +36,10 @@ namespace FlaxEditor.Content
throw new Exception("Failed to create new asset.");
}
/// <inheritdoc />
public override void OnThumbnailDrawPrepare(ThumbnailRequest request)
{
if (_preview == null)
{
_preview = new MaterialPreview(false);
InitAssetPreview(_preview);
}
}
/// <inheritdoc />
public override bool CanDrawThumbnail(ThumbnailRequest request)
{
return _preview.HasLoadedAssets && ThumbnailsModule.HasMinimumQuality((MaterialInstance)request.Asset);
}
/// <inheritdoc />
public override void OnThumbnailDrawBegin(ThumbnailRequest request, ContainerControl guiRoot, GPUContext context)
{
_preview.Material = (MaterialInstance)request.Asset;
_preview.Parent = guiRoot;
_preview.SyncBackbufferSize();
_preview.Task.OnDraw();
}
/// <inheritdoc />
public override void OnThumbnailDrawEnd(ThumbnailRequest request, ContainerControl guiRoot)
{
_preview.Material = null;
_preview.Parent = null;
}
/// <inheritdoc />
public override void Dispose()
{
if (_preview != null)
{
_preview.Dispose();
_preview = null;
}
base.Dispose();
}
}
}
+1 -95
View File
@@ -2,24 +2,18 @@
using System;
using FlaxEditor.Content.Thumbnails;
using FlaxEditor.GUI.ContextMenu;
using FlaxEditor.Viewport.Previews;
using FlaxEditor.Windows;
using FlaxEditor.Windows.Assets;
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.Content
{
/// <summary>
/// A <see cref="Material"/> asset proxy object.
/// </summary>
/// <seealso cref="FlaxEditor.Content.BinaryAssetProxy" />
[ContentContextMenu("New/Material/Material")]
public class MaterialProxy : BinaryAssetProxy
public class MaterialProxy : MaterialBaseProxy
{
private MaterialPreview _preview;
/// <inheritdoc />
public override string Name => "Material";
@@ -35,12 +29,6 @@ namespace FlaxEditor.Content
/// <inheritdoc />
public override Type AssetType => typeof(Material);
/// <inheritdoc />
public override bool CanCreate(ContentFolder targetLocation)
{
return targetLocation.CanHaveAssets;
}
/// <inheritdoc />
public override void Create(string outputPath, object arg)
{
@@ -48,92 +36,10 @@ namespace FlaxEditor.Content
throw new Exception("Failed to create new asset.");
}
/// <inheritdoc />
public override void OnContentWindowContextMenu(ContextMenu menu, ContentItem item)
{
base.OnContentWindowContextMenu(menu, item);
if (item is BinaryAssetItem binaryAssetItem)
{
var button = menu.AddButton("Create Material Instance", CreateMaterialInstanceClicked);
button.Tag = binaryAssetItem;
}
}
private void CreateMaterialInstanceClicked(ContextMenuButton obj)
{
var binaryAssetItem = (BinaryAssetItem)obj.Tag;
CreateMaterialInstance(binaryAssetItem);
}
/// <summary>
/// Creates the material instance from the given material.
/// </summary>
/// <param name="materialItem">The material item to use as a base material.</param>
public static void CreateMaterialInstance(BinaryAssetItem materialItem)
{
var materialInstanceName = materialItem.ShortName + " Instance";
var materialInstanceProxy = Editor.Instance.ContentDatabase.GetProxy<MaterialInstance>();
Editor.Instance.Windows.ContentWin.NewItem(materialInstanceProxy, null, item => OnMaterialInstanceCreated(item, materialItem), materialInstanceName);
}
private static void OnMaterialInstanceCreated(ContentItem item, BinaryAssetItem materialItem)
{
var assetItem = (AssetItem)item;
var materialInstance = FlaxEngine.Content.LoadAsync<MaterialInstance>(assetItem.ID);
if (materialInstance == null || materialInstance.WaitForLoaded())
{
Editor.LogError("Failed to load created material instance.");
return;
}
materialInstance.BaseMaterial = FlaxEngine.Content.LoadAsync<Material>(materialItem.ID);
materialInstance.Save();
}
/// <inheritdoc />
public override void OnThumbnailDrawPrepare(ThumbnailRequest request)
{
if (_preview == null)
{
_preview = new MaterialPreview(false);
InitAssetPreview(_preview);
}
}
/// <inheritdoc />
public override bool CanDrawThumbnail(ThumbnailRequest request)
{
return _preview.HasLoadedAssets && ThumbnailsModule.HasMinimumQuality((Material)request.Asset);
}
/// <inheritdoc />
public override void OnThumbnailDrawBegin(ThumbnailRequest request, ContainerControl guiRoot, GPUContext context)
{
_preview.Material = (Material)request.Asset;
_preview.Parent = guiRoot;
_preview.SyncBackbufferSize();
_preview.Task.OnDraw();
}
/// <inheritdoc />
public override void OnThumbnailDrawEnd(ThumbnailRequest request, ContainerControl guiRoot)
{
_preview.Material = null;
_preview.Parent = null;
}
/// <inheritdoc />
public override void Dispose()
{
if (_preview != null)
{
_preview.Dispose();
_preview = null;
}
base.Dispose();
}
}
}
+5
View File
@@ -360,6 +360,11 @@ public:
/// </summary>
Array<BinaryModuleInfo, InlinedAllocation<64>> BinaryModules;
/// <summary>
/// Cached version of the built binaries from project Version Control.
/// </summary>
String VersionControlInfo;
public:
/// <summary>
@@ -191,7 +191,7 @@ bool WebPlatformTools::OnPostProcess(CookingData& data)
FileSystem::GetChildDirectories(pythons, emscriptenSdk / TEXT("/python"));
if (pythons.HasItems())
{
procSettings.Arguments = procSettings.FileName + TEXT(".py ") + procSettings.Arguments;
procSettings.Arguments = String::Format(TEXT("\"{}.py\" {}"), procSettings.FileName, procSettings.Arguments);
#if PLATFORM_WINDOWS
procSettings.FileName = pythons[0] / TEXT("/python.exe");
#else
@@ -42,6 +42,13 @@ bool CompileScriptsStep::DeployBinaries(CookingData& data, const String& path, c
return true;
}
// Metadata
auto versionControlInfoMember = document.FindMember("VersionControlInfo");
if (versionControlInfoMember != document.MemberEnd() && data.VersionControlInfo.IsEmpty())
{
data.VersionControlInfo = versionControlInfoMember->value.GetText();
}
// Deploy all references
auto referencesMember = document.FindMember("References");
if (referencesMember != document.MemberEnd())
@@ -245,8 +252,15 @@ bool CompileScriptsStep::Perform(CookingData& data)
writer.String(target);
writer.JKEY("Platform");
writer.String(platform);
writer.JKEY("Architecture");
writer.String(architecture);
writer.JKEY("Configuration");
writer.String(configuration);
if (data.VersionControlInfo.HasChars())
{
writer.JKEY("VersionControlInfo");
writer.String(data.VersionControlInfo);
}
writer.JKEY("BinaryModules");
writer.StartArray();
+11 -1
View File
@@ -50,6 +50,10 @@
#endif
#include "FlaxEngine.Gen.h"
#ifndef REVERSE_Z
#define REVERSE_Z 0
#endif
Dictionary<String, CookAssetsStep::ProcessAssetFunc> CookAssetsStep::AssetProcessors;
void IBuildCache::InvalidateCacheShaders()
@@ -233,6 +237,11 @@ void CookAssetsStep::CacheData::Load(CookingData& data)
LOG(Info, "{0} option has been modified.", TEXT("ShadersGenerateDebugData"));
invalidateShaders = true;
}
if (REVERSE_Z != Settings.Global.ShadersReverseZ)
{
LOG(Info, "{0} option has been modified.", TEXT("ShadersReverseZ"));
invalidateShaders = true;
}
#if PLATFORM_TOOLS_WINDOWS
if (data.Platform == BuildPlatform::Windows32 || data.Platform == BuildPlatform::Windows64)
{
@@ -424,6 +433,7 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
options.GenerateDebugData = data.Cache.Settings.Global.ShadersGenerateDebugData;
options.TreatWarningsAsErrors = false;
options.Output = &cacheStream;
options.Platform = data.Data.Tools->GetPlatform();
Array<String> includes;
#define COMPILE_PROFILE(profile, cacheChunk) \
@@ -526,7 +536,6 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
#if PLATFORM_TOOLS_XBOX_SCARLETT
case BuildPlatform::XboxScarlett:
{
options.Platform = PlatformType::XboxScarlett;
const char* platformDefineName = "PLATFORM_XBOX_SCARLETT";
COMPILE_PROFILE(DirectX_SM6, SHADER_FILE_CHUNK_INTERNAL_D3D_SM6_CACHE);
break;
@@ -1076,6 +1085,7 @@ bool CookAssetsStep::Perform(CookingData& data)
{
cache.Settings.Global.ShadersNoOptimize = buildSettings->ShadersNoOptimize;
cache.Settings.Global.ShadersGenerateDebugData = buildSettings->ShadersGenerateDebugData;
cache.Settings.Global.ShadersReverseZ = REVERSE_Z;
cache.Settings.Global.StreamingSettingsAssetId = gameSettings->Streaming;
cache.Settings.Global.ShadersVersion = GPU_SHADER_CACHE_VERSION;
cache.Settings.Global.MaterialGraphVersion = MATERIAL_GRAPH_VERSION;
@@ -97,6 +97,7 @@ public:
{
bool ShadersNoOptimize;
bool ShadersGenerateDebugData;
bool ShadersReverseZ;
Guid StreamingSettingsAssetId;
int32 ShadersVersion;
int32 MaterialGraphVersion;
@@ -30,13 +30,6 @@ bool DeployDataStep::Perform(CookingData& data)
Platform::Sleep(10);
}
FileSystem::CreateDirectory(contentDir);
const String dstMono = data.DataOutputPath / TEXT("Mono");
#if USE_NETCORE
{
// Remove old Mono files
FileSystem::DeleteDirectory(dstMono);
FileSystem::DeleteFile(data.DataOutputPath / TEXT("MonoPosixHelper.dll"));
}
String dstDotnet = data.DataOutputPath / TEXT("Dotnet");
const DotNetAOTModes aotMode = data.Tools->UseAOT();
const bool usAOT = aotMode != DotNetAOTModes::None && aotMode != DotNetAOTModes::NoDotnet;
@@ -386,23 +379,6 @@ bool DeployDataStep::Perform(CookingData& data)
}
}
}
#else
if (!FileSystem::DirectoryExists(dstMono))
{
// Deploy Mono files (from platform data folder)
const String srcMono = depsRoot / TEXT("Mono");
if (!FileSystem::DirectoryExists(srcMono))
{
data.Error(TEXT("Missing Mono runtime data files."));
return true;
}
if (FileSystem::CopyDirectory(dstMono, srcMono))
{
data.Error(TEXT("Failed to copy Mono runtime data files."));
return true;
}
}
#endif
// Deploy engine data for the target platform
if (data.Tools->OnDeployBinaries(data))
@@ -343,6 +343,7 @@ namespace FlaxEditor.CustomEditors
}
private bool _buildOnUpdate;
private bool _initialized;
private bool _readOnly;
/// <summary>
@@ -430,6 +431,7 @@ namespace FlaxEditor.CustomEditors
ClearLayout();
_buildOnUpdate = false;
_initialized = true;
Editor.Setup(this);
Panel.IsLayoutLocked = false;
@@ -506,7 +508,11 @@ namespace FlaxEditor.CustomEditors
/// </summary>
protected virtual void OnSelectionChanged()
{
BuildLayout();
// Defer building the layout after we have initialized to improve initial loading times
if (!_initialized)
_buildOnUpdate = true;
else
BuildLayout();
SelectionChanged?.Invoke();
}
@@ -52,16 +52,15 @@ void OnAssemblyLoaded(MAssembly* assembly);
void OnAssemblyUnloading(MAssembly* assembly);
void OnBinaryModuleLoaded(BinaryModule* module);
MTypeObject* CustomEditorsUtil::GetCustomEditor(MTypeObject* refType)
MType* CustomEditorsUtil::GetCustomEditor(MType* type)
{
if (!refType)
if (!type)
return nullptr;
MType* type = INTERNAL_TYPE_OBJECT_GET(refType);
Entry result;
if (Cache.TryGet(type, result))
{
if (result.CustomEditorType)
return INTERNAL_TYPE_GET_OBJECT(result.CustomEditorType);
return result.CustomEditorType;
MClass* editor = result.CustomEditor ? result.CustomEditor : result.DefaultEditor;
if (editor)
return MUtils::GetType(editor);
@@ -127,12 +126,8 @@ void OnAssemblyLoaded(MAssembly* assembly)
continue;
// Check if attribute references a valid class
MTypeObject* refType = nullptr;
customEditorTypeField->GetValue(attribute, &refType);
if (refType == nullptr)
continue;
MType* type = INTERNAL_TYPE_OBJECT_GET(refType);
MType* type = nullptr;
customEditorTypeField->GetValue(attribute, &type);
if (type == nullptr)
continue;
MClass* typeClass = MCore::Type::GetClass(type);
@@ -12,6 +12,6 @@ class CustomEditorsUtil
public:
#if USE_CSHARP
static MTypeObject* GetCustomEditor(MTypeObject* refType);
static MType* GetCustomEditor(MType* type);
#endif
};
@@ -261,6 +261,7 @@ namespace FlaxEditor.CustomEditors.Editors
public static List<ItemInfo> GetItemsForType(ScriptType type, bool useProperties, bool useFields, bool usePropertiesWithoutSetter = false)
{
var items = new List<ItemInfo>();
var isPlayMode = Editor.IsPlayMode;
if (useProperties)
{
@@ -278,7 +279,7 @@ namespace FlaxEditor.CustomEditors.Editors
continue;
// Skip hidden fields, handle special attributes
if ((!p.IsPublic && !showInEditor) || attributes.Any(x => x is HideInEditorAttribute))
if ((!p.IsPublic && !showInEditor) || attributes.Any(x => x is HideInEditorAttribute hide && (!isPlayMode || !hide.ShowInPlayMode)))
continue;
items.Add(new ItemInfo(p, attributes));
@@ -293,11 +294,10 @@ namespace FlaxEditor.CustomEditors.Editors
for (int i = 0; i < fields.Length; i++)
{
var f = fields[i];
var attributes = f.GetAttributes(true);
// Skip hidden fields, handle special attributes
if ((!f.IsPublic && !attributes.Any(x => x is ShowInEditorAttribute)) || attributes.Any(x => x is HideInEditorAttribute))
if ((!f.IsPublic && !attributes.Any(x => x is ShowInEditorAttribute)) || attributes.Any(x => x is HideInEditorAttribute hide && (!isPlayMode || !hide.ShowInPlayMode)))
continue;
items.Add(new ItemInfo(f, attributes));
@@ -679,7 +679,7 @@ namespace FlaxEditor.CustomEditors.Editors
return asArray;
if (Values[0] is List<Tag> asList)
return asList.ToArray();
return Utils.GetEmptyArray<Tag>();
return Array.Empty<Tag>();
}
set
{
@@ -0,0 +1,90 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
using System;
namespace FlaxEditor.CustomEditors.Editors
{
/// <summary>
/// Default implementation of the inspector used to edit TimeSpan value type properties.
/// </summary>
[CustomEditor(typeof(TimeSpan)), DefaultEditor]
class TimeSpanEditor : CustomEditor
{
private TextBox _textBox;
private bool _isRefreshing;
/// <inheritdoc />
public override DisplayStyle Style => DisplayStyle.Inline;
/// <inheritdoc />
public override void Initialize(LayoutElementsContainer layout)
{
if (HasDifferentTypes)
return;
_textBox = layout.Custom<TextBox>().CustomControl;
_textBox.EditEnd += OnEditEnd;
}
private void OnEditEnd()
{
if (_isRefreshing)
return;
if (TimeSpan.TryParse(_textBox.Text, out var timeSpan))
SetValue(timeSpan);
}
/// <inheritdoc />
public override void Refresh()
{
base.Refresh();
_isRefreshing = true;
_textBox.Text = HasDifferentValues ? "Multiple Values" : ((TimeSpan)Values[0]).ToString("G");
_isRefreshing = false;
}
}
/// <summary>
/// Default implementation of the inspector used to edit DateTime value type properties.
/// </summary>
[CustomEditor(typeof(DateTime)), DefaultEditor]
class DateTimeEditor : CustomEditor
{
private TextBox _textBox;
private bool _isRefreshing;
/// <inheritdoc />
public override DisplayStyle Style => DisplayStyle.Inline;
/// <inheritdoc />
public override void Initialize(LayoutElementsContainer layout)
{
if (HasDifferentTypes)
return;
_textBox = layout.Custom<TextBox>().CustomControl;
_textBox.EditEnd += OnEditEnd;
}
private void OnEditEnd()
{
if (_isRefreshing)
return;
if (DateTime.TryParse(_textBox.Text, out var timeSpan))
SetValue(timeSpan);
}
/// <inheritdoc />
public override void Refresh()
{
base.Refresh();
_isRefreshing = true;
_textBox.Text = HasDifferentValues ? "Multiple Values" : ((DateTime)Values[0]).ToString("g");
_isRefreshing = false;
}
}
}
+3 -1
View File
@@ -12,6 +12,8 @@ using Microsoft.Win32;
/// </summary>
public class Editor : EditorModule
{
private static bool _logDotnetVersionsRange;
private void AddPlatformTools(BuildOptions options, string platformToolsRoot, string platformToolsRootExternal, string platform, params string[] macros)
{
if (Directory.Exists(Path.Combine(platformToolsRoot, platform)))
@@ -107,7 +109,7 @@ public class Editor : EditorModule
var maxVer = DotNetSdk.MaximumVersion.Major;
options.PrivateDefinitions.Add("GAME_BUILD_DOTNET_RUNTIME_MIN_VER=" + minVer);
options.PrivateDefinitions.Add("GAME_BUILD_DOTNET_RUNTIME_MAX_VER=" + DotNetSdk.MaximumVersion.Major);
Log.Verbose($"Using Dotnet runtime versions range {minVer}-{maxVer} for Game Cooker");
Log.VerboseOnce($"Using Dotnet runtime versions range {minVer}-{maxVer} for Game Cooker", ref _logDotnetVersionsRange);
}
}
+10 -1
View File
@@ -486,6 +486,15 @@ namespace FlaxEditor.GUI
button.TooltipText = _tooltips[index];
}
/// <summary>
/// Gets the text for selected item(s).
/// </summary>
/// <returns>The display text.</returns>
protected virtual string GetSelectedText()
{
return _selectedIndices.Count == 1 ? (_selectedIndices[0] >= 0 && _selectedIndices[0] < _items.Count ? _items[_selectedIndices[0]] : "") : "Multiple Values";
}
/// <summary>
/// Creates the popup menu.
/// </summary>
@@ -554,7 +563,7 @@ namespace FlaxEditor.GUI
// Check if has selected item
if (_selectedIndices != null && _selectedIndices.Count > 0)
{
string text = _selectedIndices.Count == 1 ? (_selectedIndices[0] >= 0 && _selectedIndices[0] < _items.Count ? _items[_selectedIndices[0]] : "") : "Multiple Values";
string text = GetSelectedText();
// Draw text of the selected item
float textScale = Height / DefaultHeight;
@@ -355,7 +355,7 @@ namespace FlaxEditor.GUI.ContextMenu
if (_previouslyFocused != null)
{
_previouslyFocused.RootWindow?.Focus();
_previouslyFocused.Focus();
_previouslyFocused?.Focus();
_previouslyFocused = null;
}
+1 -1
View File
@@ -103,7 +103,7 @@ namespace FlaxEditor.GUI.Drag
return results;
}
}
return Utils.GetEmptyArray<ScriptType>();
return Array.Empty<ScriptType>();
}
}
}
+1 -1
View File
@@ -101,7 +101,7 @@ public class DragControlType<U> : DragHelper<ScriptType, U> where U : DragEventA
return results;
}
}
return Utils.GetEmptyArray<ScriptType>();
return Array.Empty<ScriptType>();
}
}
+1 -1
View File
@@ -103,7 +103,7 @@ namespace FlaxEditor.GUI.Drag
return results.ToArray();
}
}
return Utils.GetEmptyArray<Script>();
return Array.Empty<Script>();
}
/// <summary>
+37 -43
View File
@@ -5,7 +5,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using FlaxEditor.CustomEditors;
using FlaxEditor.CustomEditors.Elements;
using FlaxEditor.GUI.ContextMenu;
using FlaxEditor.Scripting;
@@ -106,16 +105,6 @@ namespace FlaxEditor.GUI
if (_cachedValue == value && _hasValueCached)
return;
// Single value
for (int i = 0; i < _entries.Count; i++)
{
if (_entries[i].Value == value)
{
SelectedIndex = i;
return;
}
}
if (IsFlags)
{
// Collection of flags
@@ -123,7 +112,7 @@ namespace FlaxEditor.GUI
for (int i = 0; i < _entries.Count; i++)
{
var e = _entries[i].Value;
if (e != 0 && (e & value) == e)
if ((e != 0 || value == 0) && (e & value) == e)
{
selection.Add(i);
}
@@ -132,7 +121,17 @@ namespace FlaxEditor.GUI
}
else
{
SelectedIndex = -1;
// Single value
var toSelect = -1;
for (int i = 0; i < _entries.Count; i++)
{
if (_entries[i].Value == value)
{
toSelect = i;
break;
}
}
SelectedIndex = toSelect;
}
}
}
@@ -295,6 +294,22 @@ namespace FlaxEditor.GUI
button.CloseMenuOnClick = false;
}
/// <inheritdoc />
protected override string GetSelectedText()
{
// If multiple values are selected then try to find an enum item that matches the mask value
if (_selectedIndices.Count > 1)
{
foreach (var e in _entries)
{
if (e.Value == Value)
return e.Name;
}
}
return base.GetSelectedText();
}
/// <inheritdoc />
protected override void OnItemClicked(int index)
{
@@ -310,43 +325,22 @@ namespace FlaxEditor.GUI
}
// Calculate value that will be set after change
long valueAfter = 0;
long valueAfter = Value;
bool isSelected = _selectedIndices.Contains(index);
long selectedValue = entries[index].Value;
for (int i = 0; i < _selectedIndices.Count; i++)
if (isSelected)
{
int selectedIndex = _selectedIndices[i];
if (selectedIndex != index && (isSelected || (entries[selectedIndex].Value & selectedValue) == 0))
valueAfter |= entries[selectedIndex].Value;
// Remove from flags selection
valueAfter &= ~selectedValue;
}
if (!isSelected)
else
{
// Add to flags selection
valueAfter |= selectedValue;
// Skip if value won't change
if (Value == valueAfter)
{
return;
}
// Build new selection
for (int i = 0; i < entries.Count; i++)
{
if (entries[i].Value == valueAfter)
{
SelectedIndex = i;
return;
}
}
_selectedIndices.Clear();
for (int i = 0; i < entries.Count; i++)
{
var e = entries[i].Value;
if (e != 0 && (e & valueAfter) == e)
{
_selectedIndices.Add(i);
}
}
OnSelectedIndexChanged();
// Change value (incl. multiselection for flags)
Value = valueAfter;
return;
}
@@ -589,6 +589,8 @@ namespace FlaxEditor.GUI
// Get the next item
bool controlDown = Root.GetKey(KeyboardKeys.Control);
var items = GetVisibleItems(!controlDown);
if (items.Count == 0)
return true;
var focusedIndex = items.IndexOf(focusedItem);
int delta = key == KeyboardKeys.ArrowDown ? -1 : 1;
+22 -6
View File
@@ -229,6 +229,7 @@ namespace FlaxEditor.GUI.Timeline
private List<Track> _mediaMoveStartTracks;
private byte[][] _mediaMoveStartData;
private float _zoom = 1.0f;
private float _tracksVScrollTarget;
private bool _isMovingPositionHandle;
private bool _canPlayPause = true, _canStop = true;
private List<IUndoAction> _batchedUndoActions;
@@ -1301,10 +1302,13 @@ namespace FlaxEditor.GUI.Timeline
if (track.ParentTrack != null)
OnTracksOrderChanged();
track.OnSpawned();
_tracksPanelArea.ScrollViewTo(track);
MarkAsEdited();
if (withUndo)
Undo?.AddAction(new AddRemoveTrackAction(this, track, true));
// Scroll to track
_tracksPanelArea.ScrollViewTo(track);
_tracksVScrollTarget = _tracksPanelArea.VScrollBar.TargetValue;
}
/// <summary>
@@ -2033,12 +2037,24 @@ namespace FlaxEditor.GUI.Timeline
base.Update(deltaTime);
// Synchronize scroll vertical bars for tracks and media panels to keep the view in sync
var scroll1 = _tracksPanelArea.VScrollBar;
var scroll2 = _backgroundArea.VScrollBar;
if (scroll1.IsThumbClicked || _tracksPanelArea.IsMouseOver)
scroll2.TargetValue = scroll1.Value;
var tracksVScroll = _tracksPanelArea.VScrollBar;
var backgroundVScroll = _backgroundArea.VScrollBar;
bool forceBackgroundToTracksScroll = _tracksVScrollTarget > 0;
if (forceBackgroundToTracksScroll)
{
backgroundVScroll.TargetValue = tracksVScroll.Value;
if (Mathf.Abs(tracksVScroll.Value - _tracksVScrollTarget) < 0.5f)
_tracksVScrollTarget = 0f;
}
else if (tracksVScroll.IsThumbClicked || _tracksPanelArea.IsMouseOver)
{
backgroundVScroll.TargetValue = tracksVScroll.Value;
}
else
scroll1.TargetValue = scroll2.Value;
{
tracksVScroll.TargetValue = backgroundVScroll.Value;
}
// Batch undo actions
if (_batchedUndoActions != null && _batchedUndoActions.Count != 0)
@@ -146,12 +146,12 @@ namespace FlaxEditor.GUI.Timeline.Tracks
/// <summary>
/// The event parameters data sizes collection.
/// </summary>
public int[] EventParamsSizes = Utils.GetEmptyArray<int>();
public int[] EventParamsSizes = Array.Empty<int>();
/// <summary>
/// The event parameters types collection.
/// </summary>
public Type[] EventParamsTypes = Utils.GetEmptyArray<Type>();
public Type[] EventParamsTypes = Array.Empty<Type>();
/// <summary>
/// The event key data.
@@ -380,7 +380,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
}
else
{
EventParamsTypes = Utils.GetEmptyArray<Type>();
EventParamsTypes = Array.Empty<Type>();
}
OnEventParamsChanged();
}
+2 -1
View File
@@ -181,7 +181,7 @@ public class WindowDecorations : ContainerControl
return WindowHitCodes.NoWhere;
var dpiScale = _window.DpiScale;
var pos = _window.ScreenToClient(mouse * dpiScale); // pos is not DPI adjusted
var pos = _window.ScreenToClient(mouse * dpiScale); // pos is DPI adjusted in window space
if (!_window.IsMaximized)
{
var winSize = _window.Size;
@@ -214,6 +214,7 @@ public class WindowDecorations : ContainerControl
return WindowHitCodes.Bottom;
}
pos /= dpiScale; // The position should not be DPI adjusted in control space
var controlUnderMouse = GetChildAt(pos, control => control != _title);
if (_title.Bounds.Contains(pos) && controlUnderMouse == null)
return WindowHitCodes.Caption;
+52 -4
View File
@@ -36,8 +36,10 @@ internal class DirectionGizmo : ContainerControl
private List<AxisData> _axisData = new List<AxisData>();
private int _hoveredAxisIndex = -1;
private bool _mouseDown;
private Float2 _mouseDownLocation;
private SpriteHandle _posHandle;
private SpriteHandle _negHandle;
private FontReference _fontReference;
@@ -110,7 +112,6 @@ internal class DirectionGizmo : ContainerControl
var editor = Editor.Instance;
_posHandle = editor.Icons.VisjectBoxClosed32;
_negHandle = editor.Icons.VisjectBoxOpen32;
_fontReference = new FontReference(Style.Current.FontSmall);
@@ -142,7 +143,25 @@ internal class DirectionGizmo : ContainerControl
public override void OnMouseMove(Float2 location)
{
_hoveredAxisIndex = -1;
if (_mouseDown)
{
StartMouseCapture(true);
Cursor = CursorType.Hidden;
const float sensitivity = 0.125f;
Float2 delta = Input.MousePositionDelta;
delta *= Mathf.DegreesToRadians;
delta *= sensitivity;
const float orbitRadius = 500f;
Quaternion newOrientation = _viewport.ViewOrientation * Quaternion.RotationYawPitchRoll(delta.X , delta.Y, 0f);
Vector3 orbitCenter = _viewport.ViewPosition + _viewport.ViewDirection * orbitRadius;
_viewport.ViewportCamera.SetArcBallView(newOrientation, orbitCenter, orbitRadius);
return;
}
// Check which axis is being hovered - check from closest to farthest for proper layering
for (int i = _spritePositions.Count - 1; i >= 0; i--)
{
@@ -156,9 +175,30 @@ internal class DirectionGizmo : ContainerControl
base.OnMouseMove(location);
}
public override bool OnMouseDown(Float2 location, MouseButton button)
{
_mouseDown = true;
_mouseDownLocation = location;
return true;
}
/// <inheritdoc />
public override bool OnMouseUp(Float2 location, MouseButton button)
{
if (_mouseDown)
{
_mouseDown = false;
if (_mouseDownLocation != location)
{
_mouseDown = false;
EndMouseCapture();
Root.MousePosition = PointToParent(Root, _mouseDownLocation);
Cursor = CursorType.Default;
return true;
}
}
if (base.OnMouseUp(location, button))
return true;
@@ -222,7 +262,10 @@ internal class DirectionGizmo : ContainerControl
else
{
// This could be some actual math expression, not that hack
var fov = _owner.Viewport.FieldOfView / 60.0f;
float fov = _owner.Viewport.FieldOfView;
if (_owner.Viewport.ViewportCamera is Viewport.Cameras.FPSCamera fpsCam)
fov += fpsCam.AdditionalZoomFOV;
fov /= 60.0f;
float scaleAt30 = 0.1f, scaleAt60 = 1.0f, scaleAt120 = 1.5f, scaleAt180 = 3.0f;
heightNormalization /= Mathf.Lerp(scaleAt30, scaleAt60, fov);
heightNormalization /= Mathf.Lerp(scaleAt60, scaleAt120, Mathf.Saturate(fov - 1));
@@ -266,7 +309,12 @@ internal class DirectionGizmo : ContainerControl
// Rebuild sprite positions list for hover detection
_spritePositions.Clear();
Render2D.DrawSprite(_posHandle, new Rectangle(0, 0, Size), Color.Black.AlphaMultiplied(_backgroundOpacity));
if (IsMouseOver)
{
Rectangle backgroundRect = new Rectangle(0, 0, Size);
Color backgroundColor = Color.DarkGray.AlphaMultiplied(_backgroundOpacity);
Render2D.DrawSprite(_posHandle, backgroundRect, backgroundColor);
}
// Draw in order from farthest to closest
for (int i = 0; i < _axisData.Count; i++)
+1 -5
View File
@@ -139,15 +139,11 @@ namespace FlaxEditor.Gizmo
DrawSelectionDepth(context, renderContext.Task, customDepth);
_actors.Clear();
var near = renderContext.View.Near;
var far = renderContext.View.Far;
var projection = renderContext.View.Projection;
// Render outline
_material.SetParameterValue("OutlineColor0", _color0);
_material.SetParameterValue("OutlineColor1", _color1);
_material.SetParameterValue("CustomDepth", customDepth);
_material.SetParameterValue("ViewInfo", new Float4(1.0f / projection.M11, 1.0f / projection.M22, far / (far - near), (-far * near) / (far - near) / far));
_material.SetParameterValue("ViewInfo", renderContext.View.ViewInfo);
Renderer.DrawPostFxMaterial(context, ref renderContext, _material, output, input.View());
// Cleanup
@@ -526,7 +526,7 @@ DEFINE_INTERNAL_CALL(void) EditorInternal_SetAnimationTime(AnimatedModel* animat
animatedModel->GraphInstance.State[0].Animation.TimePosition = time;
}
DEFINE_INTERNAL_CALL(MTypeObject*) CustomEditorsUtilInternal_GetCustomEditor(MTypeObject* targetType)
DEFINE_INTERNAL_CALL(MType*) CustomEditorsUtilInternal_GetCustomEditor(MType* targetType)
{
return CustomEditorsUtil::GetCustomEditor(targetType);
}
+16 -10
View File
@@ -24,7 +24,7 @@ namespace FlaxEditor.Modules
private bool _rebuildInitFlag;
private int _itemsCreated;
private int _itemsDeleted;
private readonly HashSet<MainContentFolderTreeNode> _dirtyNodes = new HashSet<MainContentFolderTreeNode>();
private readonly HashSet<ContentFolderTreeNode> _dirtyNodes = new HashSet<ContentFolderTreeNode>();
/// <summary>
/// The project directory.
@@ -1309,26 +1309,31 @@ namespace FlaxEditor.Modules
internal void OnDirectoryEvent(MainContentFolderTreeNode node, FileSystemEventArgs e)
{
// Ensure to be ready for external events
// Ignore events during fast setup
if (_isDuringFastSetup)
return;
ContentFolderTreeNode dirtyNode = node;
// TODO: maybe we could make it faster! since we have a path so it would be easy to just create or delete given file. but remember about subdirectories
// Filter the node based on modified path
// (eg. if we have event for 'Content/Folder1/Folder2' and node is 'Content/Folder1' then we should process but skip other 'Content' subfolders)
var path = StringUtils.NormalizePath(Path.GetDirectoryName(e.FullPath));
var pathItem = node.Folder.Find(path) as ContentFolder;
if (pathItem != null)
{
dirtyNode = pathItem.Node;
}
// Switch type
switch (e.ChangeType)
{
case WatcherChangeTypes.Created:
case WatcherChangeTypes.Deleted:
case WatcherChangeTypes.Renamed:
{
lock (_dirtyNodes)
{
_dirtyNodes.Add(node);
_dirtyNodes.Add(dirtyNode);
}
break;
}
}
}
private void OnScriptsReload()
@@ -1383,14 +1388,15 @@ namespace FlaxEditor.Modules
// Update all dirty content tree nodes
lock (_dirtyNodes)
{
Profiler.BeginEvent("ContentDatabase.Refresh");
foreach (var node in _dirtyNodes)
{
LoadFolder(node, true);
if (_enableEvents)
WorkspaceModified?.Invoke();
}
if (_enableEvents && _dirtyNodes.Count != 0)
WorkspaceModified?.Invoke();
_dirtyNodes.Clear();
Profiler.EndEvent();
}
// Lazy-rebuilds
@@ -381,9 +381,6 @@ namespace FlaxEditor.Modules
Thread.Sleep(0);
_workerThread.Join(1000);
#if !USE_NETCORE
_workerThread.Abort(); // Deprecated in .NET 7
#endif
_workerThread = null;
}
@@ -2,12 +2,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using FlaxEditor.Scripting;
using FlaxEngine;
@@ -21,7 +17,6 @@ namespace FlaxEditor.Modules.SourceCodeEditing
{
private Dictionary<ScriptType, string> _typeCache = new Dictionary<ScriptType, string>();
private Dictionary<ScriptMemberInfo, string> _memberCache = new Dictionary<ScriptMemberInfo, string>();
private Dictionary<Assembly, Dictionary<string, string>> _xmlCache = new Dictionary<Assembly, Dictionary<string, string>>();
internal CodeDocsModule(Editor editor)
: base(editor)
@@ -61,13 +56,9 @@ namespace FlaxEditor.Modules.SourceCodeEditing
else if (type.Type != null)
{
// Try to use xml docs for managed type
var xml = GetXmlDocs(type.Type.Assembly);
if (xml != null)
{
var key = "T:" + GetXmlKey(type.Type.FullName);
if (xml.TryGetValue(key, out var xmlDoc))
text += '\n' + FilterWhitespaces(xmlDoc);
}
var xmlDoc = DebugCommands.GetXml(type.Type);
if (xmlDoc != null)
text += '\n' + xmlDoc;
}
_typeCache.Add(type, text);
@@ -108,242 +99,20 @@ namespace FlaxEditor.Modules.SourceCodeEditing
else if (member.Type != null)
{
// Try to use xml docs for managed member
var memberInfo = member.Type;
var xml = GetXmlDocs(memberInfo.DeclaringType.Assembly);
if (xml != null)
{
// [Reference: MSDN Magazine, October 2019, Volume 34 Number 10, "Accessing XML Documentation via Reflection"]
// https://docs.microsoft.com/en-us/archive/msdn-magazine/2019/october/csharp-accessing-xml-documentation-via-reflection
var memberType = memberInfo.MemberType;
string key = null;
if (memberType.HasFlag(MemberTypes.Field))
{
var fieldInfo = (FieldInfo)memberInfo;
key = "F:" + GetXmlKey(fieldInfo.DeclaringType.FullName) + "." + fieldInfo.Name;
}
else if (memberType.HasFlag(MemberTypes.Property))
{
var propertyInfo = (PropertyInfo)memberInfo;
key = "P:" + GetXmlKey(propertyInfo.DeclaringType.FullName) + "." + propertyInfo.Name;
}
else if (memberType.HasFlag(MemberTypes.Event))
{
var eventInfo = (EventInfo)memberInfo;
key = "E:" + GetXmlKey(eventInfo.DeclaringType.FullName) + "." + eventInfo.Name;
}
else if (memberType.HasFlag(MemberTypes.Constructor))
{
var constructorInfo = (ConstructorInfo)memberInfo;
key = GetXmlKey(constructorInfo);
}
else if (memberType.HasFlag(MemberTypes.Method))
{
var methodInfo = (MethodInfo)memberInfo;
key = GetXmlKey(methodInfo);
}
else if (memberType.HasFlag(MemberTypes.TypeInfo) || memberType.HasFlag(MemberTypes.NestedType))
{
var typeInfo = (TypeInfo)memberInfo;
key = "T:" + GetXmlKey(typeInfo.FullName);
}
if (key != null)
xml.TryGetValue(key, out text);
// Customize tooltips for properties to be more human-readable in UI
if (text != null && memberType.HasFlag(MemberTypes.Property) && text.StartsWith("Gets or sets ", StringComparison.Ordinal))
{
text = text.Substring(13);
unsafe
{
fixed (char* e = text)
e[0] = char.ToUpper(e[0]);
}
}
}
var xmlDoc = DebugCommands.GetXml(member.Type);
if (xmlDoc != null)
text = xmlDoc;
}
_memberCache.Add(member, text);
return text;
}
// [Reference: MSDN Magazine, October 2019, Volume 34 Number 10, "Accessing XML Documentation via Reflection"]
// https://docs.microsoft.com/en-us/archive/msdn-magazine/2019/october/csharp-accessing-xml-documentation-via-reflection
private string GetXmlKey(MethodInfo methodInfo)
{
var typeGenericMap = new Dictionary<string, int>();
var methodGenericMap = new Dictionary<string, int>();
ParameterInfo[] parameterInfos = methodInfo.GetParameters();
if (methodInfo.DeclaringType.IsGenericType)
{
var methods = methodInfo.DeclaringType.GetGenericTypeDefinition().GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);
methodInfo = methods.First(x => x.MetadataToken == methodInfo.MetadataToken);
}
Type[] typeGenericArguments = methodInfo.DeclaringType.GetGenericArguments();
for (int i = 0; i < typeGenericArguments.Length; i++)
{
Type typeGeneric = typeGenericArguments[i];
typeGenericMap[typeGeneric.Name] = i;
}
Type[] methodGenericArguments = methodInfo.GetGenericArguments();
for (int i = 0; i < methodGenericArguments.Length; i++)
{
Type methodGeneric = methodGenericArguments[i];
methodGenericMap[methodGeneric.Name] = i;
}
string declarationTypeString = GetXmlKey(methodInfo.DeclaringType, false, typeGenericMap, methodGenericMap);
string memberNameString = methodInfo.Name;
string methodGenericArgumentsString = methodGenericMap.Count > 0 ? "``" + methodGenericMap.Count : string.Empty;
string parametersString = parameterInfos.Length > 0 ? "(" + string.Join(",", methodInfo.GetParameters().Select(x => GetXmlKey(x.ParameterType, true, typeGenericMap, methodGenericMap))) + ")" : string.Empty;
string key = "M:" + declarationTypeString + "." + memberNameString + methodGenericArgumentsString + parametersString;
if (methodInfo.Name is "op_Implicit" || methodInfo.Name is "op_Explicit")
{
key += "~" + GetXmlKey(methodInfo.ReturnType, true, typeGenericMap, methodGenericMap);
}
return key;
}
private string GetXmlKey(ConstructorInfo constructorInfo)
{
var typeGenericMap = new Dictionary<string, int>();
var methodGenericMap = new Dictionary<string, int>();
ParameterInfo[] parameterInfos = constructorInfo.GetParameters();
Type[] typeGenericArguments = constructorInfo.DeclaringType.GetGenericArguments();
for (int i = 0; i < typeGenericArguments.Length; i++)
{
Type typeGeneric = typeGenericArguments[i];
typeGenericMap[typeGeneric.Name] = i;
}
string declarationTypeString = GetXmlKey(constructorInfo.DeclaringType, false, typeGenericMap, methodGenericMap);
string methodGenericArgumentsString = methodGenericMap.Count > 0 ? "``" + methodGenericMap.Count : string.Empty;
string parametersString = parameterInfos.Length > 0 ? "(" + string.Join(",", constructorInfo.GetParameters().Select(x => GetXmlKey(x.ParameterType, true, typeGenericMap, methodGenericMap))) + ")" : string.Empty;
return "M:" + declarationTypeString + "." + "#ctor" + methodGenericArgumentsString + parametersString;
}
internal static string GetXmlKey(Type type, bool isMethodParameter, Dictionary<string, int> typeGenericMap, Dictionary<string, int> methodGenericMap)
{
if (type.IsGenericParameter)
{
if (methodGenericMap.TryGetValue(type.Name, out var methodIndex))
return "``" + methodIndex;
if (typeGenericMap.TryGetValue(type.Name, out var typeKey))
return "`" + typeKey;
return "`";
}
if (type.HasElementType)
{
string elementTypeString = GetXmlKey(type.GetElementType(), isMethodParameter, typeGenericMap, methodGenericMap);
if (type.IsPointer)
return elementTypeString + "*";
if (type.IsByRef)
return elementTypeString + "@";
if (type.IsArray)
{
int rank = type.GetArrayRank();
string arrayDimensionsString = rank > 1 ? "[" + string.Join(",", Enumerable.Repeat("0:", rank)) + "]" : "[]";
return elementTypeString + arrayDimensionsString;
}
throw new Exception();
}
string prefaceString = type.IsNested ? GetXmlKey(type.DeclaringType, isMethodParameter, typeGenericMap, methodGenericMap) + "." : type.Namespace + ".";
string typeNameString = isMethodParameter ? Regex.Replace(type.Name, @"`\d+", string.Empty) : type.Name;
string genericArgumentsString = type.IsGenericType && isMethodParameter ? "{" + string.Join(",", type.GetGenericArguments().Select(argument => GetXmlKey(argument, true, typeGenericMap, methodGenericMap))) + "}" : string.Empty;
return prefaceString + typeNameString + genericArgumentsString;
}
private static string GetXmlKey(string typeFullNameString)
{
return Regex.Replace(typeFullNameString, @"\[.*\]", string.Empty).Replace('+', '.');
}
private static string FilterWhitespaces(string str)
{
if (str.Contains(" ", StringComparison.Ordinal))
{
var sb = new StringBuilder();
var prev = str[0];
sb.Append(prev);
for (int i = 1; i < str.Length; i++)
{
var c = str[i];
if (prev != ' ' || c != ' ')
{
sb.Append(c);
}
prev = c;
}
str = sb.ToString();
}
return str;
}
private Dictionary<string, string> GetXmlDocs(Assembly assembly)
{
if (!_xmlCache.TryGetValue(assembly, out var result))
{
Profiler.BeginEvent("GetXmlDocs");
var assemblyPath = Utils.GetAssemblyLocation(assembly);
var assemblyName = assembly.GetName().Name;
var xmlFilePath = Path.ChangeExtension(assemblyPath, ".xml");
if (!File.Exists(assemblyPath) && !string.IsNullOrEmpty(assemblyPath))
{
var uri = new UriBuilder(assemblyPath);
var path = Uri.UnescapeDataString(uri.Path);
xmlFilePath = Path.Combine(Path.GetDirectoryName(path), assemblyName + ".xml");
}
if (File.Exists(xmlFilePath))
{
Profiler.BeginEvent(assemblyName);
try
{
// Parse xml documentation
using (var xmlReader = XmlReader.Create(new StreamReader(xmlFilePath)))
{
result = new Dictionary<string, string>();
while (xmlReader.Read())
{
if (xmlReader.NodeType == XmlNodeType.Element && string.Equals(xmlReader.Name, "member", StringComparison.Ordinal))
{
string rawName = xmlReader["name"];
var memberReader = xmlReader.ReadSubtree();
if (memberReader.ReadToDescendant("summary"))
{
// Remove <see cref=""/> and replace them with the captured group (the content of the cref). Additionally, getting rid of prefixes
const string crefPattern = @"<see\s+cref=""(?:[A-Z]:FlaxEngine\.)?([^""]+)""\s*\/>";
result[rawName] = Regex.Replace(memberReader.ReadInnerXml(), crefPattern, "$1").Replace('\n', ' ').Trim();
}
}
}
}
}
catch
{
// Ignore errors
}
Profiler.EndEvent();
}
_xmlCache[assembly] = result;
Profiler.EndEvent();
}
return result;
}
private void OnTypesCleared()
{
_typeCache.Clear();
_memberCache.Clear();
_xmlCache.Clear();
DebugCommands.ClearXml();
}
/// <inheritdoc />
@@ -584,7 +584,6 @@ namespace FlaxEditor.Modules.SourceCodeEditing
var codeBase = Utils.GetAssemblyLocation(assembly);
if (string.IsNullOrEmpty(codeBase))
return true;
#if USE_NETCORE
if (assembly.ManifestModule.FullyQualifiedName == "<In Memory Module>")
return false;
@@ -592,11 +591,6 @@ namespace FlaxEditor.Modules.SourceCodeEditing
string repositoryUrl = assembly.GetCustomAttributes<AssemblyMetadataAttribute>().FirstOrDefault(x => x.Key == "RepositoryUrl")?.Value ?? "";
if (repositoryUrl != "https://github.com/dotnet/runtime")
return true;
#else
// Skip assemblies from in-build Mono directory
if (!codeBase.Contains("/Mono/lib/mono/"))
return true;
#endif
return false;
}
+2
View File
@@ -465,6 +465,8 @@ namespace FlaxEditor.Modules
internal void ProgressFailed(string message)
{
if (StatusBar == null)
return;
_progressFailed = true;
StatusBar.StatusColor = Style.Current.Statusbar.Failed;
StatusBar.Text = message;
+8
View File
@@ -347,6 +347,14 @@ namespace FlaxEditor.Options
[EditorDisplay("Viewport"), EditorOrder(1550)]
public InputBinding Down = new InputBinding(KeyboardKeys.Q);
[DefaultValue(typeof(InputBinding), "C")]
[EditorDisplay("Viewport"), EditorOrder(1551)]
public InputBinding ZoomIn = new InputBinding(KeyboardKeys.C);
[DefaultValue(typeof(InputBinding), "Z")]
[EditorDisplay("Viewport"), EditorOrder(1552)]
public InputBinding ZoomOut = new InputBinding(KeyboardKeys.Z);
[DefaultValue(typeof(InputBinding), "None")]
[EditorDisplay("Viewport", "Toggle Camera Rotation"), EditorOrder(1560)]
public InputBinding CameraToggleRotation = new InputBinding(KeyboardKeys.None);
+1 -1
View File
@@ -187,7 +187,7 @@ namespace FlaxEditor.Options
public float DirectionGizmoScale { get; set; } = 1f;
/// <summary>
/// Gets or sets a value for the opacity of the main viewports <see cref="Gizmo.DirectionGizmo"/> background.
/// Gets or sets a value for the opacity of the main viewports <see cref="Gizmo.DirectionGizmo"/> background. Background will only show when the gizmo is hovered.
/// </summary>
[DefaultValue(0.1f), Limit(0.0f, 1.0f)]
[EditorDisplay("Direction Gizmo"), EditorOrder(502), Tooltip("The background opacity of the of the direction gizmo in the main viewport.")]
@@ -14,6 +14,9 @@
#if PLATFORM_WINDOWS
#include "Engine/Platform/Win32/IncludeWindowsHeaders.h"
#elif PLATFORM_MAC
#include "Engine/Platform/Apple/AppleUtils.h"
#include <AppKit/AppKit.h>
#endif
namespace
@@ -68,10 +71,14 @@ namespace
if (!launcherPath.HasChars() || !FileSystem::FileExists(exePath))
return;
if (launchOverridePath != String::Empty)
installations->Add(New<RiderInstallation>(launchOverridePath, versionMember->value.GetText()));
else
installations->Add(New<RiderInstallation>(exePath, versionMember->value.GetText()));
String installPath = launchOverridePath != String::Empty ? launchOverridePath : exePath;
StringUtils::PathRemoveRelativeParts(installPath);
for (RiderInstallation* installation : *installations)
{
if (installation->path == installPath)
return;
}
installations->Add(New<RiderInstallation>(installPath, versionMember->value.GetText()));
}
#if PLATFORM_WINDOWS
@@ -221,17 +228,29 @@ void RiderCodeEditor::FindEditors(Array<CodeEditor*>* output)
String applicationSupportFolder;
FileSystem::GetSpecialFolderPath(SpecialFolder::ProgramData, applicationSupportFolder);
NSURL* appURL = [[NSWorkspace sharedWorkspace] URLForApplicationWithBundleIdentifier:@"com.jetbrains.rider"];
if (appURL != nullptr)
{
const String appPath = AppleUtils::ToString((CFStringRef)[appURL path]);
SearchDirectory(&installations, appPath / TEXT("Contents/Resources"), appPath);
}
Array<String> subMacDirectories;
FileSystem::GetChildDirectories(subMacDirectories, applicationSupportFolder / TEXT("JetBrains/Toolbox/apps/Rider/ch-0/"));
FileSystem::GetChildDirectories(subMacDirectories, applicationSupportFolder / TEXT("JetBrains/Toolbox/apps/Rider/ch-1/"));
for (const String& directory : subMacDirectories)
{
String riderAppDirectory = directory / TEXT("Rider.app/Contents/Resources");
SearchDirectory(&installations, riderAppDirectory);
String riderAppPath = directory / TEXT("Rider.app");
SearchDirectory(&installations, riderAppPath / TEXT("Contents/Resources"), riderAppPath);
}
// Check the local installer version
SearchDirectory(&installations, TEXT("/Applications/Rider.app/Contents/Resources"));
SearchDirectory(&installations, TEXT("/Applications/Rider.app/Contents/Resources"), TEXT("/Applications/Rider.app"));
String userFolder;
FileSystem::GetSpecialFolderPath(SpecialFolder::Documents, userFolder);
String riderAppPath = userFolder / TEXT("../Applications/Rider.app");
SearchDirectory(&installations, riderAppPath / TEXT("Contents/Resources"), riderAppPath);
#endif
for (const String& directory : subDirectories)
@@ -259,7 +278,7 @@ String RiderCodeEditor::GetName() const
String RiderCodeEditor::GetGenerateProjectCustomArgs() const
{
return TEXT("-vs2022");
return TEXT("-vs2026");
}
void RiderCodeEditor::OpenFile(const String& path, int32 line)
@@ -130,7 +130,7 @@ String VisualStudioCodeEditor::GetName() const
String VisualStudioCodeEditor::GetGenerateProjectCustomArgs() const
{
return TEXT("-vs2022 -vscode");
return TEXT("-vs2026 -vscode");
}
void VisualStudioCodeEditor::OpenFile(const String& path, int32 line)
@@ -138,7 +138,7 @@ void VisualStudioCodeEditor::OpenFile(const String& path, int32 line)
// Generate VS solution files for intellisense
if (!FileSystem::FileExists(Globals::ProjectFolder / Editor::Project->Name + TEXT(".sln")))
{
ScriptsBuilder::GenerateProject(TEXT("-vs2022"));
ScriptsBuilder::GenerateProject(TEXT("-vs2026"));
}
// Generate project files if missing
@@ -165,7 +165,7 @@ void VisualStudioCodeEditor::OpenSolution()
// Generate VS solution files for intellisense
if (!FileSystem::FileExists(Globals::ProjectFolder / Editor::Project->Name + TEXT(".sln")))
{
ScriptsBuilder::GenerateProject(TEXT("-vs2022"));
ScriptsBuilder::GenerateProject(TEXT("-vs2026"));
}
// Generate project files if solution is missing
+6 -6
View File
@@ -112,37 +112,37 @@ namespace FlaxEditor.Scripting
/// <inheritdoc />
public object[] GetAttributes(bool inherit)
{
return Utils.GetEmptyArray<object>();
return Array.Empty<object>();
}
/// <inheritdoc />
public ScriptMemberInfo[] GetMembers(string name, MemberTypes type, BindingFlags bindingAttr)
{
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <inheritdoc />
public ScriptMemberInfo[] GetMembers(BindingFlags bindingAttr)
{
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <inheritdoc />
public ScriptMemberInfo[] GetFields(BindingFlags bindingAttr)
{
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <inheritdoc />
public ScriptMemberInfo[] GetProperties(BindingFlags bindingAttr)
{
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <inheritdoc />
public ScriptMemberInfo[] GetMethods(BindingFlags bindingAttr)
{
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <inheritdoc />
+12 -12
View File
@@ -447,7 +447,7 @@ namespace FlaxEditor.Scripting
{
var parameters = methodInfo.GetParameters();
if (parameters.Length == 0)
return Utils.GetEmptyArray<Parameter>();
return Array.Empty<Parameter>();
var result = new Parameter[parameters.Length];
for (int i = 0; i < result.Length; i++)
{
@@ -593,7 +593,7 @@ namespace FlaxEditor.Scripting
}
if (_custom != null)
return _custom.GetAttributes(inherit);
return Utils.GetEmptyArray<object>();
return Array.Empty<object>();
}
/// <summary>
@@ -1116,7 +1116,7 @@ namespace FlaxEditor.Scripting
return _managed.GetCustomAttributes(inherit);
if (_custom != null)
return _custom.GetAttributes(inherit);
return Utils.GetEmptyArray<object>();
return Array.Empty<object>();
}
/// <summary>
@@ -1191,12 +1191,12 @@ namespace FlaxEditor.Scripting
if (_managed != null)
{
managedMembers = _managed.GetMember(name, type, bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
managedMembers = null;
if (_custom != null)
return _custom.GetMembers(name, type, bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
@@ -1218,7 +1218,7 @@ namespace FlaxEditor.Scripting
}
if (_custom != null)
return _custom.GetMembers(name, type, bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
@@ -1282,12 +1282,12 @@ namespace FlaxEditor.Scripting
if (_managed != null)
{
managedMembers = _managed.GetMembers(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
managedMembers = null;
if (_custom != null)
return _custom.GetMembers(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
@@ -1307,7 +1307,7 @@ namespace FlaxEditor.Scripting
}
if (_custom != null)
return _custom.GetMembers(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
@@ -1327,7 +1327,7 @@ namespace FlaxEditor.Scripting
}
if (_custom != null)
return _custom.GetFields(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
@@ -1365,7 +1365,7 @@ namespace FlaxEditor.Scripting
}
if (_custom != null)
return _custom.GetProperties(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
@@ -1403,7 +1403,7 @@ namespace FlaxEditor.Scripting
}
if (_custom != null)
return _custom.GetMethods(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
+3 -15
View File
@@ -141,10 +141,10 @@ int32 ScriptsBuilder::GetCompilationsCount()
String ScriptsBuilder::GetBuildToolPath()
{
#if USE_NETCORE && (PLATFORM_LINUX || PLATFORM_MAC)
return Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build");
#else
#if PLATFORM_WINDOWS_FAMILY
return Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build.exe");
#else
return Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build");
#endif
}
@@ -244,18 +244,6 @@ bool ScriptsBuilder::RunBuildTool(const StringView& args, const StringView& work
// Prepare build options
StringBuilder cmdLine(args.Length() + buildToolPath.Length() + 200);
#if !USE_NETCORE && (PLATFORM_LINUX || PLATFORM_MAC)
const String monoPath = Globals::MonoPath / TEXT("bin/mono");
if (!FileSystem::FileExists(monoPath))
{
Log::FileNotFoundException(monoPath).SetLevel(LogType::Fatal);
return true;
}
const String monoPath = TEXT("mono");
cmdLine.Append(monoPath);
cmdLine.Append(TEXT(" "));
// TODO: Set env var for the mono MONO_GC_PARAMS=nursery-size64m to boost build performance -> profile it
#endif
cmdLine.Append(buildToolPath);
// Call build tool
+3 -3
View File
@@ -39,8 +39,8 @@ namespace FlaxEditor.Surface
DefaultValues = new object[]
{
"State",
Utils.GetEmptyArray<byte>(),
Utils.GetEmptyArray<byte>(),
Array.Empty<byte>(),
Array.Empty<byte>(),
},
Size = new Float2(100, 0),
},
@@ -54,7 +54,7 @@ namespace FlaxEditor.Surface
Size = new Float2(100, 0),
DefaultValues = new object[]
{
Utils.GetEmptyArray<byte>(),
Array.Empty<byte>(),
},
},
}
@@ -875,7 +875,7 @@ namespace FlaxEditor.Surface.Archetypes
byte[] value;
if (Transitions.Count == 0)
{
value = Utils.GetEmptyArray<byte>();
value = Array.Empty<byte>();
}
else
{
@@ -1807,7 +1807,7 @@ namespace FlaxEditor.Surface.Archetypes
get => _ruleGraph;
set
{
_ruleGraph = value ?? Utils.GetEmptyArray<byte>();
_ruleGraph = value ?? Array.Empty<byte>();
SourceState.SaveTransitions();
}
}
@@ -1849,7 +1849,7 @@ namespace FlaxEditor.Surface.Archetypes
DestinationState = destination;
_data = data;
_data.Destination = destination.ID;
_ruleGraph = ruleGraph ?? Utils.GetEmptyArray<byte>();
_ruleGraph = ruleGraph ?? Array.Empty<byte>();
}
/// <summary>
@@ -784,7 +784,7 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
"Locomotion",
Utils.GetEmptyArray<byte>(),
Array.Empty<byte>(),
3,
true,
true,
@@ -818,8 +818,8 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
"State",
Utils.GetEmptyArray<byte>(),
Utils.GetEmptyArray<byte>(),
Array.Empty<byte>(),
Array.Empty<byte>(),
},
},
new NodeArchetype
@@ -1089,7 +1089,7 @@ namespace FlaxEditor.Surface.Archetypes
Size = new Float2(100, 0),
DefaultValues = new object[]
{
Utils.GetEmptyArray<byte>(),
Array.Empty<byte>(),
},
},
new NodeArchetype
@@ -445,7 +445,7 @@ namespace FlaxEditor.Surface.Archetypes
var decorator = Context.SpawnNode(19, 3, Location, new object[]
{
nodeType.TypeName,
Utils.GetEmptyArray<byte>(),
Array.Empty<byte>(),
});
// Add decorator to the node
@@ -646,7 +646,7 @@ namespace FlaxEditor.Surface.Archetypes
return new[] { uint.Parse(id[0]) };
}
}
return Utils.GetEmptyArray<uint>();
return Array.Empty<uint>();
}
}
@@ -949,7 +949,7 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
string.Empty, // Type Name
Utils.GetEmptyArray<byte>(), // Instance Data
Array.Empty<byte>(), // Instance Data
null, // List of Decorator Nodes IDs
},
Size = new Float2(100, 0),
@@ -967,7 +967,7 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
typeof(BehaviorTreeRootNode).FullName, // Root node
Utils.GetEmptyArray<byte>(), // Instance Data
Array.Empty<byte>(), // Instance Data
},
Size = new Float2(100, 0),
Elements = new[]
@@ -984,7 +984,7 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
string.Empty, // Type Name
Utils.GetEmptyArray<byte>(), // Instance Data
Array.Empty<byte>(), // Instance Data
},
Size = new Float2(100, 0),
},
@@ -1,5 +1,6 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
using FlaxEditor.GUI;
using FlaxEditor.Scripting;
@@ -84,7 +85,7 @@ namespace FlaxEditor.Surface.Archetypes
const int firstBox = 2;
const int maxBoxes = 40;
bool isInvalid = false;
var data = Utils.GetEmptyArray<byte>();
var data = Array.Empty<byte>();
if (valueBox.HasAnyConnection)
{
@@ -216,7 +217,7 @@ namespace FlaxEditor.Surface.Archetypes
Description = "Returns one of the input values based on the enum value",
Flags = NodeFlags.VisualScriptGraph | NodeFlags.AnimGraph,
Size = new Float2(160, 60),
DefaultValues = new object[] { Utils.GetEmptyArray<byte>() },
DefaultValues = new object[] { Array.Empty<byte>() },
ConnectionsHints = ConnectionsHint.Enum,
Elements = new[]
{
+3 -2
View File
@@ -1,5 +1,6 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
using FlaxEditor.GUI;
using FlaxEditor.Scripting;
@@ -140,7 +141,7 @@ namespace FlaxEditor.Surface.Archetypes
const int firstBox = 2;
const int maxBoxes = 40;
bool isInvalid = false;
var data = Utils.GetEmptyArray<byte>();
var data = Array.Empty<byte>();
if (valueBox.HasAnyConnection)
{
@@ -285,7 +286,7 @@ namespace FlaxEditor.Surface.Archetypes
Description = "Performs the flow logic branch based on the enum value",
Flags = NodeFlags.VisualScriptGraph,
Size = new Float2(160, 60),
DefaultValues = new object[] { Utils.GetEmptyArray<byte>() },
DefaultValues = new object[] { Array.Empty<byte>() },
ConnectionsHints = ConnectionsHint.Enum,
Elements = new[]
{
+7 -7
View File
@@ -574,7 +574,7 @@ namespace FlaxEditor.Surface.Archetypes
if (_parameters.Length == 0 && methodInfo.ValueType.IsVoid)
{
// Skip allocations if method is void and parameter-less
Values[2] = Utils.GetEmptyArray<byte>();
Values[2] = Array.Empty<byte>();
}
else
{
@@ -714,7 +714,7 @@ namespace FlaxEditor.Surface.Archetypes
method.Name, // Method name
parametersCount, // Method parameters count
false, // Is Pure?
Utils.GetEmptyArray<byte>(), // Cached function signature data
Array.Empty<byte>(), // Cached function signature data
// Default value for parameters (27 entries)
// @formatter:off
null,null,null,null,null,null,null,null,null,null,
@@ -810,7 +810,7 @@ namespace FlaxEditor.Surface.Archetypes
signature.IsStatic = reader.ReadBoolean(); // Is Static
signature.ReturnType = VariantUtils.ReadVariantScriptType(reader); // Return type
var parametersCount = reader.ReadInt32(); // Parameters count
signature.Params = parametersCount != 0 ? new SignatureParamInfo[parametersCount] : Utils.GetEmptyArray<SignatureParamInfo>();
signature.Params = parametersCount != 0 ? new SignatureParamInfo[parametersCount] : Array.Empty<SignatureParamInfo>();
for (int i = 0; i < parametersCount; i++)
{
ref var param = ref signature.Params[i];
@@ -831,7 +831,7 @@ namespace FlaxEditor.Surface.Archetypes
signature.IsStatic = reader.ReadBoolean(); // Is Static
signature.ReturnType = VariantUtils.ReadVariantScriptType(reader); // Return type
var parametersCount = reader.ReadInt32(); // Parameters count
signature.Params = parametersCount != 0 ? new SignatureParamInfo[parametersCount] : Utils.GetEmptyArray<SignatureParamInfo>();
signature.Params = parametersCount != 0 ? new SignatureParamInfo[parametersCount] : Array.Empty<SignatureParamInfo>();
for (int i = 0; i < parametersCount; i++)
{
ref var param = ref signature.Params[i];
@@ -2489,7 +2489,7 @@ namespace FlaxEditor.Surface.Archetypes
{
string.Empty, // Overriden method name
0, // Overriden method parameters count
Utils.GetEmptyArray<byte>(), // Cached function signature data
Array.Empty<byte>(), // Cached function signature data
},
},
new NodeArchetype
@@ -2507,7 +2507,7 @@ namespace FlaxEditor.Surface.Archetypes
string.Empty, // Method name
0, // Method parameters count
false, // Is Pure?
Utils.GetEmptyArray<byte>(), // Cached function signature data
Array.Empty<byte>(), // Cached function signature data
// Default value for parameters (27 entries)
// @formatter:off
@@ -2546,7 +2546,7 @@ namespace FlaxEditor.Surface.Archetypes
Size = new Float2(240, 20),
DefaultValues = new object[]
{
Utils.GetEmptyArray<byte>(), // Function signature data
Array.Empty<byte>(), // Function signature data
},
},
new NodeArchetype
+2 -2
View File
@@ -807,8 +807,8 @@ namespace FlaxEditor.Surface.Archetypes
},
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "A", true, null, 0),
NodeElementArchetype.Factory.Input(1, "B", true, null, 1),
NodeElementArchetype.Factory.Input(0, "UV", true, null, 0),
NodeElementArchetype.Factory.Input(1, "Center", true, null, 1),
NodeElementArchetype.Factory.Input(2, "Radius", true, typeof(float), 2, 0),
NodeElementArchetype.Factory.Input(3, "Hardness", true, typeof(float), 3, 1),
NodeElementArchetype.Factory.Input(4, "Invert", true, typeof(bool), 4, 2),
+3 -3
View File
@@ -156,7 +156,7 @@ namespace FlaxEditor.Surface.Archetypes
if (fieldsLength == 0)
{
// Skip allocations if structure is empty
Values[1] = Utils.GetEmptyArray<byte>();
Values[1] = Array.Empty<byte>();
}
else
{
@@ -471,7 +471,7 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
string.Empty, // Typename
Utils.GetEmptyArray<byte>(), // Cached structure layout data
Array.Empty<byte>(), // Cached structure layout data
},
Elements = new[]
{
@@ -591,7 +591,7 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
string.Empty, // Typename
Utils.GetEmptyArray<byte>(), // Cached structure layout data
Array.Empty<byte>(), // Cached structure layout data
},
Elements = new[]
{
+2 -2
View File
@@ -56,8 +56,8 @@ namespace FlaxEditor.Surface
private object Creator(Type type)
{
var ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, null, Utils.GetEmptyArray<Type>(), null);
return ctor.Invoke(Utils.GetEmptyArray<object>());
var ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, null, Array.Empty<Type>(), null);
return ctor.Invoke(Array.Empty<object>());
}
}
+1 -1
View File
@@ -1484,7 +1484,7 @@ namespace FlaxEditor.Surface.Elements
protected override void OnAttributesChanged()
{
OnCurrentTypeChanged();
_editor?.UpdateAttributes(this, _attributes ?? Utils.GetEmptyArray<object>(), _defaultValueEditor);
_editor?.UpdateAttributes(this, _attributes ?? Array.Empty<object>(), _defaultValueEditor);
}
/// <inheritdoc />
+2 -2
View File
@@ -91,7 +91,7 @@ namespace FlaxEditor.Surface
}
}
}
return Utils.GetEmptyArray<Attribute>();
return Array.Empty<Attribute>();
}
/// <summary>
@@ -106,7 +106,7 @@ namespace FlaxEditor.Surface
var json = FlaxEngine.Json.JsonSerializer.Serialize(attributes);
return Encoding.Unicode.GetBytes(json);
}
return Utils.GetEmptyArray<byte>();
return Array.Empty<byte>();
}
/// <summary>
+1 -1
View File
@@ -237,7 +237,7 @@ namespace FlaxEditor.Surface
surfaceParameters.Remove(surfaceParameter);
surfaceParameters.Add(surfaceParameter);
}
var attributes = surfaceParameter?.Meta.GetAttributes() ?? FlaxEngine.Utils.GetEmptyArray<Attribute>();
var attributes = surfaceParameter?.Meta.GetAttributes() ?? Array.Empty<Attribute>();
data[i] = new GraphParameterData(null, index++, parameter.Name, parameter.IsPublic, ToType(parameter.ParameterType), attributes, parameter);
i++;
}
@@ -17,7 +17,7 @@ namespace FlaxEditor.Tools.Foliage
private int _selectedInstanceIndex = -1;
/// <summary>
/// The foliage painting gizmo.
/// The foliage editing gizmo.
/// </summary>
public EditFoliageGizmo Gizmo;
@@ -66,8 +66,6 @@ namespace FlaxEditor.Tools.Foliage
base.Init(owner);
Gizmo = new EditFoliageGizmo(owner, this);
SelectionOutline = FlaxEngine.Object.New<EditFoliageSelectionOutline>();
SelectionOutline.GizmoMode = this;
}
/// <inheritdoc />
@@ -84,6 +82,11 @@ namespace FlaxEditor.Tools.Foliage
base.OnActivated();
Owner.Gizmos.Active = Gizmo;
if (SelectionOutline == null)
{
SelectionOutline = FlaxEngine.Object.New<EditFoliageSelectionOutline>();
SelectionOutline.GizmoMode = this;
}
((MainEditorGizmoViewport)Owner).OverrideSelectionOutline(SelectionOutline);
SelectedInstanceIndex = -1;
}
@@ -6,7 +6,7 @@ using FlaxEngine;
namespace FlaxEditor.Tools.Foliage
{
/// <summary>
/// The custom outline for drawing the selected foliage instances outlines.
/// The custom outline for drawing the selected foliage instance.
/// </summary>
/// <seealso cref="FlaxEditor.Gizmo.SelectionOutline" />
[HideInEditor]
+2 -3
View File
@@ -5,7 +5,6 @@ using System.Collections.Generic;
using FlaxEditor.GUI.Tabs;
using FlaxEditor.Modules;
using FlaxEditor.SceneGraph.Actors;
using FlaxEditor.Viewport.Modes;
using FlaxEngine;
using FlaxEngine.GUI;
@@ -214,7 +213,7 @@ namespace FlaxEditor.Tools.Foliage
private void InitSculptMode()
{
var tab = _modes.AddTab(FoliageTypes = new FoliageTypesTab(this));
var tab = _modes.AddTab(FoliageTypes = new FoliageTypesTab(this, Editor.Windows.EditWin.Viewport.EditFoliageTypesGizmo));
tab.Selected += OnTabSelected;
}
@@ -251,7 +250,7 @@ namespace FlaxEditor.Tools.Foliage
switch (_modes.SelectedTabIndex)
{
case 0:
Editor.Windows.EditWin.Viewport.Gizmos.SetActiveMode<NoGizmoMode>();
Editor.Windows.EditWin.Viewport.Gizmos.SetActiveMode<FoliageTypesGizmoMode>();
break;
case 1:
Editor.Windows.EditWin.Viewport.Gizmos.SetActiveMode<PaintFoliageGizmoMode>();
@@ -0,0 +1,44 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using FlaxEditor.Gizmo;
namespace FlaxEditor.Tools.Foliage
{
/// <summary>
/// Gizmo for editing foliage types.
/// </summary>
public sealed class FoliageTypesGizmo : GizmoBase
{
/// <summary>
/// The parent mode.
/// </summary>
public readonly FoliageTypesGizmoMode GizmoMode;
/// <summary>
/// Initializes a new instance of the <see cref="EditFoliageGizmo"/> class.
/// </summary>
/// <param name="owner">The owner.</param>
/// <param name="mode">The mode.</param>
public FoliageTypesGizmo(IGizmoOwner owner, FoliageTypesGizmoMode mode)
: base(owner)
{
GizmoMode = mode;
}
/// <inheritdoc />
public override void Pick()
{
// Get mouse ray and try to hit foliage instance
var foliage = GizmoMode.SelectedFoliage;
if (!foliage)
return;
var ray = Owner.MouseRay;
if (foliage.Intersects(ref ray, out _, out _, out var instanceIndex))
{
// Select hit instance type
var instance = foliage.GetInstance(instanceIndex);
GizmoMode.SelectedTypeIndex = instance.Type;
}
}
}
}
@@ -0,0 +1,86 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using FlaxEditor.Gizmo;
using FlaxEditor.SceneGraph.Actors;
using FlaxEditor.Viewport;
using FlaxEditor.Viewport.Modes;
namespace FlaxEditor.Tools.Foliage
{
/// <summary>
/// Foliage types editing mode.
/// </summary>
/// <seealso cref="FlaxEditor.Viewport.Modes.EditorGizmoMode" />
public class FoliageTypesGizmoMode : EditorGizmoMode
{
/// <summary>
/// The foliage types gizmo.
/// </summary>
public FoliageTypesGizmo Gizmo;
/// <summary>
/// The foliage type editing selection outline.
/// </summary>
public FoliageTypesOutline SelectionOutline;
/// <summary>
/// The selected foliage type index.
/// </summary>
public int SelectedTypeIndex
{
get => Editor.Instance.Windows.ToolboxWin.Foliage.SelectedFoliageTypeIndex;
set => Editor.Instance.Windows.ToolboxWin.Foliage.SelectedFoliageTypeIndex = value;
}
/// <summary>
/// Gets the selected foliage actor (see <see cref="Modules.SceneEditingModule"/>).
/// </summary>
public FlaxEngine.Foliage SelectedFoliage
{
get
{
var sceneEditing = Editor.Instance.SceneEditing;
var foliageNode = sceneEditing.SelectionCount == 1 ? sceneEditing.Selection[0] as FoliageNode : null;
return (FlaxEngine.Foliage)foliageNode?.Actor;
}
}
/// <inheritdoc />
public override void Init(IGizmoOwner owner)
{
base.Init(owner);
Gizmo = new FoliageTypesGizmo(owner, this);
}
/// <inheritdoc />
public override void Dispose()
{
FlaxEngine.Object.Destroy(ref SelectionOutline);
base.Dispose();
}
/// <inheritdoc />
public override void OnActivated()
{
base.OnActivated();
Owner.Gizmos.Active = Gizmo;
if (SelectionOutline == null)
{
SelectionOutline = FlaxEngine.Object.New<FoliageTypesOutline>();
SelectionOutline.GizmoMode = this;
}
((MainEditorGizmoViewport)Owner).OverrideSelectionOutline(SelectionOutline);
}
/// <inheritdoc />
public override void OnDeactivated()
{
((MainEditorGizmoViewport)Owner).OverrideSelectionOutline(null);
base.OnDeactivated();
}
}
}
@@ -0,0 +1,62 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using FlaxEditor.Gizmo;
using FlaxEngine;
namespace FlaxEditor.Tools.Foliage
{
/// <summary>
/// The custom outline for drawing the selected foliage type.
/// </summary>
/// <seealso cref="FlaxEditor.Gizmo.SelectionOutline" />
[HideInEditor]
public class FoliageTypesOutline : SelectionOutline
{
/// <summary>
/// The parent mode.
/// </summary>
public FoliageTypesGizmoMode GizmoMode;
/// <inheritdoc />
public override bool CanRender()
{
if (!HasDataReady)
return false;
var foliage = GizmoMode.SelectedFoliage;
if (!foliage)
return false;
var typeIndex = GizmoMode.SelectedTypeIndex;
if (typeIndex < 0 || typeIndex >= foliage.FoliageTypesCount)
return false;
return true;
}
/// <inheritdoc />
public override void Render(GPUContext context, ref RenderContext renderContext, GPUTexture input, GPUTexture output)
{
base.Render(context, ref renderContext, input, output);
// Restore debug option
var foliage = GizmoMode.SelectedFoliage;
if (foliage)
foliage._drawFoliageType = -1;
}
/// <inheritdoc />
protected override void DrawSelectionDepth(GPUContext context, SceneRenderTask task, GPUTexture customDepth)
{
var foliage = GizmoMode.SelectedFoliage;
if (!foliage)
return;
var typeIndex = GizmoMode.SelectedTypeIndex;
if (typeIndex < 0 || typeIndex >= foliage.FoliageTypesCount)
return;
// Draw instances of the given type
foliage._drawFoliageType = typeIndex;
_actors.Add(foliage);
Renderer.DrawSceneDepth(context, task, customDepth, _actors);
}
}
}
@@ -334,7 +334,8 @@ namespace FlaxEditor.Tools.Foliage
/// Initializes a new instance of the <see cref="FoliageTypesTab"/> class.
/// </summary>
/// <param name="tab">The parent tab.</param>
public FoliageTypesTab(FoliageTab tab)
/// <param name="mode">The gizmo mode.</param>
public FoliageTypesTab(FoliageTab tab, FoliageTypesGizmoMode mode)
: base("Foliage Types")
{
Tab = tab;

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