Compare commits

..

1197 Commits

Author SHA1 Message Date
mafiesto4 c2da48c49f Fix dotnet installation selection on Linux to favor lib over share 2023-07-08 21:05:20 +02:00
mafiesto4 ca5cbf05be Merge branch 'Tryibion-actor-tag-type' 2023-07-06 16:43:10 +02:00
mafiesto4 dc6410e7b8 Merge branch 'actor-tag-type' of https://github.com/Tryibion/FlaxEngine into Tryibion-actor-tag-type 2023-07-06 16:43:05 +02:00
mafiesto4 e1572a2a5c Merge branch 'Tryibion-remove-debug' 2023-07-06 16:41:29 +02:00
Tryibion a3dddbfa24 Remove stray debug.log 2023-07-05 16:19:25 -05:00
Tryibion d88b93d56b Add find actor by type and tag to level and actor classes. Move find actor by tag code to be by other find actor methods. 2023-07-05 14:00:07 -05:00
mafiesto4 bd0bc42adc Fix regressionn from d7dc0b76e5 2023-07-05 12:18:03 +02:00
mafiesto4 04ef3c60d5 Fix regression from c79952a4d6 2023-07-05 09:27:21 +02:00
mafiesto4 a14de5e255 Fix Array For Each visual script node local vars setup 2023-07-04 17:58:32 +02:00
mafiesto4 90f377fa83 Remove leftover log 2023-07-04 17:58:06 +02:00
mafiesto4 c79952a4d6 Implement missing dotnet7 interop for field and stabilize interop 2023-07-04 17:57:59 +02:00
mafiesto4 d7dc0b76e5 Softly handle invalid scene rendering key to prevent crashes on scene unload 2023-07-04 13:32:51 +02:00
mafiesto4 27b3538b2f Fix regression from 9d640656e6 2023-07-04 13:15:09 +02:00
mafiesto4 74ca6b2c51 Add missing Shader Model 6 define 2023-07-04 13:12:48 +02:00
mafiesto4 d49def6f7e More stuff from d31fc32399 2023-07-04 11:46:42 +02:00
mafiesto4 72d1d8f085 More stuff from d31fc32399 2023-07-04 11:06:48 +02:00
mafiesto4 d31fc32399 Fix and update engine assets 2023-07-04 11:05:32 +02:00
mafiesto4 615ec636d4 Fix crash when window gets deleted before show/close sequence 2023-07-04 10:42:49 +02:00
mafiesto4 5ee7b0d939 Bump up build number 2023-07-04 10:18:27 +02:00
mafiesto4 9f7ae5bb58 Fix warning 2023-07-03 22:13:13 +02:00
mafiesto4 5f756a6ceb Add TargetFrameworkAttribute to compiled C# assembly 2023-07-03 22:00:38 +02:00
mafiesto4 5d9e6b7364 Fix C# building to properly use reference assemblies for .NET 7 2023-07-03 22:00:23 +02:00
mafiesto4 9db3439d0d Fix compilation error 2023-07-03 16:17:46 +02:00
mafiesto4 544eb03f7e Add network replication support for in-built object/asset reference holders 2023-07-03 13:06:08 +02:00
mafiesto4 9d640656e6 Fix StringUtils::ConvertANSI2UTF16 to properly handle multi-byte characters Length
#1225
2023-07-03 12:10:06 +02:00
mafiesto4 9a1fd12a85 Fix sizeof struct within generic type instance
#1219
2023-07-03 11:42:15 +02:00
mafiesto4 aaf349170c Merge branch 'GoaLitiuM-managed_assembly_resolver_fix' 2023-07-03 11:12:33 +02:00
mafiesto4 422f2323d2 Merge branch 'managed_assembly_resolver_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-managed_assembly_resolver_fix 2023-07-03 11:12:28 +02:00
mafiesto4 10d9d53e47 Merge branch 'GoaLitiuM-api_inject_code_newline' 2023-07-03 11:11:22 +02:00
mafiesto4 94e5a8b7bc Merge branch 'api_inject_code_newline' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-api_inject_code_newline 2023-07-03 11:11:16 +02:00
mafiesto4 bda94834f7 Merge branch 'GoaLitiuM-new_project_defaultscene' 2023-07-03 11:10:19 +02:00
mafiesto4 df3969dae1 Merge branch 'new_project_defaultscene' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-new_project_defaultscene 2023-07-03 11:09:56 +02:00
mafiesto4 789dfac27c Merge branch 'GoaLitiuM-hotreload_cleanup' 2023-07-03 11:09:39 +02:00
GoaLitiuM 4f78f79201 Support line-breaks in API_INJECT_CODE macro 2023-07-02 22:13:04 +03:00
GoaLitiuM 28335478bd Fix managed library location resolver 2023-07-02 21:56:41 +03:00
GoaLitiuM 58618bd402 Fix garbage DefaultScene value in new projects 2023-06-30 14:41:14 +03:00
GoaLitiuM 0ee6aad3ec Remove old hot-reload files in project references 2023-06-30 13:01:02 +03:00
mafiesto4 9205352f94 Merge branch 'HydrogenC-patch-1' 2023-06-30 11:04:01 +02:00
mafiesto4 5079ddd20a Merge branch 'patch-1' of https://github.com/HydrogenC/FlaxEngine into HydrogenC-patch-1 2023-06-30 11:03:15 +02:00
mafiesto4 2bd2bd5081 Fix crash when modifying animated model skeleton pose from gameplay code during update event 2023-06-30 11:02:58 +02:00
mafiesto4 d5100373be Fix bugs in C# codegen for network data serialization 2023-06-30 10:38:08 +02:00
mafiesto4 8c006f6e11 Fix crash due to replicated objects leak upon system destruction 2023-06-30 10:00:12 +02:00
ExMatics HydrogenC 804826fbc7 Fix multiplication mistake 2023-06-30 14:06:52 +08:00
ExMatics HydrogenC 0498f1488e Fix space conversion issue 2023-06-30 12:25:58 +08:00
mafiesto4 96589557b3 Fix access level 96a1f20bee 2023-06-28 20:09:18 +02:00
mafiesto4 3119c50789 Fix nullable warnings 2023-06-28 20:09:01 +02:00
mafiesto4 04c1cf469d Fix codegen for C++ RPS with Array ParameterDefinition
#1209
2023-06-28 20:08:35 +02:00
mafiesto4 70ab159dd4 Fix empty clients mask for NetworkReplicationHierarchy on client to properly replicate client-owned objects
#1205
2023-06-28 19:55:10 +02:00
mafiesto4 ac54838eea Fix custom editor window restore after hot-reload
#1208
2023-06-28 18:46:46 +02:00
mafiesto4 5e5ee8e039 Merge branch 'PhyresiCompany-new_window_improvements' 2023-06-28 16:27:50 +02:00
mafiesto4 bb9711277a Cleanup code from #1213 2023-06-28 16:27:42 +02:00
mafiesto4 96a1f20bee Merge branch 'new_window_improvements' of https://github.com/PhyresiCompany/FlaxEngine into PhyresiCompany-new_window_improvements 2023-06-28 16:14:15 +02:00
mafiesto4 32629b7a44 Merge branch 'RuanLucasGD-fix_vehicle_physics_debug' 2023-06-28 16:13:39 +02:00
mafiesto4 1b46c0921f Merge branch 'fix_vehicle_physics_debug' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-fix_vehicle_physics_debug 2023-06-28 16:13:33 +02:00
mafiesto4 b581ec837c Merge branch 'Withaust-replicationnode' 2023-06-28 16:01:52 +02:00
mafiesto4 c0a5417108 Merge branch 'replicationnode' of https://github.com/Withaust/FlaxEngine into Withaust-replicationnode 2023-06-28 16:01:43 +02:00
Ruan Lucas 45a1d33689 fix orientation 2023-06-28 09:56:15 -04:00
mafiesto4 bb3cefbe54 Add check for NetworkClientsMask to ensure it has capacity 2023-06-28 15:48:32 +02:00
mafiesto4 e7b62ad1c3 Merge branch 'GoaLitiuM-intellisense_reference_fix' 2023-06-28 15:27:51 +02:00
mafiesto4 7997d2bc4e Merge branch 'intellisense_reference_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-intellisense_reference_fix 2023-06-28 15:27:11 +02:00
mafiesto4 c44e97c8bc Bump build number 2023-06-28 15:22:48 +02:00
mafiesto4 f7deac4b63 Merge branch 'GoaLitiuM-hashset_fix' 2023-06-28 15:15:16 +02:00
mafiesto4 70136509a9 Merge branch 'hashset_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-hashset_fix 2023-06-28 15:15:11 +02:00
mafiesto4 38451f7dce Merge branch 'Tryibion-realloc' 2023-06-28 15:14:20 +02:00
mafiesto4 63a70758f2 Merge branch 'realloc' of https://github.com/Tryibion/FlaxEngine into Tryibion-realloc 2023-06-28 15:13:56 +02:00
mafiesto4 890248edf2 Fix MClass::HasInterface in .NET 7 2023-06-28 15:13:33 +02:00
mafiesto4 9536c37623 Add ability to unset type reference with null item 2023-06-28 15:12:58 +02:00
GoaLitiuM bf6daed6d2 Fix Intellisense errors with referenced binary module structures 2023-06-28 15:57:25 +03:00
mafiesto4 864f5f77f5 Add output binaries folder cleanp to build clear command 2023-06-28 14:53:23 +02:00
mafiesto4 b16a6199d0 Fix invoking Client RPC on Host client when it's not included in targetIds list 2023-06-28 14:52:58 +02:00
Tryibion 093928f2f9 Change name to ReallocAligned 2023-06-28 06:42:54 -05:00
GoaLitiuM d3b96742e7 Fix compile-time error in HashSet::ClearDelete 2023-06-28 14:42:27 +03:00
mafiesto4 fb6bc75e3a Fix launchSettings.json generation bug 2023-06-28 13:42:18 +02:00
mafiesto4 61bb41c878 Merge branch 'GoaLitiuM-custom_asset_release' 2023-06-28 12:23:22 +02:00
mafiesto4 c52c23013c Merge branch 'custom_asset_release' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-custom_asset_release 2023-06-28 12:23:16 +02:00
mafiesto4 17aa4ea60d Optimize CollisionsHelper::FrustumContainsBox 2023-06-28 12:21:58 +02:00
Ruan Lucas 76e4e1b8d4 fix debug vehicle wheel orientation 2023-06-27 21:08:12 -04:00
PhyresiCompany fe8260fe14 Window improvements with a new approach 2023-06-27 19:58:37 -03:00
GoaLitiuM 90f9754781 Release custom assets before binary modules on scripting release 2023-06-28 00:35:51 +03:00
mafiesto4 75d5023354 Fix tooltip for project folder 2023-06-27 23:24:02 +02:00
mafiesto4 0711710544 Merge branch 'RuanLucasGD-fix_content_browser' 2023-06-27 23:23:08 +02:00
mafiesto4 23a6a8b69f Merge branch 'fix_content_browser' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-fix_content_browser 2023-06-27 23:20:11 +02:00
Ruan Lucas 020b0a90d7 remove unecessary code 2023-06-27 00:22:12 -04:00
Wiktor Kocielski 6013705988 Implement object to cell caching for the grid 2023-06-26 17:32:19 +03:00
Wiktor Kocielski 65397621e9 Make GetObject virtual and implement for Grid 2023-06-26 17:12:48 +03:00
Wiktor Kocielski cbd1e5c837 Add NetworkReplicationNode::GetObject 2023-06-25 23:39:59 +03:00
mafiesto4 9282bcfbbf Fix crash due to invalid RPC codegen for enum value type variable 2023-06-25 21:24:30 +02:00
Tryibion 1d8ae580b7 Add Realloc with alignment. 2023-06-24 12:05:51 -05:00
mafiesto4 694f8fbaf3 Fix missing collision events generated during CharacterController::Move
#1200
2023-06-23 22:22:50 +02:00
mafiesto4 623752e69b Merge branch 'Withaust-patch-1' 2023-06-23 21:28:31 +02:00
mafiesto4 420525f688 Merge branch 'patch-1' of https://github.com/Withaust/FlaxEngine into Withaust-patch-1 2023-06-23 21:28:24 +02:00
mafiesto4 9b570a46d2 Codestyle tweak 2023-06-23 21:28:16 +02:00
mafiesto4 b8ee20c7dc Merge branch 'optimize_actors_search' of https://github.com/RuanLucasGD/FlaxEngine 2023-06-23 21:25:32 +02:00
mafiesto4 4696ed4f8a Merge branch 'GoaLitiuM-utf8_build_files' 2023-06-23 21:18:21 +02:00
mafiesto4 c37aee0a27 Merge branch 'utf8_build_files' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-utf8_build_files 2023-06-23 21:18:14 +02:00
mafiesto4 7b34ddc089 Merge branch 'Tryibion-gitattribute' 2023-06-23 21:16:29 +02:00
Wiktor Kocielski 028ccfca2e Update NetworkReplicationNode::AddObject 2023-06-23 13:14:59 +03:00
Ruan Lucas 072d70722c add optional parameter to find only active actors on Level.FindActorsByParentTag 2023-06-21 21:38:22 -04:00
Ruan Lucas 875dd30d57 add optional parameter to find only active actors on Level.FinActors(tag) 2023-06-21 21:27:38 -04:00
Tryibion 9c2a04aa21 Add eol=lf to gitattribute 2023-06-21 07:24:37 -05:00
GoaLitiuM 83485d2f52 Write generated build configuration files in UTF-8
Git seems to have issues with handling UTF-16 encoded files, so it would
be more appropriate to write the generated files with more common UTF-8
encoding instead.
2023-06-21 13:17:49 +03:00
GoaLitiuM 74760a7661 Add support for writing UTF-8 files in FileBase::WriteAllText 2023-06-21 13:17:46 +03:00
mafiesto4 2a109e50fb Merge branch 'GoaLitiuM-custom_asset_hotreload' 2023-06-20 22:01:07 +02:00
mafiesto4 67dad80e15 Merge branch 'custom_asset_hotreload' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-custom_asset_hotreload 2023-06-20 22:00:20 +02:00
mafiesto4 64a7985376 Fix GridGizmo to render before transparency in Editor viewport
#1196
2023-06-20 21:59:36 +02:00
GoaLitiuM d3073f5251 Release custom assets before scripting hot reload 2023-06-20 21:47:23 +03:00
mafiesto4 62047d2d4c Merge branch 'GoaLitiuM-native_hotreload_fix' 2023-06-20 19:54:44 +02:00
mafiesto4 2020b8b011 Merge branch 'native_hotreload_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-native_hotreload_fix 2023-06-20 19:54:38 +02:00
GoaLitiuM 87e96a9017 Fix native library lookup after hot reload 2023-06-20 16:29:04 +03:00
mafiesto4 0e5335a806 Merge branch 'GoaLitiuM-content_api' 2023-06-20 15:20:05 +02:00
mafiesto4 e8b07e1588 Merge branch 'content_api' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-content_api 2023-06-20 15:19:59 +02:00
mafiesto4 1c4901305c Merge branch 'GoaLitiuM-csharp_nullable' 2023-06-20 15:19:26 +02:00
mafiesto4 7106d958d7 Merge branch 'csharp_nullable' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-csharp_nullable 2023-06-20 15:19:17 +02:00
mafiesto4 cd7ad4e5f8 Fix crash in particle effect
#1194
2023-06-20 15:17:46 +02:00
GoaLitiuM c0ba3b0edb Expose Content importers and exporters for scripting API 2023-06-19 22:35:36 +03:00
GoaLitiuM b82f19a0df Support changing C# nullable references context build option 2023-06-19 19:33:13 +03:00
mafiesto4 6f487bcab5 Fix doc comment warning #1188 2023-06-19 18:05:00 +02:00
mafiesto4 f7e3480d79 Fix floating point comparison #1188 2023-06-19 18:01:25 +02:00
mafiesto4 7ff3b565e5 Merge branch 'Withaust-master' 2023-06-19 18:00:00 +02:00
mafiesto4 cc6f5f83ac Merge branch 'master' of https://github.com/Withaust/FlaxEngine into Withaust-master 2023-06-19 17:59:54 +02:00
mafiesto4 c38a2870dc Merge branch 'GoaLitiuM-viewport_mouse_fix' 2023-06-19 17:50:04 +02:00
mafiesto4 287c9432b7 Merge branch 'viewport_mouse_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-viewport_mouse_fix 2023-06-19 17:49:59 +02:00
mafiesto4 0e95700349 Merge branch 'GoaLitiuM-font_float_size' 2023-06-19 17:49:50 +02:00
mafiesto4 a99282f86d Merge branch 'font_float_size' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-font_float_size 2023-06-19 17:49:44 +02:00
mafiesto4 e17eed7029 Fix regression in script values creation in Editor
#1184 #1183
2023-06-19 17:49:34 +02:00
Wiktor Kocielski 46c406cc9e Implement optional object replication 2023-06-19 16:07:53 +03:00
GoaLitiuM 6a1552505e Fix sluggish EditorViewport camera movement with high DPI
Flooring the mouse delta values seems to drop slight movements in
viewport when screen DPI is high.
2023-06-18 21:23:02 +03:00
GoaLitiuM 2190031ccf Support decimal values in Font sizes 2023-06-18 20:52:46 +03:00
mafiesto4 228ef4e130 Add objects ID inverse mapping from client to server for proper C# networking codegen 2023-06-18 19:27:46 +02:00
mafiesto4 dd8817582a Fix arg name 2023-06-18 18:36:58 +02:00
mafiesto4 3b642c0370 Merge branch 'Withaust-master' 2023-06-18 18:31:27 +02:00
mafiesto4 16159a9d98 Merge branch 'master' of https://github.com/Withaust/FlaxEngine into Withaust-master 2023-06-18 18:31:13 +02:00
mafiesto4 c87b315fef Fixes for network codegen 2023-06-18 18:28:41 +02:00
mafiesto4 b07528d9ce Refactor Network RPC C# codegen to share code with data serializer 2023-06-18 17:11:15 +02:00
mafiesto4 9e2e6759bd Implement proper POD types check in C# network replication codegen 2023-06-18 15:33:57 +02:00
Wiktor Kocielski 2485987901 Fix binding generation for interfaces 2023-06-18 10:48:46 +03:00
mafiesto4 1a6e706e57 Minor fixes 2023-06-17 17:51:14 +02:00
mafiesto4 21a3081b9f Fix 6b8d8b7913 from using filename into namespaces 2023-06-17 17:34:48 +02:00
mafiesto4 8f9989dc65 Additional fix for cc85450ed5 2023-06-17 16:41:48 +02:00
mafiesto4 a3e3ee396a Revert default value back to false as in #1179 2023-06-17 16:37:33 +02:00
mafiesto4 cd68f2463b Adjustment for #1179 to rebuild by default 2023-06-17 16:36:05 +02:00
mafiesto4 d1f11bbdb2 Merge branch 'Withaust-patch-1' 2023-06-17 16:33:11 +02:00
mafiesto4 3b6100837f Merge branch 'patch-1' of https://github.com/Withaust/FlaxEngine into Withaust-patch-1 2023-06-17 16:33:03 +02:00
mafiesto4 cc85450ed5 Change macOS editor deploy to build only current platform arch 2023-06-17 11:28:39 +02:00
Wiktor Kocielski 70470bc421 Make rebuilding database when adding asset proxy optional 2023-06-17 12:13:54 +03:00
mafiesto4 f995d12686 Fix editor deployment 2023-06-17 11:08:51 +02:00
mafiesto4 3645377b15 Merge remote-tracking branch 'origin/1.6' 2023-06-16 18:43:40 +02:00
mafiesto4 1e804a0a81 Merge branch 'GoaLitiuM-font_glyph_data_fix' 2023-06-16 18:43:01 +02:00
GoaLitiuM fadc5beb1c Fix FontTextureAtlas::GetSlotData not including padding correctly 2023-06-16 15:17:04 +03:00
mafiesto4 5f019dc79f Improve Visual Studio solution generation with nested C# project cross-references to properly place projects in group folders 2023-06-16 13:45:54 +02:00
mafiesto4 b57a3165fa Fix textbox submit when it's nav focused 2023-06-16 10:56:17 +02:00
mafiesto4 b13139c6cc Fix check from compilation errors 2023-06-15 12:14:35 +02:00
mafiesto4 fea4b3fcba Add better Texture initialization API with custom data 2023-06-15 12:14:23 +02:00
mafiesto4 329a6ce0ef Increase PhysX allocation limit to 1GB
#1176
2023-06-15 10:07:30 +02:00
mafiesto4 53587ad162 Fix error when unloading Visual Script item in Editor 2023-06-15 09:51:49 +02:00
mafiesto4 086e4c9835 Add content proxy modifications function and workspace rebuilding for custom asset types extensions 2023-06-15 09:51:26 +02:00
mafiesto4 ee9627bc15 Add launchSettings.json generation for Visual Studio 2022 with .NET 7 2023-06-14 13:14:16 +02:00
mafiesto4 9de5ee5615 Fix compilation on mac 2023-06-14 08:47:03 +02:00
mafiesto4 125591dc71 Unify app package name formatting for different platforms 2023-06-13 17:11:56 +02:00
mafiesto4 b0134ab1ce Fix missing MConverter codegen for array and generic types used in non-POD struct fields 2023-06-13 16:38:08 +02:00
mafiesto4 9f313491b8 Fix game compilation error 2023-06-13 15:45:08 +02:00
mafiesto4 8f7da81621 Merge remote-tracking branch 'origin/master' into 1.6
# Conflicts:
#	Flax.flaxproj
#	Source/Editor/Content/Items/AssetItem.cs
2023-06-13 15:41:07 +02:00
mafiesto4 55971167c8 Merge branch 'GoaLitiuM-font_glyph_data' 2023-06-13 15:27:07 +02:00
mafiesto4 9f50146e68 Merge branch 'font_glyph_data' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-font_glyph_data 2023-06-13 15:26:09 +02:00
mafiesto4 bda71c067b Port #1166 to StringAnsi 2023-06-13 15:04:30 +02:00
mafiesto4 cc1e5873a6 Merge branch 'GoaLitiuM-string_set_fix' 2023-06-13 15:00:16 +02:00
mafiesto4 c652bab9b2 Merge branch 'string_set_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-string_set_fix 2023-06-13 15:00:08 +02:00
mafiesto4 13b1c16213 Add asset reload option via context menu in Editor 2023-06-13 14:58:14 +02:00
mafiesto4 f1c98320fc Refactor vehicles to use Z axis as forward instead of X
#1050
2023-06-13 14:56:03 +02:00
mafiesto4 bdb65857bc Fix prefab data build number when loading objects from prefab 2023-06-13 12:12:59 +02:00
Ruan Lucas 164670cceb change content folder detection mode on "CanRename" 2023-06-12 20:04:32 -04:00
mafiesto4 d7ddb2ef6f Fix typo in atmosphere precompute shader 2023-06-12 21:12:17 +02:00
GoaLitiuM 326b6f000a Expose bitmap data of Font glyphs in FontTextureAtlas 2023-06-12 22:09:27 +03:00
GoaLitiuM 7cc2c143ab Fix crash when substring of String is assigned to itself 2023-06-12 22:03:17 +03:00
mafiesto4 37bf4bb34f Unify all GetActorsTree usages in Editor 2023-06-12 18:25:44 +02:00
mafiesto4 534d2388f5 Fix crash when removing json instance for scene asset that is different 2023-06-12 17:07:24 +02:00
mafiesto4 d5cb34f1b4 Minor fix for settings 2023-06-12 14:44:12 +02:00
mafiesto4 6b8d8b7913 Various fixes and improvements to auto-generated bindings usability 2023-06-12 14:35:11 +02:00
mafiesto4 14d12418b6 Add iOS and Apple icons 2023-06-12 14:34:31 +02:00
mafiesto4 979168e82c Refactor various Editor APIs to use auto-generated bindings instead of manual code 2023-06-12 14:34:07 +02:00
mafiesto4 7140c4a2d8 Merge remote-tracking branch 'origin/master' into 1.6 2023-06-11 21:38:20 +02:00
mafiesto4 5f8e5d44dc Fix RPC invoking on object with different ID but matching parent and type 2023-06-11 21:35:50 +02:00
mafiesto4 31c9b85a3f Fix prefab diff context menu in Editor to properly diff against arrays 2023-06-11 20:44:04 +02:00
mafiesto4 958c7b2181 Fix spawning nested prefab with different root actor
#1138
2023-06-11 20:43:31 +02:00
mafiesto4 652f8ccb8d Fix crash when reading field value from C# in AOT on iOS 2023-06-11 15:05:14 +02:00
mafiesto4 26f4574358 Various improvements for iOS 2023-06-11 14:56:46 +02:00
mafiesto4 0eadf2de1e Fix visual glitches on MoltenVK (macOS, iOS) 2023-06-11 00:49:48 +02:00
mafiesto4 ec67d04a0a Disable Metal validation in iOS debug run 2023-06-11 00:49:08 +02:00
mafiesto4 2df931e090 Improve tooltip 2023-06-11 00:45:46 +02:00
mafiesto4 f552dd0c28 Merge remote-tracking branch 'origin/master' into 1.6 2023-06-10 23:29:22 +02:00
mafiesto4 8cf10bf71d Add app pausing and focus management to iOS 2023-06-10 23:26:40 +02:00
mafiesto4 621d408078 Add iOS app exporting 2023-06-10 23:05:52 +02:00
mafiesto4 1fdc91255b Add iOS app icon exporting 2023-06-10 23:04:53 +02:00
mafiesto4 524b55b6c1 Add missing change in XCode project for iOS 2023-06-10 12:44:54 +02:00
mafiesto4 5e07a42417 Add app version and ui orientation settings to iOS 2023-06-10 12:43:10 +02:00
mafiesto4 ea4f97aad8 Remove unused codesigning (ios uses xcode now) 2023-06-10 12:08:22 +02:00
mafiesto4 e7804f9d02 Add audio to iOS via OpenAL 2023-06-10 12:05:13 +02:00
mafiesto4 092df84170 Add touch input to ios 2023-06-10 11:54:17 +02:00
mafiesto4 22288b0561 Add dpi for ios 2023-06-10 10:47:15 +02:00
mafiesto4 43c1e40461 Add iOS platform info for device network, screen and battery status 2023-06-10 10:31:39 +02:00
Ruan Lucas 8f76fe4049 don't let rename source/content folders 2023-06-09 22:14:33 -04:00
mafiesto4 60ddf0ea89 Add automated test for loading nested prefab with different root actor
#1138
2023-06-09 23:36:31 +02:00
mafiesto4 b299ed3246 Add more assertions to tests build 2023-06-09 23:34:55 +02:00
mafiesto4 7c55d50507 Various minor code cleanup tweaks 2023-06-09 23:26:37 +02:00
mafiesto4 d798b10d4c Remove unlogical PrefabManager::IsNotCreatingPrefab (use IsCreatingPrefab flag) 2023-06-09 22:49:19 +02:00
mafiesto4 a6430692d2 Fix crash safe handling of internal errors and exceptions when drawing asset thumbnails
#1138
2023-06-09 18:22:40 +02:00
mafiesto4 3bbfe9de8a Code cleanup, add tooltip and cache property option in layout #1140 2023-06-09 17:32:57 +02:00
mafiesto4 94abdfd734 Merge branch 'Swiggies-ui-resize-update' 2023-06-09 17:23:13 +02:00
mafiesto4 a0d6f3c22b Merge branch 'ui-resize-update' of https://github.com/Swiggies/FlaxEngine into Swiggies-ui-resize-update 2023-06-09 17:23:00 +02:00
mafiesto4 bbdc2bc876 Merge branch 'RuanLucasGD-fix-transform-gizmos' 2023-06-09 17:16:41 +02:00
mafiesto4 9bda3aa52a Merge branch 'fix-transform-gizmos' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-fix-transform-gizmos 2023-06-09 17:16:36 +02:00
mafiesto4 9faf9e43fb Codestyle fix #1118 2023-06-09 17:15:06 +02:00
mafiesto4 e5f3329e88 Merge branch 'Tryibion-scale-link-zero-fix' 2023-06-09 17:12:19 +02:00
mafiesto4 a8cf4e95c5 Merge branch 'scale-link-zero-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-scale-link-zero-fix 2023-06-09 17:12:14 +02:00
mafiesto4 f345e0dffc Merge branch 'RuanLucasGD-fix_crash_when_import_model' 2023-06-09 14:10:21 +02:00
mafiesto4 26e09aebe3 Merge branch 'fix_crash_when_import_model' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-fix_crash_when_import_model 2023-06-09 14:10:16 +02:00
mafiesto4 892e091643 Merge branch 'Withaust-inputfixes' 2023-06-09 14:08:17 +02:00
mafiesto4 ef823c0646 Merge branch 'inputfixes' of https://github.com/Withaust/FlaxEngine into Withaust-inputfixes 2023-06-09 14:08:04 +02:00
mafiesto4 c043e64b6b Merge branch 'RuanLucasGD-master' 2023-06-09 13:59:02 +02:00
mafiesto4 2382e2cbbc Merge branch 'master' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-master 2023-06-09 13:57:16 +02:00
mafiesto4 2a28126700 Merge branch 'Tryibion-limit-cc-up' 2023-06-09 13:54:59 +02:00
mafiesto4 f9251e41a4 Merge branch 'limit-cc-up' of https://github.com/Tryibion/FlaxEngine into Tryibion-limit-cc-up 2023-06-09 13:54:52 +02:00
mafiesto4 1f11f287ec Merge branch 'RuanLucasGD-new_feature_to_physics' 2023-06-09 13:53:33 +02:00
mafiesto4 0476251638 Improve line cast math and code style fix #1147 2023-06-09 13:53:26 +02:00
mafiesto4 d71f89718b Merge branch 'new_feature_to_physics' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-new_feature_to_physics 2023-06-09 13:50:00 +02:00
mafiesto4 55f76999b4 Merge branch 'Tryibion-findactor' 2023-06-09 13:48:43 +02:00
mafiesto4 393514c13d Add missing scenes locking 2023-06-09 13:48:33 +02:00
mafiesto4 126ea687e6 Merge branch 'findactor' of https://github.com/Tryibion/FlaxEngine into Tryibion-findactor 2023-06-09 13:45:49 +02:00
mafiesto4 d83dcdebf3 Merge branch 'RuanLucasGD-new_features_to_tags' 2023-06-09 13:44:31 +02:00
mafiesto4 248f78ed56 Code style fix #1146 2023-06-09 13:44:26 +02:00
mafiesto4 ee7f2b3724 Merge branch 'new_features_to_tags' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-new_features_to_tags 2023-06-09 13:42:04 +02:00
Ruan Lucas 0b8c06b149 fix for #1002 2023-06-08 11:52:00 -04:00
Ruan Lucas 8b0dd039ca Merge branch 'fix_crash_when_import_model' of https://github.com/RuanLucasGD/FlaxEngine into fix_crash_when_import_model 2023-06-08 11:49:27 -04:00
Ruan Lucas f28a3572bb ... 2023-06-08 11:49:15 -04:00
Ruan Lucas 31c3171b72 Revert "fix for #1002"
This reverts commit e000acd6fc.
2023-06-08 11:43:35 -04:00
Ruan Lucas e000acd6fc fix for #1002 2023-06-08 11:42:47 -04:00
Withaust 8c0c6c0142 Expose some Input class delegates to scripting API 2023-06-08 01:24:38 +03:00
Ruan Lucas c22eae0e2d fix crash when import model with option to generate lod and lods amount = 1 2023-06-03 22:18:18 -04:00
Ruan Lucas e32f4d5f8c add LineCastAll 2023-06-03 13:52:50 -04:00
Ruan Lucas eda4def35b add linecast with hit info 2023-06-03 13:39:10 -04:00
Ruan Lucas ac0cf01404 add simple linecast to physics 2023-06-03 13:25:29 -04:00
Ruan Lucas 50639e2378 fix doc 2023-06-03 12:03:21 -04:00
Ruan Lucas 88a5e07f2e add docs 2023-06-03 11:59:18 -04:00
Ruan Lucas 9c93828976 add search actor by parent tag 2023-06-03 11:51:24 -04:00
Tryibion fcbe624f7c Add FindActor with type and name to level. 2023-06-02 15:29:28 -05:00
Tryibion efed1f5b1d Add FindActor by type and name. 2023-06-02 15:12:55 -05:00
Tryibion 4849a49ba4 Limits character controller up direction between (-1, 1) 2023-05-31 21:43:15 -05:00
Tryibion 424e832ec7 Fix bug on disabling element on init if it is zero. 2023-05-31 21:23:34 -05:00
Ruan Lucas dae05e0549 improv: copy old curve point data to new curve point 2023-05-31 20:11:05 -04:00
mafiesto4 007edb4651 Merge commit '2c809389ad7d8953b10e7ab3b1b29aca4d072116' into 1.6 2023-06-01 01:06:27 +02:00
mafiesto4 3953e6ddc0 Merge commit 'f2ecefb7ee9b9e6c5daac9f44fe40ebdccbb1c76' into 1.6 2023-06-01 01:06:14 +02:00
mafiesto4 40f5032898 Add iOS view linkage for Metal rendering and invoke window resizing properly on a main thread 2023-06-01 01:05:06 +02:00
mafiesto4 a2e2ef51be Various twekas 2023-06-01 00:47:05 +02:00
mafiesto4 c46f78885e Refactor iOS deployment to use XCode project 2023-06-01 00:46:39 +02:00
Tryibion 5c67c4f5d4 Handle zero case correctly by disabling value boxes on zero. 2023-05-31 14:31:01 -05:00
Tryibion 70cb4d3cd9 Fix bug of moving value from zero. 2023-05-31 13:01:41 -05:00
mafiesto4 5416d385d3 iOS runtime impl progress 2023-05-30 22:03:17 +02:00
mafiesto4 2c809389ad Merge branch 'GoaLitiuM-flaxapi_fixes' 2023-05-30 10:28:16 +02:00
mafiesto4 8bd4ad03de Merge branch 'flaxapi_fixes' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-flaxapi_fixes 2023-05-30 10:28:03 +02:00
mafiesto4 01688bc050 Merge branch 'GoaLitiuM-dxgifactory_fix' 2023-05-30 10:27:06 +02:00
mafiesto4 d5c89cb3de Merge branch 'dxgifactory_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-dxgifactory_fix 2023-05-30 10:25:49 +02:00
GoaLitiuM 9e07e80fa1 Fix linking errors when referencing static members in engine classes 2023-05-29 22:23:45 +03:00
GoaLitiuM 3e848d93da Fix DXGIFactory use after release 2023-05-29 22:22:59 +03:00
mafiesto4 d0bf176178 Fix dylib rpath id on macOS 2023-05-29 17:11:51 +02:00
Olly Rybak fce41b95f6 Added bool to properties window to carry value between controls 2023-05-29 20:55:55 +10:00
mafiesto4 fb6a9728a3 Hide editor-only properties from animating in UI Control 2023-05-28 23:30:49 +02:00
mafiesto4 6a482c987c Fix 3D UI Canvas point conversion from parent control space to local space
#1129
2023-05-28 23:21:36 +02:00
mafiesto4 f60007da83 Add Camera.UnprojectPoint method 2023-05-28 23:20:39 +02:00
mafiesto4 2149995116 Minor Camera class tweaks 2023-05-28 22:57:52 +02:00
mafiesto4 44036a26d0 Fix UI Control selection highlights when using Canvas Scaler
#977
2023-05-28 21:35:56 +02:00
mafiesto4 f2ecefb7ee Refactor StringUtils 2023-05-28 21:16:29 +02:00
mafiesto4 6b4340ce24 Add build tool and game cooker caches clearing when opening project with different Editor version 2023-05-28 19:42:52 +02:00
mafiesto4 e0d97486ec Merge remote-tracking branch 'origin/master' into 1.6 2023-05-28 19:34:02 +02:00
mafiesto4 b65c84c02e Fix compilation issue from 62946f6359 2023-05-28 16:57:38 +02:00
mafiesto4 5a45ccf70d Fix text formatting infinite loop
#1127
2023-05-28 16:56:19 +02:00
mafiesto4 f3393c46a5 Fix text formatting infinite loop
#1127
2023-05-28 16:55:47 +02:00
mafiesto4 587578ccfb Update platforms impl 2023-05-28 16:45:08 +02:00
Olly Rybak 522015c2d7 Better functionality + styling 2023-05-29 00:43:14 +10:00
mafiesto4 81ae687238 Merge remote-tracking branch 'origin/master' into 1.6 2023-05-28 16:34:38 +02:00
mafiesto4 311637616b Fix Android Debug compilation error after recent Tracy update
#948
2023-05-28 16:22:34 +02:00
mafiesto4 1cf97186dd Merge branch 'Menotdan-color-picker' 2023-05-28 16:12:40 +02:00
mafiesto4 62946f6359 Cleanup and improve code from #1109 2023-05-28 16:12:32 +02:00
mafiesto4 9cdd1cbc45 Add Platform::GetMousePosition/WindowsPlatform::SetMousePosition for unified access to screen-space mouse position on all platforms
#1109
2023-05-28 15:30:16 +02:00
mafiesto4 482d516c2e Merge branch 'color-picker' of https://github.com/Menotdan/FlaxEngine into Menotdan-color-picker 2023-05-28 13:38:37 +02:00
mafiesto4 3e906686db Improve #1119 to use a bit flag for object sync 2023-05-28 13:30:14 +02:00
mafiesto4 b219aaf708 Merge branch 'Withaust-networksync' 2023-05-28 13:28:10 +02:00
mafiesto4 b6f8876315 Merge branch 'networksync' of https://github.com/Withaust/FlaxEngine into Withaust-networksync 2023-05-28 13:28:05 +02:00
mafiesto4 583a5d9223 Minor fixes to content window navigation 2023-05-28 13:17:43 +02:00
mafiesto4 d42b9321f2 Merge branch 'GoaLitiuM-content_copy_fix' 2023-05-28 13:05:15 +02:00
mafiesto4 997dc53a49 Merge branch 'content_copy_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-content_copy_fix 2023-05-28 13:05:08 +02:00
mafiesto4 95d89382c9 Update Flax .gitignore to skip generated code module header files 2023-05-28 12:35:14 +02:00
mafiesto4 ecc6f83130 Use Utilities::HertzToText from #1120 to log cpu clock speed 2023-05-28 12:03:22 +02:00
mafiesto4 7ac23e35f8 Merge branch 'Tryibion-create-script-name-change' 2023-05-28 11:58:15 +02:00
mafiesto4 eeb543c653 Merge branch 'create-script-name-change' of https://github.com/Tryibion/FlaxEngine into Tryibion-create-script-name-change 2023-05-28 11:58:10 +02:00
mafiesto4 bb567cafde Improve #1120 to use shared lookup table export from engine source and reduce memory alloc from Array via Span 2023-05-28 11:46:48 +02:00
mafiesto4 d71a9efd92 Merge branch 'Withaust-unitstotext' 2023-05-28 11:22:48 +02:00
mafiesto4 a4d7693a2f Merge branch 'unitstotext' of https://github.com/Withaust/FlaxEngine into Withaust-unitstotext 2023-05-28 11:22:02 +02:00
mafiesto4 42dbd8db0a Merge branch 'GoaLitiuM-gpu_preference' 2023-05-28 11:16:45 +02:00
Tryibion c9d48d00e7 Change default script name to MyScript and make the name invalid if it is called Script. 2023-05-27 11:15:54 -05:00
Wiktor Kocielski a21abaac84 Implement INetworkObject::OnNetworkSync and make INetworkObject just virtual 2023-05-27 04:12:46 +03:00
GoaLitiuM bca5e908f1 Copy content files using Content Database instead of Content Importing
Fixes an issue where copying asset files does not change the asset ID,
causing the copied assets to remain linked to the original files.
2023-05-27 00:41:19 +03:00
GoaLitiuM 4e683dcc15 Clean up DXGIFactory after use on D3D12 2023-05-26 20:17:30 +03:00
GoaLitiuM bdf6a11491 Prefer high-performance discrete GPUs when enumerating adapters 2023-05-26 20:05:32 +03:00
Wiktor Kocielski 91fdd60b07 BytesToText -> UnitsToText 2023-05-26 18:37:28 +03:00
mafiesto4 9572073eda Add CustomArgs to compile and link environment in build tool for customization 2023-05-26 13:43:20 +02:00
Tryibion 75f1c8baaa Fix scale linking to be a ratio. 2023-05-25 10:17:08 -05:00
Tryibion e9250ab365 Fix spacing 2023-05-25 08:25:57 -05:00
Tryibion a45f067719 Fix zero scale value changing when scales are linked. #1117 2023-05-25 08:24:49 -05:00
mafiesto4 ad1c573678 Fix false-positive error when interop structure has a additional memory size (alignment) 2023-05-25 00:12:54 +02:00
mafiesto4 c2cd3b64ff Improve generated bindings code usability in Editor 2023-05-24 23:50:51 +02:00
mafiesto4 48b18bf84e Fix regression from 7c0d1ab977 when using different access level to property getter/setter 2023-05-24 23:40:40 +02:00
mafiesto4 694980160b Merge remote-tracking branch 'origin/master' into 1.6
# Conflicts:
#	Source/Editor/CustomEditors/CustomEditorsUtil.cs
#	Source/Engine/Networking/NetworkReplicator.cpp
#	Source/Engine/Scripting/ManagedCLR/MUtils.cpp
#	Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs
2023-05-24 23:28:38 +02:00
mafiesto4 90d633fb2d Minor improvements to new replication hierarchy 2023-05-24 22:59:22 +02:00
mafiesto4 e10aa1ff58 Add support for editing dictionary keys that are structures 2023-05-24 22:58:07 +02:00
mafiesto4 7efb3e3f3d Add SoftTypeReference<T> to scripting API for lazy-load type references (via typename) 2023-05-24 22:56:29 +02:00
mafiesto4 982639f215 Fix syncing Custom Editor value when using it to edit value-type 2023-05-24 22:55:02 +02:00
mafiesto4 9986d62a28 Fix crash when scripting object gets deleted while it exists in NetworkReplicationHierarchy 2023-05-24 12:06:09 +02:00
mafiesto4 2c1f6e561a Fix replication regression from eb2fc0f02f 2023-05-24 11:52:32 +02:00
mafiesto4 c4f57d19db Fix network replicator incorrect error message filter 2023-05-24 10:52:59 +02:00
mafiesto4 1a6e4bf14b Fix missing tracy header in cooked build #948 2023-05-24 09:48:02 +02:00
mafiesto4 47f9bc2017 Fix regression in Content Item tooltip #1085 2023-05-24 09:47:27 +02:00
mafiesto4 eb2fc0f02f Add **Network Replication Hierarchy** for robust control over replication in multiplayer games 2023-05-24 09:46:38 +02:00
mafiesto4 8ba17f1026 Optimize MUtils::UnboxScriptingTypeHandle 2023-05-23 18:22:43 +02:00
mafiesto4 914f7b842e Optimize interface method lookup to eliminate strlen 2023-05-23 18:22:23 +02:00
mafiesto4 4879b9bd90 Add CPU profiler events to various networking functions 2023-05-23 16:11:34 +02:00
mafiesto4 f5adbc08fa Remove unused Function::TryCall 2023-05-23 16:08:51 +02:00
mafiesto4 2881ca17a0 Fix bindings code instance object param obj to __obj to prevent name collisions 2023-05-22 18:06:08 +02:00
mafiesto4 1b8b585367 Optimize network replication when no client can receive object 2023-05-21 22:38:48 +02:00
mafiesto4 2ae20c5fc4 Add formatting to network profiler bytes values 2023-05-21 22:36:14 +02:00
Olly Rybak c92a3e566e New button styling 2023-05-21 09:57:39 +10:00
mafiesto4 d5fcdf6edb Fix BitArray::Set to not be const 2023-05-20 11:11:06 +02:00
mafiesto4 3afec6c897 Merge branch 'GoaLitiuM-rollforward' into 1.6 2023-05-19 14:11:55 +02:00
mafiesto4 ee83c19c7b Merge branch 'rollforward' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-rollforward 2023-05-19 14:11:49 +02:00
mafiesto4 144b72109b Fix crash after scripting hot-reload in editor due to cached class attribute objects
#1108
2023-05-19 13:53:49 +02:00
mafiesto4 7b8c013918 Various minor cleanups 2023-05-19 13:53:18 +02:00
mafiesto4 3e792e6cd7 Add NativeInteropException for native interop crashes 2023-05-19 13:52:30 +02:00
mafiesto4 ed70eb24c7 Fix using proper default value in scripting bindings for IntPtr value type 2023-05-19 13:49:15 +02:00
GoaLitiuM f46d1a4aba Enable roll-forward to latest .NET major preview version 2023-05-19 14:20:06 +03:00
Menotdan 306cedeb39 stopped being stupid and just copied dependencies from the other implementations. 2023-05-19 00:54:49 -04:00
Menotdan 66f66c5481 Whoops forgot includes. Hopefully this builds, but I don't have a mac to test so... 2023-05-19 00:11:29 -04:00
Menotdan 8c20ba83de Lay out what needs to be implemented for Mac 2023-05-18 22:10:35 -04:00
Menotdan cdee91f258 Color Picker FINALLY works 2023-05-18 21:48:47 -04:00
Menotdan 8f6ceece10 Change XGrabPointer call a bit. 2023-05-18 19:40:39 -04:00
Menotdan f5d3e30972 XGrabPointer doesn't seem to be doing what I want. 2023-05-18 15:42:04 -04:00
Menotdan 408d620b17 Removed more unneeded logs. 2023-05-18 00:00:06 -04:00
Menotdan 1d079842f6 Add Mac screen utilities, and removed an unneeded log. 2023-05-17 23:57:23 -04:00
Menotdan b6395cf6f1 Trying to implement XGrabPointer... 2023-05-17 23:51:24 -04:00
Menotdan d0f5d3270f Implement GetPixelAt and GetCursorPosition. 2023-05-17 23:16:44 -04:00
Menotdan 6e6a427488 refactor the code to not include BlockAndReadMouse() as a public API_FUNCTION() 2023-05-17 21:44:26 -04:00
Menotdan 48f890dd80 Merge branch 'color-picker' of https://github.com/menotdan/flaxengine into color-picker
Pull down
2023-05-17 21:21:30 -04:00
Menotdan d4bd2d372c Merge branch 'FlaxEngine:master' into color-picker 2023-05-17 21:12:37 -04:00
Menotdan 7a6c1b8b86 Add linux implementation definitions. 2023-05-17 20:59:42 -04:00
mafiesto4 0d3bae3761 Minor adjustment to #1105 so the local client state is reflected as connecting 2023-05-17 21:37:55 +02:00
mafiesto4 3e073c45ba Merge branch 'Withaust-spawnqueueownership' 2023-05-17 21:26:38 +02:00
mafiesto4 fc5ff3feb7 Merge branch 'spawnqueueownership' of https://github.com/Withaust/FlaxEngine into Withaust-spawnqueueownership 2023-05-17 21:26:26 +02:00
mafiesto4 01365f995d Merge branch 'Withaust-netregression' 2023-05-17 21:25:06 +02:00
mafiesto4 712eaebb25 Merge branch 'netregression' of https://github.com/Withaust/FlaxEngine into Withaust-netregression 2023-05-17 21:24:55 +02:00
mafiesto4 90603792d7 Add 'NSLog' to Apple platform log in game 2023-05-17 18:56:40 +02:00
mafiesto4 04d61eba3c Add code signing to ios 2023-05-17 18:53:04 +02:00
mafiesto4 24396031a7 Fix keyboard input in various cases on macOS 2023-05-17 17:27:41 +02:00
mafiesto4 b244ffedd2 Fix output log text ranges to handle line ending 2023-05-17 12:23:01 +02:00
Olly Rybak ff3bc557b2 Added pivot relative resizing to GUI Controls 2023-05-17 14:05:31 +10:00
Wiktor Kocielski f0564e0b06 Fix NetworkReplicator::SetObjectOwnership not considering spawn queue for hierarchical asignment 2023-05-17 03:34:03 +03:00
Wiktor Kocielski 31fb25a43d Fix dispatch order regression 2023-05-17 02:28:45 +03:00
Menotdan a870513086 Color picker finally works, refactored the code. 2023-05-16 13:54:25 -04:00
Menotdan 5cf3803860 Add ScreenUtilities class, to replace ScreenUtils in the Engine, so it is being moved to the Editor. 2023-05-16 10:50:53 -04:00
mafiesto4 e045f096a9 Add network debugging panel to actors and scripts
#1066
2023-05-16 14:59:15 +02:00
mafiesto4 70593177c7 Add NetworkReplicator::HasObject 2023-05-16 14:58:47 +02:00
mafiesto4 953ae3e9bb Fix hierarchical network ownership propagation to sub-objects
#1066
2023-05-16 14:58:16 +02:00
mafiesto4 64f3f1e9bc Add network error log for missing network object when accessing ownership
#1066
2023-05-16 13:08:25 +02:00
mafiesto4 3fa9f9e9cf Follow up 4482fc0bcf
#1086
2023-05-16 12:14:52 +02:00
mafiesto4 80511d5a19 Merge branch 'Menotdan-scale-icon-change' 2023-05-16 12:14:02 +02:00
mafiesto4 4482fc0bcf Cleanup #1086
Reuse text for UI tooltip
Remove `IconButton` and use simple button instead
Cleanup code style
2023-05-16 12:13:23 +02:00
mafiesto4 73ee5676c6 Merge branch 'scale-icon-change' of https://github.com/Menotdan/FlaxEngine into Menotdan-scale-icon-change 2023-05-16 12:01:10 +02:00
mafiesto4 a3ab7cd14e Fix file lock when loading asset fails
#1103
2023-05-16 11:52:49 +02:00
Menotdan 818ee98b27 Merge branch 'FlaxEngine:master' into color-picker 2023-05-15 20:46:39 -04:00
Menotdan 2a7a07d2fc Add a delegate, unfortunately it doesn't work? 2023-05-15 20:44:18 -04:00
mafiesto4 4a165d0661 Merge iOS and macOS platform settings into shared base class 2023-05-12 23:27:57 +02:00
mafiesto4 226b1307c0 Uncompress BC testures for iOS 2023-05-12 22:48:04 +02:00
mafiesto4 1dd8aa3db8 Merge remote-tracking branch 'origin/master' into 1.6 2023-05-12 18:43:03 +02:00
mafiesto4 1af69421fa Fix actor scene tree dragging regression from d813078e91
#1104
2023-05-12 18:41:58 +02:00
mafiesto4 b43196cd1a Add missing implementation for #987 2023-05-12 14:56:19 +02:00
mafiesto4 aab48f1cc1 Merge branch 'GoaLitiuM-latefixedupdate' into 1.6 2023-05-12 14:41:54 +02:00
mafiesto4 b402603b1d Merge branch 'latefixedupdate' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-latefixedupdate 2023-05-12 14:41:49 +02:00
mafiesto4 1195572318 Merge branch 'GoaLitiuM-resolve_managed_references' into 1.6 2023-05-12 14:41:35 +02:00
mafiesto4 a2113d4acc Merge branch 'resolve_managed_references' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-resolve_managed_references 2023-05-12 14:41:29 +02:00
mafiesto4 b57018f55c Merge remote-tracking branch 'origin/master' into 1.6 2023-05-12 14:41:21 +02:00
mafiesto4 eab14e28da Add play/pause/stop buttons to particle effect editor while in play-mode 2023-05-12 14:39:57 +02:00
mafiesto4 a8f670a9c9 Simplify changes from #924 and properly update after unpausing effect 2023-05-12 14:39:25 +02:00
mafiesto4 2e5d89c8cd Merge branch 'Tryibion-particle-effect-helpers' 2023-05-12 14:19:56 +02:00
mafiesto4 cde4415052 Merge branch 'particle-effect-helpers' of https://github.com/Tryibion/FlaxEngine into Tryibion-particle-effect-helpers 2023-05-12 14:19:51 +02:00
mafiesto4 b5117af4b8 Format code 2023-05-12 14:19:40 +02:00
mafiesto4 d7327d62e2 Fix text words wrapping deadlock
#1093
2023-05-12 14:14:11 +02:00
mafiesto4 b1b1b88982 Merge branch 'Swiggies-input-phases' 2023-05-12 14:13:24 +02:00
mafiesto4 17b95e3ee5 Merge branch 'input-phases' of https://github.com/Swiggies/FlaxEngine into Swiggies-input-phases 2023-05-12 14:13:18 +02:00
mafiesto4 3d36d1ce71 Merge branch 'Tryibion-style-org' 2023-05-12 14:09:17 +02:00
mafiesto4 92b155dbb3 Fix creating C# scripts in Editor with private ctor method
#1018
2023-05-12 13:58:39 +02:00
mafiesto4 42c042c249 Fix text words wrapping deadlock
#1093
2023-05-12 13:53:31 +02:00
mafiesto4 5c6de69e0e Hide FallOffExponent when light is using inverse squared falloff
#1094
2023-05-12 12:22:39 +02:00
mafiesto4 b30f845924 Simplify radial light attenuation in shaders
#1094
2023-05-12 12:22:04 +02:00
Olly Rybak b8ed115f63 More renames 2023-05-12 09:30:35 +10:00
GoaLitiuM cbe07b842f Fix resolving managed scripts references in Editor 2023-05-11 22:11:46 +03:00
GoaLitiuM de7c6483e0 Add LateFixedUpdate event for C# scripts 2023-05-11 21:10:14 +03:00
Menotdan f94ae3f3fd Add mouse hook to the color picker. 2023-05-11 13:20:43 -04:00
Olly Rybak 4b4bf833a9 Rename Phase > State 2023-05-12 00:25:03 +10:00
Olly Rybak d5237715a5 Removed unused field 2023-05-11 21:12:03 +10:00
Olly Rybak 395a72b7d4 Added comments / reformat 2023-05-11 21:10:40 +10:00
Olly Rybak f80ded2057 Initial setup 2023-05-11 17:30:20 +10:00
Menotdan a2d4207504 Fix compile errors. 2023-05-10 19:30:58 -04:00
Menotdan 627b1cee10 Resolve issues that came through when attempting to merge previously. 2023-05-10 17:49:45 -04:00
Menotdan eb75f8a8ad Merge remote-tracking branch 'upstream/master' into color-picker 2023-05-10 17:33:07 -04:00
Menotdan 5bc76de7d6 Merge branch 'master' into scale-icon-change 2023-05-10 17:16:44 -04:00
mafiesto4 4e78b49cac Improve managed exceptions logging 2023-05-10 20:42:18 +02:00
mafiesto4 637850d06c Fix crash when C# type has missing empty ctor or it throws an exception
#1019
2023-05-10 20:41:58 +02:00
Menotdan 4144c22dc4 Working demo of colorpicker eyedropper 2023-05-10 13:41:24 -04:00
Menotdan 2ce727d994 Correctly implement the ScreenUtils class 2023-05-10 13:34:28 -04:00
Menotdan 1855ff133e Tweak a few classes, add the Base classes. 2023-05-10 12:46:54 -04:00
Menotdan 51004bbd9d Learned about filter folders and now VS likes me :) 2023-05-10 11:03:05 -04:00
Menotdan 873d42344b remove files as visual studio is bugging. 2023-05-10 10:39:25 -04:00
Menotdan 27b6ba83a6 Added Windows Base Class for getting screen pixels and other screen-wide utilities 2023-05-10 10:31:44 -04:00
Tryibion eeaf7eb733 Move BoxSize 2023-05-10 08:04:47 -05:00
Tryibion 2b59cbf0f1 Organize the style groups of UI controls 2023-05-10 07:44:54 -05:00
mafiesto4 ab2cfe89ce Fix looping animation in Anim Graph when using start position offset 2023-05-10 12:47:59 +02:00
mafiesto4 aab3d494ff Fix crash when sampling animation in Anim Graph that uses it's length to calculate start position 2023-05-10 12:27:10 +02:00
mafiesto4 fe4e8f3dd2 Merge remote-tracking branch 'origin/master' into 1.6 2023-05-10 12:13:45 +02:00
mafiesto4 0c2c643ea8 Follow up #1085 with expendable type description for content items 2023-05-10 10:29:59 +02:00
mafiesto4 3bff65d6b6 Minor fix 2023-05-10 10:03:13 +02:00
mafiesto4 1069ff0c60 Merge branch 'Menotdan-master' 2023-05-10 10:02:14 +02:00
mafiesto4 03ab243f9b Merge branch 'master' of https://github.com/Menotdan/FlaxEngine into Menotdan-master 2023-05-10 10:02:06 +02:00
mafiesto4 b9d8e2b336 Merge branch 'GoaLitiuM-optimize_profiler_asset_sort' 2023-05-10 09:56:29 +02:00
mafiesto4 ac67813198 Optimize code to alloc memory manually in #1088 2023-05-10 09:31:54 +02:00
mafiesto4 6c2ba51926 Merge branch 'GoaLitiuM-object_array_marshalling' into 1.6 2023-05-10 09:22:27 +02:00
mafiesto4 c73897ce7f Merge branch 'object_array_marshalling' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-object_array_marshalling 2023-05-10 09:22:22 +02:00
mafiesto4 32bab1e7bf Minor tweak 2023-05-10 09:22:19 +02:00
mafiesto4 e26d793976 Merge branch 'GoaLitiuM-force_gc' into 1.6 2023-05-10 08:44:34 +02:00
mafiesto4 9e3c0f5e26 Merge branch 'force_gc' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-force_gc 2023-05-10 08:44:25 +02:00
mafiesto4 b14f5f5cd6 Fix macOS build 2023-05-10 08:08:21 +02:00
Menotdan 59c54db275 Implement C# callback for pixels finished reading 2023-05-10 00:58:38 -04:00
Menotdan 1ebf4d49e5 trying to get the correct window 2023-05-09 16:49:03 -04:00
Menotdan c73ab05d70 Rather odd attempt to screenshot the view 2023-05-09 16:14:37 -04:00
mafiesto4 d29c2fc5af Add unit test for guid formatting 2023-05-09 17:32:44 +02:00
mafiesto4 ec04e858ef Fix compilation issues on non-Windows platforms 2023-05-09 17:32:31 +02:00
mafiesto4 421db7fee2 Additional optimization 2023-05-09 16:52:01 +02:00
mafiesto4 3bf9c1cc10 Fix exporting skinned model after recent version changes 2023-05-09 16:39:25 +02:00
mafiesto4 e68807d574 Optimize rapidjson std lib usage 2023-05-09 16:39:13 +02:00
mafiesto4 e03516e22e Optimize text formatting functions instantiation to favor manually called String::Format 2023-05-09 16:38:59 +02:00
mafiesto4 a403c4d9ee Update fmt llibrary to version 9.1 (Aug 27, 2022) 2023-05-09 16:38:15 +02:00
mafiesto4 d13c722ce3 Optimize text formatting in various places 2023-05-09 13:44:32 +02:00
mafiesto4 2cf70453f8 Add automated test for strings formatting and localization 2023-05-09 11:19:00 +02:00
GoaLitiuM da149d32cf Force GC to run periodically in order to reduce stuttering 2023-05-08 23:29:39 +03:00
GoaLitiuM 66de1e744a Use Unsafe.As casting in generated managed marshallers 2023-05-08 23:28:54 +03:00
GoaLitiuM cae07f3623 Optimize marshalling managed arrays of object references 2023-05-08 23:28:49 +03:00
GoaLitiuM c1fa9e595c Sort profiler window assets when the view is active 2023-05-08 23:27:02 +03:00
mafiesto4 80e6853f44 Merge remote-tracking branch 'origin/master' into 1.6
# Conflicts:
#	Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs
2023-05-08 22:22:32 +02:00
Menotdan ec60c90963 Implement basic design of the eyedropper button. 2023-05-08 15:59:19 -04:00
mafiesto4 8edc154501 Fix UIControl linkage to Prefab window when creating UI within prefab Editor
#1007
2023-05-08 19:22:23 +02:00
Menotdan 86d0ccb210 Mark SetColors() virtual to override it in IconButton 2023-05-08 12:51:34 -04:00
Menotdan 74af2e53a8 Add IconButton for this branch. 2023-05-08 12:50:33 -04:00
mafiesto4 3ea771fe22 Fix crash on engine exit when asset fails to load due to serialized version mismatch 2023-05-08 17:06:13 +02:00
mafiesto4 ec6e459aa7 Fix CPU profiler events extraction when buffer is full 2023-05-08 17:05:40 +02:00
mafiesto4 959fa185c3 Fix compilation error from fa2171503b 2023-05-08 14:30:22 +02:00
mafiesto4 fa2171503b Fix locale on Linux 2023-05-08 13:57:11 +02:00
mafiesto4 2c2b403da1 Revert aeda759086 2023-05-08 13:57:02 +02:00
mafiesto4 69cdb1268a Merge remote-tracking branch 'origin/master' into 1.6 2023-05-08 12:58:42 +02:00
mafiesto4 a5afa04f8f Fix model screen size calculation in orthographic view projections
#980
2023-05-08 12:44:01 +02:00
mafiesto4 aeda759086 Minor tweak 2023-05-08 12:32:42 +02:00
mafiesto4 0508d5a987 Merge branch 'GoaLitiuM-tracy_v09' 2023-05-08 11:56:31 +02:00
mafiesto4 31a000b2b6 Merge branch 'tracy_v09' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-tracy_v09 2023-05-08 11:56:15 +02:00
mafiesto4 95daff3e96 Run editor analytics in async 2023-05-08 11:40:50 +02:00
mafiesto4 04439d9dec Upgrade Editor analytics from deprecated Universal Analytics to the latest GA4 2023-05-08 11:40:20 +02:00
Menotdan 681564189f Finish implementing IconButton and use that to create a more intuitive scale linking interface. 2023-05-08 00:42:38 -04:00
Menotdan f6ee5123d7 Revert "Use shorter, relative path for displaying Asset Tooltips."
This reverts commit 4c906f4040.

Revert changes I don't want anymore, after making a new branch for the changes I've done.
2023-05-07 23:10:07 -04:00
Menotdan 296ac0b940 Revert "Use shorter, relative path for displaying Asset Tooltips."
This reverts commit 4c906f4040.

undo changes from master branch which I don't want for this seperate change.
2023-05-07 23:04:11 -04:00
Menotdan 141555377b Begin working on an IconButton class, and demoing the IconButton idea using the scale link icon. 2023-05-07 22:58:57 -04:00
mafiesto4 c0428c3316 Simplify Editor analytics code 2023-05-07 23:02:36 +02:00
Menotdan e7249d9d94 Merge branch 'FlaxEngine:master' into master 2023-05-07 15:38:07 -04:00
Menotdan f3d7ad0aa9 Add better tooltips to all files and folders. 2023-05-07 14:03:27 -04:00
mafiesto4 5a66e90b56 Merge remote-tracking branch 'origin/master' into 1.6
# Conflicts:
#	.github/workflows/tests.yml
#	Source/Engine/Content/JsonAsset.cs
2023-05-07 19:46:29 +02:00
Menotdan cffc3f7f5d Better formatting for type names. 2023-05-07 13:44:15 -04:00
mafiesto4 0a5d37fd9b Add support for spawning multiple objects over network within a single group that is not from Prefabs
#1066
2023-05-07 19:40:31 +02:00
mafiesto4 531d005169 Fix accessing object ownership info locally before object gets fully spawned
#1066
2023-05-07 19:39:57 +02:00
Menotdan c717a102fc Add an option to toggle translating tooltip type names (not implemented yet) 2023-05-07 13:12:27 -04:00
Menotdan 4c906f4040 Use shorter, relative path for displaying Asset Tooltips. 2023-05-07 13:11:53 -04:00
mafiesto4 159fb8f5ee Fix folders delete regression issue from dbd5c71344
#1084
2023-05-07 18:22:58 +02:00
mafiesto4 0c3d1e3ec6 Fix existing nested prefabs sync applying when updating base prefab changes
#1015
2023-05-07 18:12:06 +02:00
mafiesto4 dd7dc28828 Add automated unit test for nested prefab changes sync after base prefab apply #1015 2023-05-07 18:09:54 +02:00
mafiesto4 a99f792979 Disable unit test on Linux for now 2023-05-07 13:58:28 +02:00
mafiesto4 713cf0d4b2 Improve #1077 to use a single pixel shader with permutations 2023-05-07 11:01:30 +02:00
mafiesto4 10541ac743 Merge branch 'Withaust-debugshader' 2023-05-07 10:55:32 +02:00
mafiesto4 7c6148dfd8 Merge branch 'debugshader' of https://github.com/Withaust/FlaxEngine into Withaust-debugshader 2023-05-07 10:53:54 +02:00
mafiesto4 fae6a1ebe9 Merge branch 'Withaust-layermatrix' 2023-05-07 10:53:02 +02:00
mafiesto4 bc1cb402ab Merge branch 'layermatrix' of https://github.com/Withaust/FlaxEngine into Withaust-layermatrix 2023-05-07 10:52:10 +02:00
mafiesto4 e973c3ee67 Merge branch 'Tryibion-ensure-prefab-staticflags' 2023-05-07 10:46:26 +02:00
mafiesto4 bcbbd98898 Merge branch 'ensure-prefab-staticflags' of https://github.com/Tryibion/FlaxEngine into Tryibion-ensure-prefab-staticflags 2023-05-07 10:46:20 +02:00
mafiesto4 4131e15f0e Fix deprecation warnings 2023-05-07 10:46:13 +02:00
mafiesto4 e8ec5794d2 Simplify code #1034 2023-05-06 23:02:35 +02:00
mafiesto4 a9f1163743 Merge branch 'RuanLucasGD-master' 2023-05-06 23:01:47 +02:00
mafiesto4 4be02f5832 Merge branch 'master' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-master 2023-05-06 23:01:42 +02:00
mafiesto4 efab20e335 Fix compilation regression from 5d2a3482c7 2023-05-06 23:00:50 +02:00
mafiesto4 c47907c0c3 Fix C# serialization of reference to self (eg. script sub-object referencing owning script)
#55
2023-05-06 17:36:17 +02:00
Ruan Lucas 7faa9aa23a Merge branch 'master' into master 2023-05-06 10:53:37 -04:00
Ruan Lucas 64515404e9 refactor again 2023-05-06 10:49:07 -04:00
Ruan Lucas db14c8a0a6 refactor "GetSubTags" 2023-05-06 10:46:26 -04:00
mafiesto4 10bab59acc Fix scene asset runtime contents when saving scene file in Editor 2023-05-06 14:58:10 +02:00
mafiesto4 2affebd375 Fix C# serialization of scene objects when property throws and exception
#88
2023-05-06 14:57:44 +02:00
mafiesto4 3f2f567364 Merge branch 'Withaust-customicons' 2023-05-05 16:28:28 +02:00
mafiesto4 dee445c32c Fix compilation warnings 2023-05-05 16:27:57 +02:00
mafiesto4 d65fe3bae3 Merge branch 'customicons' of https://github.com/Withaust/FlaxEngine into Withaust-customicons 2023-05-05 16:23:42 +02:00
mafiesto4 04daf10a92 Merge branch 'Tryibion-random-range-visject' 2023-05-05 16:22:51 +02:00
mafiesto4 1a3c6bfc73 Merge branch 'random-range-visject' of https://github.com/Tryibion/FlaxEngine into Tryibion-random-range-visject 2023-05-05 16:22:46 +02:00
mafiesto4 b797d3b0f0 Merge branch 'Withaust-sceneunloading' 2023-05-05 16:19:53 +02:00
mafiesto4 bcefaea416 Merge branch 'sceneunloading' of https://github.com/Withaust/FlaxEngine into Withaust-sceneunloading 2023-05-05 16:19:16 +02:00
Tryibion 12a2a69ad7 Change to TryGetBox 2023-05-05 09:18:44 -05:00
Wiktor Kocielski 68151592a4 Make Level class to unload scenes in reversed order 2023-05-05 17:11:24 +03:00
mafiesto4 5d2a3482c7 Reduce compilation problems by moving FindObject fwd decl to be more commonly included
#1040
2023-05-05 16:10:09 +02:00
mafiesto4 e93eb6aae6 Merge branch 'Tryibion-collision-creation-fix' 2023-05-05 16:05:31 +02:00
mafiesto4 b7f269f9bd Merge branch 'collision-creation-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-collision-creation-fix 2023-05-05 16:05:26 +02:00
mafiesto4 bb4c459296 Merge branch 'Tryibion-reopen-all-active-scenes' 2023-05-05 15:58:58 +02:00
mafiesto4 404340b02e Improve #1025 2023-05-05 15:58:18 +02:00
mafiesto4 50c6b23e35 Merge branch 'reopen-all-active-scenes' of https://github.com/Tryibion/FlaxEngine into Tryibion-reopen-all-active-scenes 2023-05-05 15:47:41 +02:00
Tryibion 95d798f49e Standardize to changing the folder for any proxy that can not be created in the current view. 2023-05-05 08:30:17 -05:00
Wiktor Kocielski 42a9eaf72e Make DebugDraw render lines with unlit PS 2023-05-05 16:29:12 +03:00
Tryibion 86044fcc05 Change logic for Random Rang particle nodes 2023-05-05 08:17:07 -05:00
mafiesto4 285a824858 Fix crash when removing particle emitter from system that has old parameter override
#1044
2023-05-05 15:08:53 +02:00
mafiesto4 37e8fa7b76 Fix creating localization table on blank project
#1060
2023-05-05 14:54:42 +02:00
mafiesto4 315df12fbe Favor passing Tag as value since it's just uint32 under the hood 2023-05-05 14:34:32 +02:00
mafiesto4 3a3e8e2ad5 Fix actors spawning in prefab editor 2023-05-05 14:18:32 +02:00
mafiesto4 ec2226f06e Fixes for dotnet7 after #1061 and 5e31a678bd 2023-05-05 11:58:11 +02:00
mafiesto4 22239bc2d1 Merge remote-tracking branch 'origin/master' into 1.6 2023-05-05 11:41:32 +02:00
mafiesto4 238526bdc4 Merge branch 'GoaLitiuM-managed_handle_fix' into 1.6 2023-05-05 11:40:43 +02:00
mafiesto4 b1988776ab Merge branch 'managed_handle_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-managed_handle_fix 2023-05-05 11:40:37 +02:00
mafiesto4 de1ba2de6f Merge branch 'RuanLucasGD-improv_material_proxy' 2023-05-05 11:38:39 +02:00
mafiesto4 65a68131cc Improve name construction in #1038 2023-05-05 11:38:28 +02:00
mafiesto4 c6ecf12c32 Merge branch 'improv_material_proxy' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-improv_material_proxy 2023-05-05 11:36:21 +02:00
mafiesto4 177d48acb5 Merge branch 'Tryibion-delete-bug-fix' 2023-05-05 11:26:25 +02:00
mafiesto4 695b630e79 Merge branch 'delete-bug-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-delete-bug-fix 2023-05-05 11:26:09 +02:00
mafiesto4 ea1b2ada50 Merge branch 'Withaust-staticflagtypofix' 2023-05-05 11:24:29 +02:00
mafiesto4 912d1503e5 Merge branch 'staticflagtypofix' of https://github.com/Withaust/FlaxEngine into Withaust-staticflagtypofix 2023-05-05 11:24:23 +02:00
mafiesto4 9c9bb7ca53 Merge branch 'Tryibion-vect3-add-fix' 2023-05-05 11:23:41 +02:00
mafiesto4 c665cc99b9 Merge branch 'vect3-add-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-vect3-add-fix 2023-05-05 11:22:59 +02:00
mafiesto4 bd43ca236b Merge branch 'Tryibion-unload-scenes' 2023-05-05 11:13:48 +02:00
mafiesto4 9e7fb79859 Merge branch 'unload-scenes' of https://github.com/Tryibion/FlaxEngine into Tryibion-unload-scenes 2023-05-05 11:11:33 +02:00
mafiesto4 9cd8a74bba Merge branch 'RuanLucasGD-small_fix_combobox' 2023-05-05 11:09:36 +02:00
mafiesto4 daa06cb320 Merge branch 'small_fix_combobox' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-small_fix_combobox 2023-05-05 11:09:27 +02:00
mafiesto4 bc1da787de Merge branch 'Tryibion-darker-drag-between' 2023-05-05 10:59:37 +02:00
mafiesto4 11a8bb59ce Merge branch 'darker-drag-between' of https://github.com/Tryibion/FlaxEngine into Tryibion-darker-drag-between 2023-05-05 10:58:48 +02:00
mafiesto4 a324e05e8f Merge branch 'Tryibion-col-size-edit' 2023-05-05 10:55:20 +02:00
mafiesto4 747abba4f7 Merge branch 'col-size-edit' of https://github.com/Tryibion/FlaxEngine into Tryibion-col-size-edit 2023-05-05 10:55:13 +02:00
mafiesto4 e9eb9890a0 Merge branch 'RuanLucasGD-changes_particle_window' 2023-05-05 10:52:49 +02:00
mafiesto4 deaab07793 Merge branch 'changes_particle_window' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-changes_particle_window 2023-05-05 10:52:41 +02:00
mafiesto4 5e31a678bd Improve C# Object comparison by using native pointer compare #1061 #713 #795 2023-05-05 10:49:07 +02:00
mafiesto4 f0176c3520 Merge branch 'RuanLucasGD-simplify_actor_comparations' 2023-05-05 10:16:56 +02:00
mafiesto4 142202f519 Merge branch 'simplify_actor_comparations' of https://github.com/RuanLucasGD/FlaxEngine into RuanLucasGD-simplify_actor_comparations 2023-05-05 10:16:47 +02:00
mafiesto4 634053432e Merge branch 'GoaLitiuM-weak_handle_improvements_2' into 1.6 2023-05-05 10:04:33 +02:00
mafiesto4 17fbfc969b Merge branch 'weak_handle_improvements_2' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-weak_handle_improvements_2 2023-05-05 10:04:27 +02:00
mafiesto4 e8e3d5dfa6 Merge branch 'GoaLitiuM-reuse_pooled_array_buffers' into 1.6 2023-05-05 10:02:34 +02:00
mafiesto4 f82e4b332d Merge branch 'reuse_pooled_array_buffers' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-reuse_pooled_array_buffers 2023-05-05 10:02:28 +02:00
mafiesto4 433a398b45 Fix array copy in #1065 2023-05-05 10:00:44 +02:00
mafiesto4 ca9d98f466 Merge branch 'GoaLitiuM-custom_attrib_caching' into 1.6 2023-05-05 09:58:59 +02:00
mafiesto4 e97653d3f3 Merge branch 'custom_attrib_caching' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-custom_attrib_caching 2023-05-05 09:58:48 +02:00
mafiesto4 b98d3ae572 Update splash screen quotes 2023-05-05 09:36:32 +02:00
mafiesto4 53223bb2ab Update splash screen quotes 2023-05-05 09:35:19 +02:00
mafiesto4 848ab51753 Adjust Visject CM header background 2023-05-05 09:24:47 +02:00
mafiesto4 d56f7a211f Optimize UI performance when destroying complex UI structures 2023-05-05 09:23:22 +02:00
Tryibion 98a5985ce9 Fix bug of the collection size changing while still editing or sliding the size box. 2023-05-04 11:03:39 -05:00
mafiesto4 71a5d56105 Add support for importing skeleton-only as Skinned Model (eg. from animation file to have skeleton for retargeting) 2023-05-04 15:43:44 +02:00
mafiesto4 c91bc0d8c6 Improve Root Motion extraction and playback 2023-05-04 15:10:55 +02:00
mafiesto4 57052b3b14 Fix marshallers 2023-05-04 14:18:32 +02:00
mafiesto4 a889d888ff Refactor RootMotionData into Transform to simplify code 2023-05-04 14:18:12 +02:00
mafiesto4 2b2b4f6b6f Fix exception in rare cases 2023-05-04 13:55:14 +02:00
mafiesto4 273b6c0228 Various minor improvements 2023-05-04 11:55:22 +02:00
mafiesto4 1c12e3d530 Fix bug in StringUtils::PathRemoveRelativeParts when going up to the Windows drive with relative path bits 2023-05-04 11:54:55 +02:00
mafiesto4 05ffaf7cef Add **skeleton retargeting** to play animations on different skeletons 2023-05-04 11:54:17 +02:00
Tryibion 144287ba1c Add Unload all but this scene option to scene context menu to unload all of the active scenes except for the selected one. 2023-05-03 20:38:55 -05:00
Tryibion f0da221621 Make the drag indicator between tree nodes a little brighter. 2023-05-02 21:44:00 -05:00
Ruan Lucas 518ce457df fix doc 2023-05-02 08:56:18 -04:00
GoaLitiuM 5efbfc86ad Prevent weak managed handle collections during long operations
Loading larger scenes may trigger multiple collections during the P/Invoke call,
so prevent collections from happening within a second to avoid in-flight handles
getting collected before the operation finishes.
2023-05-01 20:08:00 +03:00
GoaLitiuM 36a9ffe3aa Try to reuse previously allocated buffers in pooled ManagedArrays 2023-05-01 20:07:27 +03:00
GoaLitiuM 65b63da93a Improve custom attributes caching in managed classes 2023-05-01 20:06:51 +03:00
Ruan Lucas c900b6525d forgot to save the XD file 2023-04-30 14:30:08 -04:00
Ruan Lucas 176f95fbbc move == operator from Actor class to Object class 2023-04-30 14:25:41 -04:00
Ruan Lucas cfefe7a24c add == operator on Actors 2023-04-30 11:06:58 -04:00
Ruan Lucas 299ca398fa small change in particle window 2023-04-29 18:44:54 -04:00
Ruan Lucas bc9c9d2e72 Merge branch 'FlaxEngine:master' into master 2023-04-29 08:48:52 -04:00
mafiesto4 6d7e23f254 Fix text wrapping regression 2023-04-29 13:05:23 +02:00
mafiesto4 b89d32ce2b Fix text wrapping regression 2023-04-29 13:05:06 +02:00
mafiesto4 3136079ca3 Merge branch 'GoaLitiuM-weak_handle_improvements' into 1.6 2023-04-29 12:18:39 +02:00
mafiesto4 7f741c04ed Merge branch 'weak_handle_improvements' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-weak_handle_improvements 2023-04-29 12:18:28 +02:00
mafiesto4 5a2831d0cb Various improvements 2023-04-29 12:11:17 +02:00
mafiesto4 896f75b789 Add skeleton nodes names debug drawing in Editor preview when enabled 2023-04-29 12:10:15 +02:00
mafiesto4 ba319d8499 Add scale parameter to DebugDraw text drawing to rescale text without reducing font size 2023-04-29 12:09:36 +02:00
GoaLitiuM 320955f8b7 Use weak handles for marshalling temporary managed-to-native parameters 2023-04-29 12:41:02 +03:00
GoaLitiuM 6378f62acd Improve weak managed handle collection
Use thread-static pools for weak managed handles in order to reduce locking,
and collect the handles either right after garbage collection or when the pool
size becomes too large.
2023-04-29 12:40:58 +03:00
mafiesto4 7c0d1ab977 Fix access level of generated type marshaller if target type is protected or private 2023-04-29 11:11:30 +02:00
mafiesto4 4d1ac04e5c Add GroupElement.AddSettingsButton for editor ui 2023-04-29 11:10:48 +02:00
mafiesto4 385ef7361c Fix file size on unix systems if file is missing 2023-04-28 23:55:11 +02:00
mafiesto4 b6ceed5c6d Add packaging iOS app to ipa file 2023-04-28 23:54:50 +02:00
Tryibion 6fd636b421 Change to serialize list as array 2023-04-28 09:33:24 -05:00
Tryibion 1978cb6df9 Fix bug with not deleting all children on folder delete 2023-04-28 08:48:13 -05:00
mafiesto4 8de2e6a424 Fix build tool compilation with older dotnet tools 2023-04-26 22:36:44 +02:00
mafiesto4 915f6a719d Add automatic skeleton retargeting when playing Anim Graph on other skeletal model 2023-04-26 20:03:27 +02:00
mafiesto4 12f5157bfb Add debug drawing selected skeleton node in Skinned Model window viewport 2023-04-26 17:28:58 +02:00
mafiesto4 968e1328dc Add skeleton node or bone copy context menu in Editor 2023-04-26 16:20:30 +02:00
mafiesto4 6aaa5832a8 Fix crash when updating GPU texture residency to 0 2023-04-26 15:00:07 +02:00
mafiesto4 cf6b9b7ab5 Fix crash when updating GPU texture residency to 0 2023-04-26 14:59:36 +02:00
mafiesto4 5b50562a9f Refactor Skeleton Mapping to be handled by Skinned Model instead of Animation asset 2023-04-26 14:27:01 +02:00
Wiktor Kocielski 89d34650c0 Fix LayersMatrixEditor 2023-04-26 00:28:51 +03:00
mafiesto4 39b89ada6c Fix Anim Graph state machine rule graph opening after transition removal undo 2023-04-25 10:59:31 +02:00
mafiesto4 698a9f1938 Add **Interruption options** to State Machine transition 2023-04-25 10:47:10 +02:00
Tryibion c920b75142 Fix collision assets creation in non asset folders. 2023-04-24 17:47:19 -05:00
Tryibion 5178caeda6 Add inputs to Random Range visject float nodes 2023-04-24 17:27:43 -05:00
mafiesto4 7158cfb5bf Add **Any State to Anim Graph state machines** 2023-04-24 20:20:27 +02:00
Wiktor Kocielski 2c9541f6a0 ViewportIconsRenderer::AddActorWithTexture addition 2023-04-24 19:08:29 +03:00
Tryibion 0b3259fcc3 Increase size of add node so that vector3 fits correctly 2023-04-24 11:02:44 -05:00
Ruan Lucas 309302c212 improv: set new material instance name to parent material name 2023-04-23 13:27:32 -04:00
Wiktor Kocielski ce1b47979e Typo fixes 2023-04-23 18:26:05 +03:00
Ruan Lucas 85cfc73bbf clean code 2023-04-22 14:51:40 -04:00
mafiesto4 65e477cfd0 Add engine version defines for build scripts (eg. FLAX_1_6_OR_NEWER) 2023-04-22 19:55:29 +02:00
Ruan Lucas 107bea9c2e implement: add "GetSubTags" to "Tags" 2023-04-22 13:38:54 -04:00
Tryibion 918140bc6d Change List<Guid> to Guid[] when deserializing. 2023-04-22 12:04:57 -05:00
mafiesto4 390460907d Merge remote-tracking branch 'origin/master' into 1.6
# Conflicts:
#	Source/Editor/Scripting/CodeEditors/VisualStudioCodeEditor.cpp
#	Source/Tools/Flax.Build/Deps/Dependencies/OpenAL.cs
2023-04-22 18:59:41 +02:00
mafiesto4 73ff053470 Fix ViewportIconsRenderer usage in game C++ scripts 2023-04-22 18:43:11 +02:00
mafiesto4 9377466ec8 Allow newer clang versions on Linux 2023-04-22 18:31:25 +02:00
mafiesto4 37032810c9 Fix collision data cooking from model asset by favoring CPU data fetching 2023-04-22 18:15:49 +02:00
mafiesto4 9e222d222c Fix dead-lock in characters layout calc regression from e8aa2f922b 2023-04-22 18:00:25 +02:00
mafiesto4 55621054d8 Merge branch 'GoaLitiuM-vscode_goto_fix' 2023-04-22 17:45:38 +02:00
mafiesto4 8d057f5b8e Merge branch 'vscode_goto_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-vscode_goto_fix 2023-04-22 17:45:32 +02:00
mafiesto4 f04d723b29 Merge branch 'Withaust-nettransformfix' 2023-04-22 17:34:13 +02:00
mafiesto4 2bd66cf625 Merge branch 'nettransformfix' of https://github.com/Withaust/FlaxEngine into Withaust-nettransformfix 2023-04-22 17:34:07 +02:00
mafiesto4 c9a2a17166 Merge branch 'PrecisionRender-add-missing-math-funcs' 2023-04-22 17:31:39 +02:00
mafiesto4 c5b7d2fe8a Merge branch 'add-missing-math-funcs' of https://github.com/PrecisionRender/FlaxEngine into PrecisionRender-add-missing-math-funcs 2023-04-22 17:31:33 +02:00
mafiesto4 978b3f835a Add editor playback utilities for Audio Source and Scene Animation Player 2023-04-22 17:25:55 +02:00
GoaLitiuM 765cd7a0f0 Fix managed scripting object handles created in managed side 2023-04-22 14:21:45 +03:00
GoaLitiuM f19e0628c5 Fix Visual Studio Code jump to line argument 2023-04-22 14:21:02 +03:00
mafiesto4 2090cba743 Fix crash when using multiple audio clips streaming with XAudio2 backend 2023-04-22 13:01:05 +02:00
mafiesto4 8d0cfcf05d Fix missing initial audio source volume setup for XAudio2 2023-04-22 12:26:10 +02:00
mafiesto4 97e2e9a61d Fix content view items refresh (eg. after delete) when using search field 2023-04-22 11:51:18 +02:00
Wiktor Kocielski a1f225d2ef [C++] NetTransform copy-paste mistake fix 2023-04-21 18:57:41 +03:00
Tryibion c93b41a88d Small Cleanup 2023-04-21 10:34:40 -05:00
mafiesto4 3e8a29cdd5 Improve XAudio2 backend playback quality for spatial multi-channel sounds 2023-04-21 15:59:41 +02:00
mafiesto4 3d16f97e4c Improve audio source setup clip after all properties are read 2023-04-21 15:59:18 +02:00
mafiesto4 2afa287b67 Improve automatic slider speed for float value fields in Editor 2023-04-21 15:58:48 +02:00
mafiesto4 8457687025 Add Pan to Audio Source for stereo panning 2023-04-21 15:58:22 +02:00
Tryibion 76c6696ead Add saving and re-opening all active scenes between editor sessions. 2023-04-21 08:36:56 -05:00
PrecisionRender 5a94116c9b Add some more missing functions to C++ Math 2023-04-20 11:50:19 -05:00
mafiesto4 eb613d3e8a Add DopplerFactor to Audio Source 2023-04-20 16:01:27 +02:00
mafiesto4 c8dc8396f9 Merge branch 'Tryibion-remap-change' 2023-04-20 15:24:36 +02:00
mafiesto4 8cfc14f4b1 Add EnumAddFlags for easy flags appending 2023-04-20 15:21:47 +02:00
mafiesto4 1ffe8a7b60 Add OpenAL AL_SOFT_source_spatialize extension support for stereo spatial audio playback
Add `AllowSpatialization` option to `AudioSource`
2023-04-20 15:01:22 +02:00
mafiesto4 094a3cfe5a Refactor 3d audio for good spatial sound quality 2023-04-20 14:54:12 +02:00
mafiesto4 8c638e7947 Improve audio clip window usability in Editor 2023-04-20 11:13:20 +02:00
mafiesto4 d719ef8d03 Fix crash when reimporting audio clip while it's being played 2023-04-20 10:56:57 +02:00
mafiesto4 6ec35e5175 Add audio clip preview refresh on asset reimport in Editor 2023-04-20 10:50:29 +02:00
mafiesto4 dd9fa6e949 Fix OpenAL and XAudio2 audio backend listener/source velocity to prevent too strong Doppler effect 2023-04-19 23:24:43 +02:00
Tryibion be204fd2f5 Ensure prefab actors static flags match parent flags or keeps it's own. 2023-04-19 14:05:51 -05:00
mafiesto4 787414451e Add current playback position preview with seeking functionality to Audio Clip window in Editor 2023-04-19 15:17:01 +02:00
mafiesto4 552ce3e495 Add AudioDataInfo.Length 2023-04-19 15:15:28 +02:00
Tryibion 29f5556634 Fix obsolete map warnings. 2023-04-19 07:23:27 -05:00
mafiesto4 1e1c296300 Cleanup HRTF support code #963 2023-04-19 13:12:27 +02:00
mafiesto4 1b278f5c56 Update Mathf.Map usage to Mathf.Remap
#1008
2023-04-19 13:11:52 +02:00
mafiesto4 c2117f0254 Update OpenAL version to 1.23.1
#963
2023-04-19 13:11:04 +02:00
mafiesto4 648520a6dc Merge branch 'envision3d-feature/openal-hrtf' 2023-04-19 11:41:46 +02:00
mafiesto4 42c657cb58 Merge branch 'feature/openal-hrtf' of https://github.com/envision3d/FlaxEngine into envision3d-feature/openal-hrtf 2023-04-19 11:41:40 +02:00
mafiesto4 b6a46a5ec2 Merge branch 'PrecisionRender-cpp-move-towards' 2023-04-19 11:18:50 +02:00
mafiesto4 6fef9b09fa Merge branch 'cpp-move-towards' of https://github.com/PrecisionRender/FlaxEngine into PrecisionRender-cpp-move-towards 2023-04-19 11:18:34 +02:00
mafiesto4 941237342d Merge branch 'Withaust-mathfix' 2023-04-19 11:12:26 +02:00
mafiesto4 9501d23f35 Merge branch 'mathfix' of https://github.com/Withaust/FlaxEngine into Withaust-mathfix 2023-04-19 11:12:19 +02:00
mafiesto4 0a13e01d95 Merge branch 'Tryibion-sign-fix' 2023-04-19 11:09:23 +02:00
mafiesto4 1f2260048a Merge branch 'sign-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-sign-fix 2023-04-19 11:09:13 +02:00
mafiesto4 44d78dccbb Merge branch 'Tryibion-drag-fix' 2023-04-19 11:04:23 +02:00
mafiesto4 5eb888868f Merge branch 'drag-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-drag-fix 2023-04-19 11:04:17 +02:00
mafiesto4 38b1203bb2 Merge branch 'Tryibion-prefab-name' 2023-04-19 10:59:39 +02:00
mafiesto4 627de10e72 Merge branch 'prefab-name' of https://github.com/Tryibion/FlaxEngine into Tryibion-prefab-name 2023-04-19 10:52:25 +02:00
mafiesto4 644eb35b97 Fix building bindings-only cross-platform with dotnet7 2023-04-18 20:25:06 +02:00
mafiesto4 ca48d60627 Merge remote-tracking branch 'origin/master' into 1.6 2023-04-18 19:47:13 +02:00
mafiesto4 a500f88b4c Fix compilation with UseLargeWorlds 2023-04-18 19:44:32 +02:00
mafiesto4 808c741ed7 Add SDKs printing in Github Actions for more verbosity of the setup 2023-04-18 19:39:50 +02:00
mafiesto4 9eaef3447c Improve Flax.Build build rules caching to include .NET runtime version and engine installation check 2023-04-18 19:06:49 +02:00
mafiesto4 364676ceae Fix compile warning in 32-bit build 2023-04-18 18:19:34 +02:00
mafiesto4 e21756d685 Add logging .NET runtime version to build tool 2023-04-18 18:19:03 +02:00
mafiesto4 7df206f533 Fix deploying system .NET runtime files after system-installed .NET has been updated 2023-04-18 18:18:43 +02:00
mafiesto4 e3ceaa3f9a Update Flax deployment scripts for dotnet7 2023-04-18 18:17:47 +02:00
mafiesto4 8b2d3db3f1 Fix passing boxed reference values to managed thunk and properly unbox non-POD structures 2023-04-18 15:54:54 +02:00
mafiesto4 589941d6b2 Add non-POD structure test for method or event parameter reference passing via scripting bindings 2023-04-18 14:00:16 +02:00
mafiesto4 f046642ba7 Improve stability by fixing various crashes with dotnet7 2023-04-18 12:36:33 +02:00
Tryibion 3792aa1984 Add select actor on script drop, Fix dragging asset into scene tree between nodes. 2023-04-17 17:31:21 -05:00
mafiesto4 024dd74ae1 Fix interface marshaller codegen for dotnet7 2023-04-17 22:34:00 +02:00
Tryibion cdc8e4adb8 Take parent actor name as initial prefab name. 2023-04-17 13:34:25 -05:00
mafiesto4 8c02dfbb3f Ignore logging missing env var on Windows 2023-04-17 19:02:58 +02:00
mafiesto4 9a84f9e4ac Improve native library path on dotnet when using plugins 2023-04-17 14:06:47 +02:00
mafiesto4 9322a2006a Post merge fixes for new dotnet7 2023-04-17 14:04:08 +02:00
mafiesto4 67b373c6df Merge remote-tracking branch 'origin/master' into 1.6 2023-04-17 13:18:08 +02:00
mafiesto4 0842a95dd6 Merge branch 'Tryibion-change-profilier-play-icon' 2023-04-17 13:08:52 +02:00
mafiesto4 c3ef9f993b Merge branch 'change-profilier-play-icon' of https://github.com/Tryibion/FlaxEngine into Tryibion-change-profilier-play-icon 2023-04-17 13:08:46 +02:00
mafiesto4 378e48e7aa Fix cached DraggedOverNode to be properly reset after drag and #996 2023-04-17 13:06:56 +02:00
mafiesto4 7ad497ca3b Merge branch 'Tryibion-actor-drag-visual-change' 2023-04-17 12:59:24 +02:00
mafiesto4 0e3dedbc5b Merge branch 'actor-drag-visual-change' of https://github.com/Tryibion/FlaxEngine into Tryibion-actor-drag-visual-change 2023-04-17 12:59:08 +02:00
mafiesto4 414bce38bb DOn't even start drag and drop if content item is detached from UI 2023-04-17 12:54:01 +02:00
mafiesto4 67da36a611 Merge branch 'Tryibion-change-wrap-words' 2023-04-17 12:51:07 +02:00
mafiesto4 dc32386590 Merge branch 'change-wrap-words' of https://github.com/Tryibion/FlaxEngine into Tryibion-change-wrap-words 2023-04-17 12:51:02 +02:00
mafiesto4 e9bdc8b319 Fix crash when starting drag&drop with invalid control state (detached from window) 2023-04-17 12:36:59 +02:00
mafiesto4 4449f1ddcf Merge branch 'Withaust-master' 2023-04-17 12:34:29 +02:00
mafiesto4 6562a8769e Merge branch 'master' of https://github.com/Withaust/FlaxEngine into Withaust-master 2023-04-17 12:34:23 +02:00
mafiesto4 fcb71134c2 Merge branch 'Tryibion-content-bug-fix' 2023-04-17 12:29:16 +02:00
mafiesto4 b7dcf9576e Merge branch 'content-bug-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-content-bug-fix 2023-04-17 12:29:03 +02:00
mafiesto4 2eea7abc27 Add Create collision data action to be performed for each model selected in the Content Window 2023-04-17 12:20:02 +02:00
mafiesto4 71b5b528fd Remove shadows casting and sdf data from editor camera model 2023-04-17 11:52:19 +02:00
GoaLitiuM d5b8e44572 Cache networking code generation task results 2023-04-17 11:12:16 +02:00
mafiesto4 b85184eee0 Optimize vectors normalization 2023-04-17 11:10:14 +02:00
Wiktor Kocielski 2e1691c2f1 CSharp Math.Remap method obsoletion 2023-04-17 05:52:02 +03:00
mafiesto4 c3cc78b7c2 Cleanup code after #1001 2023-04-16 19:46:36 +02:00
mafiesto4 297b4f2a81 Merge branch 'PrecisionRender-cpp-clamp-length' 2023-04-16 19:43:03 +02:00
mafiesto4 e1ea6a0676 Merge branch 'cpp-clamp-length' of https://github.com/PrecisionRender/FlaxEngine into PrecisionRender-cpp-clamp-length 2023-04-16 19:42:55 +02:00
mafiesto4 4378b9e455 Merge branch 'Tryibion-change-cook-text' 2023-04-16 19:41:26 +02:00
mafiesto4 f843b3858a Merge branch 'change-cook-text' of https://github.com/Tryibion/FlaxEngine into Tryibion-change-cook-text 2023-04-16 19:41:20 +02:00
mafiesto4 f5c9dce34a Fix network RPC object id mapping back to server id when sent from client 2023-04-16 18:55:31 +02:00
mafiesto4 8a80a26523 Add networking replication codegen for C# array properties with object references or custom structures 2023-04-16 15:30:51 +02:00
mafiesto4 2e22abaff9 Refactor C# network replication codegen to be more extendable based on value context source 2023-04-16 14:56:54 +02:00
mafiesto4 d38badb54b Add array property replication code-gen for C# networking 2023-04-16 13:00:28 +02:00
PrecisionRender 17aca44a3b Add MoveTowards functions to C++ Math 2023-04-15 16:40:03 -05:00
Wiktor Kocielski dbd5c71344 Fix RMB deletion to take selection into account 2023-04-15 22:32:52 +03:00
PrecisionRender 49e05bc206 Add ClampLength functions to C++ Vector3 2023-04-15 12:53:19 -05:00
mafiesto4 2d51332bf7 Rename networking codegen initializer to NetworkingPlugin for C# netcode 2023-04-15 12:05:33 +02:00
mafiesto4 e4804db160 Add NetworkRpcParams for sending RPC to specific set of clients or to read sender id 2023-04-15 12:04:40 +02:00
Tryibion 4e5795ab91 Changed Cook&Run to Cook & Run. 2023-04-14 16:21:19 -05:00
Tryibion acecda482d Changes the play icon to a stop icon and vice versa when clicked for the profiler. 2023-04-14 15:29:02 -05:00
Tryibion da85771472 Small fixes 2023-04-14 15:07:06 -05:00
Tryibion e8aa2f922b Allow word wrapping to wrap on capital letters and underscores. 2023-04-14 15:00:50 -05:00
Tryibion 62a335fab0 Fix bug of re-parenting actors if children and parent actors are selected 2023-04-14 13:34:43 -05:00
Tryibion d813078e91 Made it so the visuals of dragging an actor will only show between the nodes and on the node. 2023-04-14 12:55:40 -05:00
Tryibion 685a68b7b8 Fix c# math sign functions for #993 2023-04-14 09:31:49 -05:00
Tryibion c420318267 Fix bug with path name preventing the item to be renamed when duplicated. 2023-04-14 09:18:06 -05:00
mafiesto4 a52b352bd9 Add NetworkManager::GetClient by uint32 clientId 2023-04-14 15:03:16 +02:00
mafiesto4 b4d20e128b Add Span<T> to C++ debugger natvis file 2023-04-14 15:01:40 +02:00
mafiesto4 89704bebe9 Add Span<T> support for scripting fields 2023-04-14 15:01:22 +02:00
mafiesto4 62fdfe2519 Add NetworkStream::SenderId to detect message sender during object replication or RPC code 2023-04-14 14:25:18 +02:00
mafiesto4 7a01ccb5fb Updates on iOS app packging 2023-04-13 23:01:31 +02:00
mafiesto4 2c653f8c92 Improve display names of the platform enum items 2023-04-13 21:56:08 +02:00
mafiesto4 e5f4a52be1 Finish Mono AOT for iOS with .NET 7 2023-04-13 21:55:42 +02:00
mafiesto4 924ee9085f Add logging command in build tool when explicitly specified 2023-04-13 21:03:37 +02:00
mafiesto4 4bdeb26e74 Add NetworkReplicator::EnableLog to optionally enable verbose logging of networking 2023-04-13 13:06:39 +02:00
mafiesto4 91c017713c Merge remote-tracking branch 'origin/master' into 1.6 2023-04-13 12:12:33 +02:00
mafiesto4 a379c551cb Fix memory leak when exporting png texture via stb 2023-04-13 11:21:15 +02:00
mafiesto4 8a44ea5a99 Fix TextureMipData::GetPixels to properly copy pixels of the same format
Fixes #988
2023-04-13 11:20:56 +02:00
mafiesto4 f8bfc3520b Merge branch 'Tryibion-adjustable-editor-focus-fps' 2023-04-13 11:02:12 +02:00
mafiesto4 31c35a7dd9 Merge branch 'adjustable-editor-focus-fps' of https://github.com/Tryibion/FlaxEngine into Tryibion-adjustable-editor-focus-fps 2023-04-13 11:01:01 +02:00
mafiesto4 a11ffb5ea5 Merge branch 'Tryibion-visjectCM-visual' 2023-04-13 10:59:28 +02:00
mafiesto4 01ced1cacd Fix Visject CM item search highlight placement and center CM title text
#983
2023-04-13 10:59:19 +02:00
mafiesto4 09ebd7462a Merge branch 'visjectCM-visual' of https://github.com/Tryibion/FlaxEngine into Tryibion-visjectCM-visual 2023-04-13 10:48:32 +02:00
mafiesto4 0281c6dcde Merge branch 'Tryibion-deselect-content' 2023-04-13 10:46:25 +02:00
mafiesto4 048c1f6985 Merge branch 'deselect-content' of https://github.com/Tryibion/FlaxEngine into Tryibion-deselect-content 2023-04-13 10:45:39 +02:00
mafiesto4 a9a7bc0b70 Merge branch 'Tryibion-scroll-change' 2023-04-13 10:44:33 +02:00
mafiesto4 898a5c4561 Merge branch 'scroll-change' of https://github.com/Tryibion/FlaxEngine into Tryibion-scroll-change 2023-04-13 10:38:37 +02:00
mafiesto4 b0966c9114 Add logging PixelFormat as string instead of integer value for better readability 2023-04-13 10:31:40 +02:00
mafiesto4 cffa9aa58e Add info about UWP platform support end 2023-04-13 10:07:51 +02:00
mafiesto4 0652a1c367 Add more code for iOS mono aot 2023-04-13 10:00:40 +02:00
mafiesto4 c5491eea97 Add Mono AOT for iOS to run C# 2023-04-13 08:34:49 +02:00
mafiesto4 cf397e1cc7 Fix var name typo and make improve class lib and platforms tools searching for Mono AOT 2023-04-13 08:27:49 +02:00
mafiesto4 d9855f2ed6 DIsable leftover debug aot 2023-04-12 23:16:39 +02:00
mafiesto4 047eb2eddf Add iOS to Game Cooker platforms 2023-04-12 22:29:21 +02:00
mafiesto4 8c94b56080 Add iOS to Github Actions CI 2023-04-12 22:11:36 +02:00
mafiesto4 bedb056645 Fix codestyle #989 2023-04-12 17:03:30 +02:00
mafiesto4 e6de28bb6a Merge branch 'Withaust-master' 2023-04-12 17:02:15 +02:00
mafiesto4 2e5adca99a Merge branch 'master' of https://github.com/Withaust/FlaxEngine into Withaust-master 2023-04-12 17:02:10 +02:00
mafiesto4 9e5a48af4b Fix bug when using material instance of material that uses GlobalSDF 2023-04-12 16:59:59 +02:00
mafiesto4 abf68328e6 Fix bug when using material instance of material that uses GlobalSDF 2023-04-12 16:59:03 +02:00
mafiesto4 609217a3bb Fix using Nullable<T> in C# properties
Fixes #935
2023-04-12 15:47:03 +02:00
mafiesto4 f8cf82a005 Fix comment copy/paste typo 2023-04-12 15:43:03 +02:00
mafiesto4 3c1622fbfd Merge branch 'GoaLitiuM-fix_method_invoker' into 1.6 2023-04-12 15:05:30 +02:00
mafiesto4 0bea917ef1 Merge branch 'fix_method_invoker' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-fix_method_invoker 2023-04-12 15:05:24 +02:00
mafiesto4 4de3512e12 Merge branch 'GoaLitiuM-lagless_networklagdriver' into 1.6 2023-04-12 15:04:10 +02:00
mafiesto4 b747031e2f Merge branch 'lagless_networklagdriver' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-lagless_networklagdriver 2023-04-12 15:04:05 +02:00
mafiesto4 66a140f402 Fix build 2023-04-12 14:59:15 +02:00
mafiesto4 b40384c329 Update docs 2023-04-12 14:39:07 +02:00
mafiesto4 7c39e5726d Improve csproj project files generation 2023-04-12 14:00:24 +02:00
mafiesto4 338e3bbd42 Updates for arm64 usage 2023-04-12 14:00:03 +02:00
mafiesto4 99566a0f0f Fix typo 2023-04-12 11:21:55 +02:00
mafiesto4 1a604e24a0 Disable tests code when not in test build 2023-04-12 10:41:42 +02:00
mafiesto4 9ecfe90708 Fix typo 2023-04-11 18:27:43 +02:00
mafiesto4 f9e8ad7c12 Add env var DOTNET_ROOT support for dotnet location probing 2023-04-11 18:14:28 +02:00
mafiesto4 68c6a01805 Update Switch platform support 2023-04-11 15:53:53 +02:00
Wiktor Kocielski 96609815ec Fix C++ API for Vector2/3 Normalization 2023-04-11 15:56:46 +03:00
GoaLitiuM 558a7d99ff Add LateFixedUpdate event for scripts 2023-04-09 18:26:33 +03:00
GoaLitiuM e186adc90e Support handling network events immediately in NetworkLagDriver 2023-04-09 18:25:45 +03:00
GoaLitiuM 7df5a7c646 Fix managed method invoker delegate caching 2023-04-09 18:25:14 +03:00
Tryibion 06ba894e39 Various changes to scroll bar to make it feel better 2023-04-08 23:00:43 -05:00
Tryibion 7b3152885d Remove animation time. 2023-04-08 19:01:55 -05:00
Tryibion a82856176e Small fixes 2023-04-08 08:54:06 -05:00
Tryibion 4e3d5ad11c First pass on visject CM visual changes 2023-04-07 23:17:57 -05:00
Tryibion 133e192b98 Added the function of de-selecting items in content view and removed selecting first item 2023-04-07 11:04:52 -05:00
mafiesto4 aa64da9869 Mark iOS platform as AOT-only 2023-04-06 14:19:10 +02:00
mafiesto4 92520a3c17 Add .NET 7 improvements for platforms 2023-04-06 13:07:45 +02:00
mafiesto4 0c167f38b7 Add TaskGraphSystem.RemoveDependency and automatically cleanup dependencies on system destroy 2023-04-05 22:43:05 +02:00
mafiesto4 f4e62afe8a Fix compilation with C# disabled 2023-04-05 19:39:04 +02:00
mafiesto4 a9b706becf Reset AOT Assemblies game cooker cache when Flax.Build gets modified 2023-04-05 19:17:53 +02:00
mafiesto4 09bd7c696b Add .NET 7 for PlayStation 4 2023-04-05 19:17:22 +02:00
mafiesto4 2475706df4 Merge remote-tracking branch 'origin/master' into 1.6 2023-04-04 18:08:25 +02:00
mafiesto4 8719bfe820 Merge branch 'GoaLitiuM-fix_editor_sleep' into 1.6 2023-04-04 17:57:53 +02:00
mafiesto4 cd2669230e Merge branch 'fix_editor_sleep' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-fix_editor_sleep 2023-04-04 17:57:49 +02:00
mafiesto4 d8f996ddc7 Merge branch 'Withaust-inputbindings' 2023-04-04 17:47:48 +02:00
mafiesto4 1093818381 Merge branch 'inputbindings' of https://github.com/Withaust/FlaxEngine into Withaust-inputbindings 2023-04-04 17:47:42 +02:00
mafiesto4 067ae8fc8e Merge branch 'Tryibion-copy-euler' 2023-04-04 17:42:59 +02:00
mafiesto4 f721284f70 Merge branch 'copy-euler' of https://github.com/Tryibion/FlaxEngine into Tryibion-copy-euler 2023-04-04 17:42:54 +02:00
mafiesto4 f930c9b5dc Merge branch 'Tryibion-double-color-fix' 2023-04-04 17:41:23 +02:00
mafiesto4 bb7ca521c4 Merge branch 'double-color-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-double-color-fix 2023-04-04 17:41:18 +02:00
mafiesto4 6c8b5e5e8a Improve #970 by using OptionsChanged event 2023-04-04 17:40:05 +02:00
mafiesto4 ce45c92dae Merge branch 'Tryibion-update-mainmenu-shortkeys' 2023-04-04 17:36:56 +02:00
mafiesto4 7de30bef7c Merge branch 'update-mainmenu-shortkeys' of https://github.com/Tryibion/FlaxEngine into Tryibion-update-mainmenu-shortkeys 2023-04-04 17:36:46 +02:00
mafiesto4 a8c6b2b619 Fix crash on end play when one of the actors has been manually disabled 2023-04-04 15:56:56 +02:00
mafiesto4 a236bc0b81 Merge branch 'dotnet7' into 1.6 2023-04-04 15:12:51 +02:00
GoaLitiuM 58d0ed18e6 Improve Linux dotnet runtime identifier detection 2023-04-04 15:12:29 +02:00
mafiesto4 0df9f5c797 Merge branch 'linux_rid_fix' of https://github.com/GoaLitiuM/FlaxEngine into 1.6 2023-04-04 15:09:37 +02:00
mafiesto4 0c4a608b65 Add .NET 7 support to Xbox 2023-04-04 14:46:08 +02:00
mafiesto4 e48e15f02f Fix tests compilation 2023-04-03 23:50:59 +02:00
mafiesto4 eda07ac57b Fix build tool crash when includes cache file is corrupted 2023-04-03 23:42:32 +02:00
mafiesto4 820c18968a Add C# class library optimization for normal game builds (without AOT) 2023-04-03 23:41:18 +02:00
mafiesto4 be7da82cfc Add printing output C# files size in game cooker 2023-04-03 18:26:17 +02:00
mafiesto4 bb84a51478 Add FileSystem::GetDirectorySize 2023-04-03 18:22:57 +02:00
mafiesto4 03b16875c7 Add SkipUnusedDotnetLibsPackaging to build settings for optional whole C# stdlib packaging 2023-04-03 18:03:28 +02:00
mafiesto4 84bb56d68b Minor dotnet tweaks 2023-04-03 14:12:27 +02:00
mafiesto4 d28be9cf44 Optimize out debug symbols generation for C# stdlib in Mono AOT builds 2023-04-03 13:53:03 +02:00
mafiesto4 58e5c988af Optimize Utils.InitStructure usage in generated bindings code if structure can be zero-inited 2023-04-03 13:52:15 +02:00
mafiesto4 e995736012 Optimize out System.ComponentModel.TypeConverter assembly usage to reduce cooked game builds 2023-04-03 13:51:33 +02:00
mafiesto4 493f3430bc Improve AOT cache usage when using different build configurations 2023-04-03 13:49:53 +02:00
mafiesto4 350112a0d7 Fix C# string chars getter in AOT build 2023-04-03 11:23:32 +02:00
mafiesto4 5ca6dae8c3 Fix crash in AOT build when platform has overridden AOT mode 2023-04-02 14:56:33 +02:00
mafiesto4 21f419dd4b Fix C# assemblies loading in AOT mode (use file path to correctly load precompiled native assembly) 2023-04-02 14:50:42 +02:00
Tryibion 0d082f5773 Added ability to change the fps of the not focused editor window. 2023-04-01 17:23:00 -05:00
mafiesto4 a3517b273c Add warning check to Mono AOT process to detect not supported features usage 2023-04-01 23:35:20 +02:00
mafiesto4 e1a0e51bc7 Optimzie Newtonsoft.Json lib by removing Xml, Schema support and making it AOT-friendly for AOT game builds 2023-04-01 23:34:24 +02:00
mafiesto4 12f4dc74d2 Optimize default C# stdlib references to prevent using jit-ed features in a game assembly 2023-04-01 23:34:05 +02:00
mafiesto4 2196a3d791 Add USE_AOT define to C# when compiling with AOT-enabled 2023-04-01 21:23:49 +02:00
GoaLitiuM c505561118 Remove extra sleep when Editor is not focused
The engine is already sleeping the extra time between frames
2023-04-01 20:20:16 +03:00
mafiesto4 809a1041b3 Merge remote-tracking branch 'origin/1.6' into 1.6 2023-03-31 19:38:05 +02:00
mafiesto4 29d0281932 Missing change 2023-03-31 19:37:55 +02:00
mafiesto4 e562a7d72c Fix loading C# assemblies from Mono AOT output 2023-03-31 18:31:25 +02:00
mafiesto4 7bec45dacf Typo fixes 2023-03-31 18:29:44 +02:00
mafiesto4 5a96c0e717 Add AOT cache invalidation when AOT Mode gets changed for next iterative cook 2023-03-31 18:23:50 +02:00
mafiesto4 a7c9c6142c Remove test logs 2023-03-31 18:23:24 +02:00
mafiesto4 dfca248ebd Optimize C# IsCollectible to be used in Editor-only builds 2023-03-31 14:56:57 +02:00
mafiesto4 4cc0807384 Skip nethost dependency from automatic building (manual-only) 2023-03-31 14:42:14 +02:00
mafiesto4 7cbafcd86b Implement C# AOT process for .NET 7 for Windows platform 2023-03-31 14:41:42 +02:00
mafiesto4 20ce4642ea Add nethost usage for iOS build 2023-03-30 18:39:19 +02:00
mafiesto4 4528cce71c Fixes for macOS game building 2023-03-30 18:38:58 +02:00
mafiesto4 aeb0bf700f Fix old Platform proces api usage 2023-03-30 18:07:47 +02:00
mafiesto4 bb27f85951 Optimize MCore::Array::GetAddress usage in MUtils 2023-03-29 10:39:20 +02:00
mafiesto4 94e7531109 Fix native libs loading on Android 2023-03-29 10:32:47 +02:00
mafiesto4 fd23a61846 Fix ManagedDictionary error on null object 2023-03-29 10:32:30 +02:00
mafiesto4 de566a361a Implement Mono hosting for .NET 7 on Android 2023-03-29 10:32:09 +02:00
mafiesto4 d925c8dab8 Fixes for Android 2023-03-28 17:21:27 +02:00
mafiesto4 a25eae5d10 Move dotnet7 native interop, wrappers and marshalers into FlaxEngine.Interop namespace 2023-03-28 13:20:18 +02:00
mafiesto4 6f7b138488 Implement missing dotnet7 api 2023-03-28 13:00:42 +02:00
mafiesto4 52fb941237 Refactor Native Interop codebase with cleanup/rename 2023-03-28 12:53:06 +02:00
mafiesto4 0694f87b0d Fixes for Visual Scripting interop via C# on new dotnet7 hosting 2023-03-28 12:01:55 +02:00
mafiesto4 ed13de2d5b Fix using managed arrays with Variant in dotnet7 2023-03-27 19:41:53 +02:00
mafiesto4 8d7225c056 Remove debug code leftover from 4755c42d70 2023-03-27 17:35:56 +02:00
mafiesto4 4755c42d70 Fix .NET generic class typename to match old mono style without inlined assembly name and ver 2023-03-27 17:30:48 +02:00
mafiesto4 510fc443e8 Refactor CoreCLR runtime into explicit dotnet api instead of mocking mono api
Required by platforms that will use mono under the hood for .Net 7
New `USE_CSHARP` define for C# ability
Engine doesn't use `mono_*` apis directly but via MCore/MClass/MMethod/ apis
2023-03-27 17:29:42 +02:00
Wiktor Kocielski 27ab8ea404 Make InputBindings modifiable 2023-03-26 15:12:53 +03:00
mafiesto4 eed2cdfe04 Progress on dotnet7 runtime hosting with mono 2023-03-22 17:59:46 +01:00
mafiesto4 4c4a559125 Improve dotnet host runtime detection if pack has multiple different versions 2023-03-22 14:20:38 +01:00
mafiesto4 4c1519ba1b Fix bindings generation for in-built Char type used in Array 2023-03-22 14:19:52 +01:00
mafiesto4 2253b5713b Fix dotnet sdk detection 2023-03-22 14:19:12 +01:00
mafiesto4 7d4bf8356e Update to the latest Platform::CreateProcess 2023-03-22 14:18:52 +01:00
mafiesto4 c31e4023c4 Optimize TypeInfo.GetFullNameNative for simple types 2023-03-22 14:12:25 +01:00
mafiesto4 3bbc7faf11 Refactor platform process startup with CreateProcessSettings 2023-03-22 14:09:20 +01:00
mafiesto4 497aca829d Fix 2023-03-21 23:03:01 +01:00
mafiesto4 7e28db91c2 Fix 2023-03-21 22:59:49 +01:00
mafiesto4 c71a34a1e9 Reenable Android CI build 2023-03-21 22:57:41 +01:00
mafiesto4 30e825db75 Add dotnet7 for Android (wip) 2023-03-21 22:49:09 +01:00
mafiesto4 ad536a945e Run build twice for build tool tests to fix error on Github Action run 2023-03-20 20:30:34 +01:00
mafiesto4 5dbc5f42d2 Remove mono files 2023-03-20 19:32:24 +01:00
mafiesto4 154076a5d0 Migrate Linux build from mono to to dotnet7 2023-03-20 19:25:00 +01:00
mafiesto4 d719c534d4 Missing change 2023-03-20 18:57:34 +01:00
mafiesto4 d63c21ec41 Build Physx 5 for Linux 2023-03-20 18:56:14 +01:00
mafiesto4 1fa7397b32 Update readme instructions for Vulkan SDK on Ubuntu 2023-03-20 18:55:58 +01:00
mafiesto4 5bf645252f Fix crash due to typo in Character Controller 2023-03-20 18:55:41 +01:00
mafiesto4 9568237c8e Fix build instructions on Linux to not use snap due to broken tooling 2023-03-20 18:30:56 +01:00
mafiesto4 0232197cdc Add more iOS platform impl 2023-03-18 22:43:13 +01:00
Tryibion 773047dc69 Add Copy Euler angles to Quaternion editor. 2023-03-16 21:46:07 -05:00
Tryibion 98ebbf8b99 Fix double color change on animation state machine states 2023-03-16 21:03:36 -05:00
Tryibion 1a2eb48705 Added updating the main menu shortcut keys on editor options saved. Also adds an action that can be used to update plugin short keys if needed. 2023-03-16 20:54:56 -05:00
mafiesto4 c615ad18a8 Build deps for iOS 2023-03-16 22:13:37 +01:00
mafiesto4 0ba261d338 Add iOS platform (refactor Mac into shared Apple platform impl) 2023-03-15 20:58:23 +01:00
mafiesto4 dc29ee180e Use arm64 for deploy for macOS 2023-03-15 20:58:23 +01:00
mafiesto4 8d16fb21b9 Merge branch 'GoaLitiuM-flax_build_perf_improvements' into 1.6 2023-03-15 17:57:22 +01:00
mafiesto4 33ac9c8811 Merge branch 'flax_build_perf_improvements' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-flax_build_perf_improvements 2023-03-15 17:57:16 +01:00
mafiesto4 4f10f852c7 Merge branch 'GoaLitiuM-includescache_fix' into 1.6 2023-03-15 17:57:06 +01:00
GoaLitiuM e11587e72e Use System.Text.Json over Newtonsoft.Json in Flax.Build 2023-03-14 20:03:34 +02:00
GoaLitiuM 16131b2858 Cache networking code generation task results 2023-03-14 20:03:33 +02:00
GoaLitiuM e878f5be15 Optimize saving TaskGraph cache 2023-03-14 20:03:33 +02:00
GoaLitiuM 19d77f0d81 Use filesystem caching in TaskGraph 2023-03-14 20:03:33 +02:00
GoaLitiuM 2f9e72e03e Use caching for filesystem queries in BindingsGenerator 2023-03-14 20:03:33 +02:00
GoaLitiuM 47e2c82551 Find build files without recursion 2023-03-14 20:03:32 +02:00
GoaLitiuM 9e4fd9fadb Exclude API code injection lines from includes cache 2023-03-14 20:02:35 +02:00
mafiesto4 edd4e37111 Improve missing .NET 7 handling to launch download page and warn user properly 2023-03-14 12:42:19 +01:00
mafiesto4 01d5c6a25b Fix tests script 2023-03-14 12:41:54 +01:00
mafiesto4 31a6c052f3 Fix tests build 2023-03-14 12:33:29 +01:00
mafiesto4 74758f5380 Merge remote-tracking branch 'origin/master' into 1.6
# Conflicts:
#	Source/Tools/Flax.Build/Build/Builder.Projects.cs
#	Source/Tools/Flax.Build/Build/Plugins/NetworkingPlugin.cs
2023-03-14 11:52:41 +01:00
mafiesto4 b7a3b10498 Merge branch 'GoaLitiuM-fix_network_rpc' into 1.6 2023-03-14 11:50:26 +01:00
mafiesto4 dad41d9e0e Merge branch 'fix_network_rpc' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-fix_network_rpc 2023-03-14 11:50:09 +01:00
mafiesto4 1c27674fd5 Merge branch 'Tryibion-tangent-color-change' 2023-03-14 09:44:11 +01:00
mafiesto4 c39242ecba Merge branch 'tangent-color-change' of https://github.com/Tryibion/FlaxEngine into Tryibion-tangent-color-change 2023-03-14 09:42:54 +01:00
mafiesto4 9614110f10 Merge branch 'Tryibion-blend-with-mask-fix' 2023-03-14 09:40:37 +01:00
mafiesto4 39c3b760ac Merge branch 'blend-with-mask-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-blend-with-mask-fix 2023-03-14 09:39:42 +01:00
mafiesto4 72659a481e Merge branch 'Tryibion-better-looking-states' 2023-03-14 09:38:49 +01:00
mafiesto4 55a439645c Merge branch 'better-looking-states' of https://github.com/Tryibion/FlaxEngine into Tryibion-better-looking-states 2023-03-14 09:35:21 +01:00
mafiesto4 eece05c118 Add support for using INetworkSerializable on custom structure in C++ for networking 2023-03-14 00:02:47 +01:00
mafiesto4 7950c0d9d7 Fix codegen for C# networking when using custom structures for replication and RPCs 2023-03-14 00:02:24 +01:00
mafiesto4 7cdd35cc8d Fix network codegen for 6 or more param RPC in C# 2023-03-13 20:36:10 +01:00
mafiesto4 6f304040b0 Format code 2023-03-13 20:20:10 +01:00
mafiesto4 d2a0438b71 Fix error on control reorder while it got remove before 2023-03-13 20:06:45 +01:00
mafiesto4 dea3319b9d Merge branch 'Tryibion-output-gitignore' 2023-03-13 16:11:10 +01:00
mafiesto4 58fab97447 Merge branch 'output-gitignore' of https://github.com/Tryibion/FlaxEngine into Tryibion-output-gitignore 2023-03-13 16:11:05 +01:00
mafiesto4 a41ad511f0 Fix Visual Studio project names collision when using both C++ and C# scripting 2023-03-13 16:10:21 +01:00
mafiesto4 44b45faa9a Merge branch 'Tryibion-fix-missing-generic-json' 2023-03-13 16:04:51 +01:00
mafiesto4 e747a345d8 Merge branch 'fix-missing-generic-json' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-missing-generic-json 2023-03-13 16:04:40 +01:00
mafiesto4 dadb9207b9 Fix Json asset cooking to properly serialize whole asset data even if modified at runtime 2023-03-13 16:00:27 +01:00
mafiesto4 086c2f155d Fix error when using nested Visject Surface context during State Machines editing in Anim Graph 2023-03-13 15:39:36 +01:00
mafiesto4 cfa7cac149 Fix crash when loading scene with script which type is not a scene object 2023-03-13 14:24:16 +01:00
mafiesto4 95748744a4 Add logging missing asset type on failed load 2023-03-13 14:23:23 +01:00
mafiesto4 34629d46f3 Add **Physics Statistics and profiler** 2023-03-13 12:31:51 +01:00
mafiesto4 af54b907d7 Merge remote-tracking branch 'origin/1.6' into 1.6 2023-03-13 10:26:13 +01:00
mafiesto4 2930b0ad67 Fix crash in GPU devices init when system has no valid GPU driver installed 2023-03-13 10:25:08 +01:00
mafiesto4 e00bf92f05 Add .Net Runtime deployment for cooked game 2023-03-13 10:23:42 +01:00
mafiesto4 c1dcc52a6a Build PhysX 5 for macOS x64 and arm64 2023-03-12 12:39:02 +01:00
mafiesto4 c351e58c6e Merge commit 'c60b2cb4d7dfe4cb0d55a4431acbb48b88920d6c' into 1.6 2023-03-12 11:08:46 +01:00
mafiesto4 c60b2cb4d7 Merge commit '0112f70c05ddfb9c91dacb0829594ab2f285c248' into dotnet7 2023-03-12 11:04:17 +01:00
mafiesto4 2c70b74814 Refactor widowing on macOS to support screen scale and highDpi mode 2023-03-12 10:58:55 +01:00
mafiesto4 e83b8afdd3 Add nethost for ps4 2023-03-11 21:30:56 +01:00
Tryibion 4cf20efe2e Add Output folder to .gitignore 2023-03-07 08:51:24 -06:00
mafiesto4 b7d4758dde Update PhysX building for consoles 2023-03-06 17:39:18 +01:00
GoaLitiuM 559aef2ee3 Fix typos 2023-03-06 18:11:14 +02:00
mafiesto4 7fce25a2e4 Fix building consoles 2023-03-06 16:19:16 +01:00
mafiesto4 aaaf7c5c37 Various fixes to scripting 2023-03-06 16:17:52 +01:00
Tryibion 4265ba12d7 Fixed the Generic Json Proxy not showing up in the content cm. 2023-03-05 12:04:45 -06:00
GoaLitiuM 85c5c7f309 Fix generated network RPC execute method visibility 2023-03-05 19:32:28 +02:00
GoaLitiuM c838a800b6 Add error logging for module initializers 2023-03-05 19:32:23 +02:00
GoaLitiuM 22af41193e Fix crash when calling RPC functions 2023-03-05 18:42:56 +02:00
envision3d b450c65c93 fix incorrect audio direction calculation 2023-03-05 03:50:51 -06:00
envision3d 4ce89f56cc implement openal hrtf audio support
- upgrade openal version
        - add support to create openal context with hrtf enabled
        - add option in audio settings for hrtf enablement
        - add static property on Audio class for runtime toggling of hrtf
	- fix bug with left/right and front/back being reversed
2023-03-04 20:37:56 -06:00
Tryibion 57014851a7 Fix visuals of the Blend with Mask node 2023-03-03 16:46:22 -06:00
Tryibion e6b0cd69ae Small bug fix 2023-03-03 13:34:24 -06:00
Tryibion 70e9410da0 Changed color of tangents when editing a spline to help the user know where the tangents are. 2023-03-03 13:25:53 -06:00
Tryibion 38c027704e Better looking state machine states. 2023-03-03 12:31:13 -06:00
mafiesto4 31411e334b Fix AnimatedModel bounds calculations 2023-03-03 17:44:34 +01:00
mafiesto4 987e680908 Fix warning on Asset::WaitForLoaded` when loading failed before 2023-03-03 17:43:55 +01:00
mafiesto4 d5df227df5 Fix deprecation compile warning in NetworkConfig on Clang 2023-03-03 17:15:31 +01:00
mafiesto4 60f21d1a92 Update old copyright headers 2023-03-03 17:14:35 +01:00
mafiesto4 a26d0d03eb Upgrade to PhysX 5.1.3 2023-03-03 17:13:46 +01:00
mafiesto4 a7c5397641 Fix content window auto scrolling regression
656fcf9847
2023-03-01 22:47:52 +01:00
mafiesto4 0112f70c05 Merge remote-tracking branch 'origin/master' into dotnet7 2023-03-01 19:50:22 +01:00
mafiesto4 1647fff024 Code style fix 2023-03-01 19:48:48 +01:00
mafiesto4 9fe54dc02c Merge commit '2016297fce673c2ac48549a6d8e8a772cf29d4fe' into dotnet7 2023-02-28 20:26:02 +01:00
mafiesto4 6691aaca1e Fix crash on arm64 mac 2023-02-28 18:49:48 +01:00
mafiesto4 82a22b2a87 Add vscode detection on macOS 2023-02-28 18:49:32 +01:00
mafiesto4 2016297fce Configure dotnet env vars for Github Actions 2023-02-28 10:47:28 +01:00
mafiesto4 fa6b621368 Merge branch 'GoaLitiuM-system_array_marshalling' into dotnet7 2023-02-28 10:41:16 +01:00
mafiesto4 a17981bc87 Merge branch 'system_array_marshalling' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-system_array_marshalling 2023-02-28 10:26:56 +01:00
mafiesto4 f88dd50098 Merge commit '272ffe2ea22eecb8f7cd6662efc1cadbe5593feb' into dotnet7 2023-02-27 23:17:04 +01:00
mafiesto4 fb06fa2c8b Add optional build without PhysX 2023-02-27 23:01:10 +01:00
mafiesto4 ad4c2484f3 Add deps for arm64 mac 2023-02-27 23:00:04 +01:00
mafiesto4 3be4e50b78 Amr64 on mac impl progress 2023-02-27 22:57:42 +01:00
mafiesto4 499df770cc Match C++ managed memory alloc with C# for scripting 2023-02-27 22:56:15 +01:00
mafiesto4 6f9f40192e Update min macOS version to 10.15 "Catalina" 2023-02-22 19:57:47 +01:00
mafiesto4 64752781ed Add arm64 support for macOS 2023-02-21 18:15:22 +01:00
GoaLitiuM 87e9046e41 Fix native to managed marshalling of System.Array 2023-02-19 20:33:12 +02:00
GoaLitiuM 1c74e89f0d Revert "Add System.Array interop from native return to managed world"
This reverts commit 272ffe2ea2.
2023-02-19 20:32:50 +02:00
mafiesto4 272ffe2ea2 Add System.Array interop from native return to managed world 2023-02-19 16:58:37 +01:00
mafiesto4 d7e24f0168 Fix missing dotnet hosting components for not yet supported platforms during projects generation stage 2023-02-19 15:16:34 +01:00
mafiesto4 0cf40729fa Merge remote-tracking branch 'origin/master' into dotnet7 2023-02-19 15:04:02 +01:00
mafiesto4 c00769e2b8 Fix deprecation warning 2023-02-19 14:32:34 +01:00
mafiesto4 1096daaeb7 Dont assume path ends with directory slash in dotnet root 2023-02-19 14:30:42 +01:00
GoaLitiuM 9560bbe23e Fix build issue 2023-02-19 15:13:38 +02:00
mafiesto4 0d78a6ba67 Fix path combine error 2023-02-19 14:01:37 +01:00
mafiesto4 e07a07f13e Support 'DOTNET_ROOT' env var in build tool for custom .NET SDK location 2023-02-19 13:51:54 +01:00
mafiesto4 2c1409c2a4 Add macOS build for dotnet7 2023-02-19 13:31:57 +01:00
mafiesto4 b44c7ab32c Print missing SDKs in Flax.Build 2023-02-19 13:03:29 +01:00
mafiesto4 c18cefbb0b Add support for dotnet7 on macOS 2023-02-19 13:03:12 +01:00
GoaLitiuM 5b23a4b318 Update tracy to v0.9 2023-02-18 22:35:26 +02:00
GoaLitiuM 91247cc080 Improve Linux dotnet runtime identifier detection 2023-02-17 17:01:13 +02:00
mafiesto4 30fa911832 Merge remote-tracking branch 'origin/master' into dotnet7
# Conflicts:
#	README.md
2023-02-16 09:54:22 +01:00
mafiesto4 c4b7f50609 Merge branch 'GoaLitiuM-fix_csharp_module_linking' into dotnet7 2023-02-16 09:46:04 +01:00
GoaLitiuM 7ccc0b83ff Fix linking against C#-only modules 2023-02-13 20:11:00 +02:00
mafiesto4 45a0b25ee4 Fix after merge 2023-02-13 10:52:11 +01:00
mafiesto4 ac59cc4633 Merge remote-tracking branch 'origin/master' into dotnet7 2023-02-13 10:05:51 +01:00
mafiesto4 cdc5106ef9 Merge branch 'GoaLitiuM-linux_dotnet7_sdk_fix' into dotnet7 2023-02-13 10:05:31 +01:00
mafiesto4 dff13626c4 Merge branch 'linux_dotnet7_sdk_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-linux_dotnet7_sdk_fix 2023-02-13 10:05:24 +01:00
mafiesto4 436d55932d Merge branch 'GoaLitiuM-threadsafe_managedarraypool' into dotnet7 2023-02-13 10:04:08 +01:00
mafiesto4 2a6fb3ba81 Merge branch 'threadsafe_managedarraypool' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-threadsafe_managedarraypool 2023-02-13 10:04:03 +01:00
mafiesto4 ea9dd48da9 Expose ManagedArray to be used in game code bindings 2023-02-06 10:44:10 +01:00
mafiesto4 547f4d1180 Fix missing getter/setter methods attributes 2023-02-06 10:43:08 +01:00
mafiesto4 1ff49e1faf Add engine version defines to C++ game scripts 2023-02-06 10:25:07 +01:00
mafiesto4 64f7c6bf64 Add FLAX_X_Y_OR_NEWER to game code defines 2023-02-06 10:24:37 +01:00
mafiesto4 0270772463 Merge remote-tracking branch 'origin/master' into dotnet7 2023-02-06 10:02:13 +01:00
Tryibion f3b2011fef Small fix 2023-02-04 08:25:07 -06:00
Tryibion dbee9f6816 Small fix 2023-02-03 12:11:18 -06:00
Tryibion 2d98a46d94 Clean up code 2023-02-03 11:27:11 -06:00
Tryibion baf6048377 Added Play, pause, and stop functions to particle effect for more manual control if needed. 2023-02-03 11:22:41 -06:00
GoaLitiuM 02c6354003 Store pooled ManagedArray in thread-local storage 2023-01-29 18:09:37 +02:00
GoaLitiuM 641e746ee1 Fix dotnet SDK detection on Linux
The dotnet-sdk package on Arch Linux seems to different RID prefix in SDK location.
2023-01-28 20:40:34 +02:00
mafiesto4 9f7df23788 Fix file copy 2023-01-27 22:39:08 +01:00
mafiesto4 c42ae97bb2 Restore native test run 2023-01-27 22:35:57 +01:00
mafiesto4 e6e34a7baf Tests fixing attempt 2023-01-27 20:55:41 +01:00
mafiesto4 1a4113009a Tests fixing attempt 2023-01-27 20:22:52 +01:00
mafiesto4 bc85c1b421 Tests fixing attempt 2023-01-27 20:20:48 +01:00
mafiesto4 f6aea86aeb Attempt to fix build 2023-01-27 19:43:21 +01:00
mafiesto4 86c5f3675b Use dotnet test for C# unit tests execution 2023-01-27 17:46:41 +01:00
mafiesto4 4f71976958 CoreCRL fixes and tweaks 2023-01-27 14:24:53 +01:00
mafiesto4 2fd251e7b1 Fix running tests on Linux with dotne7 2023-01-27 14:24:30 +01:00
mafiesto4 08ae1917e8 Fix proper readlink usage on Linux to get app path 2023-01-25 20:33:23 +01:00
mafiesto4 e779c3ca17 Merge commit '997baa3b774ac4dea739e15a55070519b0863afc' into dotnet7 2023-01-25 20:13:34 +01:00
mafiesto4 173f4e8092 Fix building scripts on Linux from Editor 2023-01-25 20:11:11 +01:00
mafiesto4 de7edf9e78 Fix ccatching C# exceptions in Visual Studio Code when debugging native code 2023-01-25 20:10:40 +01:00
mafiesto4 6b6f1eeb9b Fix exception in build tool when running in workspace without project file 2023-01-25 19:54:45 +01:00
mafiesto4 0847ccc360 Fix loading xml docs for assembly 2023-01-25 19:52:06 +01:00
mafiesto4 f5a37ec3b4 Final fix for full P/Invoke compatibility on Linux 2023-01-24 18:49:33 +01:00
mafiesto4 acb1cef19d Use plain-C style exported function for P/Invoke bindings on Clang 2023-01-24 18:32:23 +01:00
mafiesto4 20c32ea6ed Impl progress on c++ name mangling on Clang for proper P/Invokes binding 2023-01-24 17:31:09 +01:00
mafiesto4 35ea0b5447 Add more explicit error message on LibraryImport unit test error 2023-01-24 16:55:28 +01:00
mafiesto4 e818d37dd6 Add separated bindings method impl for scripting evnts binding on Clang 2023-01-24 16:55:06 +01:00
mafiesto4 048a4ac1e3 Use separated internal managed binding method declaration and implementation on Clang to properly export symbol for P/Invoke 2023-01-24 14:00:39 +01:00
mafiesto4 f665642e71 Fix build 2023-01-24 12:32:41 +01:00
mafiesto4 6fb604a9a0 Update comment 2023-01-24 10:13:08 +01:00
mafiesto4 02e3697817 Fix using proper engine native module for importing symbols 2023-01-24 10:13:08 +01:00
mafiesto4 1c72798229 Update readme instructions for Linux 2023-01-24 10:13:08 +01:00
mafiesto4 761d3735a7 Minor adjust followup #894 2023-01-24 09:41:18 +01:00
mafiesto4 71c2770df0 Merge branch 'GoaLitiuM-dotnet7_vscode_debugging' into dotnet7 2023-01-24 09:32:31 +01:00
mafiesto4 c6be71c4ff Merge branch 'dotnet7_vscode_debugging' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-dotnet7_vscode_debugging 2023-01-24 09:32:25 +01:00
mafiesto4 754ccaa9b4 Merge branch 'GoaLitiuM-dotnet7' into dotnet7 2023-01-24 09:30:56 +01:00
mafiesto4 798b950046 Merge branch 'dotnet7' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-dotnet7 2023-01-24 09:30:38 +01:00
mafiesto4 c9c35eb74e Merge remote-tracking branch 'origin/1.5' into dotnet7 2023-01-24 09:25:45 +01:00
mafiesto4 f1f5dacb6f Add unit test to verify LibraryImport attributes usage for proper bindings 2023-01-24 09:25:39 +01:00
mafiesto4 405ae519dd Refactor generated bindings P/Invoke to support name mangling for symbols 2023-01-23 18:41:12 +01:00
mafiesto4 f3366178ea Refactor manually written managed bindings to use C-style exported P/Invoke 2023-01-23 18:14:38 +01:00
mafiesto4 38fcfee9a4 Merge branch '1.5' into dotnet7 2023-01-23 14:47:12 +01:00
mafiesto4 25811ed6d4 Optimize bindings code generation via String Builder pooling 2023-01-23 13:22:43 +01:00
GoaLitiuM 3ca0ea2e50 Fix unfreed managed string handles 2023-01-22 17:29:34 +02:00
GoaLitiuM a917567e92 Fix passing weak managed string handles in marshallers 2023-01-22 17:29:30 +02:00
mafiesto4 a633aa69c3 Remove mono debugger from VS Code extensions list 2023-01-17 15:35:15 +01:00
mafiesto4 32440d6993 Add support for using system-installed Vulkan SDK on Linux 2023-01-17 15:34:45 +01:00
mafiesto4 7b20bc38a4 Merge branch '1.5' into dotnet7
# Conflicts:
#	Content/Shaders/GI/DDGI.flax
#	Content/Shaders/GI/GlobalSurfaceAtlas.flax
#	Content/Shaders/TAA.flax
#	Content/Shaders/VolumetricFog.flax
#	Source/Tools/Flax.Build/Projects/VisualStudio/VCProjectGenerator.cs
2023-01-17 11:52:52 +01:00
GoaLitiuM be720257ca Fix crash when marshalling generated managed interfaces
Marshaller returns a permanent handle, avoid releasing it during marshalling
2023-01-16 20:12:42 +02:00
GoaLitiuM 5e9d153c6a Generate C# debugger launch profiles for VSCode 2023-01-14 19:17:54 +02:00
GoaLitiuM 1a1fadcc2f Fix incorrect marshalling of TextureImportEntry fields 2023-01-14 17:50:25 +02:00
mafiesto4 abdc257332 Merge branch 'GoaLitiuM-dotnet7' into dotnet7 2023-01-12 15:15:47 +01:00
mafiesto4 59ba9102a6 Merge branch 'dotnet7' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-dotnet7 2023-01-12 15:15:40 +01:00
mafiesto4 daa92db25c Add support for using managed method thunks on dotnet7 in all cases 2023-01-12 15:14:43 +01:00
mafiesto4 3df10d1d0a Add configuration-specific C# libs references to generates csproj file 2023-01-11 16:25:47 +01:00
mafiesto4 824ce1cacf Run native tests on Windows CI 2023-01-11 16:25:29 +01:00
mafiesto4 4a8f336118 Change build script for tests 2023-01-11 15:08:03 +01:00
mafiesto4 6ec6f9501b Change build script for tests 2023-01-11 15:05:49 +01:00
mafiesto4 b1ecb2f0eb Fix xcopy path on Windows in Flax.Build 2023-01-11 14:27:37 +01:00
mafiesto4 474ce10e7e Update test projects to properly build and run under dotnet7 2023-01-11 14:27:17 +01:00
mafiesto4 3c40c22049 Tweaks to tests 2023-01-11 11:06:10 +01:00
mafiesto4 9281db73a7 Update nunit to properly run teests with dotnet7 2023-01-11 11:05:31 +01:00
mafiesto4 45a557f9c0 Minor tweaks 2023-01-10 16:50:52 +01:00
mafiesto4 7698e79143 Fix dotnet7 method runtime invoke to match return value boxing 2023-01-10 16:47:02 +01:00
mafiesto4 1c584e937a Fix mono_class_get_interfaces on dotnet7 to match mono behavior 2023-01-10 16:39:48 +01:00
mafiesto4 6ef5c76e1a Fix regression from recent scripting fixes/features on 1.5 2023-01-10 16:13:53 +01:00
mafiesto4 eebc4951de Merge branch '1.5' into dotnet7
# Conflicts:
#	Source/Platforms/DotNet/NUnit/agents/net40/nunit-agent.exe
#	Source/Platforms/DotNet/NUnit/agents/net40/nunit.engine.api.dll
#	Source/Platforms/DotNet/NUnit/agents/net40/nunit.engine.core.dll
#	Source/Platforms/DotNet/NUnit/agents/net7.0/nunit.agent.addins
#	Source/Platforms/DotNet/NUnit/nunit.engine.api.dll
#	Source/Platforms/DotNet/NUnit/nunit.engine.core.dll
#	Source/Platforms/DotNet/NUnit/nunit.engine.dll
#	Source/Platforms/DotNet/NUnit/nunit3-console.exe
#	Source/Platforms/DotNet/NUnit/nunit3-console.exe.config
#	Source/Platforms/DotNet/NUnit/testcentric.engine.metadata.dll
#	Source/Tools/Flax.Build/Deps/Downloader.cs
#	Source/Tools/Flax.Stats/CodeFrame.cs
#	Source/Tools/Flax.Stats/CodeFrameNode.cs
#	Source/Tools/Flax.Stats/Flax.Stats.Build.cs
#	Source/Tools/Flax.Stats/Languages.cs
#	Source/Tools/Flax.Stats/Program.cs
#	Source/Tools/Flax.Stats/TaskType.cs
#	Source/Tools/Flax.Stats/Tools.cs
#	Source/Tools/FlaxEngine.Tests/TestEditorUtils.cs
2023-01-10 15:49:44 +01:00
GoaLitiuM 7048281931 Hide AbstractWrappers in Editor 2023-01-09 15:20:24 +02:00
GoaLitiuM 9f76e9e230 Hide types in unloaded scripting assemblies 2023-01-09 15:20:24 +02:00
mafiesto4 4e4f4e700b Updates for dev with dotnet on linux 2023-01-08 20:27:28 +01:00
mafiesto4 bf60955e5e Fix C# tests running with dotnet 2023-01-08 19:17:41 +01:00
mafiesto4 c53af39c92 Merge remote-tracking branch 'origin/1.5' into dotnet7 2023-01-08 15:05:56 +01:00
mafiesto4 d034874fb7 Add dotnet setup to other github actions 2023-01-08 15:05:36 +01:00
mafiesto4 5ec9716eac Progress for dotnet7 support on Linux 2023-01-08 15:05:36 +01:00
mafiesto4 8896ebadda Minor fixes for dotnet7 2023-01-06 11:31:08 +01:00
mafiesto4 a6050e6f27 Add managed memory allocations profiling with dotnet7 2023-01-06 09:18:11 +01:00
mafiesto4 1e046c0033 Optimize GPU Resource name to prevent memory allocs when changing name frequently 2023-01-06 08:56:03 +01:00
mafiesto4 34cc546f00 Minor tweaks 2023-01-05 11:32:25 +01:00
mafiesto4 b21aeedae2 Fix build 2023-01-05 09:38:46 +01:00
mafiesto4 0872002dae Attempt to restore Linux build with dotnet7 2023-01-04 19:01:21 +01:00
mafiesto4 c4e4e38c4f Update readme 2023-01-04 19:00:24 +01:00
mafiesto4 63d3c9b1e0 Fix build on Linux 2023-01-04 19:00:06 +01:00
mafiesto4 ccd919d4d6 Fix default value in viewport options 2023-01-04 14:29:00 +01:00
mafiesto4 88bd5b2534 Fix threading issues with GPU buffers mapping 2023-01-04 12:06:56 +01:00
mafiesto4 0b8d4850f0 Use manual pdb file loading for debug symbols in C# 2023-01-04 09:56:58 +01:00
mafiesto4 26f8e5aa9e Use embedded debug information for C# dll to have proper stack trace information on game scripts exceptions 2023-01-03 18:38:44 +01:00
mafiesto4 06b2bf0094 Add logging native exception stack trace on Windows when debugger is attached before going back to the crash location 2023-01-03 15:58:02 +01:00
mafiesto4 e596d48729 Merge remote-tracking branch 'origin/1.5' into dotnet7 2023-01-03 14:34:20 +01:00
mafiesto4 ceacdc8d08 Fixes for dotnet7 bindings to pass unit tests 2023-01-03 14:34:16 +01:00
mafiesto4 6a2c5169a9 Merge branch 'GoaLitiuM-dotnet7' into dotnet7 2023-01-02 11:21:17 +01:00
mafiesto4 dea307179f Merge branch 'dotnet7' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-dotnet7
# Conflicts:
#	Source/Engine/Engine/NativeInterop.cs
2023-01-02 11:04:36 +01:00
mafiesto4 0ab6e29792 Merge branch 'envision3d-dotnet7' into dotnet7 2023-01-02 10:59:46 +01:00
mafiesto4 e718766073 Merge branch 'dotnet7' of https://github.com/envision3d/FlaxEngine into envision3d-dotnet7 2023-01-02 10:59:39 +01:00
mafiesto4 d3cdca6b33 Merge remote-tracking branch 'origin/1.5' into dotnet7 2023-01-02 10:37:04 +01:00
mafiesto4 e48b642101 Minor code cleanup 2023-01-02 10:36:57 +01:00
mafiesto4 9acb597d5d Adjust scripting types visibility in editor 2023-01-02 10:36:24 +01:00
mafiesto4 00d960d61e Refactor abstract classes handling for scripting types creation (eg. Script or GPUResource) under dotnet7 2023-01-02 10:35:39 +01:00
GoaLitiuM 5b4e209816 Fix creating delegates to scripting methods after script reload 2023-01-01 22:06:00 +02:00
GoaLitiuM 21c67b4777 Fix weak ManagedHandles collection 2022-12-31 15:34:16 +02:00
GoaLitiuM 2f507091b2 Fix ManagedHandle marshalling 2022-12-31 15:30:58 +02:00
GoaLitiuM 8b80f73641 Implement ManagedHandle replacement for GCHandles
Allows for more controlled management of weak handles, increasing their lifetime for slightly longer than with GCHandles.
2022-12-30 22:14:48 +02:00
mafiesto4 6a8483a898 Fix converting managed array back to native if passed via structure argument 2022-12-30 16:05:33 +01:00
mafiesto4 71e2cbe856 Minor tweaks to dotnet interop 2022-12-30 15:36:35 +01:00
mafiesto4 af7b53814d Merge remote-tracking branch 'origin/1.5' into dotnet7
# Conflicts:
#	Content/Shaders/GI/DDGI.flax
#	Content/Shaders/TAA.flax
2022-12-30 09:24:10 +01:00
mafiesto4 147cadee16 Merge branch 'GoaLitiuM-dotnet7' into dotnet7 2022-12-30 09:19:24 +01:00
GoaLitiuM 77478f9515 Fix managed and native array field marshalling 2022-12-30 01:34:52 +02:00
GoaLitiuM 64809f553b Skip cached rules assembly after changing project references 2022-12-30 01:34:52 +02:00
envision3d 78a2f2e8f0 Remove UWP platform from deployer script to fix platform packaging 2022-12-29 16:40:10 -06:00
mafiesto4 28da925c52 Fix DisableRuntimeMarshalling attribute usage to be declared once per C# assembly 2022-12-29 14:11:22 +01:00
mafiesto4 9083f511b5 Cache managed serializers for networking replication to prevent from being collected by GC 2022-12-29 14:01:01 +01:00
mafiesto4 c2bb717a69 Exclude StreamingStats from default value generation 2022-12-29 13:56:52 +01:00
mafiesto4 2408aa48c1 Fixes for networking change in 762f460e23 2022-12-29 13:56:25 +01:00
mafiesto4 45286468c9 Remove old Mono files when cooking game to the same output folder with dotnet7 2022-12-29 11:21:03 +01:00
mafiesto4 6f8c007a66 Fix assertion on thread double-free from registry (not harmful) 2022-12-29 11:20:39 +01:00
mafiesto4 c48a81a068 Merge branch '1.5' into dotnet7
# Conflicts:
#	Source/Editor/Managed/ManagedEditor.Internal.cpp
#	Source/Engine/Core/Config/LayersAndTagsSettings.cs
2022-12-28 18:49:14 +01:00
mafiesto4 aa0208072c Merge branch 'GoaLitiuM-dotnet7' into dotnet7 2022-12-28 09:07:26 +01:00
GoaLitiuM d3e02e23e5 Cleanup 2022-12-27 19:40:50 +02:00
GoaLitiuM f12475ea99 Prefer NativeMemory.AlignedAlloc over Marshal.Alloc* 2022-12-27 19:08:56 +02:00
GoaLitiuM d966519d95 Remove Mono files from cooked builds 2022-12-27 19:03:19 +02:00
GoaLitiuM 3f14d4bf64 Fix deserialization errors preventing context menus to open
Not a proper fix but Mono runtime seems to silently ignore this error when clipboard contains garbage data.
2022-12-27 19:03:18 +02:00
GoaLitiuM dfc69c9c8e Fix array return type marshalling 2022-12-27 19:02:40 +02:00
GoaLitiuM 53de6d018b Return container types as return parameters 2022-12-27 19:02:40 +02:00
mafiesto4 3e8e839cd1 Refactor Editor Windows layout serialization of splitter values to prevent invalid state when loading windows 2022-12-27 13:54:53 +01:00
mafiesto4 c53bf2b7e3 Fix crash when catching exception in managed code but native code ignores it in dotnet7 2022-12-27 13:50:38 +01:00
mafiesto4 219ad40088 Fix exception when using null version object for marshalling into native data 2022-12-27 13:50:11 +01:00
mafiesto4 d9042b3db2 Fix building various plugin projects with new dotnet7 2022-12-27 13:49:47 +01:00
mafiesto4 c59586a934 Ignore local VS launch options file 2022-12-24 15:36:02 +01:00
mafiesto4 7440cb0963 Rename generated method parameters in bindings to prevent name collisions 2022-12-24 15:35:46 +01:00
mafiesto4 d8805dc801 Tweaks 2022-12-24 15:24:51 +01:00
mafiesto4 45b0bb24c4 Merge branch 'GoaLitiuM-dotnet7' into dotnet7 2022-12-24 12:32:20 +01:00
GoaLitiuM 759a9bd365 Fix native library resolver not working after hot-reload 2022-12-24 03:13:40 +02:00
GoaLitiuM 48214f925b Fix wrong import name in generated plugin bindings 2022-12-24 01:13:56 +02:00
GoaLitiuM 2c0e9faa32 Remove throwing exceptions from invoked methods with debugger
The same effect can be achieved by enabling all CLR exceptions in VS debugger settings, and it also supports continuation after catching exceptions.
2022-12-23 22:36:19 +02:00
GoaLitiuM 80c3056daf Fix errors when compiling plugins 2022-12-23 22:33:22 +02:00
mafiesto4 61bd491969 Fix selection outline when nothing is selected 2022-12-23 11:37:11 +01:00
mafiesto4 fd64a33d3e Merge branch 'GoaLitiuM-dotnet7' into dotnet7 2022-12-23 09:39:00 +01:00
GoaLitiuM 2e502ce82a Cache managed type MonoTypeEnum values 2022-12-22 20:17:06 +02:00
GoaLitiuM 3c79be2910 Cleanup 2022-12-22 20:16:02 +02:00
GoaLitiuM e03a819176 Replace usage of Utils.ExtractArrayFromList with Span 2022-12-22 19:54:59 +02:00
GoaLitiuM 6a41ab0b6d Fix unnecessary allocations when creating managed arrays 2022-12-22 19:54:58 +02:00
GoaLitiuM 22b4e25c02 Improve array allocations when marshalling method parameters 2022-12-22 19:54:58 +02:00
GoaLitiuM e71e6835de Optimize allocations in return values from invoked managed methods 2022-12-22 18:13:23 +02:00
GoaLitiuM b449353d2f Fix incorrect field reference for reference types 2022-12-22 18:13:23 +02:00
mafiesto4 94c5211ee6 Rename gchandle to MGCHandle 2022-12-22 13:02:00 +01:00
mafiesto4 75130fcca3 Fix using Function in scripting api to pass function pointer to native code when running in dotnet7 2022-12-22 11:50:29 +01:00
mafiesto4 3f172442be Add DotNetSdk to simplify using it 2022-12-21 14:13:00 +01:00
mafiesto4 b049688d31 Merge branch 'GoaLitiuM-dotnet7' into dotnet7 2022-12-21 12:32:35 +01:00
mafiesto4 04799c89dc Merge branch 'dotnet7' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-dotnet7 2022-12-21 12:28:55 +01:00
mafiesto4 ac99dc0ac4 Add Platform.BuildTargetArchitecture 2022-12-21 11:33:25 +01:00
mafiesto4 8dc5c4e00b Restore assembly config for Flax.Build 2022-12-21 11:07:58 +01:00
mafiesto4 edac611444 Fix generated plugin projects that use both C++ and C# scripting 2022-12-21 11:04:41 +01:00
mafiesto4 37a8380521 Cleanup code 2022-12-21 11:04:28 +01:00
mafiesto4 60a1de42a2 Update shaders 2022-12-21 11:04:21 +01:00
mafiesto4 b2beeb653b Remove unused using statement 2022-12-21 11:04:13 +01:00
mafiesto4 6ff5dcfa50 Improve build rules assembly cache to include build tool changes 2022-12-21 10:45:24 +01:00
mafiesto4 9a5c105db9 Merge branch '1.5' into dotnet7 2022-12-21 10:35:58 +01:00
mafiesto4 aea28ce499 Optimize Flax.Build to not use Nuget 2022-12-21 10:23:50 +01:00
GoaLitiuM c8cc899128 Optimize allocations in method parameter marshalling and invocation 2022-12-21 00:40:38 +02:00
GoaLitiuM 55747edaae Cleanup 2022-12-21 00:40:38 +02:00
GoaLitiuM 15af6502a0 Log error whenever build tool fails to run 2022-12-21 00:40:38 +02:00
GoaLitiuM 8c4771a738 Fix SEH exceptions not handled properly when debugger is attached 2022-12-21 00:40:37 +02:00
mafiesto4 2fee75517d Updates for vs2022 2022-12-20 18:23:20 +01:00
mafiesto4 580f4120dc Update nunit for Unit Tests running with .net7 2022-12-20 18:21:45 +01:00
mafiesto4 f874a0ad57 Update csprojects to the latest NetCore7 2022-12-19 17:39:39 +01:00
mafiesto4 a56090e70f Update deprecated WebClient into HttpClient in Flax.Build files download utility 2022-12-19 11:17:09 +01:00
mafiesto4 f0d0e0637c Merge branch 'GoaLitiuM-dotnet7' into dotnet7 2022-12-19 10:10:54 +01:00
mafiesto4 eae38fa0c6 Merge branch 'dotnet7' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-dotnet7 2022-12-19 10:10:34 +01:00
mafiesto4 93f0b0e2e8 Fix type usage 2022-12-19 10:10:26 +01:00
mafiesto4 979f8bcfee Remove Flax.Stats project 2022-12-19 10:10:12 +01:00
GoaLitiuM b9f11298e8 Avoid pre-allocating custom attributes for managed types 2022-12-17 15:39:04 +02:00
GoaLitiuM 84f8e3a4b4 Fix crash when releasing scripting assembly 2022-12-17 15:39:00 +02:00
GoaLitiuM 551c58db4f Fix incorrect array marshalling in few Editor methods 2022-12-17 15:38:55 +02:00
GoaLitiuM ff438a6219 Set default culture to InvariantCulture
Fixes issues such as wrong decimal separator in floating point strings when used with parameterless .ToString()
2022-12-17 15:38:52 +02:00
mafiesto4 84a68c5977 Update Newtonsoft.Json to 13.0.2 and .Net 7 2022-12-17 13:38:30 +01:00
mafiesto4 889eb7d846 Revert "Implement JSON difference serialization"
This reverts commit 6bfb0205fd.
2022-12-17 13:06:16 +01:00
mafiesto4 6eaecc8793 Fix VisualStudioInstance.GetInstances() to be sorted from newest to oldest 2022-12-17 12:58:58 +01:00
mafiesto4 df6bf1e04d Disable UWP platform from build 2022-12-16 15:19:03 +01:00
mafiesto4 ff1ccdb7ee Improvements for Flax.Build setup 2022-12-16 15:18:45 +01:00
mafiesto4 d7fc221a6b Merge branch 'GoaLitiuM-dotnet7' into dotnet7 2022-12-16 13:12:27 +01:00
GoaLitiuM fcd1366d26 Fix memory leaks caused by unreleased GCHandles 2022-12-02 00:06:32 +02:00
GoaLitiuM 8cd90280c1 Fix InputBinding serialization 2022-12-01 23:52:56 +02:00
GoaLitiuM 4e4fb91a6f Prevent optimizing C#-projects in Development builds for better debugging 2022-11-29 21:18:42 +02:00
GoaLitiuM 55e287c890 Disable self-contained Flax.Build binaries and other build script fixes 2022-11-29 19:38:12 +02:00
GoaLitiuM cc7655d804 Fix managed array element marshalling with strings 2022-11-29 18:40:11 +02:00
GoaLitiuM 676d87129c Fix array count output parameter handling when returning arrays 2022-11-28 00:07:02 +02:00
GoaLitiuM 4a1c1ebe3a Fix ScriptingObject handles getting released during marshalling 2022-11-27 23:53:30 +02:00
GoaLitiuM bf190810dd Fix building VC++-projects 2022-11-27 15:49:39 +02:00
GoaLitiuM 2227642c13 Fix JsonAsset instantiation after script reload 2022-11-27 14:47:02 +02:00
GoaLitiuM 76ee695a59 Cleanup and minor fixes 2022-11-27 14:45:55 +02:00
GoaLitiuM 0d68e90b59 Fix array count output parameter handling when returning arrays 2022-11-27 14:42:11 +02:00
GoaLitiuM 3b80a01813 Fix build errors on Linux 2022-11-26 23:20:13 +02:00
GoaLitiuM 89ac54520a Add Linux support for nethost module, build tool and build scripts 2022-11-26 23:19:46 +02:00
GoaLitiuM dc08f49bbe Temporarily disabling other build workflows 2022-11-26 18:17:24 +02:00
GoaLitiuM 9fb0b00e75 Setup GitHub actions with .NET 7 2022-11-26 17:18:10 +02:00
GoaLitiuM 96dc279ebd Implement .NET 7 runtime support and bindings generation 2022-11-26 14:37:07 +02:00
GoaLitiuM fe943ca010 Temporary fix to build errors in VC++ projects 2022-11-26 13:55:19 +02:00
GoaLitiuM 3396e10613 Implement FlaxVersionConverter for JSON serialization 2022-11-26 13:55:19 +02:00
GoaLitiuM 6bfb0205fd Implement JSON difference serialization 2022-11-26 13:55:18 +02:00
GoaLitiuM c4be764f61 Add nethost module and EngineConfiguration for .NET runtime 2022-11-26 13:50:32 +02:00
GoaLitiuM cb09fb570d Change build scripts to call build tool with dotnet 2022-11-26 13:50:32 +02:00
GoaLitiuM 7e80a4fe0f Use Roslyn C#-compiler for build rules compilation 2022-11-26 13:50:31 +02:00
GoaLitiuM 44d1527759 Fix CopyFiles not working on Linux 2022-11-26 13:50:31 +02:00
GoaLitiuM 5e6fcc9669 Prepare Flax.Build project for .NET 7
Add .NET SDK project generator and upgrade Flax.Build project files
2022-11-26 13:50:31 +02:00
3923 changed files with 228342 additions and 254864 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
* text=auto eol=lf
# Explicitly declare text files you want to always be normalized and converted to native line endings on checkout.
*.c text diff=cpp
+17 -2
View File
@@ -1,21 +1,36 @@
name: Build Android
on: [push, pull_request]
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: false
jobs:
# Game
game-windows:
name: Game (Android, Release ARM64)
runs-on: "windows-2019"
runs-on: "windows-2022"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Setup .NET Workload
run: |
dotnet workload install android
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Checkout LFS
run: |
git lfs version
git lfs pull
- name: Build
run: |
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -arch=ARM64 -platform=Android -configuration=Release -buildtargets=FlaxGame
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -arch=ARM64 -platform=Android -configuration=Release -buildtargets=FlaxGame
+36
View File
@@ -0,0 +1,36 @@
name: Build iOS
on: [push, pull_request]
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: false
jobs:
# Game
game-windows:
name: Game (iOS, Release ARM64)
runs-on: "macos-latest"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Setup .NET Workload
run: |
dotnet workload install ios
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Checkout LFS
run: |
git lfs version
git lfs pull
- name: Build
run: |
./Development/Scripts/Mac/CallBuildTool.sh -build -log -arch=ARM64 -platform=iOS -configuration=Release -buildtargets=FlaxGame
+22 -2
View File
@@ -1,6 +1,10 @@
name: Build Linux
on: [push, pull_request]
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: false
jobs:
# Editor
@@ -18,13 +22,21 @@ jobs:
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Checkout LFS
run: |
git lfs version
git lfs pull
- name: Build
run: |
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxEditor
./Development/Scripts/Linux/CallBuildTool.sh -build -log -printSDKs -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxEditor
# Game
game-linux:
@@ -38,10 +50,18 @@ jobs:
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Checkout LFS
run: |
git lfs version
git lfs pull
- name: Build
run: |
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Release -buildtargets=FlaxGame
./Development/Scripts/Linux/CallBuildTool.sh -build -log -printSDKs -arch=x64 -platform=Linux -configuration=Release -buildtargets=FlaxGame
+22 -2
View File
@@ -1,6 +1,10 @@
name: Build macOS
on: [push, pull_request]
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: false
jobs:
# Editor
@@ -12,13 +16,21 @@ jobs:
uses: actions/checkout@v3
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Checkout LFS
run: |
git lfs version
git lfs pull
- name: Build
run: |
./Development/Scripts/Mac/CallBuildTool.sh -build -log -arch=x64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -arch=x64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor
# Game
game-mac:
@@ -29,10 +41,18 @@ jobs:
uses: actions/checkout@v3
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Checkout LFS
run: |
git lfs version
git lfs pull
- name: Build
run: |
./Development/Scripts/Mac/CallBuildTool.sh -build -log -arch=x64 -platform=Mac -configuration=Release -buildtargets=FlaxGame
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -arch=x64 -platform=Mac -configuration=Release -buildtargets=FlaxGame
+24 -4
View File
@@ -1,38 +1,58 @@
name: Build Windows
on: [push, pull_request]
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: false
jobs:
# Editor
editor-windows:
name: Editor (Windows, Development x64)
runs-on: "windows-2019"
runs-on: "windows-2022"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Checkout LFS
run: |
git lfs version
git lfs pull
- name: Build
run: |
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxEditor
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxEditor
# Game
game-windows:
name: Game (Windows, Release x64)
runs-on: "windows-2019"
runs-on: "windows-2022"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Checkout LFS
run: |
git lfs version
git lfs pull
- name: Build
run: |
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -arch=x64 -platform=Windows -configuration=Release -buildtargets=FlaxGame
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -arch=x64 -platform=Windows -configuration=Release -buildtargets=FlaxGame
+54 -2
View File
@@ -4,12 +4,16 @@ on:
- cron: '15 4 * * *'
workflow_dispatch:
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: false
jobs:
# Windows
package-windows-editor:
name: Editor (Windows)
runs-on: "windows-2019"
runs-on: "windows-2022"
steps:
- name: Checkout repo
uses: actions/checkout@v3
@@ -19,6 +23,14 @@ jobs:
git lfs pull
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Build
run: |
.\PackageEditor.bat -arch=x64 -platform=Windows -deployOutput=Output
@@ -34,7 +46,7 @@ jobs:
path: Output/EditorDebugSymbols.zip
package-windows-game:
name: Game (Windows)
runs-on: "windows-2019"
runs-on: "windows-2022"
steps:
- name: Checkout repo
uses: actions/checkout@v3
@@ -44,6 +56,14 @@ jobs:
git lfs pull
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Build
run: |
.\PackagePlatforms.bat -arch=x64 -platform=Windows -deployOutput=Output
@@ -72,6 +92,14 @@ jobs:
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Build
run: |
./PackageEditor.sh -arch=x64 -platform=Linux -deployOutput=Output
@@ -98,6 +126,14 @@ jobs:
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Build
run: |
./PackagePlatforms.sh -arch=x64 -platform=Linux -deployOutput=Output
@@ -120,6 +156,14 @@ jobs:
git lfs pull
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Build
run: |
./PackageEditor.command -arch=x64 -platform=Mac -deployOutput=Output
@@ -140,6 +184,14 @@ jobs:
git lfs pull
- name: Setup Vulkan
uses: ./.github/actions/vulkan
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Build
run: |
./PackagePlatforms.command -arch=x64 -platform=Mac -deployOutput=Output
+39 -16
View File
@@ -1,6 +1,10 @@
name: Tests
on: [push, pull_request]
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: false
jobs:
# Tests on Linux
@@ -10,6 +14,14 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Checkout LFS
run: |
git lfs version
@@ -22,41 +34,52 @@ jobs:
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
- name: Build
run: |
./GenerateProjectFiles.sh -vs2019
./GenerateProjectFiles.sh -vs2022 -log -verbose -printSDKs
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxTestsTarget
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Debug -buildtargets=FlaxEditor -BuildBindingsOnly
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Debug -buildtargets="FlaxEngine.Tests"
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Debug -buildtargets="Flax.Build.Tests"
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: |
Binaries/Editor/Linux/Development/FlaxTests
mono Source/Platforms/DotNet/NUnit/nunit3-console.exe Binaries/Tools/FlaxEngine.Tests.dll --framework=mono-4.0
mono Source/Platforms/DotNet/NUnit/nunit3-console.exe Binaries/Tools/Flax.Build.Tests.dll --framework=mono-4.0
${GITHUB_WORKSPACE}/Binaries/Editor/Linux/Development/FlaxTests
dotnet test -f net7.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 net7.0 Binaries/Tests/FlaxEngine.CSharp.dll
- name: Test UseLargeWorlds
run: |
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxTestsTarget -UseLargeWorlds=true
Binaries/Editor/Linux/Development/FlaxTests
${GITHUB_WORKSPACE}/Binaries/Editor/Linux/Development/FlaxTests
# Tests on Windows
tests-windows:
name: Tests (Windows)
runs-on: "windows-2019"
runs-on: "windows-2022"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Print .NET info
run: |
dotnet --info
dotnet workload --info
- name: Checkout LFS
run: |
git lfs version
git lfs pull
- name: Build
run: |
.\GenerateProjectFiles.bat -vs2019
.\GenerateProjectFiles.bat -vs2022 -log -verbose -printSDKs
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxTestsTarget
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -arch=x64 -platform=Windows -configuration=Debug -buildtargets=FlaxEditor -BuildBindingsOnly
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -arch=x64 -platform=Windows -configuration=Debug -buildtargets="FlaxEngine.Tests"
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -arch=x64 -platform=Windows -configuration=Debug -buildtargets="Flax.Build.Tests"
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: |
Binaries\Editor\Win64\Development\FlaxTests.exe
Source\Platforms\DotNet\NUnit\nunit3-console.exe Binaries\Tools\FlaxEngine.Tests.dll --framework=net-4.5.2
Source\Platforms\DotNet\NUnit\nunit3-console.exe Binaries\Tools\Flax.Build.Tests.dll --framework=net-4.5.2
.\Binaries\Editor\Win64\Development\FlaxTests.exe
dotnet test -f net7.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 net7.0 Binaries\Tests\FlaxEngine.CSharp.dll
+3
View File
@@ -5,7 +5,9 @@
obj/
Cache/
Binaries/
Output/
Logs/
Source/*.Gen.*
Source/*.csproj
/Package_*/
!Source/Engine/Debug
@@ -23,6 +25,7 @@ PackagePlatforms_Cert.bat
*.opendb
*.DS_Store
*.xcodeproj
launchSettings.json
# NUNIT
*.VisualState.xml
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
@0// Deferred Shading: Defines
@1// Deferred Shading: Includes
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
@0// Distortion: Defines
@1// Distortion: Includes
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
@0// Forward Shading: Defines
#define MAX_LOCAL_LIGHTS 4
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
@0// Global Illumination: Defines
#define USE_GI 1
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
@0// Lightmap: Defines
#define CAN_USE_LIGHTMAP 1
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
@0// Motion Vectors: Defines
@1// Motion Vectors: Includes
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
@0// Tessellation: Defines
#define TessalationProjectOntoPlane(planeNormal, planePosition, pointToProject) pointToProject - dot(pointToProject - planePosition, planeNormal) * planeNormal
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -3
View File
@@ -10,8 +10,7 @@ if [ $testfilesize -le 1000 ]; then
fi
# Compile the build tool.
xbuild /nologo /verbosity:quiet "Source/Tools/Flax.Build/Flax.Build.csproj" /property:Configuration=Release /property:Platform=AnyCPU /target:Build
dotnet msbuild /nologo /verbosity:quiet "Source/Tools/Flax.Build/Flax.Build.csproj" /property:Configuration=Release /target:Restore,Build /property:RestorePackagesConfig=True /p:RuntimeIdentifiers=linux-x64
# Run the build tool using the provided arguments.
#mono --debug --debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:55555 Binaries/Tools/Flax.Build.exe "$@"
mono Binaries/Tools/Flax.Build.exe "$@"
Binaries/Tools/Flax.Build "$@"
+2 -3
View File
@@ -10,8 +10,7 @@ if [ $testfilesize -le 1000 ]; then
fi
# Compile the build tool.
xbuild /nologo /verbosity:quiet "Source/Tools/Flax.Build/Flax.Build.csproj" /property:Configuration=Release /property:Platform=AnyCPU /target:Build
dotnet msbuild /nologo /verbosity:quiet "Source/Tools/Flax.Build/Flax.Build.csproj" /property:Configuration=Release /target:Restore,Build /property:RestorePackagesConfig=True /p:RuntimeIdentifiers=osx-x64
# Run the build tool using the provided arguments.
#mono --debug --debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:55555 Binaries/Tools/Flax.Build.exe "$@"
mono Binaries/Tools/Flax.Build.exe "$@"
Binaries/Tools/Flax.Build "$@"
+2 -2
View File
@@ -2,7 +2,7 @@
# Copyright (c) 2012-2023 Wojciech Figat. All rights reserved
# Fix mono bin to be in a path
export PATH=/Library/Frameworks/Mono.framework/Versions/Current/Commands:$PATH
#export PATH=/Library/Frameworks/Mono.framework/Versions/Current/Commands:$PATH
echo "Running Flax.Build $*"
mono Binaries/Tools/Flax.Build.exe "$@"
Binaries/Tools/Flax.Build "$@"
@@ -28,9 +28,9 @@ fc /b Cache\Intermediate\Build\Flax.Build.Files.txt Cache\Intermediate\Build\Fla
if not errorlevel 1 goto SkipClean
copy /y Cache\Intermediate\Build\Flax.Build.Files.txt Cache\Intermediate\Build\Flax.Build.PrevFiles.txt >nul
%MSBUILD_PATH% /nologo /verbosity:quiet Source\Tools\Flax.Build\Flax.Build.csproj /property:Configuration=Release /property:Platform=AnyCPU /target:Clean
%MSBUILD_PATH% /nologo /verbosity:quiet Source\Tools\Flax.Build\Flax.Build.csproj /property:Configuration=Release /target:Restore,Clean /property:RestorePackagesConfig=True /p:RuntimeIdentifiers=win-x64
:SkipClean
%MSBUILD_PATH% /nologo /verbosity:quiet Source\Tools\Flax.Build\Flax.Build.csproj /property:Configuration=Release /property:Platform=AnyCPU /target:Build
%MSBUILD_PATH% /nologo /verbosity:quiet Source\Tools\Flax.Build\Flax.Build.csproj /property:Configuration=Release /target:Build /property:SelfContained=False /property:RuntimeIdentifiers=win-x64
if errorlevel 1 goto Error_CompilationFailed
Binaries\Tools\Flax.Build.exe %*
+4 -3
View File
@@ -2,8 +2,8 @@
"Name": "Flax",
"Version": {
"Major": 1,
"Minor": 5,
"Build": 6339
"Minor": 6,
"Build": 6344
},
"Company": "Flax",
"Copyright": "Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.",
@@ -11,6 +11,7 @@
"EditorTarget": "FlaxEditor",
"Configuration": {
"UseCSharp": true,
"UseLargeWorlds": false
"UseLargeWorlds": false,
"UseDotNet": true
}
}
+6
View File
@@ -278,6 +278,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=heightfield/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Heightmap/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=HLSL/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=HRTF/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Inlines/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Inscattering/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Interpolants/@EntryIndexedValue">True</s:Boolean>
@@ -305,6 +306,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=occluder/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=offseted/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=offsetted/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=opcode/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Perlin/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=phong/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=preload/@EntryIndexedValue">True</s:Boolean>
@@ -320,6 +322,9 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Reimports/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=reimported/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=renderable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=retarget/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=retargeting/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=retargets/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=reverb/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=rigidbodies/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=rigidbody/@EntryIndexedValue">True</s:Boolean>
@@ -334,6 +339,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Skybox/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Skyboxes/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=slerp/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Spatialization/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=splatmap/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=splatmaps/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=SRGB/@EntryIndexedValue">True</s:Boolean>
+25 -16
View File
@@ -26,16 +26,12 @@ This repository contains full source code of the Flax Engine (excluding NDA-prot
Follow the instructions below to compile and run the engine from source.
## Flax plugin for Visual Studio
Flax Visual Studio extension provides better programming workflow, C# scripts debugging functionality and allows to attach to running engine instance to debug C# source. This extension is available to download [here](https://marketplace.visualstudio.com/items?itemName=Flax.FlaxVS).
## Windows
* Install Visual Studio 2015 or newer
* Install Visual Studio 2022 or newer
* Install Windows 8.1 SDK or newer (via Visual Studio Installer)
* Install Microsoft Visual C++ 2015 v140 toolset or newer (via Visual Studio Installer)
* Install .Net Framework 4.5.2 SDK/Targeting Pack (via Visual Studio Installer)
* Install .Net 7 SDK (via Visual Studio Installer or [from web](https://dotnet.microsoft.com/en-us/download/dotnet/7.0))
* Install Git with LFS
* Clone repo (with LFS)
* Run **GenerateProjectFiles.bat**
@@ -44,16 +40,13 @@ Flax Visual Studio extension provides better programming workflow, C# scripts de
* Compile Flax project (hit F7 or CTRL+Shift+B)
* Run Flax (hit F5 key)
> When building on Windows to support Vulkan rendering, first 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%`
## Linux
* Install Visual Studio Code
* Install Mono
* Ubuntu: see the instructions here: ([https://www.mono-project.com/download/stable](https://www.mono-project.com/download/stable))
* Arch: `sudo pacman -S mono`
* Install Vulkan SDK
* Ubuntu: see the instructions here: ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/))
* Install .Net 7 SDK ([https://dotnet.microsoft.com/en-us/download/dotnet/7.0](https://dotnet.microsoft.com/en-us/download/dotnet/7.0))
* Ubuntu: `sudo apt install dotnet-sdk-7.0`
* Install Vulkan SDK ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/))
* Ubuntu: `sudo apt install vulkan-sdk`
* Arch: `sudo pacman -S spirv-tools vulkan-headers vulkan-tools vulkan-validation-layers`
* Install Git with LFS
* Ubuntu: `sudo apt-get install git git-lfs`
@@ -73,13 +66,31 @@ Flax Visual Studio extension provides better programming workflow, C# scripts de
## Mac
* Install XCode
* Install Mono ([https://www.mono-project.com/download/stable](https://www.mono-project.com/download/stable))
* Install .Net 7 SDK ([https://dotnet.microsoft.com/en-us/download/dotnet/7.0](https://dotnet.microsoft.com/en-us/download/dotnet/7.0))
* Install Vulkan SDK ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/))
* Clone repo (with LFS)
* Run `GenerateProjectFiles.command`
* Open workspace with XCode or Visual Studio Code
* Build and run (configuration `Editor.Mac.Development`)
#### Troubleshooting
* `Could not execute because the specified command or file was not found.`
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 7.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 7.0`
Use Visual Studio 2022, older versions are not supported by .NET SDK 7.
* `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`
Install `.NET SDK`, `NuGet package manager` and `NuGet targets and build tasks` in Visual Studio components.
## Workspace directory
- **Binaries/** - executable files
@@ -93,7 +104,6 @@ Flax Visual Studio extension provides better programming workflow, C# scripts de
- **Content/** - assets and binary files used by the engine and editor
- **Development/** - engine development files
- **Scripts/** - utility scripts
- **packages/** - NuGet packages cache location
- **Source/** - source code location
- **Editor/** - Flax Editor source code
- **Engine/** - Flax Engine source code
@@ -103,7 +113,6 @@ Flax Visual Studio extension provides better programming workflow, C# scripts de
- ***PlatformName*/** - per-platform files
- **Binaries/** - per-platform binaries
- **Game/** - Flax Game binaries
- **Mono/** - Mono runtime files and data
- **ThirdParty/** - prebuilt 3rd Party binaries
- **Shaders/** - shaders source code
- **ThirdParty/** - 3rd Party source code
+170 -168
View File
@@ -1,49 +1,103 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#include "EditorAnalytics.h"
#include "EditorAnalyticsController.h"
#include "Editor/Editor.h"
#include "Editor/ProjectInfo.h"
#include "Editor/Cooker/GameCooker.h"
#include "Engine/Threading/Task.h"
#include "Engine/Threading/Threading.h"
#include "Engine/Platform/FileSystem.h"
#include "Engine/Platform/MemoryStats.h"
#include "Engine/Core/Log.h"
#include "Engine/Core/Math/Vector2.h"
#include "Engine/Core/Types/DateTime.h"
#include "Engine/Core/Types/TimeSpan.h"
#include "Editor/Editor.h"
#include "Editor/ProjectInfo.h"
#include "Engine/Engine/EngineService.h"
#include "Engine/Engine/Globals.h"
#include "Engine/Graphics/GPUDevice.h"
#include "Engine/Utilities/StringConverter.h"
#include "Engine/Utilities/TextWriter.h"
#include "Engine/ShadowsOfMordor/Builder.h"
#include "Engine/Profiler/ProfilerCPU.h"
#include "FlaxEngine.Gen.h"
#include <ThirdParty/UniversalAnalytics/universal-analytics.h>
#include <ThirdParty/UniversalAnalytics/http.h>
#define FLAX_EDITOR_GOOGLE_ID "UA-88357703-3"
// Docs:
// https://developers.google.com/analytics/devguides/collection/ga4
// https://developers.google.com/analytics/devguides/collection/protocol/ga4
// Helper doc: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
// [GA4] Flax Editor
#define GA_MEASUREMENT_ID "G-2SNY6RW6VX"
#define GA_API_SECRET "wFlau4khTPGFRnx-AIZ1zg"
#define GA_DEBUG 0
#if GA_DEBUG
#define GA_URL "https://www.google-analytics.com/debug/mp/collect"
#else
#define GA_URL "https://www.google-analytics.com/mp/collect"
#endif
namespace EditorAnalyticsImpl
namespace
{
UATracker Tracker = nullptr;
StringAnsi Url;
StringAnsi ClientId;
StringAnsi ProjectName;
StringAnsi ScreenResolution;
StringAnsi UserLanguage;
StringAnsi GPU;
DateTime SessionStartTime;
CriticalSection Locker;
bool IsSessionActive = false;
EditorAnalyticsController Controller;
Array<char> TmpBuffer;
TextWriterANSI JsonBuffer;
curl_slist* CurlHttpHeadersList = nullptr;
}
using namespace EditorAnalyticsImpl;
size_t curl_null_data_handler(char* ptr, size_t size, size_t nmemb, void* userdata)
{
return nmemb * size;
}
void RegisterGameCookingStart(GameCooker::EventType type)
{
if (type == GameCooker::EventType::BuildStarted)
{
auto& data = *GameCooker::GetCurrentData();
StringAnsi name = "Build " + StringAnsi(ToString(data.Platform));
const Pair<const char*, const char*> params[1] = { { "GameCooker", name.Get() } };
EditorAnalytics::SendEvent("Actions", ToSpan(params, ARRAY_COUNT(params)));
}
}
void RegisterLightmapsBuildingStart()
{
const Pair<const char*, const char*> params[1] = { { "ShadowsOfMordor", "Build" }, };
EditorAnalytics::SendEvent("Actions", ToSpan(params, ARRAY_COUNT(params)));
}
void RegisterError(LogType type, const StringView& msg)
{
if (type == LogType::Error && false)
{
StringAnsi value(msg);
const int32 MaxLength = 300;
if (msg.Length() > MaxLength)
value = value.Substring(0, MaxLength);
value.Replace('\n', ' ');
value.Replace('\r', ' ');
const Pair<const char*, const char*> params[1] = { { "Error", value.Get() }, };
EditorAnalytics::SendEvent("Errors", ToSpan(params, ARRAY_COUNT(params)));
}
else if (type == LogType::Fatal)
{
StringAnsi value(msg);
const int32 MaxLength = 300;
if (msg.Length() > MaxLength)
value = value.Substring(0, MaxLength);
value.Replace('\n', ' ');
value.Replace('\r', ' ');
const Pair<const char*, const char*> params[1] = { { "Fatal", value.Get() }, };
EditorAnalytics::SendEvent("Errors", ToSpan(params, ARRAY_COUNT(params)));
}
}
class EditorAnalyticsService : public EngineService
{
public:
EditorAnalyticsService()
: EngineService(TEXT("Editor Analytics"))
{
@@ -57,192 +111,141 @@ EditorAnalyticsService EditorAnalyticsServiceInstance;
bool EditorAnalytics::IsSessionActive()
{
return EditorAnalyticsImpl::IsSessionActive;
return ::IsSessionActive;
}
void EditorAnalytics::StartSession()
{
ScopeLock lock(Locker);
if (EditorAnalyticsImpl::IsSessionActive)
if (::IsSessionActive)
return;
PROFILE_CPU();
// Prepare client metadata
if (ClientId.IsEmpty())
{
ClientId = Platform::GetUniqueDeviceId().ToString(Guid::FormatType::N).ToStringAnsi();
}
if (ScreenResolution.IsEmpty())
{
const auto desktopSize = Platform::GetDesktopSize();
ScreenResolution = StringAnsi(StringUtils::ToString((int32)desktopSize.X)) + "x" + StringAnsi(StringUtils::ToString((int32)desktopSize.Y));
}
if (UserLanguage.IsEmpty())
{
UserLanguage = Platform::GetUserLocaleName().ToStringAnsi();
}
if (GPU.IsEmpty())
{
const auto gpu = GPUDevice::Instance;
if (gpu && gpu->GetState() == GPUDevice::DeviceState::Ready)
GPU = StringAsANSI<>(gpu->GetAdapter()->GetDescription().GetText()).Get();
}
if (ProjectName.IsEmpty())
{
ProjectName = Editor::Project->Name.ToStringAnsi();
}
ClientId = Platform::GetUniqueDeviceId().ToString(Guid::FormatType::N).ToStringAnsi();
StringAnsi ProjectName = Editor::Project->Name.ToStringAnsi();
const auto desktopSize = Platform::GetDesktopSize();
StringAnsi ScreenResolution = StringAnsi::Format("{0}x{1}", (int32)desktopSize.X, (int32)desktopSize.Y);
const auto memoryStats = Platform::GetMemoryStats();
StringAnsi Memory = StringAnsi::Format("{0} GB", (int32)(memoryStats.TotalPhysicalMemory / 1024 / 1024 / 1000));
StringAnsi UserLocale = Platform::GetUserLocaleName().ToStringAnsi();
StringAnsi GPU;
if (GPUDevice::Instance && GPUDevice::Instance->GetState() == GPUDevice::DeviceState::Ready)
GPU = StringAsANSI<>(GPUDevice::Instance->GetAdapter()->GetDescription().GetText()).Get();
SessionStartTime = DateTime::Now();
// Initialize the analytics tracker
Tracker = createTracker(FLAX_EDITOR_GOOGLE_ID, ClientId.Get(), nullptr);
Tracker->user_agent = "Flax Editor";
// Store these options permanently (for the lifetime of the tracker)
setTrackerOption(Tracker, UA_OPTION_QUEUE, 1);
UASettings GlobalSettings =
{
{
{ UA_DOCUMENT_PATH, 0, "Flax Editor" },
{ UA_DOCUMENT_TITLE, 0, "Flax Editor" },
StringAnsiView EngineVersion = FLAXENGINE_VERSION_TEXT;
#if PLATFORM_WINDOWS
{ UA_USER_AGENT, 0, "Windows " FLAXENGINE_VERSION_TEXT },
StringAnsiView PlatformName = "Windows";
#elif PLATFORM_LINUX
{ UA_USER_AGENT, 0, "Linux " FLAXENGINE_VERSION_TEXT },
StringAnsiView PlatformName = "Linux";
#elif PLATFORM_MAC
{ UA_USER_AGENT, 0, "Mac " FLAXENGINE_VERSION_TEXT },
StringAnsiView PlatformName = "Mac";
#else
#error "Unknown platform"
#endif
{ UA_ANONYMIZE_IP, 0, "0" },
{ UA_APP_ID, 0, "Flax Editor " FLAXENGINE_VERSION_TEXT },
{ UA_APP_INSTALLER_ID, 0, "Flax Editor" },
{ UA_APP_NAME, 0, "Flax Editor" },
{ UA_APP_VERSION, 0, FLAXENGINE_VERSION_TEXT },
{ UA_SCREEN_NAME, 0, "Flax Editor " FLAXENGINE_VERSION_TEXT },
{ UA_SCREEN_RESOLUTION, 0, ScreenResolution.Get() },
{ UA_USER_LANGUAGE, 0, UserLanguage.Get() },
}
};
setParameters(Tracker, &GlobalSettings);
// Send the initial session event
UAOptions sessionViewOptions =
// Initialize HTTP
Url = StringAnsi::Format("{0}?measurement_id={1}&api_secret={2}", GA_URL, GA_MEASUREMENT_ID, GA_API_SECRET);
curl_global_init(CURL_GLOBAL_ALL);
CurlHttpHeadersList = curl_slist_append(nullptr, "Content-Type: application/json");
::IsSessionActive = true;
// Start session
{
{
{ UA_EVENT_CATEGORY, 0, "Session" },
{ UA_EVENT_ACTION, 0, "Start Editor" },
{ UA_EVENT_LABEL, 0, "Start Editor" },
{ UA_SESSION_CONTROL, 0, "start" },
{ UA_DOCUMENT_TITLE, 0, ProjectName.Get() },
}
};
sendTracking(Tracker, UA_SCREENVIEW, &sessionViewOptions);
EditorAnalyticsImpl::IsSessionActive = true;
Controller.Init();
// Report GPU model
if (GPU.HasChars())
{
SendEvent("Telemetry", "GPU.Model", GPU.Get());
const Pair<const char*, const char*> params[1] = { { "Project", ProjectName.Get() }, };
SendEvent("Session", ToSpan(params, ARRAY_COUNT(params)));
}
// Report telemetry stats
#define SEND_TELEMETRY(name, value) \
if (value.HasChars()) \
{ \
const Pair<const char*, const char*> params[1] = { { name, value.Get() } }; \
SendEvent("Telemetry", ToSpan(params, ARRAY_COUNT(params))); \
}
SEND_TELEMETRY("Platform", PlatformName);
SEND_TELEMETRY("GPU", GPU);
SEND_TELEMETRY("Memory", Memory);
SEND_TELEMETRY("Locale", UserLocale);
SEND_TELEMETRY("Screen", ScreenResolution);
SEND_TELEMETRY("Version", EngineVersion);
#undef SEND_TELEMETRY
// Bind events
GameCooker::OnEvent.Bind<RegisterGameCookingStart>();
ShadowsOfMordor::Builder::Instance()->OnBuildStarted.Bind<RegisterLightmapsBuildingStart>();
Log::Logger::OnError.Bind<RegisterError>();
}
void EditorAnalytics::EndSession()
{
ScopeLock lock(Locker);
if (!EditorAnalyticsImpl::IsSessionActive)
if (!::IsSessionActive)
return;
PROFILE_CPU();
Controller.Cleanup();
// Unbind events
GameCooker::OnEvent.Unbind<RegisterGameCookingStart>();
ShadowsOfMordor::Builder::Instance()->OnBuildStarted.Unbind<RegisterLightmapsBuildingStart>();
Log::Logger::OnError.Unbind<RegisterError>();
StringAnsi sessionLength = StringAnsi::Format("{0}", (int32)(DateTime::Now() - SessionStartTime).GetTotalSeconds());
// Send the end session event
UAOptions sessionEventOptions =
// End session
{
StringAnsi sessionLength = StringAnsi::Format("{}", (int32)(DateTime::Now() - SessionStartTime).GetTotalSeconds());
const Pair<const char*, const char*> params[1] =
{
{ UA_EVENT_CATEGORY, 0, "Session" },
{ UA_EVENT_ACTION, 0, "Session Length" },
{ UA_EVENT_LABEL, 0, "Session Length" },
{ UA_EVENT_VALUE, 0, sessionLength.Get() },
{ UA_CUSTOM_DIMENSION, 1, "Session Length" },
{ UA_CUSTOM_METRIC, 1, sessionLength.Get() },
}
};
sendTracking(Tracker, UA_EVENT, &sessionEventOptions);
// Send the end session event
UAOptions sessionViewOptions =
{
{
{ UA_EVENT_CATEGORY, 0, "Session" },
{ UA_EVENT_ACTION, 0, "End Editor" },
{ UA_EVENT_LABEL, 0, "End Editor" },
{ UA_EVENT_VALUE, 0, sessionLength.Get() },
{ UA_SESSION_CONTROL, 0, "end" },
}
};
sendTracking(Tracker, UA_SCREENVIEW, &sessionViewOptions);
{ "Duration", sessionLength.Get() },
};
SendEvent("Session", ToSpan(params, ARRAY_COUNT(params)));
}
// Cleanup
removeTracker(Tracker);
Tracker = nullptr;
EditorAnalyticsImpl::IsSessionActive = false;
curl_slist_free_all(CurlHttpHeadersList);
CurlHttpHeadersList = nullptr;
curl_global_cleanup();
::IsSessionActive = false;
}
void EditorAnalytics::SendEvent(const char* category, const char* name, const char* label)
void EditorAnalytics::SendEvent(const char* name, Span<Pair<const char*, const char*>> parameters)
{
ScopeLock lock(Locker);
if (!EditorAnalyticsImpl::IsSessionActive)
if (!::IsSessionActive)
return;
PROFILE_CPU();
UAOptions opts =
// Create Json request contents
JsonBuffer.Clear();
JsonBuffer.Write("{ \"client_id\": \"");
JsonBuffer.Write(ClientId);
JsonBuffer.Write("\", \"events\": [ { \"name\": \"");
JsonBuffer.Write(name);
JsonBuffer.Write("\", \"params\": {");
for (int32 i = 0; i < parameters.Length(); i++)
{
{
{ UA_EVENT_CATEGORY, 0, (char*)category },
{ UA_EVENT_ACTION, 0, (char*)name },
{ UA_EVENT_LABEL, 0, (char*)label },
}
};
if (i != 0)
JsonBuffer.Write(",");
const auto& e = parameters[i];
JsonBuffer.Write("\"");
JsonBuffer.Write(e.First);
JsonBuffer.Write("\":\"");
JsonBuffer.Write(e.Second);
JsonBuffer.Write("\"");
}
JsonBuffer.Write("}}]}");
const StringAnsiView json((const char*)JsonBuffer.GetBuffer()->GetHandle(), (int32)JsonBuffer.GetBuffer()->GetPosition());
sendTracking(Tracker, UA_EVENT, &opts);
}
void EditorAnalytics::SendEvent(const char* category, const char* name, const StringView& label)
{
SendEvent(category, name, label.Get());
}
void EditorAnalytics::SendEvent(const char* category, const char* name, const Char* label)
{
ScopeLock lock(Locker);
if (!EditorAnalyticsImpl::IsSessionActive)
return;
ASSERT(category && name && label);
const int32 labelLength = StringUtils::Length(label);
TmpBuffer.Clear();
TmpBuffer.Resize(labelLength + 1);
StringUtils::ConvertUTF162ANSI(label, TmpBuffer.Get(), labelLength);
TmpBuffer[labelLength] = 0;
UAOptions opts =
{
{
{ UA_EVENT_CATEGORY, 0, (char*)category },
{ UA_EVENT_ACTION, 0, (char*)name },
{ UA_EVENT_LABEL, 0, (char*)TmpBuffer.Get() },
}
};
sendTracking(Tracker, UA_EVENT, &opts);
// Send HTTP request
CURL* curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_POST, 1);
curl_easy_setopt(curl, CURLOPT_URL, Url.Get());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, CurlHttpHeadersList);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, json.Get());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, json.Length());
curl_easy_setopt(curl, CURLOPT_USERAGENT, "Flax Editor");
curl_easy_setopt(curl, CURLOPT_WRITEDATA, curl);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_null_data_handler);
CURLcode res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
bool EditorAnalyticsService::Init()
@@ -265,8 +268,7 @@ bool EditorAnalyticsService::Init()
}
LOG(Info, "Editor analytics service is enabled. Curl version: {0}", TEXT(LIBCURL_VERSION));
EditorAnalytics::StartSession();
Task::StartNew(EditorAnalytics::StartSession);
return false;
}
+2 -21
View File
@@ -10,11 +10,9 @@
class EditorAnalytics
{
public:
/// <summary>
/// Determines whether analytics session is active.
/// </summary>
/// <returns><c>true</c> if there is active analytics session running; otherwise, <c>false</c>.</returns>
static bool IsSessionActive();
/// <summary>
@@ -30,24 +28,7 @@ public:
/// <summary>
/// Sends the custom event.
/// </summary>
/// <param name="category">The event category name.</param>
/// <param name="name">The event name.</param>
/// <param name="label">The event label.</param>
static void SendEvent(const char* category, const char* name, const char* label = nullptr);
/// <summary>
/// Sends the custom event.
/// </summary>
/// <param name="category">The event category name.</param>
/// <param name="name">The event name.</param>
/// <param name="label">The event label.</param>
static void SendEvent(const char* category, const char* name, const StringView& label);
/// <summary>
/// Sends the custom event.
/// </summary>
/// <param name="category">The event category name.</param>
/// <param name="name">The event name.</param>
/// <param name="label">The event label.</param>
static void SendEvent(const char* category, const char* name, const Char* label);
/// <param name="parameters">The event parameters (key and value pairs).</param>
static void SendEvent(const char* name, Span<Pair<const char*, const char*>> parameters);
};
@@ -1,69 +0,0 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#include "EditorAnalyticsController.h"
#include "Editor/Cooker/GameCooker.h"
#include "EditorAnalytics.h"
#include "Engine/ShadowsOfMordor/Builder.h"
void RegisterGameCookingStart(GameCooker::EventType type)
{
auto& data = *GameCooker::GetCurrentData();
auto platform = ToString(data.Platform);
if (type == GameCooker::EventType::BuildStarted)
{
EditorAnalytics::SendEvent("Actions", "GameCooker.Start", platform);
}
else if (type == GameCooker::EventType::BuildFailed)
{
EditorAnalytics::SendEvent("Actions", "GameCooker.Failed", platform);
}
else if (type == GameCooker::EventType::BuildDone)
{
EditorAnalytics::SendEvent("Actions", "GameCooker.End", platform);
}
}
void RegisterLightmapsBuildingStart()
{
EditorAnalytics::SendEvent("Actions", "ShadowsOfMordor.Build", "ShadowsOfMordor.Build");
}
void RegisterError(LogType type, const StringView& msg)
{
if (type == LogType::Error && false)
{
String value = msg.ToString();
const int32 MaxLength = 300;
if (msg.Length() > MaxLength)
value = value.Substring(0, MaxLength);
value.Replace('\n', ' ');
value.Replace('\r', ' ');
EditorAnalytics::SendEvent("Errors", "Log.Error", value);
}
else if (type == LogType::Fatal)
{
String value = msg.ToString();
const int32 MaxLength = 300;
if (msg.Length() > MaxLength)
value = value.Substring(0, MaxLength);
value.Replace('\n', ' ');
value.Replace('\r', ' ');
EditorAnalytics::SendEvent("Errors", "Log.Fatal", value);
}
}
void EditorAnalyticsController::Init()
{
GameCooker::OnEvent.Bind<RegisterGameCookingStart>();
ShadowsOfMordor::Builder::Instance()->OnBuildStarted.Bind<RegisterLightmapsBuildingStart>();
Log::Logger::OnError.Bind<RegisterError>();
}
void EditorAnalyticsController::Cleanup()
{
GameCooker::OnEvent.Unbind<RegisterGameCookingStart>();
ShadowsOfMordor::Builder::Instance()->OnBuildStarted.Unbind<RegisterLightmapsBuildingStart>();
Log::Logger::OnError.Unbind<RegisterError>();
}
@@ -1,21 +0,0 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
/// <summary>
/// The controller object for the tracking events for the editor analytics.
/// </summary>
class EditorAnalyticsController
{
public:
/// <summary>
/// Starts the service (registers to event handlers).
/// </summary>
void Init();
/// <summary>
/// Ends the service (unregisters to event handlers).
/// </summary>
void Cleanup();
};
+5 -2
View File
@@ -692,10 +692,13 @@ namespace FlaxEditor.Content.GUI
c = char.ToLowerInvariant(c);
for (int i = 0; i < _items.Count; i++)
{
var name = _items[i].ShortName;
var item = _items[i];
var name = item.ShortName;
if (!string.IsNullOrEmpty(name) && char.ToLowerInvariant(name[0]) == c)
{
Select(_items[i]);
Select(item);
if (Parent is Panel panel)
panel.ScrollViewTo(item, true);
break;
}
}
@@ -2,9 +2,9 @@
using System.ComponentModel;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using FlaxEngine;
using FlaxEngine.Interop;
namespace FlaxEditor.Content.Import
{
@@ -93,6 +93,7 @@ namespace FlaxEditor.Content.Import
[StructLayout(LayoutKind.Sequential)]
internal struct InternalOptions
{
[MarshalAs(UnmanagedType.I1)]
public AudioFormat Format;
public byte DisableStreaming;
public byte Is3D;
@@ -144,7 +145,7 @@ namespace FlaxEditor.Content.Import
/// Audio asset import entry.
/// </summary>
/// <seealso cref="AssetImportEntry" />
public class AudioImportEntry : AssetImportEntry
public partial class AudioImportEntry : AssetImportEntry
{
private AudioImportSettings _settings = new AudioImportSettings();
@@ -182,8 +183,9 @@ namespace FlaxEditor.Content.Import
#region Internal Calls
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern bool Internal_GetAudioImportOptions(string path, out AudioImportSettings.InternalOptions result);
[LibraryImport("FlaxEngine", EntryPoint = "AudioImportEntryInternal_GetAudioImportOptions", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool Internal_GetAudioImportOptions(string path, out AudioImportSettings.InternalOptions result);
#endregion
}
+51 -515
View File
@@ -1,88 +1,47 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using FlaxEditor.CustomEditors.Editors;
using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.Tools;
namespace FlaxEngine.Tools
{
partial class ModelTool
{
partial struct Options
{
private bool ShowGeometry => Type == ModelTool.ModelType.Model || Type == ModelTool.ModelType.SkinnedModel;
private bool ShowModel => Type == ModelTool.ModelType.Model;
private bool ShowSkinnedModel => Type == ModelTool.ModelType.SkinnedModel;
private bool ShowAnimation => Type == ModelTool.ModelType.Animation;
private bool ShowSmoothingNormalsAngle => ShowGeometry && CalculateNormals;
private bool ShowSmoothingTangentsAngle => ShowGeometry && CalculateTangents;
private bool ShowFramesRange => ShowAnimation && Duration == ModelTool.AnimationDuration.Custom;
}
}
}
namespace FlaxEditor.CustomEditors.Dedicated
{
/// <summary>
/// Custom editor for <see cref="FlaxEngine.Tools.ModelTool.Options"/>.
/// </summary>
[CustomEditor(typeof(FlaxEngine.Tools.ModelTool.Options)), DefaultEditor]
public class ModelToolOptionsEditor : GenericEditor
{
/// <inheritdoc />
protected override List<ItemInfo> GetItemsForType(ScriptType type)
{
// Show both fields and properties
return GetItemsForType(type, true, true);
}
}
}
namespace FlaxEditor.Content.Import
{
/// <summary>
/// Importing model lightmap UVs source
/// </summary>
[HideInEditor]
public enum ModelLightmapUVsSource : int
{
/// <summary>
/// No lightmap UVs.
/// </summary>
Disable = 0,
/// <summary>
/// Generate lightmap UVs from model geometry.
/// </summary>
Generate = 1,
/// <summary>
/// The texcoords channel 0.
/// </summary>
Channel0 = 2,
/// <summary>
/// The texcoords channel 1.
/// </summary>
Channel1 = 3,
/// <summary>
/// The texcoords channel 2.
/// </summary>
Channel2 = 4,
/// <summary>
/// The texcoords channel 3.
/// </summary>
Channel3 = 5
}
/// <summary>
/// Declares the imported data type.
/// </summary>
[HideInEditor]
public enum ModelType : int
{
/// <summary>
/// The model asset.
/// </summary>
Model = 0,
/// <summary>
/// The skinned model asset.
/// </summary>
SkinnedModel = 1,
/// <summary>
/// The animation asset.
/// </summary>
Animation = 2,
}
/// <summary>
/// Declares the imported animation clip duration.
/// </summary>
[HideInEditor]
public enum AnimationDuration : int
{
/// <summary>
/// The imported duration.
/// </summary>
Imported = 0,
/// <summary>
/// The custom duration specified via keyframes range.
/// </summary>
Custom = 1,
}
/// <summary>
/// Proxy object to present model import settings in <see cref="ImportFilesDialog"/>.
/// </summary>
@@ -90,431 +49,10 @@ namespace FlaxEditor.Content.Import
public class ModelImportSettings
{
/// <summary>
/// Type of the imported asset.
/// The settings data.
/// </summary>
[EditorOrder(0)]
public ModelType Type { get; set; } = ModelType.Model;
/// <summary>
/// Enable model normal vectors recalculating.
/// </summary>
[EditorDisplay("Geometry"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(20), DefaultValue(false)]
public bool CalculateNormals { get; set; } = false;
/// <summary>
/// Specifies the maximum angle (in degrees) that may be between two face normals at the same vertex position that their are smoothed together. The default value is 175.
/// </summary>
[EditorDisplay("Geometry"), VisibleIf(nameof(ShowSmoothingNormalsAngle))]
[EditorOrder(30), DefaultValue(175.0f), Limit(0, 175, 0.1f)]
public float SmoothingNormalsAngle { get; set; } = 175.0f;
private bool ShowSmoothingNormalsAngle => ShowGeometry && CalculateNormals;
/// <summary>
/// If checked, the imported normal vectors of the mesh will be flipped (scaled by -1).
/// </summary>
[EditorDisplay("Geometry"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(35), DefaultValue(false)]
public bool FlipNormals { get; set; } = false;
/// <summary>
/// Enable model tangent vectors recalculating.
/// </summary>
[EditorDisplay("Geometry"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(40), DefaultValue(false)]
public bool CalculateTangents { get; set; } = false;
/// <summary>
/// Specifies the maximum angle (in degrees) that may be between two vertex tangents that their tangents and bi-tangents are smoothed. The default value is 45.
/// </summary>
[EditorDisplay("Geometry"), VisibleIf(nameof(ShowSmoothingTangentsAngle))]
[EditorOrder(45), DefaultValue(45.0f), Limit(0, 45, 0.1f)]
public float SmoothingTangentsAngle { get; set; } = 45.0f;
private bool ShowSmoothingTangentsAngle => ShowGeometry && CalculateTangents;
/// <summary>
/// Enable/disable meshes geometry optimization.
/// </summary>
[EditorDisplay("Geometry"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(50), DefaultValue(true)]
public bool OptimizeMeshes { get; set; } = true;
/// <summary>
/// Enable/disable geometry merge for meshes with the same materials.
/// </summary>
[EditorDisplay("Geometry"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(60), DefaultValue(true)]
public bool MergeMeshes { get; set; } = true;
/// <summary>
/// Enable/disable importing meshes Level of Details.
/// </summary>
[EditorDisplay("Geometry", "Import LODs"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(70), DefaultValue(true)]
public bool ImportLODs { get; set; } = true;
/// <summary>
/// Enable/disable importing vertex colors (channel 0 only).
/// </summary>
[EditorDisplay("Geometry"), VisibleIf(nameof(ShowModel))]
[EditorOrder(80), DefaultValue(true)]
public bool ImportVertexColors { get; set; } = true;
/// <summary>
/// Enable/disable importing blend shapes (morph targets).
/// </summary>
[EditorDisplay("Geometry"), VisibleIf(nameof(ShowSkinnedModel))]
[EditorOrder(85), DefaultValue(false)]
public bool ImportBlendShapes { get; set; } = false;
/// <summary>
/// The lightmap UVs source.
/// </summary>
[EditorDisplay("Geometry", "Lightmap UVs Source"), VisibleIf(nameof(ShowModel))]
[EditorOrder(90), DefaultValue(ModelLightmapUVsSource.Disable)]
public ModelLightmapUVsSource LightmapUVsSource { get; set; } = ModelLightmapUVsSource.Disable;
/// <summary>
/// If specified, all meshes which name starts with this prefix will be imported as a separate collision data (excluded used for rendering).
/// </summary>
[EditorDisplay("Geometry"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(100), DefaultValue("")]
public string CollisionMeshesPrefix { get; set; }
/// <summary>
/// Custom uniform import scale.
/// </summary>
[EditorOrder(500), DefaultValue(1.0f), EditorDisplay("Transform")]
public float Scale { get; set; } = 1.0f;
/// <summary>
/// Custom import geometry rotation.
/// </summary>
[DefaultValue(typeof(Quaternion), "0,0,0,1")]
[EditorOrder(510), EditorDisplay("Transform")]
public Quaternion Rotation { get; set; } = Quaternion.Identity;
/// <summary>
/// Custom import geometry offset.
/// </summary>
[DefaultValue(typeof(Float3), "0,0,0")]
[EditorOrder(520), EditorDisplay("Transform")]
public Float3 Translation { get; set; } = Float3.Zero;
/// <summary>
/// If checked, the imported geometry will be shifted to the center of mass.
/// </summary>
[EditorOrder(530), DefaultValue(false), EditorDisplay("Transform")]
public bool CenterGeometry { get; set; } = false;
/// <summary>
/// Imported animation duration mode. Can use the original value or overriden by settings.
/// </summary>
[EditorDisplay("Animation"), VisibleIf(nameof(ShowAnimation))]
[EditorOrder(1000), DefaultValue(AnimationDuration.Imported)]
public AnimationDuration Duration { get; set; } = AnimationDuration.Imported;
/// <summary>
/// Imported animation first frame index. Used only if Duration mode is set to Custom.
/// </summary>
[EditorDisplay("Animation"), VisibleIf(nameof(ShowFramesRange))]
[EditorOrder(1010), DefaultValue(0.0f), Limit(0)]
public float FramesRangeStart { get; set; } = 0;
/// <summary>
/// Imported animation last frame index. Used only if Duration mode is set to Custom.
/// </summary>
[EditorDisplay("Animation"), VisibleIf(nameof(ShowFramesRange))]
[EditorOrder(1020), DefaultValue(0.0f), Limit(0)]
public float FramesRangeEnd { get; set; } = 0;
private bool ShowFramesRange => ShowAnimation && Duration == AnimationDuration.Custom;
/// <summary>
/// The imported animation default frame rate. Can specify the default frames per second amount for imported animation. If value is 0 then the original animation frame rate will be used.
/// </summary>
[EditorDisplay("Animation"), VisibleIf(nameof(ShowAnimation))]
[EditorOrder(1025), DefaultValue(0.0f), Limit(0, 1000, 0.01f)]
public float DefaultFrameRate { get; set; } = 0.0f;
/// <summary>
/// The imported animation sampling rate. If value is 0 then the original animation speed will be used.
/// </summary>
[EditorDisplay("Animation"), VisibleIf(nameof(ShowAnimation))]
[EditorOrder(1030), DefaultValue(0.0f), Limit(0, 1000, 0.01f)]
public float SamplingRate { get; set; } = 0.0f;
/// <summary>
/// The imported animation will have removed tracks with no keyframes or unspecified data.
/// </summary>
[EditorDisplay("Animation"), VisibleIf(nameof(ShowAnimation))]
[EditorOrder(1040), DefaultValue(true)]
public bool SkipEmptyCurves { get; set; } = true;
/// <summary>
/// The imported animation channels will be optimized to remove redundant keyframes.
/// </summary>
[EditorDisplay("Animation"), VisibleIf(nameof(ShowAnimation))]
[EditorOrder(1050), DefaultValue(true)]
public bool OptimizeKeyframes { get; set; } = true;
/// <summary>
/// If checked, the importer will import scale animation tracks (otherwise scale animation will be ignored).
/// </summary>
[EditorDisplay("Animation"), VisibleIf(nameof(ShowAnimation))]
[EditorOrder(1055), DefaultValue(false)]
public bool ImportScaleTracks { get; set; } = false;
/// <summary>
/// Enables root motion extraction support from this animation.
/// </summary>
[EditorDisplay("Animation"), VisibleIf(nameof(ShowAnimation))]
[EditorOrder(1060), DefaultValue(false)]
public bool EnableRootMotion { get; set; } = false;
/// <summary>
/// The custom node name to be used as a root motion source. If not specified the actual root node will be used.
/// </summary>
[EditorDisplay("Animation"), VisibleIf(nameof(ShowAnimation))]
[EditorOrder(1070), DefaultValue(typeof(string), "")]
public string RootNodeName { get; set; }
/// <summary>
/// If checked, the importer will generate a sequence of LODs based on the base LOD index.
/// </summary>
[EditorDisplay("Level Of Detail", "Generate LODs"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(1100), DefaultValue(false)]
public bool GenerateLODs { get; set; } = false;
/// <summary>
/// The index of the LOD from the source model data to use as a reference for following LODs generation.
/// </summary>
[EditorDisplay("Level Of Detail", "Base LOD"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(1110), DefaultValue(0), Limit(0, Model.MaxLODs - 1)]
public int BaseLOD { get; set; } = 0;
/// <summary>
/// The amount of LODs to include in the model (all remaining ones starting from Base LOD will be generated).
/// </summary>
[EditorDisplay("Level Of Detail", "LOD Count"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(1120), DefaultValue(4), Limit(1, Model.MaxLODs)]
public int LODCount { get; set; } = 4;
/// <summary>
/// The target amount of triangles for the generated LOD (based on the higher LOD). Normalized to range 0-1. For instance 0.4 cuts the triangle count to 40%.
/// </summary>
[EditorDisplay("Level Of Detail"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(1130), DefaultValue(0.5f), Limit(0, 1, 0.001f)]
public float TriangleReduction { get; set; } = 0.5f;
/// <summary>
/// If checked, the importer will create materials for model meshes as specified in the file.
/// </summary>
[EditorDisplay("Materials"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(400), DefaultValue(true)]
public bool ImportMaterials { get; set; } = true;
/// <summary>
/// If checked, the importer will import texture files used by the model and any embedded texture resources.
/// </summary>
[EditorDisplay("Materials"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(410), DefaultValue(true)]
public bool ImportTextures { get; set; } = true;
/// <summary>
/// If checked, the importer will try to restore the model material slots.
/// </summary>
[EditorDisplay("Materials", "Restore Materials On Reimport"), VisibleIf(nameof(ShowGeometry))]
[EditorOrder(420), DefaultValue(true)]
public bool RestoreMaterialsOnReimport { get; set; } = true;
/// <summary>
/// If checked, enables generation of Signed Distance Field (SDF).
/// </summary>
[EditorDisplay("SDF"), VisibleIf(nameof(ShowModel))]
[EditorOrder(1500), DefaultValue(false)]
public bool GenerateSDF { get; set; } = false;
/// <summary>
/// Resolution scale for generated Signed Distance Field (SDF) texture. Higher values improve accuracy but increase memory usage and reduce performance.
/// </summary>
[EditorDisplay("SDF"), VisibleIf(nameof(ShowModel))]
[EditorOrder(1510), DefaultValue(1.0f), Limit(0.0001f, 100.0f)]
public float SDFResolution { get; set; } = 1.0f;
/// <summary>
/// If checked, the imported mesh/animations are splitted into separate assets. Used if ObjectIndex is set to -1.
/// </summary>
[EditorOrder(2000), DefaultValue(false), EditorDisplay("Splitting")]
public bool SplitObjects { get; set; } = false;
/// <summary>
/// The zero-based index for the mesh/animation clip to import. If the source file has more than one mesh/animation it can be used to pick a desire object. Default -1 imports all objects.
/// </summary>
[EditorOrder(2010), DefaultValue(-1), EditorDisplay("Splitting")]
public int ObjectIndex { get; set; } = -1;
private bool ShowGeometry => Type == ModelType.Model || Type == ModelType.SkinnedModel;
private bool ShowModel => Type == ModelType.Model;
private bool ShowSkinnedModel => Type == ModelType.SkinnedModel;
private bool ShowAnimation => Type == ModelType.Animation;
[StructLayout(LayoutKind.Sequential)]
internal struct InternalOptions
{
public ModelType Type;
// Geometry
public byte CalculateNormals;
public float SmoothingNormalsAngle;
public byte FlipNormals;
public float SmoothingTangentsAngle;
public byte CalculateTangents;
public byte OptimizeMeshes;
public byte MergeMeshes;
public byte ImportLODs;
public byte ImportVertexColors;
public byte ImportBlendShapes;
public ModelLightmapUVsSource LightmapUVsSource;
public string CollisionMeshesPrefix;
// Transform
public float Scale;
public Quaternion Rotation;
public Float3 Translation;
public byte CenterGeometry;
// Animation
public AnimationDuration Duration;
public float FramesRangeStart;
public float FramesRangeEnd;
public float DefaultFrameRate;
public float SamplingRate;
public byte SkipEmptyCurves;
public byte OptimizeKeyframes;
public byte ImportScaleTracks;
public byte EnableRootMotion;
public string RootNodeName;
// Level Of Detail
public byte GenerateLODs;
public int BaseLOD;
public int LODCount;
public float TriangleReduction;
// Misc
public byte ImportMaterials;
public byte ImportTextures;
public byte RestoreMaterialsOnReimport;
// SDF
public byte GenerateSDF;
public float SDFResolution;
// Splitting
public byte SplitObjects;
public int ObjectIndex;
}
internal void ToInternal(out InternalOptions options)
{
options = new InternalOptions
{
Type = Type,
CalculateNormals = (byte)(CalculateNormals ? 1 : 0),
SmoothingNormalsAngle = SmoothingNormalsAngle,
FlipNormals = (byte)(FlipNormals ? 1 : 0),
SmoothingTangentsAngle = SmoothingTangentsAngle,
CalculateTangents = (byte)(CalculateTangents ? 1 : 0),
OptimizeMeshes = (byte)(OptimizeMeshes ? 1 : 0),
MergeMeshes = (byte)(MergeMeshes ? 1 : 0),
ImportLODs = (byte)(ImportLODs ? 1 : 0),
ImportVertexColors = (byte)(ImportVertexColors ? 1 : 0),
ImportBlendShapes = (byte)(ImportBlendShapes ? 1 : 0),
LightmapUVsSource = LightmapUVsSource,
CollisionMeshesPrefix = CollisionMeshesPrefix,
Scale = Scale,
Rotation = Rotation,
Translation = Translation,
CenterGeometry = (byte)(CenterGeometry ? 1 : 0),
Duration = Duration,
FramesRangeStart = FramesRangeStart,
FramesRangeEnd = FramesRangeEnd,
DefaultFrameRate = DefaultFrameRate,
SamplingRate = SamplingRate,
SkipEmptyCurves = (byte)(SkipEmptyCurves ? 1 : 0),
OptimizeKeyframes = (byte)(OptimizeKeyframes ? 1 : 0),
ImportScaleTracks = (byte)(ImportScaleTracks ? 1 : 0),
EnableRootMotion = (byte)(EnableRootMotion ? 1 : 0),
RootNodeName = RootNodeName,
GenerateLODs = (byte)(GenerateLODs ? 1 : 0),
BaseLOD = BaseLOD,
LODCount = LODCount,
TriangleReduction = TriangleReduction,
ImportMaterials = (byte)(ImportMaterials ? 1 : 0),
ImportTextures = (byte)(ImportTextures ? 1 : 0),
RestoreMaterialsOnReimport = (byte)(RestoreMaterialsOnReimport ? 1 : 0),
GenerateSDF = (byte)(GenerateSDF ? 1 : 0),
SDFResolution = SDFResolution,
SplitObjects = (byte)(SplitObjects ? 1 : 0),
ObjectIndex = ObjectIndex,
};
}
internal void FromInternal(ref InternalOptions options)
{
Type = options.Type;
CalculateNormals = options.CalculateNormals != 0;
SmoothingNormalsAngle = options.SmoothingNormalsAngle;
FlipNormals = options.FlipNormals != 0;
SmoothingTangentsAngle = options.SmoothingTangentsAngle;
CalculateTangents = options.CalculateTangents != 0;
OptimizeMeshes = options.OptimizeMeshes != 0;
MergeMeshes = options.MergeMeshes != 0;
ImportLODs = options.ImportLODs != 0;
ImportVertexColors = options.ImportVertexColors != 0;
ImportBlendShapes = options.ImportBlendShapes != 0;
LightmapUVsSource = options.LightmapUVsSource;
CollisionMeshesPrefix = options.CollisionMeshesPrefix;
Scale = options.Scale;
Rotation = options.Rotation;
Translation = options.Translation;
CenterGeometry = options.CenterGeometry != 0;
FramesRangeStart = options.FramesRangeStart;
FramesRangeEnd = options.FramesRangeEnd;
DefaultFrameRate = options.DefaultFrameRate;
SamplingRate = options.SamplingRate;
SkipEmptyCurves = options.SkipEmptyCurves != 0;
OptimizeKeyframes = options.OptimizeKeyframes != 0;
ImportScaleTracks = options.ImportScaleTracks != 0;
EnableRootMotion = options.EnableRootMotion != 0;
RootNodeName = options.RootNodeName;
GenerateLODs = options.GenerateLODs != 0;
BaseLOD = options.BaseLOD;
LODCount = options.LODCount;
TriangleReduction = options.TriangleReduction;
ImportMaterials = options.ImportMaterials != 0;
ImportTextures = options.ImportTextures != 0;
RestoreMaterialsOnReimport = options.RestoreMaterialsOnReimport != 0;
GenerateSDF = options.GenerateSDF != 0;
SDFResolution = options.SDFResolution;
SplitObjects = options.SplitObjects != 0;
ObjectIndex = options.ObjectIndex;
}
/// <summary>
/// Tries the restore the asset import options from the target resource file. Applies the project default options too.
/// </summary>
/// <param name="options">The options.</param>
/// <param name="assetPath">The asset path.</param>
/// <returns>True settings has been restored, otherwise false.</returns>
public static void TryRestore(ref ModelImportSettings options, string assetPath)
{
ModelImportEntry.Internal_GetModelImportOptions(assetPath, out var internalOptions);
options.FromInternal(ref internalOptions);
}
[EditorDisplay(null, EditorDisplayAttribute.InlineStyle)]
public ModelTool.Options Settings = ModelTool.Options.Default;
}
/// <summary>
@@ -523,7 +61,7 @@ namespace FlaxEditor.Content.Import
/// <seealso cref="AssetImportEntry" />
public class ModelImportEntry : AssetImportEntry
{
private ModelImportSettings _settings = new ModelImportSettings();
private ModelImportSettings _settings = new();
/// <summary>
/// Initializes a new instance of the <see cref="ModelImportEntry"/> class.
@@ -533,7 +71,7 @@ namespace FlaxEditor.Content.Import
: base(ref request)
{
// Try to restore target asset model import options (useful for fast reimport)
ModelImportSettings.TryRestore(ref _settings, ResultUrl);
Editor.TryRestoreImportOptions(ref _settings.Settings, ResultUrl);
}
/// <inheritdoc />
@@ -542,9 +80,14 @@ namespace FlaxEditor.Content.Import
/// <inheritdoc />
public override bool TryOverrideSettings(object settings)
{
if (settings is ModelImportSettings o)
if (settings is ModelImportSettings s)
{
_settings = o;
_settings.Settings = s.Settings;
return true;
}
if (settings is ModelTool.Options o)
{
_settings.Settings = o;
return true;
}
return false;
@@ -553,14 +96,7 @@ namespace FlaxEditor.Content.Import
/// <inheritdoc />
public override bool Import()
{
return Editor.Import(SourceUrl, ResultUrl, _settings);
return Editor.Import(SourceUrl, ResultUrl, _settings.Settings);
}
#region Internal Calls
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern void Internal_GetModelImportOptions(string path, out ModelImportSettings.InternalOptions result);
#endregion
}
}
+108 -406
View File
@@ -3,56 +3,94 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using FlaxEditor.CustomEditors.Editors;
using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.Tools;
// ReSharper disable InconsistentNaming
namespace FlaxEngine.Tools
{
partial class TextureTool
{
partial struct Options
{
#pragma warning disable CS1591
public enum CustomMaxSizes
{
_32 = 32,
_64 = 64,
_128 = 128,
_256 = 256,
_512 = 512,
_1024 = 1024,
_2048 = 2048,
_4096 = 4096,
_8192 = 8192,
_16384 = 16384,
}
#pragma warning restore CS1591
/// <summary>
/// The size of the imported texture. If Resize property is set to true then texture will be resized during the import to this value. Otherwise it will be ignored.
/// </summary>
[EditorOrder(110), VisibleIf(nameof(Resize)), DefaultValue(typeof(Int2), "1024,1024")]
public Int2 Size
{
get => new Int2(SizeX, SizeY);
set
{
SizeX = value.X;
SizeY = value.Y;
}
}
/// <summary>
/// Maximum size of the texture (for both width and height). Higher resolution textures will be resized during importing process.
/// </summary>
[EditorOrder(90), DefaultValue(CustomMaxSizes._8192), EditorDisplay(null, "Max Size")]
public CustomMaxSizes CustomMaxSize
{
get
{
var value = MaxSize;
if (!Mathf.IsPowerOfTwo(value))
value = Mathf.NextPowerOfTwo(value);
FieldInfo[] fields = typeof(CustomMaxSizes).GetFields();
for (int i = 0; i < fields.Length; i++)
{
var field = fields[i];
if (field.Name.Equals("value__"))
continue;
if (value == (int)field.GetRawConstantValue())
return (CustomMaxSizes)value;
}
return CustomMaxSizes._8192;
}
set => MaxSize = (int)value;
}
}
}
}
namespace FlaxEditor.CustomEditors.Dedicated
{
/// <summary>
/// Custom editor for <see cref="FlaxEngine.Tools.TextureTool.Options"/>.
/// </summary>
[CustomEditor(typeof(FlaxEngine.Tools.TextureTool.Options)), DefaultEditor]
public class TextureToolOptionsEditor : GenericEditor
{
/// <inheritdoc />
protected override List<ItemInfo> GetItemsForType(ScriptType type)
{
// Show both fields and properties
return GetItemsForType(type, true, true);
}
}
}
namespace FlaxEditor.Content.Import
{
/// <summary>
/// Texture format types.
/// </summary>
[HideInEditor]
public enum TextureFormatType : byte
{
/// <summary>
/// The unknown.
/// </summary>
Unknown = 0,
/// <summary>
/// The color with RGB channels.
/// </summary>
ColorRGB = 1,
/// <summary>
/// The color with RGBA channels.
/// </summary>
ColorRGBA = 2,
/// <summary>
/// The normal map (packed and compressed).
/// </summary>
NormalMap = 3,
/// <summary>
/// The gray scale (R channel).
/// </summary>
GrayScale = 4,
/// <summary>
/// The HDR color (RGBA channels).
/// </summary>
HdrRGBA = 5,
/// <summary>
/// The HDR color (RGB channels).
/// </summary>
HdrRGB = 6
}
/// <summary>
/// Proxy object to present texture import settings in <see cref="ImportFilesDialog"/>.
/// </summary>
@@ -60,346 +98,10 @@ namespace FlaxEditor.Content.Import
public class TextureImportSettings
{
/// <summary>
/// A custom version of <see cref="TextureFormatType"/> for GUI.
/// The settings data.
/// </summary>
public enum CustomTextureFormatType
{
/// <summary>
/// The color with RGB channels.
/// </summary>
ColorRGB = 1,
/// <summary>
/// The color with RGBA channels.
/// </summary>
ColorRGBA = 2,
/// <summary>
/// The normal map (packed and compressed).
/// </summary>
NormalMap = 3,
/// <summary>
/// The gray scale (R channel).
/// </summary>
GrayScale = 4,
/// <summary>
/// The HDR color (RGBA channels).
/// </summary>
HdrRGBA = 5,
/// <summary>
/// The HDR color (RGB channels).
/// </summary>
HdrRGB = 6
}
/// <summary>
/// A custom set of max texture import sizes.
/// </summary>
public enum CustomMaxSizeType
{
/// <summary>
/// The 32.
/// </summary>
_32 = 32,
/// <summary>
/// The 64.
/// </summary>
_64 = 64,
/// <summary>
/// The 128.
/// </summary>
_128 = 128,
/// <summary>
/// The 256.
/// </summary>
_256 = 256,
/// <summary>
/// The 512.
/// </summary>
_512 = 512,
/// <summary>
/// The 1024.
/// </summary>
_1024 = 1024,
/// <summary>
/// The 2048.
/// </summary>
_2048 = 2048,
/// <summary>
/// The 4096.
/// </summary>
_4096 = 4096,
/// <summary>
/// The 8192.
/// </summary>
_8192 = 8192,
}
/// <summary>
/// Converts the maximum size to enum.
/// </summary>
/// <param name="f">The max size.</param>
/// <returns>The converted enum.</returns>
public static CustomMaxSizeType ConvertMaxSize(int f)
{
if (!Mathf.IsPowerOfTwo(f))
f = Mathf.NextPowerOfTwo(f);
FieldInfo[] fields = typeof(CustomMaxSizeType).GetFields();
for (int i = 0; i < fields.Length; i++)
{
var field = fields[i];
if (field.Name.Equals("value__"))
continue;
if (f == (int)field.GetRawConstantValue())
return (CustomMaxSizeType)f;
}
return CustomMaxSizeType._8192;
}
/// <summary>
/// The sprite info.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct SpriteInfo
{
/// <summary>
/// The sprite area.
/// </summary>
public Rectangle Area;
/// <summary>
/// The sprite name.
/// </summary>
public string Name;
/// <summary>
/// Initializes a new instance of the <see cref="SpriteInfo"/> struct.
/// </summary>
/// <param name="area">The area.</param>
/// <param name="name">The name.</param>
public SpriteInfo(Rectangle area, string name)
{
Area = area;
Name = name;
}
}
/// <summary>
/// Texture format type
/// </summary>
[EditorOrder(0), DefaultValue(CustomTextureFormatType.ColorRGB), Tooltip("Texture import format type")]
public CustomTextureFormatType Type { get; set; } = CustomTextureFormatType.ColorRGB;
/// <summary>
/// True if texture should be imported as a texture atlas resource
/// </summary>
[EditorOrder(10), DefaultValue(false), Tooltip("True if texture should be imported as a texture atlas (with sprites)")]
public bool IsAtlas { get; set; }
/// <summary>
/// True if disable dynamic texture streaming
/// </summary>
[EditorOrder(20), DefaultValue(false), Tooltip("True if disable dynamic texture streaming")]
public bool NeverStream { get; set; }
/// <summary>
/// Enables/disables texture data compression.
/// </summary>
[EditorOrder(30), DefaultValue(true), Tooltip("True if compress texture data")]
public bool Compress { get; set; } = true;
/// <summary>
/// True if texture channels have independent data
/// </summary>
[EditorOrder(40), DefaultValue(false), Tooltip("True if texture channels have independent data (for compression methods)")]
public bool IndependentChannels { get; set; }
/// <summary>
/// True if use sRGB format for texture data. Recommended for color maps and diffuse color textures.
/// </summary>
[EditorOrder(50), DefaultValue(false), EditorDisplay(null, "sRGB"), Tooltip("True if use sRGB format for texture data. Recommended for color maps and diffuse color textures.")]
public bool sRGB { get; set; }
/// <summary>
/// True if generate mip maps chain for the texture.
/// </summary>
[EditorOrder(60), DefaultValue(true), Tooltip("True if generate mip maps chain for the texture")]
public bool GenerateMipMaps { get; set; } = true;
/// <summary>
/// True if flip Y coordinate of the texture.
/// </summary>
[EditorOrder(65), DefaultValue(false), EditorDisplay(null, "Flip Y"), Tooltip("True if flip Y coordinate of the texture.")]
public bool FlipY { get; set; } = false;
/// <summary>
/// The import texture scale.
/// </summary>
[EditorOrder(70), DefaultValue(1.0f), Tooltip("Texture scale. Default is 1.")]
public float Scale { get; set; } = 1.0f;
/// <summary>
/// Maximum size of the texture (for both width and height).
/// Higher resolution textures will be resized during importing process.
/// </summary>
[EditorOrder(80), DefaultValue(CustomMaxSizeType._8192), Tooltip("Maximum texture size (will be resized if need to)")]
public CustomMaxSizeType MaxSize { get; set; } = CustomMaxSizeType._8192;
/// <summary>
/// True if resize texture on import. Use Size property to define texture width and height. Texture scale property will be ignored.
/// </summary>
[EditorOrder(90), DefaultValue(false), Tooltip("True if resize texture on import. Use Size property to define texture width and height. Texture scale property will be ignored.")]
public bool Resize { get; set; } = false;
/// <summary>
/// Gets or sets the size of the imported texture. If Resize property is set to true then texture will be resized during the import to this value. Otherwise it will be ignored.
/// </summary>
[EditorOrder(100), VisibleIf("Resize"), DefaultValue(typeof(Int2), "1024,1024"), Tooltip("The size of the imported texture. If Resize property is set to true then texture will be resized during the import to this value. Otherwise it will be ignored.")]
public Int2 Size { get; set; } = new Int2(1024, 1024);
/// <summary>
/// True if preserve alpha coverage in generated mips for alpha test reference. Scales mipmap alpha values to preserve alpha coverage based on an alpha test reference value.
/// </summary>
[EditorOrder(240), DefaultValue(false), Tooltip("Check to preserve alpha coverage in generated mips for alpha test reference. Scales mipmap alpha values to preserve alpha coverage based on an alpha test reference value.")]
public bool PreserveAlphaCoverage { get; set; } = false;
/// <summary>
/// The reference value for the alpha coverage preserving.
/// </summary>
[EditorOrder(250), VisibleIf("PreserveAlphaCoverage"), DefaultValue(0.5f), Tooltip("The reference value for the alpha coverage preserving.")]
public float PreserveAlphaCoverageReference { get; set; } = 0.5f;
/// <summary>
/// Texture group for streaming (negative if unused). See Streaming Settings.
/// </summary>
[CustomEditor(typeof(CustomEditors.Dedicated.TextureGroupEditor))]
[EditorOrder(300), Tooltip("Texture group for streaming (negative if unused). See Streaming Settings.")]
public int TextureGroup = -1;
/// <summary>
/// The sprites. Used to keep created sprites on sprite atlas reimport.
/// </summary>
[HideInEditor]
public List<SpriteInfo> Sprites = new List<SpriteInfo>();
[StructLayout(LayoutKind.Sequential)]
internal struct InternalOptions
{
public TextureFormatType Type;
public byte IsAtlas;
public byte NeverStream;
public byte Compress;
public byte IndependentChannels;
public byte sRGB;
public byte GenerateMipMaps;
public byte FlipY;
public byte Resize;
public byte PreserveAlphaCoverage;
public float PreserveAlphaCoverageReference;
public float Scale;
public int MaxSize;
public int TextureGroup;
public Int2 Size;
public Rectangle[] SpriteAreas;
public string[] SpriteNames;
}
internal void ToInternal(out InternalOptions options)
{
options = new InternalOptions
{
Type = (TextureFormatType)(int)Type,
IsAtlas = (byte)(IsAtlas ? 1 : 0),
NeverStream = (byte)(NeverStream ? 1 : 0),
Compress = (byte)(Compress ? 1 : 0),
IndependentChannels = (byte)(IndependentChannels ? 1 : 0),
sRGB = (byte)(sRGB ? 1 : 0),
GenerateMipMaps = (byte)(GenerateMipMaps ? 1 : 0),
FlipY = (byte)(FlipY ? 1 : 0),
Resize = (byte)(Resize ? 1 : 0),
PreserveAlphaCoverage = (byte)(PreserveAlphaCoverage ? 1 : 0),
PreserveAlphaCoverageReference = PreserveAlphaCoverageReference,
Scale = Scale,
Size = Size,
MaxSize = (int)MaxSize,
TextureGroup = TextureGroup,
};
if (Sprites != null && Sprites.Count > 0)
{
int count = Sprites.Count;
options.SpriteAreas = new Rectangle[count];
options.SpriteNames = new string[count];
for (int i = 0; i < count; i++)
{
options.SpriteAreas[i] = Sprites[i].Area;
options.SpriteNames[i] = Sprites[i].Name;
}
}
else
{
options.SpriteAreas = null;
options.SpriteNames = null;
}
}
internal void FromInternal(ref InternalOptions options)
{
Type = (CustomTextureFormatType)(int)options.Type;
IsAtlas = options.IsAtlas != 0;
NeverStream = options.NeverStream != 0;
Compress = options.Compress != 0;
IndependentChannels = options.IndependentChannels != 0;
sRGB = options.sRGB != 0;
GenerateMipMaps = options.GenerateMipMaps != 0;
FlipY = options.FlipY != 0;
Resize = options.Resize != 0;
PreserveAlphaCoverage = options.PreserveAlphaCoverage != 0;
PreserveAlphaCoverageReference = options.PreserveAlphaCoverageReference;
Scale = options.Scale;
MaxSize = ConvertMaxSize(options.MaxSize);
TextureGroup = options.TextureGroup;
Size = options.Size;
if (options.SpriteAreas != null)
{
int spritesCount = options.SpriteAreas.Length;
Sprites.Capacity = spritesCount;
for (int i = 0; i < spritesCount; i++)
{
Sprites.Add(new SpriteInfo(options.SpriteAreas[i], options.SpriteNames[i]));
}
}
}
/// <summary>
/// Tries the restore the asset import options from the target resource file.
/// </summary>
/// <param name="options">The options.</param>
/// <param name="assetPath">The asset path.</param>
/// <returns>True settings has been restored, otherwise false.</returns>
public static bool TryRestore(ref TextureImportSettings options, string assetPath)
{
if (TextureImportEntry.Internal_GetTextureImportOptions(assetPath, out var internalOptions))
{
// Restore settings
options.FromInternal(ref internalOptions);
return true;
}
return false;
}
[EditorDisplay(null, EditorDisplayAttribute.InlineStyle)]
public TextureTool.Options Settings = TextureTool.Options.Default;
}
/// <summary>
@@ -408,7 +110,7 @@ namespace FlaxEditor.Content.Import
/// <seealso cref="AssetImportEntry" />
public class TextureImportEntry : AssetImportEntry
{
private TextureImportSettings _settings = new TextureImportSettings();
private TextureImportSettings _settings = new();
/// <summary>
/// Initializes a new instance of the <see cref="TextureImportEntry"/> class.
@@ -423,15 +125,15 @@ namespace FlaxEditor.Content.Import
if (extension == ".raw")
{
// Raw image data in 16bit gray-scale, preserve the quality
_settings.Type = TextureImportSettings.CustomTextureFormatType.HdrRGBA;
_settings.Compress = false;
_settings.Settings.Type = TextureFormatType.HdrRGBA;
_settings.Settings.Compress = false;
}
else if (extension == ".hdr")
{
// HDR sky texture
_settings.Type = TextureImportSettings.CustomTextureFormatType.HdrRGB;
_settings.Settings.Type = TextureFormatType.HdrRGB;
}
else if (_settings.Type != TextureImportSettings.CustomTextureFormatType.ColorRGB)
else if (_settings.Settings.Type != TextureFormatType.ColorRGB)
{
// Skip checking
}
@@ -443,7 +145,7 @@ namespace FlaxEditor.Content.Import
|| snl.EndsWith("normals"))
{
// Normal map
_settings.Type = TextureImportSettings.CustomTextureFormatType.NormalMap;
_settings.Settings.Type = TextureFormatType.NormalMap;
}
else if (snl.EndsWith("_d")
|| snl.Contains("diffuse")
@@ -454,8 +156,8 @@ namespace FlaxEditor.Content.Import
|| snl.Contains("albedo"))
{
// Albedo or diffuse map
_settings.Type = TextureImportSettings.CustomTextureFormatType.ColorRGB;
_settings.sRGB = true;
_settings.Settings.Type = TextureFormatType.ColorRGB;
_settings.Settings.sRGB = true;
}
else if (snl.EndsWith("ao")
|| snl.EndsWith("ambientocclusion")
@@ -478,11 +180,11 @@ namespace FlaxEditor.Content.Import
|| snl.EndsWith("metallic"))
{
// Glossiness, metalness, ambient occlusion, displacement, height, cavity or specular
_settings.Type = TextureImportSettings.CustomTextureFormatType.GrayScale;
_settings.Settings.Type = TextureFormatType.GrayScale;
}
// Try to restore target asset texture import options (useful for fast reimport)
TextureImportSettings.TryRestore(ref _settings, ResultUrl);
Editor.TryRestoreImportOptions(ref _settings.Settings, ResultUrl);
}
/// <inheritdoc />
@@ -491,11 +193,18 @@ namespace FlaxEditor.Content.Import
/// <inheritdoc />
public override bool TryOverrideSettings(object settings)
{
if (settings is TextureImportSettings o)
if (settings is TextureImportSettings s)
{
var sprites = o.Sprites ?? _settings.Sprites; // Preserve sprites if not specified to override
_settings = o;
_settings.Sprites = sprites;
var sprites = s.Settings.Sprites ?? _settings.Settings.Sprites; // Preserve sprites if not specified to override
_settings.Settings = s.Settings;
_settings.Settings.Sprites = sprites;
return true;
}
if (settings is TextureTool.Options o)
{
var sprites = o.Sprites ?? _settings.Settings.Sprites; // Preserve sprites if not specified to override
_settings.Settings = o;
_settings.Settings.Sprites = sprites;
return true;
}
return false;
@@ -504,14 +213,7 @@ namespace FlaxEditor.Content.Import
/// <inheritdoc />
public override bool Import()
{
return Editor.Import(SourceUrl, ResultUrl, _settings);
return Editor.Import(SourceUrl, ResultUrl, _settings.Settings);
}
#region Internal Calls
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern bool Internal_GetTextureImportOptions(string path, out TextureImportSettings.InternalOptions result);
#endregion
}
}
+42 -21
View File
@@ -1,8 +1,6 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System;
using System.IO;
using System.Text;
using FlaxEngine;
using FlaxEngine.GUI;
@@ -25,6 +23,11 @@ namespace FlaxEditor.Content
/// </summary>
public string TypeName { get; }
/// <summary>
/// Returns true if asset is now loaded.
/// </summary>
public bool IsLoaded => FlaxEngine.Content.GetAsset(ID)?.IsLoaded ?? false;
/// <summary>
/// Initializes a new instance of the <see cref="AssetItem"/> class.
/// </summary>
@@ -38,14 +41,6 @@ namespace FlaxEditor.Content
ID = id;
}
/// <inheritdoc />
public override void UpdateTooltipText()
{
var sb = new StringBuilder();
OnBuildTooltipText(sb);
TooltipText = sb.ToString();
}
private sealed class TooltipDoubleClickHook : Control
{
public AssetItem Item;
@@ -74,20 +69,46 @@ namespace FlaxEditor.Content
hook.Item = this;
}
/// <summary>
/// Called when building tooltip text.
/// </summary>
/// <param name="sb">The String Builder.</param>
protected virtual void OnBuildTooltipText(StringBuilder sb)
{
sb.Append("Type: ").Append(TypeName).AppendLine();
sb.Append("Size: ").Append(Utilities.Utils.FormatBytesCount((int)new FileInfo(Path).Length)).AppendLine();
sb.Append("Path: ").Append(Path).AppendLine();
}
/// <inheritdoc />
public override ContentItemType ItemType => ContentItemType.Asset;
/// <inheritdoc />
public override string TypeDescription
{
get
{
// Translate asset type name
var typeName = TypeName;
string[] typeNamespaces = typeName.Split('.');
if (typeNamespaces.Length != 0 && typeNamespaces.Length != 0)
{
typeName = Utilities.Utils.GetPropertyNameUI(typeNamespaces[typeNamespaces.Length - 1]);
}
return typeName;
}
}
/// <summary>
/// Loads the asset.
/// </summary>
/// <returns>The asset object.</returns>
public Asset LoadAsync()
{
return FlaxEngine.Content.LoadAsync<Asset>(ID);
}
/// <summary>
/// Reloads the asset (if it's loaded).
/// </summary>
public void Reload()
{
var asset = FlaxEngine.Content.GetAsset(ID);
if (asset != null && asset.IsLoaded)
{
asset.Reload();
}
}
/// <summary>
/// Determines whether asset is of the specified type (included inheritance checks).
/// </summary>
@@ -19,6 +19,9 @@ namespace FlaxEditor.Content
{
}
/// <inheritdoc />
public override string TypeDescription => "C# Source Code";
/// <inheritdoc />
public override SpriteHandle DefaultThumbnail => Editor.Instance.Icons.CSharpScript128;
}
+16 -3
View File
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using FlaxEditor.GUI.Drag;
using FlaxEngine;
using FlaxEngine.GUI;
@@ -112,7 +113,15 @@ namespace FlaxEditor.Content
public override ContentItemSearchFilter SearchFilter => ContentItemSearchFilter.Other;
/// <inheritdoc />
public override bool CanRename => ParentFolder != null; // Deny rename action for root folders
public override bool CanRename
{
get
{
var hasParentFolder = ParentFolder != null;
var isContentFolder = Node is MainContentTreeNode;
return hasParentFolder && !isContentFolder;
}
}
/// <inheritdoc />
public override bool CanDrag => ParentFolder != null; // Deny rename action for root folders
@@ -120,6 +129,9 @@ namespace FlaxEditor.Content
/// <inheritdoc />
public override bool Exists => Directory.Exists(Path);
/// <inheritdoc />
public override string TypeDescription => "Folder";
/// <inheritdoc />
public override SpriteHandle DefaultThumbnail => Editor.Instance.Icons.Folder128;
@@ -135,9 +147,10 @@ namespace FlaxEditor.Content
}
/// <inheritdoc />
public override void UpdateTooltipText()
protected override void OnBuildTooltipText(StringBuilder sb)
{
TooltipText = Path;
sb.Append("Type: ").Append(TypeDescription).AppendLine();
sb.Append("Path: ").Append(Utilities.Utils.GetAssetNamePathWithExt(Path)).AppendLine();
}
/// <inheritdoc />
+32 -3
View File
@@ -2,6 +2,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using FlaxEditor.Content.GUI;
using FlaxEditor.GUI.Drag;
using FlaxEngine;
@@ -222,7 +224,7 @@ namespace FlaxEditor.Content
/// <summary>
/// Gets a value indicating whether this item can be dragged and dropped.
/// </summary>
public virtual bool CanDrag => true;
public virtual bool CanDrag => Root != null;
/// <summary>
/// Gets a value indicating whether this <see cref="ContentItem"/> exists on drive.
@@ -273,6 +275,11 @@ namespace FlaxEditor.Content
/// </summary>
public string NamePath => FlaxEditor.Utilities.Utils.GetAssetNamePath(Path);
/// <summary>
/// Gets the content item type description (for UI).
/// </summary>
public abstract string TypeDescription { get; }
/// <summary>
/// Gets the default name of the content item thumbnail. Returns null if not used.
/// </summary>
@@ -357,7 +364,29 @@ namespace FlaxEditor.Content
/// </summary>
public virtual void UpdateTooltipText()
{
TooltipText = "Path: " + Path;
var sb = new StringBuilder();
OnBuildTooltipText(sb);
if (sb.Length != 0 && sb[sb.Length - 1] == '\n')
{
// Remove new-line from end
int sub = 1;
if (sb.Length != 1 && sb[sb.Length - 2] == '\r')
sub = 2;
sb.Length -= sub;
}
TooltipText = sb.ToString();
}
/// <summary>
/// Called when building tooltip text.
/// </summary>
/// <param name="sb">The output string builder.</param>
protected virtual void OnBuildTooltipText(StringBuilder sb)
{
sb.Append("Type: ").Append(TypeDescription).AppendLine();
if (File.Exists(Path))
sb.Append("Size: ").Append(Utilities.Utils.FormatBytesCount((int)new FileInfo(Path).Length)).AppendLine();
sb.Append("Path: ").Append(Utilities.Utils.GetAssetNamePathWithExt(Path)).AppendLine();
}
/// <summary>
@@ -690,7 +719,7 @@ namespace FlaxEditor.Content
public override bool OnMouseDoubleClick(Float2 location, MouseButton button)
{
Focus();
// Open
(Parent as ContentView).OnItemDoubleClick(this);
@@ -19,6 +19,9 @@ namespace FlaxEditor.Content
{
}
/// <inheritdoc />
public override string TypeDescription => Path.EndsWith(".h") ? "C++ Header File" : "C++ Source Code";
/// <inheritdoc />
public override SpriteHandle DefaultThumbnail => Editor.Instance.Icons.CPPScript128;
}
+3
View File
@@ -25,6 +25,9 @@ namespace FlaxEditor.Content
/// <inheritdoc />
public override ContentItemSearchFilter SearchFilter => ContentItemSearchFilter.Other;
/// <inheritdoc />
public override string TypeDescription => "File";
/// <inheritdoc />
public override SpriteHandle DefaultThumbnail => Editor.Instance.Icons.Document128;
}
+10
View File
@@ -1,5 +1,6 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System.Text;
using FlaxEngine;
namespace FlaxEditor.Content
@@ -39,10 +40,19 @@ namespace FlaxEditor.Content
/// <inheritdoc />
public override ContentItemSearchFilter SearchFilter => ContentItemSearchFilter.Other;
/// <inheritdoc />
public override string TypeDescription => "New";
/// <inheritdoc />
public override SpriteHandle DefaultThumbnail => Editor.Instance.Icons.Document128;
/// <inheritdoc />
protected override bool DrawShadow => true;
/// <inheritdoc />
public override void UpdateTooltipText()
{
TooltipText = null;
}
}
}
+3
View File
@@ -27,6 +27,9 @@ namespace FlaxEditor.Content
/// <inheritdoc />
public override ContentItemSearchFilter SearchFilter => ContentItemSearchFilter.Scene;
/// <inheritdoc />
public override string TypeDescription => "Scene";
/// <inheritdoc />
public override SpriteHandle DefaultThumbnail => Editor.Instance.Icons.Scene128;
@@ -26,6 +26,9 @@ namespace FlaxEditor.Content
/// <inheritdoc />
public override ContentItemSearchFilter SearchFilter => ContentItemSearchFilter.Shader;
/// <inheritdoc />
public override string TypeDescription => "Shader Source Code";
/// <inheritdoc />
public override SpriteHandle DefaultThumbnail => Editor.Instance.Icons.Document128;
}
@@ -8,6 +8,7 @@ using System.Reflection;
using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.Json;
using FlaxEngine.Utilities;
using Object = FlaxEngine.Object;
namespace FlaxEditor.Content
@@ -134,7 +135,7 @@ namespace FlaxEditor.Content
_index = index;
type.Asset.GetMethodSignature(index, out _name, out _flags, out var returnTypeName, out var paramNames, out var paramTypeNames, out var paramOuts);
_returnType = TypeUtils.GetType(returnTypeName);
if (paramNames.Length != 0)
if (paramNames != null && paramNames.Length != 0)
{
_parameters = new ScriptMemberInfo.Parameter[paramNames.Length];
for (int i = 0; i < _parameters.Length; i++)
@@ -310,7 +311,10 @@ namespace FlaxEditor.Content
internal void Dispose()
{
OnAssetReloading(_asset);
if (_parameters != null)
{
OnAssetReloading(_asset);
}
_asset = null;
}
@@ -2,6 +2,7 @@
using System;
using FlaxEngine;
using FlaxEngine.Utilities;
namespace FlaxEditor.Content
{
@@ -42,7 +43,7 @@ namespace FlaxEditor.Content
/// <inheritdoc />
public override AssetItem ConstructItem(string path, string typeName, ref Guid id)
{
var type = Scripting.TypeUtils.GetType(typeName).Type;
var type = TypeUtils.GetType(typeName).Type;
if (typeof(TextureBase).IsAssignableFrom(type))
return new TextureAssetItem(path, ref id, typeName, type);
@@ -80,7 +80,8 @@ namespace FlaxEditor.Content
/// </summary>
/// <param name="model">The associated model.</param>
/// <param name="created">The action to call once the collision data gets created (or reused from existing).</param>
public void CreateCollisionDataFromModel(Model model, Action<CollisionData> created = null)
/// <param name="withRenaming">True if start initial item renaming by user, or tru to skip it.</param>
public void CreateCollisionDataFromModel(Model model, Action<CollisionData> created = null, bool withRenaming = true)
{
// Check if there already is collision data for that model to reuse
var modelItem = (AssetItem)Editor.Instance.ContentDatabase.Find(model.ID);
@@ -140,7 +141,7 @@ namespace FlaxEditor.Content
});
};
var initialName = (modelItem?.ShortName ?? Path.GetFileNameWithoutExtension(model.Path)) + " Collision";
Editor.Instance.Windows.ContentWin.NewItem(this, null, create, initialName);
Editor.Instance.Windows.ContentWin.NewItem(this, null, create, initialName, withRenaming);
}
}
}
@@ -22,7 +22,6 @@ namespace FlaxEditor.Content
/// Json assets proxy.
/// </summary>
/// <seealso cref="FlaxEditor.Content.JsonAssetBaseProxy" />
[ContentContextMenu("New/Json Asset")]
public abstract class JsonAssetProxy : JsonAssetBaseProxy
{
/// <summary>
@@ -127,6 +126,7 @@ namespace FlaxEditor.Content
/// Generic Json assets proxy (supports all json assets that don't have dedicated proxy).
/// </summary>
/// <seealso cref="FlaxEditor.Content.JsonAssetBaseProxy" />
[ContentContextMenu("New/Json Asset")]
public class GenericJsonAssetProxy : JsonAssetProxy
{
/// <inheritdoc />
+2 -4
View File
@@ -72,11 +72,9 @@ namespace FlaxEditor.Content
/// <param name="materialItem">The material item to use as a base material.</param>
public static void CreateMaterialInstance(BinaryAssetItem materialItem)
{
if (materialItem == null)
throw new ArgumentNullException();
var materialInstanceName = materialItem.ShortName + " Instance";
var materialInstanceProxy = Editor.Instance.ContentDatabase.GetProxy<MaterialInstance>();
Editor.Instance.Windows.ContentWin.NewItem(materialInstanceProxy, null, item => OnMaterialInstanceCreated(item, materialItem));
Editor.Instance.Windows.ContentWin.NewItem(materialInstanceProxy, null, item => OnMaterialInstanceCreated(item, materialItem), materialInstanceName);
}
private static void OnMaterialInstanceCreated(ContentItem item, BinaryAssetItem materialItem)
+16 -2
View File
@@ -47,9 +47,23 @@ namespace FlaxEditor.Content
menu.AddButton("Create collision data", () =>
{
var model = FlaxEngine.Content.LoadAsync<Model>(((ModelItem)item).ID);
var collisionDataProxy = (CollisionDataProxy)Editor.Instance.ContentDatabase.GetProxy<CollisionData>();
collisionDataProxy.CreateCollisionDataFromModel(model);
var selection = Editor.Instance.Windows.ContentWin.View.Selection;
if (selection.Count > 1)
{
// Batch action
var items = selection.ToArray(); // Clone to prevent issue when iterating over and content window changes the selection
foreach (var contentItem in items)
{
if (contentItem is ModelItem modelItem)
collisionDataProxy.CreateCollisionDataFromModel(FlaxEngine.Content.LoadAsync<Model>(modelItem.ID), null, false);
}
}
else
{
var model = FlaxEngine.Content.LoadAsync<Model>(((ModelItem)item).ID);
collisionDataProxy.CreateCollisionDataFromModel(model);
}
});
}
+3 -1
View File
@@ -45,7 +45,7 @@ namespace FlaxEditor.Content
}
/// <inheritdoc />
public override string NewItemName => "Script";
public override string NewItemName => "MyScript";
/// <inheritdoc />
public override bool CanCreate(ContentFolder targetLocation)
@@ -72,6 +72,8 @@ namespace FlaxEditor.Content
// Scripts cannot start with digit.
if (Char.IsDigit(filename[0]))
return false;
if (filename.Equals("Script"))
return false;
return true;
}
@@ -59,7 +59,10 @@ namespace FlaxEditor.Content
// Check if asset is streamed enough
var asset = (SkinnedModel)request.Asset;
return asset.LoadedLODs >= Mathf.Max(1, (int)(asset.LODs.Length * ThumbnailsModule.MinimumRequiredResourcesQuality));
var lods = asset.LODs.Length;
if (asset.IsLoaded && lods == 0)
return true; // Skeleton-only model
return asset.LoadedLODs >= Mathf.Max(1, (int)(lods * ThumbnailsModule.MinimumRequiredResourcesQuality));
}
/// <inheritdoc />
@@ -8,6 +8,7 @@ using FlaxEditor.Windows;
using FlaxEditor.Windows.Assets;
using FlaxEngine;
using FlaxEngine.Json;
using FlaxEngine.Utilities;
namespace FlaxEditor.Content
{
@@ -242,21 +242,36 @@ namespace FlaxEditor.Content.Thumbnails
if (!atlas.IsReady)
return;
// Setup
_guiRoot.RemoveChildren();
_guiRoot.AccentColor = request.Proxy.AccentColor;
try
{
// Setup
_guiRoot.RemoveChildren();
_guiRoot.AccentColor = request.Proxy.AccentColor;
// Call proxy to prepare for thumbnail rendering
request.Proxy.OnThumbnailDrawBegin(request, _guiRoot, context);
_guiRoot.UnlockChildrenRecursive();
// Call proxy to prepare for thumbnail rendering
request.Proxy.OnThumbnailDrawBegin(request, _guiRoot, context);
_guiRoot.UnlockChildrenRecursive();
// Draw preview
context.Clear(_output.View(), Color.Black);
Render2D.CallDrawing(_guiRoot, context, _output);
// Draw preview
context.Clear(_output.View(), Color.Black);
Render2D.CallDrawing(_guiRoot, context, _output);
// Call proxy and cleanup UI (delete create controls, shared controls should be unlinked during OnThumbnailDrawEnd event)
request.Proxy.OnThumbnailDrawEnd(request, _guiRoot);
_guiRoot.DisposeChildren();
// Call proxy and cleanup UI (delete create controls, shared controls should be unlinked during OnThumbnailDrawEnd event)
request.Proxy.OnThumbnailDrawEnd(request, _guiRoot);
}
catch (Exception ex)
{
// Handle internal errors gracefully (eg. when asset is corrupted and proxy fails)
Editor.LogError("Failed to render thumbnail icon for asset: " + request.Item);
Editor.LogWarning(ex);
request.FinishRender(ref SpriteHandle.Invalid);
RemoveRequest(request);
return;
}
finally
{
_guiRoot.DisposeChildren();
}
// Copy backbuffer with rendered preview into atlas
SpriteHandle icon = atlas.OccupySlot(_output, request.Item.ID);
+53 -14
View File
@@ -115,9 +115,19 @@ API_ENUM() enum class BuildPlatform
/// </summary>
API_ENUM(Attributes="EditorDisplay(null, \"Mac x64\")")
MacOSx64 = 12,
};
extern FLAXENGINE_API const Char* ToString(const BuildPlatform platform);
/// <summary>
/// MacOS (ARM64 Apple Silicon)
/// </summary>
API_ENUM(Attributes="EditorDisplay(null, \"Mac ARM64\")")
MacOSARM64 = 13,
/// <summary>
/// iOS (ARM64)
/// </summary>
API_ENUM(Attributes="EditorDisplay(null, \"iOS ARM64\")")
iOSARM64 = 14,
};
/// <summary>
/// Game build configuration modes.
@@ -140,7 +150,35 @@ API_ENUM() enum class BuildConfiguration
Release = 2,
};
/// <summary>
/// .NET Ahead of Time Compilation (AOT) modes.
/// </summary>
enum class DotNetAOTModes
{
/// <summary>
/// AOT is not used.
/// </summary>
None,
/// <summary>
/// Use .NET Native IL Compiler (shorten as ILC) to convert all C# assemblies in native platform executable binary.
/// </summary>
ILC,
/// <summary>
/// Use Mono AOT to cross-compile all used C# assemblies into native platform shared libraries.
/// </summary>
MonoAOTDynamic,
/// <summary>
/// Use Mono AOT to cross-compile all used C# assemblies into native platform static libraries which can be linked into a single shared library.
/// </summary>
MonoAOTStatic,
};
extern FLAXENGINE_API const Char* ToString(const BuildPlatform platform);
extern FLAXENGINE_API const Char* ToString(const BuildConfiguration configuration);
extern FLAXENGINE_API const Char* ToString(const DotNetAOTModes mode);
#define BUILD_STEP_CANCEL_CHECK if (GameCooker::IsCancelRequested()) return true
@@ -188,7 +226,7 @@ public:
API_FIELD(ReadOnly) String OriginalOutputPath;
/// <summary>
/// The output path for data files (Content, Mono, etc.).
/// The output path for data files (Content, Dotnet, Mono, etc.).
/// </summary>
API_FIELD(ReadOnly) String DataOutputPath;
@@ -300,15 +338,18 @@ public:
/// <summary>
/// Gets the absolute path to the Platform Data folder that contains the binary files used by the current build configuration.
/// </summary>
/// <returns>The platform data folder path.</returns>
String GetGameBinariesPath() const;
/// <summary>
/// Gets the absolute path to the platform folder that contains the dependency files used by the current build configuration.
/// </summary>
/// <returns>The platform deps folder path.</returns>
String GetPlatformBinariesRoot() const;
/// <summary>
/// Gets the name of the platform and architecture for the current BuildPlatform.
/// </summary>
void GetBuildPlatformName(const Char*& platform, const Char*& architecture) const;
public:
/// <summary>
@@ -368,17 +409,15 @@ public:
public:
void Error(const String& msg);
void Error(const StringView& msg);
void Error(const String& msg)
{
Error(StringView(msg));
}
void Error(const Char* msg)
{
Error(String(msg));
}
template<typename... Args>
void Error(const Char* format, const Args& ... args)
{
const String msg = String::Format(format, args...);
Error(msg);
Error(StringView(msg));
}
};
+133 -13
View File
@@ -3,9 +3,10 @@
#include "GameCooker.h"
#include "PlatformTools.h"
#include "FlaxEngine.Gen.h"
#include "Engine/Scripting/MainThreadManagedInvokeAction.h"
#include "Engine/Scripting/ManagedCLR/MTypes.h"
#include "Engine/Scripting/ManagedCLR/MClass.h"
#include "Engine/Scripting/ManagedCLR/MException.h"
#include "Engine/Scripting/Internal/MainThreadManagedInvokeAction.h"
#include "Engine/Scripting/Scripting.h"
#include "Engine/Scripting/ScriptingType.h"
#include "Engine/Scripting/BinaryModule.h"
@@ -23,12 +24,12 @@
#include "Steps/CookAssetsStep.h"
#include "Steps/PostProcessStep.h"
#include "Engine/Platform/ConditionVariable.h"
#include "Engine/Platform/CreateProcessSettings.h"
#include "Engine/Scripting/ManagedCLR/MDomain.h"
#include "Engine/Scripting/ManagedCLR/MCore.h"
#include "Engine/Scripting/ManagedCLR/MAssembly.h"
#include "Engine/Content/JsonAsset.h"
#include "Engine/Content/AssetReference.h"
#include "Engine/Scripting/MException.h"
#if PLATFORM_TOOLS_WINDOWS
#include "Platform/Windows/WindowsPlatformTools.h"
#include "Engine/Platform/Windows/WindowsPlatformSettings.h"
@@ -63,6 +64,10 @@
#include "Platform/Mac/MacPlatformTools.h"
#include "Engine/Platform/Mac/MacPlatformSettings.h"
#endif
#if PLATFORM_TOOLS_IOS
#include "Platform/iOS/iOSPlatformTools.h"
#include "Engine/Platform/iOS/iOSPlatformSettings.h"
#endif
namespace GameCookerImpl
{
@@ -139,8 +144,12 @@ const Char* ToString(const BuildPlatform platform)
return TEXT("PlayStation 5");
case BuildPlatform::MacOSx64:
return TEXT("Mac x64");
case BuildPlatform::MacOSARM64:
return TEXT("Mac ARM64");
case BuildPlatform::iOSARM64:
return TEXT("iOS ARM64");
default:
return TEXT("?");
return TEXT("");
}
}
@@ -155,10 +164,37 @@ const Char* ToString(const BuildConfiguration configuration)
case BuildConfiguration::Release:
return TEXT("Release");
default:
return TEXT("?");
return TEXT("");
}
}
const Char* ToString(const DotNetAOTModes mode)
{
switch (mode)
{
case DotNetAOTModes::None:
return TEXT("None");
case DotNetAOTModes::ILC:
return TEXT("ILC");
case DotNetAOTModes::MonoAOTDynamic:
return TEXT("MonoAOTDynamic");
case DotNetAOTModes::MonoAOTStatic:
return TEXT("MonoAOTStatic");
default:
return TEXT("");
}
}
bool PlatformTools::IsNativeCodeFile(CookingData& data, const String& file)
{
const String filename = StringUtils::GetFileName(file);
if (filename.Contains(TEXT(".CSharp")) ||
filename.Contains(TEXT("Newtonsoft.Json")))
return false;
// TODO: maybe use Mono.Cecil via Flax.Build to read assembly image metadata and check if it contains C#?
return true;
}
bool CookingData::AssetTypeStatistics::operator<(const AssetTypeStatistics& other) const
{
if (ContentSize != other.ContentSize)
@@ -211,6 +247,71 @@ String CookingData::GetPlatformBinariesRoot() const
return Globals::StartupFolder / TEXT("Source/Platforms") / Tools->GetName() / TEXT("Binaries");
}
void CookingData::GetBuildPlatformName(const Char*& platform, const Char*& architecture) const
{
switch (Platform)
{
case BuildPlatform::Windows32:
platform = TEXT("Windows");
architecture = TEXT("x86");
break;
case BuildPlatform::Windows64:
platform = TEXT("Windows");
architecture = TEXT("x64");
break;
case BuildPlatform::UWPx86:
platform = TEXT("UWP");
architecture = TEXT("x86");
break;
case BuildPlatform::UWPx64:
platform = TEXT("UWP");
architecture = TEXT("x64");
break;
case BuildPlatform::XboxOne:
platform = TEXT("XboxOne");
architecture = TEXT("x64");
break;
case BuildPlatform::LinuxX64:
platform = TEXT("Linux");
architecture = TEXT("x64");
break;
case BuildPlatform::PS4:
platform = TEXT("PS4");
architecture = TEXT("x64");
break;
case BuildPlatform::XboxScarlett:
platform = TEXT("XboxScarlett");
architecture = TEXT("x64");
break;
case BuildPlatform::AndroidARM64:
platform = TEXT("Android");
architecture = TEXT("ARM64");
break;
case BuildPlatform::Switch:
platform = TEXT("Switch");
architecture = TEXT("ARM64");
break;
case BuildPlatform::PS5:
platform = TEXT("PS5");
architecture = TEXT("x64");
break;
case BuildPlatform::MacOSx64:
platform = TEXT("Mac");
architecture = TEXT("x64");
break;
case BuildPlatform::MacOSARM64:
platform = TEXT("Mac");
architecture = TEXT("ARM64");
break;
case BuildPlatform::iOSARM64:
platform = TEXT("iOS");
architecture = TEXT("ARM64");
break;
default:
LOG(Fatal, "Unknown or unsupported build platform.");
}
}
void CookingData::StepProgress(const String& info, const float stepProgress) const
{
const float singleStepProgress = 1.0f / (StepsCount + 1);
@@ -242,7 +343,7 @@ void CookingData::AddRootEngineAsset(const String& internalPath)
}
}
void CookingData::Error(const String& msg)
void CookingData::Error(const StringView& msg)
{
LOG_STR(Error, msg);
}
@@ -340,6 +441,14 @@ PlatformTools* GameCooker::GetTools(BuildPlatform platform)
case BuildPlatform::MacOSx64:
result = New<MacPlatformTools>(ArchitectureType::x64);
break;
case BuildPlatform::MacOSARM64:
result = New<MacPlatformTools>(ArchitectureType::ARM64);
break;
#endif
#if PLATFORM_TOOLS_IOS
case BuildPlatform::iOSARM64:
result = New<iOSPlatformTools>();
break;
#endif
}
Tools.Add(platform, result);
@@ -470,7 +579,10 @@ void GameCooker::GetCurrentPlatform(PlatformType& platform, BuildPlatform& build
buildPlatform = BuildPlatform::PS5;
break;
case PlatformType::Mac:
buildPlatform = BuildPlatform::MacOSx64;
buildPlatform = PLATFORM_ARCH_ARM || PLATFORM_ARCH_ARM64 ? BuildPlatform::MacOSARM64 : BuildPlatform::MacOSx64;
break;
case PlatformType::iOS:
buildPlatform = BuildPlatform::iOSARM64;
break;
default: ;
}
@@ -511,9 +623,9 @@ void GameCookerImpl::OnCollectAssets(HashSet<Guid>& assets)
ASSERT(GameCookerImpl::Internal_OnCollectAssets);
}
MCore::AttachThread();
MCore::Thread::Attach();
MObject* exception = nullptr;
auto list = (MonoArray*)Internal_OnCollectAssets->Invoke(nullptr, nullptr, &exception);
auto list = (MArray*)Internal_OnCollectAssets->Invoke(nullptr, nullptr, &exception);
if (exception)
{
MException ex(exception);
@@ -547,13 +659,13 @@ bool GameCookerImpl::Build()
Steps.Add(New<PostProcessStep>());
}
MCore::AttachThread();
MCore::Thread::Attach();
// Build Started
CallEvent(GameCooker::EventType::BuildStarted);
data.Tools->OnBuildStarted(data);
for (int32 stepIndex = 0; stepIndex < Steps.Count(); stepIndex++)
Steps[stepIndex]->OnBuildStarted(data);
data.Tools->OnBuildStarted(data);
data.InitProgress(Steps.Count());
// Execute all steps in a sequence
@@ -602,7 +714,15 @@ bool GameCookerImpl::Build()
const String commandLine = commandLineFormat.HasChars() ? String::Format(*commandLineFormat, gameArgs) : gameArgs;
if (workingDir.IsEmpty())
workingDir = data.NativeCodeOutputPath;
Platform::StartProcess(executableFile, commandLine, workingDir);
CreateProcessSettings procSettings;
procSettings.FileName = executableFile;
procSettings.Arguments = commandLine;
procSettings.WorkingDirectory = workingDir;
procSettings.HiddenWindow = false;
procSettings.WaitForEnd = false;
procSettings.LogOutput = false;
procSettings.ShellExecute = true;
Platform::CreateProcess(procSettings);
}
else
{
@@ -612,9 +732,9 @@ bool GameCookerImpl::Build()
}
IsRunning = false;
CancelFlag = 0;
data.Tools->OnBuildEnded(data, failed);
for (int32 stepIndex = 0; stepIndex < Steps.Count(); stepIndex++)
Steps[stepIndex]->OnBuildEnded(data, failed);
data.Tools->OnBuildEnded(data, failed);
CallEvent(failed ? GameCooker::EventType::BuildFailed : GameCooker::EventType::BuildDone);
Delete(Data);
Data = nullptr;
@@ -667,7 +787,7 @@ void GameCookerService::Update()
}
MainThreadManagedInvokeAction::ParamsBuilder params;
params.AddParam(ProgressMsg, Scripting::GetScriptsDomain()->GetNative());
params.AddParam(ProgressMsg, Scripting::GetScriptsDomain());
params.AddParam(ProgressValue);
MainThreadManagedInvokeAction::Invoke(Internal_OnProgress, params);
GameCooker::OnProgress(ProgressMsg, ProgressValue);
+2
View File
@@ -103,7 +103,9 @@ namespace FlaxEditor
case BuildPlatform.AndroidARM64: return PlatformType.Android;
case BuildPlatform.XboxScarlett: return PlatformType.XboxScarlett;
case BuildPlatform.Switch: return PlatformType.Switch;
case BuildPlatform.MacOSARM64:
case BuildPlatform.MacOSx64: return PlatformType.Mac;
case BuildPlatform.iOSARM64: return PlatformType.iOS;
default: throw new ArgumentOutOfRangeException(nameof(buildPlatform), buildPlatform, null);
}
}
@@ -9,6 +9,7 @@
#include "Editor/Utilities/EditorUtilities.h"
#include "Engine/Platform/File.h"
#include "Engine/Platform/FileSystem.h"
#include "Engine/Platform/CreateProcessSettings.h"
#include "Engine/Platform/Android/AndroidPlatformSettings.h"
#include "Engine/Graphics/PixelFormatExtensions.h"
#include "Engine/Graphics/Textures/TextureData.h"
@@ -115,8 +116,6 @@ void AndroidPlatformTools::OnBuildStarted(CookingData& data)
data.DataOutputPath /= TEXT("app/assets");
data.NativeCodeOutputPath /= TEXT("app/assets");
data.ManagedCodeOutputPath /= TEXT("app/assets");
PlatformTools::OnBuildStarted(data);
}
bool AndroidPlatformTools::OnPostProcess(CookingData& data)
@@ -140,33 +139,8 @@ bool AndroidPlatformTools::OnPostProcess(CookingData& data)
// Setup package name (eg. com.company.project)
String packageName = platformSettings->PackageName;
{
String productName = gameSettings->ProductName;
productName.Replace(TEXT(" "), TEXT(""));
productName.Replace(TEXT("."), TEXT(""));
productName.Replace(TEXT("-"), TEXT(""));
String companyName = gameSettings->CompanyName;
companyName.Replace(TEXT(" "), TEXT(""));
companyName.Replace(TEXT("."), TEXT(""));
companyName.Replace(TEXT("-"), TEXT(""));
packageName.Replace(TEXT("${PROJECT_NAME}"), *productName, StringSearchCase::IgnoreCase);
packageName.Replace(TEXT("${COMPANY_NAME}"), *companyName, StringSearchCase::IgnoreCase);
packageName = packageName.ToLower();
for (int32 i = 0; i < packageName.Length(); i++)
{
const auto c = packageName[i];
if (c != '_' && c != '.' && !StringUtils::IsAlnum(c))
{
LOG(Error, "Android Package Name \'{0}\' contains invalid character. Only letters, numbers, dots and underscore characters are allowed.", packageName);
return true;
}
}
if (packageName.IsEmpty())
{
LOG(Error, "Android Package Name is empty.", packageName);
return true;
}
}
if (EditorUtilities::FormatAppPackageName(packageName))
return true;
// Setup Android application permissions
HashSet<String> permissionsList;
@@ -267,7 +241,7 @@ bool AndroidPlatformTools::OnPostProcess(CookingData& data)
}
}
// Generate Mono files hash id used to skip deploying Mono files if already extracted on device (Mono cannot access files packed into .apk via unix file access)
// Generate Dotnet files hash id used to skip deploying Dotnet files if already extracted on device (Dotnet cannot access files packed into .apk via unix file access)
File::WriteAllText(assetsPath / TEXT("hash.txt"), Guid::New().ToString(), Encoding::ANSI);
// TODO: expose event to inject custom gradle and manifest options or custom binaries into app
@@ -309,11 +283,13 @@ bool AndroidPlatformTools::OnPostProcess(CookingData& data)
Platform::RunProcess(String::Format(TEXT("chmod +x \"{0}/gradlew\""), data.OriginalOutputPath), data.OriginalOutputPath, Dictionary<String, String>(), true);
#endif
const bool distributionPackage = buildSettings->ForDistribution;
const String gradleCommand = String::Format(TEXT("\"{0}\" {1}"), data.OriginalOutputPath / gradlew, distributionPackage ? TEXT("assemble") : TEXT("assembleDebug"));
const int32 result = Platform::RunProcess(gradleCommand, data.OriginalOutputPath, Dictionary<String, String>(), true);
CreateProcessSettings procSettings;
procSettings.FileName = String::Format(TEXT("\"{0}\" {1}"), data.OriginalOutputPath / gradlew, distributionPackage ? TEXT("assemble") : TEXT("assembleDebug"));
procSettings.WorkingDirectory = data.OriginalOutputPath;
const int32 result = Platform::CreateProcess(procSettings);
if (result != 0)
{
data.Error(TEXT("Failed to build Gradle project into package (result code: {0}). See log for more info."), result);
data.Error(String::Format(TEXT("Failed to build Gradle project into package (result code: {0}). See log for more info."), result));
return true;
}
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2019 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
@@ -5,6 +5,7 @@
#include "GDKPlatformTools.h"
#include "Engine/Platform/File.h"
#include "Engine/Platform/FileSystem.h"
#include "Engine/Platform/CreateProcessSettings.h"
#include "Engine/Platform/GDK/GDKPlatformSettings.h"
#include "Engine/Core/Types/StringBuilder.h"
#include "Engine/Core/Collections/Sorting.h"
@@ -36,24 +37,9 @@ GDKPlatformTools::GDKPlatformTools()
}
}
bool GDKPlatformTools::UseAOT() const
DotNetAOTModes GDKPlatformTools::UseAOT() const
{
return true;
}
bool GDKPlatformTools::OnScriptsStepDone(CookingData& data)
{
// Override Newtonsoft.Json.dll for some platforms (that don't support runtime code generation)
const String customBinPath = data.GetPlatformBinariesRoot() / TEXT("Newtonsoft.Json.dll");
const String assembliesPath = data.ManagedCodeOutputPath;
if (FileSystem::CopyFile(assembliesPath / TEXT("Newtonsoft.Json.dll"), customBinPath))
{
data.Error(TEXT("Failed to copy deloy custom assembly."));
return true;
}
FileSystem::DeleteFile(assembliesPath / TEXT("Newtonsoft.Json.pdb"));
return false;
return DotNetAOTModes::MonoAOTDynamic;
}
bool GDKPlatformTools::OnDeployBinaries(CookingData& data)
@@ -66,7 +52,7 @@ bool GDKPlatformTools::OnDeployBinaries(CookingData& data)
files.Add(binPath / executableFilename);
if (!FileSystem::FileExists(files[0]))
{
data.Error(TEXT("Missing executable file ({0})."), files[0]);
data.Error(String::Format(TEXT("Missing executable file ({0})."), files[0]));
return true;
}
FileSystem::DirectoryGetFiles(files, binPath, TEXT("*.dll"), DirectorySearchOption::TopDirectoryOnly);
@@ -74,7 +60,7 @@ bool GDKPlatformTools::OnDeployBinaries(CookingData& data)
{
if (FileSystem::CopyFile(data.NativeCodeOutputPath / StringUtils::GetFileName(files[i]), files[i]))
{
data.Error(TEXT("Failed to setup output directory (file {0})."), files[i]);
data.Error(String::Format(TEXT("Failed to setup output directory (file {0})."), files[i]));
return true;
}
}
@@ -82,85 +68,6 @@ bool GDKPlatformTools::OnDeployBinaries(CookingData& data)
return false;
}
void GDKPlatformTools::OnConfigureAOT(CookingData& data, AotConfig& config)
{
const auto platformDataPath = data.GetPlatformBinariesRoot();
const bool useInterpreter = true; // TODO: use Full AOT on GDK
const bool enableDebug = data.Configuration != BuildConfiguration::Release;
const Char* aotMode = useInterpreter ? TEXT("full,interp") : TEXT("full");
const Char* debugMode = enableDebug ? TEXT("soft-debug") : TEXT("nodebug");
config.AotCompilerArgs = String::Format(TEXT("--aot={0},verbose,stats,print-skipped,{1} -O=all"), aotMode, debugMode);
if (enableDebug)
config.AotCompilerArgs = TEXT("--debug ") + config.AotCompilerArgs;
config.AotCompilerPath = platformDataPath / TEXT("Tools/mono.exe");
}
bool GDKPlatformTools::OnPerformAOT(CookingData& data, AotConfig& config, const String& assemblyPath)
{
// Skip .dll.dll which could be a false result from the previous AOT which could fail
if (assemblyPath.EndsWith(TEXT(".dll.dll")))
{
LOG(Warning, "Skip AOT for file '{0}' as it can be a result from the previous task", assemblyPath);
return false;
}
// Check if skip this assembly (could be already processed)
const String filename = StringUtils::GetFileName(assemblyPath);
const String outputPath = config.AotCachePath / filename + TEXT(".dll");
if (FileSystem::FileExists(outputPath) && FileSystem::GetFileLastEditTime(assemblyPath) < FileSystem::GetFileLastEditTime(outputPath))
return false;
LOG(Info, "Calling AOT tool for \"{0}\"", assemblyPath);
// Cleanup temporary results (fromm the previous AT that fail or sth)
const String resultPath = assemblyPath + TEXT(".dll");
const String resultPathExp = resultPath + TEXT(".exp");
const String resultPathLib = resultPath + TEXT(".lib");
const String resultPathPdb = resultPath + TEXT(".pdb");
if (FileSystem::FileExists(resultPath))
FileSystem::DeleteFile(resultPath);
if (FileSystem::FileExists(resultPathExp))
FileSystem::DeleteFile(resultPathExp);
if (FileSystem::FileExists(resultPathLib))
FileSystem::DeleteFile(resultPathLib);
if (FileSystem::FileExists(resultPathPdb))
FileSystem::DeleteFile(resultPathPdb);
// Call tool
const String workingDir = StringUtils::GetDirectoryName(config.AotCompilerPath);
const String command = String::Format(TEXT("\"{0}\" {1} \"{2}\""), config.AotCompilerPath, config.AotCompilerArgs, assemblyPath);
const int32 result = Platform::RunProcess(command, workingDir, config.EnvVars);
if (result != 0)
{
data.Error(TEXT("AOT tool execution failed with result code {1} for assembly \"{0}\". See log for more info."), assemblyPath, result);
return true;
}
// Copy result
if (FileSystem::CopyFile(outputPath, resultPath))
{
data.Error(TEXT("Failed to copy the AOT tool result file. It can be missing."));
return true;
}
// Copy pdb file if exists
if (data.Configuration != BuildConfiguration::Release && FileSystem::FileExists(resultPathPdb))
{
FileSystem::CopyFile(config.AotCachePath / StringUtils::GetFileName(resultPathPdb), resultPathPdb);
}
// Clean intermediate results
if (FileSystem::DeleteFile(resultPath)
|| (FileSystem::FileExists(resultPathExp) && FileSystem::DeleteFile(resultPathExp))
|| (FileSystem::FileExists(resultPathLib) && FileSystem::DeleteFile(resultPathLib))
|| (FileSystem::FileExists(resultPathPdb) && FileSystem::DeleteFile(resultPathPdb))
)
{
LOG(Warning, "Failed to remove the AOT tool result file(s).");
}
return false;
}
bool GDKPlatformTools::OnPostProcess(CookingData& data, GDKPlatformSettings* platformSettings)
{
// Configuration
@@ -275,8 +182,10 @@ bool GDKPlatformTools::OnPostProcess(CookingData& data, GDKPlatformSettings* pla
data.StepProgress(TEXT("Generating package layout"), 0.3f);
const String gdkBinPath = _gdkPath / TEXT("../bin");
const String makePkgPath = gdkBinPath / TEXT("MakePkg.exe");
const String command = String::Format(TEXT("\"{0}\" genmap /f layout.xml /d \"{1}\""), makePkgPath, data.DataOutputPath);
const int32 result = Platform::RunProcess(command, data.DataOutputPath);
CreateProcessSettings procSettings;
procSettings.FileName = String::Format(TEXT("\"{0}\" genmap /f layout.xml /d \"{1}\""), makePkgPath, data.DataOutputPath);
procSettings.WorkingDirectory = data.DataOutputPath;
const int32 result = Platform::CreateProcess(procSettings);
if (result != 0)
{
data.Error(TEXT("Failed to generate package layout."));
@@ -26,11 +26,8 @@ public:
public:
// [PlatformTools]
bool UseAOT() const override;
bool OnScriptsStepDone(CookingData& data) override;
DotNetAOTModes UseAOT() const override;
bool OnDeployBinaries(CookingData& data) override;
void OnConfigureAOT(CookingData& data, AotConfig& config) override;
bool OnPerformAOT(CookingData& data, AotConfig& config, const String& assemblyPath) override;
};
#endif
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2019 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#if PLATFORM_TOOLS_LINUX
@@ -34,6 +34,11 @@ ArchitectureType LinuxPlatformTools::GetArchitecture() const
return ArchitectureType::x64;
}
bool LinuxPlatformTools::UseSystemDotnet() const
{
return true;
}
bool LinuxPlatformTools::OnDeployBinaries(CookingData& data)
{
const auto gameSettings = GameSettings::Get();
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2019 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
@@ -18,6 +18,7 @@ public:
const Char* GetName() const override;
PlatformType GetPlatform() const override;
ArchitectureType GetArchitecture() const override;
bool UseSystemDotnet() const override;
bool OnDeployBinaries(CookingData& data) override;
};
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2019 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#if PLATFORM_TOOLS_MAC
@@ -59,6 +59,11 @@ ArchitectureType MacPlatformTools::GetArchitecture() const
return _arch;
}
bool MacPlatformTools::UseSystemDotnet() const
{
return true;
}
bool MacPlatformTools::IsNativeCodeFile(CookingData& data, const String& file)
{
String extension = FileSystem::GetExtension(file);
@@ -87,33 +92,8 @@ bool MacPlatformTools::OnPostProcess(CookingData& data)
// Setup package name (eg. com.company.project)
String appIdentifier = platformSettings->AppIdentifier;
{
String productName = gameSettings->ProductName;
productName.Replace(TEXT(" "), TEXT(""));
productName.Replace(TEXT("."), TEXT(""));
productName.Replace(TEXT("-"), TEXT(""));
String companyName = gameSettings->CompanyName;
companyName.Replace(TEXT(" "), TEXT(""));
companyName.Replace(TEXT("."), TEXT(""));
companyName.Replace(TEXT("-"), TEXT(""));
appIdentifier.Replace(TEXT("${PROJECT_NAME}"), *productName, StringSearchCase::IgnoreCase);
appIdentifier.Replace(TEXT("${COMPANY_NAME}"), *companyName, StringSearchCase::IgnoreCase);
appIdentifier = appIdentifier.ToLower();
for (int32 i = 0; i < appIdentifier.Length(); i++)
{
const auto c = appIdentifier[i];
if (c != '_' && c != '.' && !StringUtils::IsAlnum(c))
{
LOG(Error, "Apple app identifier \'{0}\' contains invalid character. Only letters, numbers, dots and underscore characters are allowed.", appIdentifier);
return true;
}
}
if (appIdentifier.IsEmpty())
{
LOG(Error, "Apple app identifier is empty.", appIdentifier);
return true;
}
}
if (EditorUtilities::FormatAppPackageName(appIdentifier))
return true;
// Find executable
String executableName;
@@ -187,7 +167,7 @@ bool MacPlatformTools::OnPostProcess(CookingData& data)
ADD_ENTRY("CFBundlePackageType", "APPL");
ADD_ENTRY("NSPrincipalClass", "NSApplication");
ADD_ENTRY("LSApplicationCategoryType", "public.app-category.games");
ADD_ENTRY("LSMinimumSystemVersion", "10.14");
ADD_ENTRY("LSMinimumSystemVersion", "10.15");
ADD_ENTRY("CFBundleIconFile", "icon.icns");
ADD_ENTRY_STR("CFBundleExecutable", executableName);
ADD_ENTRY_STR("CFBundleIdentifier", appIdentifier);
@@ -201,10 +181,19 @@ bool MacPlatformTools::OnPostProcess(CookingData& data)
dict.append_child(PUGIXML_TEXT("key")).set_child_value(PUGIXML_TEXT("LSMinimumSystemVersionByArchitecture"));
xml_node LSMinimumSystemVersionByArchitecture = dict.append_child(PUGIXML_TEXT("dict"));
LSMinimumSystemVersionByArchitecture.append_child(PUGIXML_TEXT("key")).set_child_value(PUGIXML_TEXT("x86_64"));
LSMinimumSystemVersionByArchitecture.append_child(PUGIXML_TEXT("string")).set_child_value(PUGIXML_TEXT("10.14"));
switch (_arch)
{
case ArchitectureType::x64:
LSMinimumSystemVersionByArchitecture.append_child(PUGIXML_TEXT("key")).set_child_value(PUGIXML_TEXT("x86_64"));
break;
case ArchitectureType::ARM64:
LSMinimumSystemVersionByArchitecture.append_child(PUGIXML_TEXT("key")).set_child_value(PUGIXML_TEXT("arm64"));
break;
}
LSMinimumSystemVersionByArchitecture.append_child(PUGIXML_TEXT("string")).set_child_value(PUGIXML_TEXT("10.15"));
#undef ADD_ENTRY
#undef ADD_ENTRY_STR
if (!doc.save_file(*StringAnsi(plistPath)))
{
@@ -215,8 +204,6 @@ bool MacPlatformTools::OnPostProcess(CookingData& data)
// TODO: sign binaries
// TODO: expose event to inject custom post-processing before app packaging (eg. third-party plugins)
// Package application
const auto buildSettings = BuildSettings::Get();
if (buildSettings->SkipPackaging)
@@ -228,7 +215,7 @@ bool MacPlatformTools::OnPostProcess(CookingData& data)
const int32 result = Platform::RunProcess(dmgCommand, data.OriginalOutputPath);
if (result != 0)
{
data.Error(TEXT("Failed to package app (result code: {0}). See log for more info."), result);
data.Error(String::Format(TEXT("Failed to package app (result code: {0}). See log for more info."), result));
return true;
}
// TODO: sign dmg
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2019 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
@@ -23,6 +23,7 @@ public:
const Char* GetName() const override;
PlatformType GetPlatform() const override;
ArchitectureType GetArchitecture() const override;
bool UseSystemDotnet() const override;
bool IsNativeCodeFile(CookingData& data, const String& file) override;
void OnBuildStarted(CookingData& data) override;
bool OnPostProcess(CookingData& data) override;
@@ -1,10 +1,11 @@
// Copyright (c) 2012-2019 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#if PLATFORM_TOOLS_UWP
#include "UWPPlatformTools.h"
#include "Engine/Platform/FileSystem.h"
#include "Engine/Platform/File.h"
#include "Engine/Platform/CreateProcessSettings.h"
#include "Engine/Platform/UWP/UWPPlatformSettings.h"
#include "Engine/Core/Config/GameSettings.h"
#include "Engine/Core/Types/StringBuilder.h"
@@ -36,24 +37,9 @@ ArchitectureType UWPPlatformTools::GetArchitecture() const
return _arch;
}
bool UWPPlatformTools::UseAOT() const
DotNetAOTModes UWPPlatformTools::UseAOT() const
{
return true;
}
bool UWPPlatformTools::OnScriptsStepDone(CookingData& data)
{
// Override Newtonsoft.Json.dll for some platforms (that don't support runtime code generation)
const String customBinPath = data.GetPlatformBinariesRoot() / TEXT("Newtonsoft.Json.dll");
const String assembliesPath = data.ManagedCodeOutputPath;
if (FileSystem::CopyFile(assembliesPath / TEXT("Newtonsoft.Json.dll"), customBinPath))
{
data.Error(TEXT("Failed to copy deploy custom assembly."));
return true;
}
FileSystem::DeleteFile(assembliesPath / TEXT("Newtonsoft.Json.pdb"));
return false;
return DotNetAOTModes::MonoAOTDynamic;
}
bool UWPPlatformTools::OnDeployBinaries(CookingData& data)
@@ -79,7 +65,7 @@ bool UWPPlatformTools::OnDeployBinaries(CookingData& data)
{
if (!FileSystem::FileExists(files[i]))
{
data.Error(TEXT("Missing source file {0}."), files[i]);
data.Error(String::Format(TEXT("Missing source file {0}."), files[i]));
return true;
}
@@ -414,90 +400,9 @@ bool UWPPlatformTools::OnDeployBinaries(CookingData& data)
return false;
}
void UWPPlatformTools::OnConfigureAOT(CookingData& data, AotConfig& config)
{
const auto platformDataPath = data.GetPlatformBinariesRoot();
const bool useInterpreter = true; // TODO: support using Full AOT instead of interpreter
const bool enableDebug = data.Configuration != BuildConfiguration::Release;
const Char* aotMode = useInterpreter ? TEXT("full,interp") : TEXT("full");
const Char* debugMode = enableDebug ? TEXT("soft-debug") : TEXT("nodebug");
config.AotCompilerArgs = String::Format(TEXT("--aot={0},verbose,stats,print-skipped,{1} -O=all"),
aotMode,
debugMode);
if (enableDebug)
config.AotCompilerArgs = TEXT("--debug ") + config.AotCompilerArgs;
config.AotCompilerPath = platformDataPath / TEXT("Tools/mono.exe");
}
bool UWPPlatformTools::OnPerformAOT(CookingData& data, AotConfig& config, const String& assemblyPath)
{
// Skip .dll.dll which could be a false result from the previous AOT which could fail
if (assemblyPath.EndsWith(TEXT(".dll.dll")))
{
LOG(Warning, "Skip AOT for file '{0}' as it can be a result from the previous task", assemblyPath);
return false;
}
// Check if skip this assembly (could be already processed)
const String filename = StringUtils::GetFileName(assemblyPath);
const String outputPath = config.AotCachePath / filename + TEXT(".dll");
if (FileSystem::FileExists(outputPath) && FileSystem::GetFileLastEditTime(assemblyPath) < FileSystem::GetFileLastEditTime(outputPath))
return false;
LOG(Info, "Calling AOT tool for \"{0}\"", assemblyPath);
// Cleanup temporary results (fromm the previous AT that fail or sth)
const String resultPath = assemblyPath + TEXT(".dll");
const String resultPathExp = resultPath + TEXT(".exp");
const String resultPathLib = resultPath + TEXT(".lib");
const String resultPathPdb = resultPath + TEXT(".pdb");
if (FileSystem::FileExists(resultPath))
FileSystem::DeleteFile(resultPath);
if (FileSystem::FileExists(resultPathExp))
FileSystem::DeleteFile(resultPathExp);
if (FileSystem::FileExists(resultPathLib))
FileSystem::DeleteFile(resultPathLib);
if (FileSystem::FileExists(resultPathPdb))
FileSystem::DeleteFile(resultPathPdb);
// Call tool
String workingDir = StringUtils::GetDirectoryName(config.AotCompilerPath);
String command = String::Format(TEXT("\"{0}\" {1} \"{2}\""), config.AotCompilerPath, config.AotCompilerArgs, assemblyPath);
const int32 result = Platform::RunProcess(command, workingDir, config.EnvVars);
if (result != 0)
{
data.Error(TEXT("AOT tool execution failed with result code {1} for assembly \"{0}\". See log for more info."), assemblyPath, result);
return true;
}
// Copy result
if (FileSystem::CopyFile(outputPath, resultPath))
{
data.Error(TEXT("Failed to copy the AOT tool result file. It can be missing."));
return true;
}
// Copy pdb file if exists
if (data.Configuration != BuildConfiguration::Release && FileSystem::FileExists(resultPathPdb))
{
FileSystem::CopyFile(config.AotCachePath / StringUtils::GetFileName(resultPathPdb), resultPathPdb);
}
// Clean intermediate results
if (FileSystem::DeleteFile(resultPath)
|| (FileSystem::FileExists(resultPathExp) && FileSystem::DeleteFile(resultPathExp))
|| (FileSystem::FileExists(resultPathLib) && FileSystem::DeleteFile(resultPathLib))
|| (FileSystem::FileExists(resultPathPdb) && FileSystem::DeleteFile(resultPathPdb))
)
{
LOG(Warning, "Failed to remove the AOT tool result file(s).");
}
return false;
}
bool UWPPlatformTools::OnPostProcess(CookingData& data)
{
LOG(Error, "UWP (Windows Store) platform has been deprecated and soon will be removed!");
LOG(Error, "UWP (Windows Store) platform has been deprecated and is no longer supported");
// Special case for UWP
// FlaxEngine.dll cannot be added to the solution as `Content` item (due to conflicts with C++ /CX FlaxEngine.dll)
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2019 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
@@ -29,11 +29,8 @@ public:
const Char* GetName() const override;
PlatformType GetPlatform() const override;
ArchitectureType GetArchitecture() const override;
bool UseAOT() const override;
bool OnScriptsStepDone(CookingData& data) override;
DotNetAOTModes UseAOT() const override;
bool OnDeployBinaries(CookingData& data) override;
void OnConfigureAOT(CookingData& data, AotConfig& config) override;
bool OnPerformAOT(CookingData& data, AotConfig& config, const String& assemblyPath) override;
bool OnPostProcess(CookingData& data) override;
};
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2019 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#if PLATFORM_TOOLS_WINDOWS
@@ -33,6 +33,11 @@ ArchitectureType WindowsPlatformTools::GetArchitecture() const
return _arch;
}
bool WindowsPlatformTools::UseSystemDotnet() const
{
return true;
}
bool WindowsPlatformTools::OnDeployBinaries(CookingData& data)
{
const auto platformSettings = WindowsPlatformSettings::Get();
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2019 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
@@ -29,6 +29,7 @@ public:
const Char* GetName() const override;
PlatformType GetPlatform() const override;
ArchitectureType GetArchitecture() const override;
bool UseSystemDotnet() const override;
bool OnDeployBinaries(CookingData& data) override;
void OnRun(CookingData& data, String& executableFile, String& commandLineFormat, String& workingDir) override;
};
@@ -0,0 +1,284 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#if PLATFORM_TOOLS_IOS
#include "iOSPlatformTools.h"
#include "Engine/Platform/File.h"
#include "Engine/Platform/FileSystem.h"
#include "Engine/Platform/CreateProcessSettings.h"
#include "Engine/Platform/iOS/iOSPlatformSettings.h"
#include "Engine/Core/Config/GameSettings.h"
#include "Engine/Core/Config/BuildSettings.h"
#include "Engine/Core/Collections/Dictionary.h"
#include "Engine/Graphics/Textures/TextureData.h"
#include "Engine/Graphics/PixelFormatExtensions.h"
#include "Engine/Content/Content.h"
#include "Engine/Content/JsonAsset.h"
#include "Engine/Engine/Globals.h"
#include "Editor/Editor.h"
#include "Editor/ProjectInfo.h"
#include "Editor/Cooker/GameCooker.h"
#include "Editor/Utilities/EditorUtilities.h"
IMPLEMENT_SETTINGS_GETTER(iOSPlatformSettings, iOSPlatform);
namespace
{
String GetAppName()
{
const auto gameSettings = GameSettings::Get();
String productName = gameSettings->ProductName;
productName.Replace(TEXT(" "), TEXT(""));
productName.Replace(TEXT("."), TEXT(""));
productName.Replace(TEXT("-"), TEXT(""));
return productName;
}
const Char* GetExportMethod(iOSPlatformSettings::ExportMethods method)
{
switch (method)
{
case iOSPlatformSettings::ExportMethods::AppStore: return TEXT("app-store");
case iOSPlatformSettings::ExportMethods::Development: return TEXT("development");
case iOSPlatformSettings::ExportMethods::AdHoc: return TEXT("ad-hoc");
case iOSPlatformSettings::ExportMethods::Enterprise: return TEXT("enterprise");
default: return TEXT("");
}
}
String GetUIInterfaceOrientation(iOSPlatformSettings::UIInterfaceOrientations orientations)
{
String result;
if (EnumHasAnyFlags(orientations, iOSPlatformSettings::UIInterfaceOrientations::Portrait))
result += TEXT("UIInterfaceOrientationPortrait ");
if (EnumHasAnyFlags(orientations, iOSPlatformSettings::UIInterfaceOrientations::PortraitUpsideDown))
result += TEXT("UIInterfaceOrientationPortraitUpsideDown ");
if (EnumHasAnyFlags(orientations, iOSPlatformSettings::UIInterfaceOrientations::LandscapeLeft))
result += TEXT("UIInterfaceOrientationLandscapeLeft ");
if (EnumHasAnyFlags(orientations, iOSPlatformSettings::UIInterfaceOrientations::LandscapeRight))
result += TEXT("UIInterfaceOrientationLandscapeRight ");
result = result.TrimTrailing();
return result;
}
}
const Char* iOSPlatformTools::GetDisplayName() const
{
return TEXT("iOS");
}
const Char* iOSPlatformTools::GetName() const
{
return TEXT("iOS");
}
PlatformType iOSPlatformTools::GetPlatform() const
{
return PlatformType::iOS;
}
ArchitectureType iOSPlatformTools::GetArchitecture() const
{
return ArchitectureType::ARM64;
}
DotNetAOTModes iOSPlatformTools::UseAOT() const
{
return DotNetAOTModes::MonoAOTDynamic;
}
PixelFormat iOSPlatformTools::GetTextureFormat(CookingData& data, TextureBase* texture, PixelFormat format)
{
// TODO: add ETC compression support for iOS
// TODO: add ASTC compression support for iOS
if (PixelFormatExtensions::IsCompressedBC(format))
{
switch (format)
{
case PixelFormat::BC1_Typeless:
case PixelFormat::BC2_Typeless:
case PixelFormat::BC3_Typeless:
return PixelFormat::R8G8B8A8_Typeless;
case PixelFormat::BC1_UNorm:
case PixelFormat::BC2_UNorm:
case PixelFormat::BC3_UNorm:
return PixelFormat::R8G8B8A8_UNorm;
case PixelFormat::BC1_UNorm_sRGB:
case PixelFormat::BC2_UNorm_sRGB:
case PixelFormat::BC3_UNorm_sRGB:
return PixelFormat::R8G8B8A8_UNorm_sRGB;
case PixelFormat::BC4_Typeless:
return PixelFormat::R8_Typeless;
case PixelFormat::BC4_UNorm:
return PixelFormat::R8_UNorm;
case PixelFormat::BC4_SNorm:
return PixelFormat::R8_SNorm;
case PixelFormat::BC5_Typeless:
return PixelFormat::R16G16_Typeless;
case PixelFormat::BC5_UNorm:
return PixelFormat::R16G16_UNorm;
case PixelFormat::BC5_SNorm:
return PixelFormat::R16G16_SNorm;
case PixelFormat::BC7_Typeless:
case PixelFormat::BC6H_Typeless:
return PixelFormat::R16G16B16A16_Typeless;
case PixelFormat::BC7_UNorm:
case PixelFormat::BC6H_Uf16:
case PixelFormat::BC6H_Sf16:
return PixelFormat::R16G16B16A16_Float;
case PixelFormat::BC7_UNorm_sRGB:
return PixelFormat::R16G16B16A16_UNorm;
default:
return format;
}
}
return format;
}
bool iOSPlatformTools::IsNativeCodeFile(CookingData& data, const String& file)
{
String extension = FileSystem::GetExtension(file);
return extension.IsEmpty() || extension == TEXT("dylib");
}
void iOSPlatformTools::OnBuildStarted(CookingData& data)
{
// Adjust the cooking output folders for packaging app
const Char* subDir = TEXT("FlaxGame/Data");
data.DataOutputPath /= subDir;
data.NativeCodeOutputPath /= subDir;
data.ManagedCodeOutputPath /= subDir;
PlatformTools::OnBuildStarted(data);
}
bool iOSPlatformTools::OnPostProcess(CookingData& data)
{
const auto gameSettings = GameSettings::Get();
const auto platformSettings = iOSPlatformSettings::Get();
const auto platformDataPath = data.GetPlatformBinariesRoot();
const auto projectVersion = Editor::Project->Version.ToString();
const auto appName = GetAppName();
// Setup package name (eg. com.company.project)
String appIdentifier = platformSettings->AppIdentifier;
if (EditorUtilities::FormatAppPackageName(appIdentifier))
return true;
// Copy fresh Gradle project template
if (FileSystem::CopyDirectory(data.OriginalOutputPath, platformDataPath / TEXT("Project"), true))
{
LOG(Error, "Failed to deploy XCode project to {0} from {1}", data.OriginalOutputPath, platformDataPath);
return true;
}
// Format project template files
Dictionary<String, String> configReplaceMap;
configReplaceMap[TEXT("${AppName}")] = appName;
configReplaceMap[TEXT("${AppIdentifier}")] = appIdentifier;
configReplaceMap[TEXT("${AppTeamId}")] = platformSettings->AppTeamId;
configReplaceMap[TEXT("${AppVersion}")] = platformSettings->AppVersion;
configReplaceMap[TEXT("${ProjectName}")] = gameSettings->ProductName;
configReplaceMap[TEXT("${ProjectVersion}")] = projectVersion;
configReplaceMap[TEXT("${HeaderSearchPaths}")] = Globals::StartupFolder;
configReplaceMap[TEXT("${ExportMethod}")] = GetExportMethod(platformSettings->ExportMethod);
configReplaceMap[TEXT("${UISupportedInterfaceOrientations_iPhone}")] = GetUIInterfaceOrientation(platformSettings->SupportedInterfaceOrientationsiPhone);
configReplaceMap[TEXT("${UISupportedInterfaceOrientations_iPad}")] = GetUIInterfaceOrientation(platformSettings->SupportedInterfaceOrientationsiPad);
{
// Initialize auto-generated areas as empty
configReplaceMap[TEXT("${PBXBuildFile}")] = String::Empty;
configReplaceMap[TEXT("${PBXCopyFilesBuildPhaseFiles}")] = String::Empty;
configReplaceMap[TEXT("${PBXFileReference}")] = String::Empty;
configReplaceMap[TEXT("${PBXFrameworksBuildPhase}")] = String::Empty;
configReplaceMap[TEXT("${PBXFrameworksGroup}")] = String::Empty;
configReplaceMap[TEXT("${PBXFilesGroup}")] = String::Empty;
configReplaceMap[TEXT("${PBXResourcesGroup}")] = String::Empty;
}
{
// Rename dotnet license files to not mislead the actual game licensing
FileSystem::MoveFile(data.DataOutputPath / TEXT("Dotnet/DOTNET-LICENSE.TXT"), data.DataOutputPath / TEXT("Dotnet/LICENSE.TXT"), true);
FileSystem::MoveFile(data.DataOutputPath / TEXT("Dotnet/DOTNET-THIRD-PARTY-NOTICES.TXT"), data.DataOutputPath / TEXT("Dotnet/THIRD-PARTY-NOTICES.TXT"), true);
}
Array<String> files;
FileSystem::DirectoryGetFiles(files, data.DataOutputPath, TEXT("*"), DirectorySearchOption::AllDirectories);
for (const String& file : files)
{
String name = StringUtils::GetFileName(file);
if (name == TEXT(".DS_Store") || name == TEXT("FlaxGame"))
continue;
String fileId = Guid::New().ToString(Guid::FormatType::N).Left(24);
String projectPath = FileSystem::ConvertAbsolutePathToRelative(data.DataOutputPath, file);
if (name.EndsWith(TEXT(".dylib")))
{
String frameworkId = Guid::New().ToString(Guid::FormatType::N).Left(24);
String frameworkEmbedId = Guid::New().ToString(Guid::FormatType::N).Left(24);
configReplaceMap[TEXT("${PBXBuildFile}")] += String::Format(TEXT("\t\t{0} /* {1} in Frameworks */ = {{isa = PBXBuildFile; fileRef = {2} /* {1} */; }};\n"), frameworkId, name, fileId);
configReplaceMap[TEXT("${PBXBuildFile}")] += String::Format(TEXT("\t\t{0} /* {1} in Embed Frameworks */ = {{isa = PBXBuildFile; fileRef = {2} /* {1} */; settings = {{ATTRIBUTES = (CodeSignOnCopy, ); }}; }};\n"), frameworkEmbedId, name, fileId);
configReplaceMap[TEXT("${PBXCopyFilesBuildPhaseFiles}")] += String::Format(TEXT("\t\t\t\t{0} /* {1} in Embed Frameworks */,\n"), frameworkEmbedId, name);
configReplaceMap[TEXT("${PBXFileReference}")] += String::Format(TEXT("\t\t{0} /* {1} */ = {{isa = PBXFileReference; lastKnownFileType = \"compiled.mach-o.dylib\"; name = \"{1}\"; path = \"FlaxGame/Data/{2}\"; sourceTree = \"<group>\"; }};\n"), fileId, name, projectPath);
configReplaceMap[TEXT("${PBXFrameworksBuildPhase}")] += String::Format(TEXT("\t\t\t\t{0} /* {1} in Frameworks */,\n"), frameworkId, name);
configReplaceMap[TEXT("${PBXFrameworksGroup}")] += String::Format(TEXT("\t\t\t\t{0} /* {1} */,\n"), fileId, name);
}
else
{
String fileRefId = Guid::New().ToString(Guid::FormatType::N).Left(24);
configReplaceMap[TEXT("${PBXBuildFile}")] += String::Format(TEXT("\t\t{0} /* {1} in Resources */ = {{isa = PBXBuildFile; fileRef = {2} /* {1} */; }};\n"), fileRefId, name, fileId);
configReplaceMap[TEXT("${PBXFileReference}")] += String::Format(TEXT("\t\t{0} /* {1} */ = {{isa = PBXFileReference; lastKnownFileType = file; name = \"{1}\"; path = \"Data/{2}\"; sourceTree = \"<group>\"; }};\n"), fileId, name, projectPath);
configReplaceMap[TEXT("${PBXFilesGroup}")] += String::Format(TEXT("\t\t\t\t{0} /* {1} */,\n"), fileId, name);
configReplaceMap[TEXT("${PBXResourcesGroup}")] += String::Format(TEXT("\t\t\t\t{0} /* {1} in Resources */,\n"), fileRefId, name);
}
}
bool failed = false;
failed |= EditorUtilities::ReplaceInFile(data.OriginalOutputPath / TEXT("FlaxGame.xcodeproj/project.pbxproj"), configReplaceMap);
failed |= EditorUtilities::ReplaceInFile(data.OriginalOutputPath / TEXT("ExportOptions.plist"), configReplaceMap);
if (failed)
{
LOG(Error, "Failed to format XCode project");
return true;
}
// Export images
// TODO: provide per-device icons (eg. iPad 1x, iPad 2x) instead of a single icon size
TextureData iconData;
if (!EditorUtilities::GetApplicationImage(platformSettings->OverrideIcon, iconData))
{
String outputPath = data.OriginalOutputPath / TEXT("FlaxGame/Assets.xcassets/AppIcon.appiconset/ios_store_icon.png");
if (EditorUtilities::ExportApplicationImage(iconData, 1024, 1024, PixelFormat::R8G8B8A8_UNorm, outputPath))
{
LOG(Error, "Failed to export application icon.");
return true;
}
}
// Package application
const auto buildSettings = BuildSettings::Get();
if (buildSettings->SkipPackaging)
return false;
GameCooker::PackageFiles();
{
LOG(Info, "Building app package...");
const Char* configuration = data.Configuration == BuildConfiguration::Release ? TEXT("Release") : TEXT("Debug");
String command = String::Format(TEXT("xcodebuild -project FlaxGame.xcodeproj -configuration {} -scheme FlaxGame -archivePath FlaxGame.xcarchive archive"), configuration);
int32 result = Platform::RunProcess(command, data.OriginalOutputPath);
if (result != 0)
{
data.Error(String::Format(TEXT("Failed to package app (result code: {0}). See log for more info."), result));
return true;
}
command = TEXT("xcodebuild -exportArchive -archivePath FlaxGame.xcarchive -allowProvisioningUpdates -exportPath . -exportOptionsPlist ExportOptions.plist");
result = Platform::RunProcess(command, data.OriginalOutputPath);
if (result != 0)
{
data.Error(String::Format(TEXT("Failed to package app (result code: {0}). See log for more info."), result));
return true;
}
const String ipaPath = data.OriginalOutputPath / TEXT("FlaxGame.ipa");
LOG(Info, "Output application package: {0} (size: {1} MB)", ipaPath, FileSystem::GetFileSize(ipaPath) / 1024 / 1024);
}
return false;
}
#endif
@@ -0,0 +1,27 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
#if PLATFORM_TOOLS_IOS
#include "../../PlatformTools.h"
/// <summary>
/// The iOS platform support tools.
/// </summary>
class iOSPlatformTools : public PlatformTools
{
public:
// [PlatformTools]
const Char* GetDisplayName() const override;
const Char* GetName() const override;
PlatformType GetPlatform() const override;
ArchitectureType GetArchitecture() const override;
DotNetAOTModes UseAOT() const override;
PixelFormat GetTextureFormat(CookingData& data, TextureBase* texture, PixelFormat format) override;
bool IsNativeCodeFile(CookingData& data, const String& file) override;
void OnBuildStarted(CookingData& data) override;
bool OnPostProcess(CookingData& data) override;
};
#endif
+12 -73
View File
@@ -1,9 +1,8 @@
// Copyright (c) 2012-2019 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
#include "CookingData.h"
#include "Engine/Core/Collections/Dictionary.h"
#include "Editor/Scripting/ScriptsBuilder.h"
#include "Engine/Graphics/PixelFormat.h"
@@ -15,7 +14,6 @@ class TextureBase;
class FLAXENGINE_API PlatformTools
{
public:
/// <summary>
/// Finalizes an instance of the <see cref="PlatformTools"/> class.
/// </summary>
@@ -24,32 +22,35 @@ public:
/// <summary>
/// Gets the name of the platform for UI and logging.
/// </summary>
/// <returns>The name.</returns>
virtual const Char* GetDisplayName() const = 0;
/// <summary>
/// Gets the name of the platform for filesystem cache directories, deps folder.
/// </summary>
/// <returns>The name.</returns>
virtual const Char* GetName() const = 0;
/// <summary>
/// Gets the type of the platform.
/// </summary>
/// <returns>The platform type.</returns>
virtual PlatformType GetPlatform() const = 0;
/// <summary>
/// Gets the architecture of the platform.
/// </summary>
/// <returns>The architecture type.</returns>
virtual ArchitectureType GetArchitecture() const = 0;
/// <summary>
/// Gets the value indicating whenever platform requires AOT.
/// Gets the value indicating whenever platform requires AOT (needs C# assemblies to be precompiled).
/// </summary>
/// <returns>True if platform uses AOT and needs C# assemblies to be precompiled, otherwise false.</returns>
virtual bool UseAOT() const
virtual DotNetAOTModes UseAOT() const
{
return DotNetAOTModes::None;
}
/// <summary>
/// Gets the value indicating whenever platform supports using system-installed .Net Runtime.
/// </summary>
virtual bool UseSystemDotnet() const
{
return false;
}
@@ -72,13 +73,9 @@ public:
/// <param name="data">The cooking data.</param>
/// <param name="file">The file path.</param>
/// <returns>True if it's a native file, otherwise false.<returns>
virtual bool IsNativeCodeFile(CookingData& data, const String& file)
{
return false;
}
virtual bool IsNativeCodeFile(CookingData& data, const String& file);
public:
/// <summary>
/// Called when game building starts.
/// </summary>
@@ -136,64 +133,6 @@ public:
return false;
}
/// <summary>
/// The C# scripts AOT configuration options.
/// </summary>
struct AotConfig
{
String AotCompilerPath;
String AotCompilerArgs;
String AssemblerPath;
String AssemblerArgs;
String ArchiverPath;
String ArchiverArgs;
String AuxToolPath;
String AuxToolArgs;
String AotCachePath;
Dictionary<String, String> EnvVars;
Array<String> AssembliesSearchDirs;
Array<String> Assemblies;
AotConfig(CookingData& data)
{
Platform::GetEnvironmentVariables(EnvVars);
EnvVars[TEXT("MONO_PATH")] = data.DataOutputPath / TEXT("Mono/lib/mono/4.5");
AssembliesSearchDirs.Add(data.DataOutputPath / TEXT("Mono/lib/mono/4.5"));
}
};
/// <summary>
/// Called to configure AOT options.
/// </summary>
/// <param name="data">The cooking data.</param>
/// <param name="config">The configuration.</param>
virtual void OnConfigureAOT(CookingData& data, AotConfig& config)
{
}
/// <summary>
/// Called to execute AOT for the given assembly.
/// </summary>
/// <param name="data">The cooking data.</param>
/// <param name="config">The configuration.</param>
/// <param name="assemblyPath">The input managed library file path.</param>
/// <returns>True if failed, otherwise false.<returns>
virtual bool OnPerformAOT(CookingData& data, AotConfig& config, const String& assemblyPath)
{
return false;
}
/// <summary>
/// Called after AOT execution for the assemblies.
/// </summary>
/// <param name="data">The cooking data.</param>
/// <param name="config">The configuration.</param>
/// <returns>True if failed, otherwise false.<returns>
virtual bool OnPostProcessAOT(CookingData& data, AotConfig& config)
{
return false;
}
/// <summary>
/// Called during staged build post-processing.
/// </summary>
@@ -95,8 +95,8 @@ bool CompileScriptsStep::DeployBinaries(CookingData& data, const String& path, c
Scripting::ProcessBuildInfoPath(e.NativePath, projectFolderPath);
Scripting::ProcessBuildInfoPath(e.ManagedPath, projectFolderPath);
e.NativePath = StringUtils::GetFileName(e.NativePath);
e.ManagedPath = StringUtils::GetFileName(e.ManagedPath);
e.NativePath = String(StringUtils::GetFileName(e.NativePath));
e.ManagedPath = String(StringUtils::GetFileName(e.ManagedPath));
LOG(Info, "Collecting binary module {0}", e.Name);
}
@@ -129,7 +129,7 @@ bool CompileScriptsStep::DeployBinaries(CookingData& data, const String& path, c
continue;
if (FileSystem::CopyFile(dst, file))
{
data.Error(TEXT("Failed to copy file from {0} to {1}."), file, dst);
data.Error(String::Format(TEXT("Failed to copy file from {0} to {1}."), file, dst));
return true;
}
@@ -154,60 +154,7 @@ bool CompileScriptsStep::Perform(CookingData& data)
String target = project->GameTarget;
StringView workingDir;
const Char *platform, *architecture, *configuration = ::ToString(data.Configuration);
switch (data.Platform)
{
case BuildPlatform::Windows32:
platform = TEXT("Windows");
architecture = TEXT("x86");
break;
case BuildPlatform::Windows64:
platform = TEXT("Windows");
architecture = TEXT("x64");
break;
case BuildPlatform::UWPx86:
platform = TEXT("UWP");
architecture = TEXT("x86");
break;
case BuildPlatform::UWPx64:
platform = TEXT("UWP");
architecture = TEXT("x64");
break;
case BuildPlatform::XboxOne:
platform = TEXT("XboxOne");
architecture = TEXT("x64");
break;
case BuildPlatform::LinuxX64:
platform = TEXT("Linux");
architecture = TEXT("x64");
break;
case BuildPlatform::PS4:
platform = TEXT("PS4");
architecture = TEXT("x64");
break;
case BuildPlatform::XboxScarlett:
platform = TEXT("XboxScarlett");
architecture = TEXT("x64");
break;
case BuildPlatform::AndroidARM64:
platform = TEXT("Android");
architecture = TEXT("ARM64");
break;
case BuildPlatform::Switch:
platform = TEXT("Switch");
architecture = TEXT("ARM64");
break;
case BuildPlatform::PS5:
platform = TEXT("PS5");
architecture = TEXT("x64");
break;
case BuildPlatform::MacOSx64:
platform = TEXT("Mac");
architecture = TEXT("x64");
break;
default:
LOG(Error, "Unknown or unsupported build platform.");
return true;
}
data.GetBuildPlatformName(platform, architecture);
String targetBuildInfo = project->ProjectFolderPath / TEXT("Binaries") / target / platform / architecture / configuration / target + TEXT(".Build.json");
if (target.IsEmpty())
{
@@ -241,8 +188,8 @@ bool CompileScriptsStep::Perform(CookingData& data)
LOG(Info, "Starting scripts compilation for game...");
const String logFile = data.CacheDirectory / TEXT("CompileLog.txt");
auto args = String::Format(
TEXT("-log -logfile=\"{4}\" -build -mutex -buildtargets={0} -platform={1} -arch={2} -configuration={3}"),
target, platform, architecture, configuration, logFile);
TEXT("-log -logfile=\"{4}\" -build -mutex -buildtargets={0} -platform={1} -arch={2} -configuration={3} -aotMode={5}"),
target, platform, architecture, configuration, logFile, ToString(data.Tools->UseAOT()));
#if PLATFORM_WINDOWS
if (data.Platform == BuildPlatform::LinuxX64)
#elif PLATFORM_LINUX
@@ -257,7 +204,7 @@ bool CompileScriptsStep::Perform(CookingData& data)
// Assume FlaxGame was prebuilt for target platform
args += TEXT(" -SkipTargets=FlaxGame");
}
for (auto& define : data.CustomDefines)
for (const String& define : data.CustomDefines)
{
args += TEXT(" -D");
args += define;
+14 -4
View File
@@ -35,6 +35,7 @@
#include "Engine/Engine/Base/GameBase.h"
#include "Engine/Engine/Globals.h"
#include "Engine/Tools/TextureTool/TextureTool.h"
#include "Engine/Scripting/Enums.h"
#if PLATFORM_TOOLS_WINDOWS
#include "Engine/Platform/Windows/WindowsPlatformSettings.h"
#endif
@@ -327,8 +328,8 @@ bool CookAssetsStep::ProcessDefaultAsset(AssetCookData& options)
{
// Use compact json
rapidjson_flax::StringBuffer buffer;
rapidjson_flax::Writer<rapidjson_flax::StringBuffer> writer(buffer);
asJsonAsset->Document.Accept(writer);
CompactJsonWriter writerObj(buffer);
asJsonAsset->Save(writerObj);
// Store json data in the first chunk
auto chunk = New<FlaxChunk>();
@@ -409,7 +410,7 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
assetBase->InitCompilationOptions(options); \
if (ShadersCompilation::Compile(options)) \
{ \
data.Data.Error(TEXT("Failed to compile shader '{0}' (profile: {1})."), asset->ToString(), ::ToString(options.Profile)); \
data.Data.Error(String::Format(TEXT("Failed to compile shader '{0}' (profile: {1})."), asset->ToString(), ::ToString(options.Profile))); \
return true; \
} \
includes.Clear(); \
@@ -528,11 +529,20 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
#endif
#if PLATFORM_TOOLS_MAC
case BuildPlatform::MacOSx64:
case BuildPlatform::MacOSARM64:
{
const char* platformDefineName = "PLATFORM_MAC";
COMPILE_PROFILE(Vulkan_SM5, SHADER_FILE_CHUNK_INTERNAL_VULKAN_SM5_CACHE);
break;
}
#endif
#if PLATFORM_TOOLS_IOS
case BuildPlatform::iOSARM64:
{
const char* platformDefineName = "PLATFORM_IOS";
COMPILE_PROFILE(Vulkan_SM5, SHADER_FILE_CHUNK_INTERNAL_VULKAN_SM5_CACHE);
break;
}
#endif
default:
{
@@ -647,7 +657,7 @@ bool ProcessTextureBase(CookAssetsStep::AssetCookData& data)
// Convert texture data to the target format
if (TextureTool::Convert(textureDataTmp1, *textureData, targetFormat))
{
LOG(Error, "Failed to convert texture {0} from format {1} to {2}", asset->ToString(), (int32)format, (int32)targetFormat);
LOG(Error, "Failed to convert texture {0} from format {1} to {2}", asset->ToString(), ScriptingEnum::ToString(format), ScriptingEnum::ToString(targetFormat));
return true;
}
textureData = &textureDataTmp1;
+263 -7
View File
@@ -1,19 +1,23 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#include "DeployDataStep.h"
#include "Engine/Platform/File.h"
#include "Engine/Platform/FileSystem.h"
#include "Editor/Cooker/PlatformTools.h"
#include "Engine/Core/Collections/Sorting.h"
#include "Engine/Core/Config/BuildSettings.h"
#include "Engine/Core/Config/GameSettings.h"
#include "Engine/Renderer/ReflectionsPass.h"
#include "Engine/Renderer/AntiAliasing/SMAA.h"
#include "Engine/Engine/Globals.h"
#include "Editor/Cooker/PlatformTools.h"
#include "Editor/Utilities/EditorUtilities.h"
bool DeployDataStep::Perform(CookingData& data)
{
data.StepProgress(TEXT("Deploying engine data"), 0);
const String depsRoot = data.GetPlatformBinariesRoot();
const auto gameSettings = GameSettings::Get();
const auto& gameSettings = *GameSettings::Get();
const auto& buildSettings = *BuildSettings::Get();
// Setup output folders and copy required data
const auto contentDir = data.DataOutputPath / TEXT("Content");
@@ -26,22 +30,275 @@ bool DeployDataStep::Perform(CookingData& data)
Platform::Sleep(10);
}
FileSystem::CreateDirectory(contentDir);
const auto srcMono = depsRoot / TEXT("Mono");
const auto dstMono = data.DataOutputPath / TEXT("Mono");
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;
if (usAOT)
{
// Deploy Dotnet files into intermediate cooking directory for AOT
FileSystem::DeleteDirectory(dstDotnet);
dstDotnet = data.ManagedCodeOutputPath;
}
if (buildSettings.SkipDotnetPackaging && data.Tools->UseSystemDotnet())
{
// Use system-installed .Net Runtime
FileSystem::DeleteDirectory(dstDotnet);
}
else
{
// Deploy .Net Runtime files
FileSystem::CreateDirectory(dstDotnet);
String srcDotnet = depsRoot / TEXT("Dotnet");
if (FileSystem::DirectoryExists(srcDotnet))
{
// Use prebuilt .Net installation for that platform
LOG(Info, "Using .Net Runtime {} at {}", data.Tools->GetName(), srcDotnet);
if (EditorUtilities::CopyDirectoryIfNewer(dstDotnet, srcDotnet, true))
{
data.Error(TEXT("Failed to copy .Net runtime data files."));
return true;
}
}
else
{
bool canUseSystemDotnet = false;
switch (data.Platform)
{
case BuildPlatform::Windows32:
case BuildPlatform::Windows64:
canUseSystemDotnet = PLATFORM_TYPE == PlatformType::Windows;
break;
case BuildPlatform::LinuxX64:
canUseSystemDotnet = PLATFORM_TYPE == PlatformType::Linux;
break;
case BuildPlatform::MacOSx64:
case BuildPlatform::MacOSARM64:
canUseSystemDotnet = PLATFORM_TYPE == PlatformType::Mac;
break;
}
if (canUseSystemDotnet && (aotMode == DotNetAOTModes::None || aotMode == DotNetAOTModes::ILC))
{
// Ask Flax.Build to provide .Net SDK location for the current platform
String sdks;
bool failed = ScriptsBuilder::RunBuildTool(TEXT("-log -logMessagesOnly -logFileWithConsole -logfile=SDKs.txt -printSDKs"), data.CacheDirectory);
failed |= File::ReadAllText(data.CacheDirectory / TEXT("SDKs.txt"), sdks);
int32 idx = sdks.Find(TEXT("DotNetSdk, "), StringSearchCase::CaseSensitive);
if (idx != -1)
{
idx = sdks.Find(TEXT(", "), StringSearchCase::CaseSensitive, idx + 12);
idx += 2;
int32 end = sdks.Find(TEXT("\n"), StringSearchCase::CaseSensitive, idx);
if (sdks[end] == '\r')
end--;
srcDotnet = String(sdks.Get() + idx, end - idx).TrimTrailing();
}
if (failed || !FileSystem::DirectoryExists(srcDotnet))
{
data.Error(TEXT("Failed to get .Net SDK location for a current platform."));
return true;
}
// Select version to use
Array<String> versions;
FileSystem::GetChildDirectories(versions, srcDotnet / TEXT("host/fxr"));
if (versions.Count() == 0)
{
data.Error(TEXT("Failed to get .Net SDK location for a current platform."));
return true;
}
for (String& version : versions)
{
version = String(StringUtils::GetFileName(version));
if (!version.StartsWith(TEXT("7.")))
version.Clear();
}
Sorting::QuickSort(versions.Get(), versions.Count());
const String version = versions.Last();
FileSystem::NormalizePath(srcDotnet);
LOG(Info, "Using .Net Runtime {} at {}", version, srcDotnet);
// Check if previously deployed files are valid (eg. system-installed .NET was updated from version 7.0.3 to 7.0.5)
{
const String dotnetCacheFilePath = data.CacheDirectory / TEXT("SystemDotnetInfo.txt");
String dotnetCachedValue = String::Format(TEXT("{};{}"), version, srcDotnet);
if (FileSystem::DirectoryExists(dstDotnet))
{
String cachedData;
File::ReadAllText(dotnetCacheFilePath, cachedData);
if (cachedData != dotnetCachedValue)
{
FileSystem::DeleteDirectory(dstDotnet);
FileSystem::CreateDirectory(dstDotnet);
}
}
File::WriteAllText(dotnetCacheFilePath, dotnetCachedValue, Encoding::ANSI);
}
// Deploy runtime files
FileSystem::CopyFile(dstDotnet / TEXT("LICENSE.TXT"), srcDotnet / TEXT("LICENSE.txt"));
FileSystem::CopyFile(dstDotnet / TEXT("LICENSE.TXT"), srcDotnet / TEXT("LICENSE.TXT"));
FileSystem::CopyFile(dstDotnet / TEXT("THIRD-PARTY-NOTICES.TXT"), srcDotnet / TEXT("ThirdPartyNotices.txt"));
FileSystem::CopyFile(dstDotnet / TEXT("THIRD-PARTY-NOTICES.TXT"), srcDotnet / TEXT("THIRD-PARTY-NOTICES.TXT"));
if (usAOT)
{
failed |= EditorUtilities::CopyDirectoryIfNewer(dstDotnet, srcDotnet / TEXT("shared/Microsoft.NETCore.App") / version, true);
}
else
{
failed |= EditorUtilities::CopyDirectoryIfNewer(dstDotnet / TEXT("host/fxr") / version, srcDotnet / TEXT("host/fxr") / version, true);
failed |= EditorUtilities::CopyDirectoryIfNewer(dstDotnet / TEXT("shared/Microsoft.NETCore.App") / version, srcDotnet / TEXT("shared/Microsoft.NETCore.App") / version, true);
}
if (failed)
{
data.Error(TEXT("Failed to copy .Net runtime data files."));
return true;
}
}
else
{
// Ask Flax.Build to provide .Net Host Runtime location for the target platform
String sdks;
const Char *platformName, *archName;
data.GetBuildPlatformName(platformName, archName);
String args = String::Format(TEXT("-log -logMessagesOnly -logFileWithConsole -logfile=SDKs.txt -printDotNetRuntime -platform={} -arch={}"), platformName, archName);
bool failed = ScriptsBuilder::RunBuildTool(args, data.CacheDirectory);
failed |= File::ReadAllText(data.CacheDirectory / TEXT("SDKs.txt"), sdks);
Array<String> parts;
sdks.Split(',', parts);
failed |= parts.Count() != 3;
if (!failed)
{
srcDotnet = parts[2].TrimTrailing();
}
if (failed || !FileSystem::DirectoryExists(srcDotnet))
{
data.Error(TEXT("Failed to get .Net SDK location for a current platform."));
return true;
}
FileSystem::NormalizePath(srcDotnet);
LOG(Info, "Using .Net Runtime {} at {}", TEXT("Host"), srcDotnet);
// Deploy runtime files
const Char* corlibPrivateName = TEXT("System.Private.CoreLib.dll");
const bool srcDotnetFromEngine = srcDotnet.Contains(TEXT("Source/Platforms"));
String packFolder = srcDotnet / TEXT("../../../");
String dstDotnetLibs = dstDotnet, srcDotnetLibs = srcDotnet;
StringUtils::PathRemoveRelativeParts(packFolder);
if (usAOT)
{
if (srcDotnetFromEngine)
{
// AOT runtime files inside Engine Platform folder
packFolder /= TEXT("Dotnet");
dstDotnetLibs /= TEXT("lib/net7.0");
srcDotnetLibs = packFolder / TEXT("lib/net7.0");
}
else
{
// Runtime files inside Dotnet SDK folder but placed for AOT
dstDotnetLibs /= TEXT("lib/net7.0");
srcDotnetLibs /= TEXT("../lib/net7.0");
}
}
else
{
if (srcDotnetFromEngine)
{
// Runtime files inside Engine Platform folder
dstDotnetLibs /= TEXT("lib/net7.0");
srcDotnetLibs /= TEXT("lib/net7.0");
}
else
{
// Runtime files inside Dotnet SDK folder
dstDotnetLibs /= TEXT("shared/Microsoft.NETCore.App");
srcDotnetLibs /= TEXT("../lib/net7.0");
}
}
FileSystem::CopyFile(dstDotnet / TEXT("LICENSE.TXT"), packFolder / TEXT("LICENSE.txt"));
FileSystem::CopyFile(dstDotnet / TEXT("LICENSE.TXT"), packFolder / TEXT("LICENSE.TXT"));
FileSystem::CopyFile(dstDotnet / TEXT("THIRD-PARTY-NOTICES.TXT"), packFolder / TEXT("ThirdPartyNotices.txt"));
FileSystem::CopyFile(dstDotnet / TEXT("THIRD-PARTY-NOTICES.TXT"), packFolder / TEXT("THIRD-PARTY-NOTICES.TXT"));
failed |= EditorUtilities::CopyDirectoryIfNewer(dstDotnetLibs, srcDotnetLibs, true);
if (FileSystem::FileExists(srcDotnet / corlibPrivateName))
failed |= EditorUtilities::CopyFileIfNewer(dstDotnetLibs / corlibPrivateName, srcDotnet / corlibPrivateName);
switch (data.Platform)
{
#define DEPLOY_NATIVE_FILE(filename) failed |= FileSystem::CopyFile(data.NativeCodeOutputPath / TEXT(filename), srcDotnet / TEXT(filename));
case BuildPlatform::AndroidARM64:
if (data.Configuration != BuildConfiguration::Release)
{
DEPLOY_NATIVE_FILE("libmono-component-debugger.so");
DEPLOY_NATIVE_FILE("libmono-component-diagnostics_tracing.so");
DEPLOY_NATIVE_FILE("libmono-component-hot_reload.so");
}
DEPLOY_NATIVE_FILE("libmonosgen-2.0.so");
DEPLOY_NATIVE_FILE("libSystem.IO.Compression.Native.so");
DEPLOY_NATIVE_FILE("libSystem.Native.so");
DEPLOY_NATIVE_FILE("libSystem.Security.Cryptography.Native.Android.so");
break;
case BuildPlatform::iOSARM64:
DEPLOY_NATIVE_FILE("libmonosgen-2.0.dylib");
DEPLOY_NATIVE_FILE("libSystem.IO.Compression.Native.dylib");
DEPLOY_NATIVE_FILE("libSystem.Native.dylib");
DEPLOY_NATIVE_FILE("libSystem.Net.Security.Native.dylib");
DEPLOY_NATIVE_FILE("libSystem.Security.Cryptography.Native.Apple.dylib");
break;
#undef DEPLOY_NATIVE_FILE
default: ;
}
if (failed)
{
data.Error(TEXT("Failed to copy .Net runtime data files."));
return true;
}
}
}
// Optimize deployed C# class library (remove DLLs unused by scripts)
if (aotMode == DotNetAOTModes::None && buildSettings.SkipUnusedDotnetLibsPackaging)
{
LOG(Info, "Optimizing .NET class library size to include only used assemblies");
const String logFile = data.CacheDirectory / TEXT("StripDotnetLibs.txt");
String args = String::Format(
TEXT("-log -logfile=\"{}\" -runDotNetClassLibStripping -mutex -binaries=\"{}\""),
logFile, data.DataOutputPath);
for (const String& define : data.CustomDefines)
{
args += TEXT(" -D");
args += define;
}
if (ScriptsBuilder::RunBuildTool(args))
{
data.Error(TEXT("Failed to optimize .Net class library."));
return true;
}
}
}
#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, true))
{
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))
@@ -82,7 +339,7 @@ bool DeployDataStep::Perform(CookingData& data)
data.AddRootEngineAsset(TEXT("Engine/DefaultMaterial"));
data.AddRootEngineAsset(TEXT("Engine/DefaultDeformableMaterial"));
data.AddRootEngineAsset(TEXT("Engine/DefaultTerrainMaterial"));
if (!gameSettings->NoSplashScreen && !gameSettings->SplashScreen.IsValid())
if (!gameSettings.NoSplashScreen && !gameSettings.SplashScreen.IsValid())
data.AddRootEngineAsset(TEXT("Engine/Textures/Logo"));
data.AddRootEngineAsset(TEXT("Engine/Textures/NormalTexture"));
data.AddRootEngineAsset(TEXT("Engine/Textures/BlackTexture"));
@@ -112,7 +369,6 @@ bool DeployDataStep::Perform(CookingData& data)
// Register game assets
data.StepProgress(TEXT("Deploying game data"), 50);
auto& buildSettings = *BuildSettings::Get();
for (auto& e : buildSettings.AdditionalAssets)
data.AddRootAsset(e.GetID());
for (auto& e : buildSettings.AdditionalScenes)
@@ -2,9 +2,20 @@
#include "PostProcessStep.h"
#include "Editor/Cooker/PlatformTools.h"
#include "Engine/Platform/FileSystem.h"
bool PostProcessStep::Perform(CookingData& data)
{
// Print .NET stats
const DotNetAOTModes aotMode = data.Tools->UseAOT();
uint64 outputSize = FileSystem::GetDirectorySize(data.DataOutputPath / TEXT("Dotnet"));
if (aotMode == DotNetAOTModes::None)
{
for (auto& binaryModule : data.BinaryModules)
outputSize += FileSystem::GetFileSize(data.DataOutputPath / binaryModule.ManagedPath);
}
LOG(Info, "Output .NET files size: {0} MB", (uint32)(outputSize / (1024ull * 1024)));
GameCooker::PostProcessFiles();
return data.Tools->OnPostProcess(data);
}
@@ -1,78 +1,86 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#include "PrecompileAssembliesStep.h"
#include "Editor/Scripting/ScriptsBuilder.h"
#include "Engine/Platform/FileSystem.h"
#include "Engine/Platform/File.h"
#include "Engine/Core/Config/BuildSettings.h"
#include "Engine/Engine/Globals.h"
#include "Editor/Scripting/ScriptsBuilder.h"
#include "Editor/Cooker/PlatformTools.h"
#include "Editor/Utilities/EditorUtilities.h"
void PrecompileAssembliesStep::OnBuildStarted(CookingData& data)
{
const DotNetAOTModes aotMode = data.Tools->UseAOT();
if (aotMode == DotNetAOTModes::None)
return;
const auto& buildSettings = *BuildSettings::Get();
// Redirect C# assemblies to intermediate cooking directory (processed by ILC)
data.ManagedCodeOutputPath = data.CacheDirectory / TEXT("AOTAssemblies");
// Reset any AOT cache from previous run if the AOT mode has changed (eg. Mono AOT -> ILC on Desktop)
const String aotModeCacheFilePath = data.ManagedCodeOutputPath / TEXT("AOTMode.txt");
String aotModeCacheValue = String::Format(TEXT("{};{};{};{}"),
(int32)aotMode,
(int32)data.Configuration,
(int32)buildSettings.SkipUnusedDotnetLibsPackaging,
FileSystem::GetFileLastEditTime(ScriptsBuilder::GetBuildToolPath()).Ticks);
for (const String& define : data.CustomDefines)
aotModeCacheValue += define;
if (FileSystem::DirectoryExists(data.ManagedCodeOutputPath))
{
String cachedData;
File::ReadAllText(aotModeCacheFilePath, cachedData);
if (cachedData != aotModeCacheValue)
{
LOG(Info, "AOT cache invalidation");
FileSystem::DeleteDirectory(data.ManagedCodeOutputPath);
}
}
if (!FileSystem::DirectoryExists(data.ManagedCodeOutputPath))
{
FileSystem::CreateDirectory(data.ManagedCodeOutputPath);
File::WriteAllText(aotModeCacheFilePath, aotModeCacheValue, Encoding::ANSI);
}
}
bool PrecompileAssembliesStep::Perform(CookingData& data)
{
// Skip for some platforms
if (!data.Tools->UseAOT())
const DotNetAOTModes aotMode = data.Tools->UseAOT();
if (aotMode == DotNetAOTModes::None)
return false;
const auto& buildSettings = *BuildSettings::Get();
if (buildSettings.SkipDotnetPackaging && data.Tools->UseSystemDotnet())
return false;
LOG(Info, "Using AOT...");
// Useful references about AOT:
// http://www.mono-project.com/docs/advanced/runtime/docs/aot/
// http://www.mono-project.com/docs/advanced/aot/
const String infoMsg = TEXT("Running AOT");
data.StepProgress(infoMsg, 0);
// Setup
PlatformTools::AotConfig config(data);
data.Tools->OnConfigureAOT(data, config);
// Override Newtonsoft.Json with AOT-version (one that doesn't use System.Reflection.Emit)
EditorUtilities::CopyFileIfNewer(data.ManagedCodeOutputPath / TEXT("Newtonsoft.Json.dll"), Globals::StartupFolder / TEXT("Source/Platforms/DotNet/AOT/Newtonsoft.Json.dll"));
FileSystem::DeleteFile(data.ManagedCodeOutputPath / TEXT("Newtonsoft.Json.xml"));
FileSystem::DeleteFile(data.ManagedCodeOutputPath / TEXT("Newtonsoft.Json.pdb"));
// Prepare output directory
config.AotCachePath = data.DataOutputPath / TEXT("Mono/lib/mono/aot-cache");
switch (data.Tools->GetArchitecture())
// Run AOT by Flax.Build (see DotNetAOT)
const Char *platform, *architecture, *configuration = ::ToString(data.Configuration);
data.GetBuildPlatformName(platform, architecture);
const String logFile = data.CacheDirectory / TEXT("AOTLog.txt");
String args = String::Format(
TEXT("-log -logfile=\"{}\" -runDotNetAOT -mutex -platform={} -arch={} -configuration={} -aotMode={} -binaries=\"{}\" -intermediate=\"{}\""),
logFile, platform, architecture, configuration, ToString(aotMode), data.DataOutputPath, data.ManagedCodeOutputPath);
if (!buildSettings.SkipUnusedDotnetLibsPackaging)
args += TEXT(" -skipUnusedDotnetLibs=false"); // Run AOT on whole class library (not just used libs)
for (const String& define : data.CustomDefines)
{
case ArchitectureType::x86:
config.AotCachePath /= TEXT("x86");
break;
case ArchitectureType::x64:
config.AotCachePath /= TEXT("amd64");
break;
default:
data.Error(TEXT("Not supported AOT architecture"));
args += TEXT(" -D");
args += define;
}
if (ScriptsBuilder::RunBuildTool(args))
{
data.Error(TEXT("Failed to precompile game scripts."));
return true;
}
if (!FileSystem::DirectoryExists(config.AotCachePath))
{
if (FileSystem::CreateDirectory(config.AotCachePath))
{
data.Error(TEXT("Failed to setup AOT output directory."));
return true;
}
}
// Collect assemblies for AOT
// TODO: don't perform AOT on all assemblies but only ones used by the game and engine assemblies
for (auto& dir : config.AssembliesSearchDirs)
FileSystem::DirectoryGetFiles(config.Assemblies, dir, TEXT("*.dll"), DirectorySearchOption::TopDirectoryOnly);
for (auto& binaryModule : data.BinaryModules)
if (binaryModule.ManagedPath.HasChars())
config.Assemblies.Add(data.ManagedCodeOutputPath / binaryModule.ManagedPath);
// TODO: move AOT to Flax.Build and perform it on all C# assemblies used in target build
config.Assemblies.Add(data.ManagedCodeOutputPath / TEXT("Newtonsoft.Json.dll"));
// Perform AOT for the assemblies
for (int32 i = 0; i < config.Assemblies.Count(); i++)
{
BUILD_STEP_CANCEL_CHECK;
if (data.Tools->OnPerformAOT(data, config, config.Assemblies[i]))
return true;
data.StepProgress(infoMsg, static_cast<float>(i) / config.Assemblies.Count());
}
BUILD_STEP_CANCEL_CHECK;
if (data.Tools->OnPostProcessAOT(data, config))
return true;
// TODO: maybe remove GAC/assemblies? aot-cache could be only used in the build game
return false;
}
@@ -5,8 +5,7 @@
#include "Editor/Cooker/GameCooker.h"
/// <summary>
/// Optional step used only on selected platform that precompiles C# script assemblies.
/// Uses Mono Ahead of Time Compilation (AOT) feature.
/// Optional step used only on selected platform that precompiles C# script assemblies. Uses Ahead of Time Compilation (AOT) feature.
/// </summary>
/// <seealso cref="GameCooker::BuildStep" />
class PrecompileAssembliesStep : public GameCooker::BuildStep
@@ -14,5 +13,6 @@ class PrecompileAssembliesStep : public GameCooker::BuildStep
public:
// [BuildStep]
void OnBuildStarted(CookingData& data) override;
bool Perform(CookingData& data) override;
};
+5 -2
View File
@@ -3,7 +3,6 @@
using FlaxEditor.CustomEditors;
using FlaxEditor.Windows;
using FlaxEngine.GUI;
using FlaxEngine;
using DockState = FlaxEditor.GUI.Docking.DockState;
namespace FlaxEditor
@@ -86,8 +85,12 @@ namespace FlaxEditor
if (!FlaxEngine.Scripting.IsTypeFromGameScripts(type))
return;
Editor.Instance.Windows.AddToRestore(this);
if (!Window.IsHidden)
{
Editor.Instance.Windows.AddToRestore(this);
}
Window.Close();
Window.Dispose();
}
/// <summary>
+36 -6
View File
@@ -7,6 +7,7 @@ using FlaxEditor.CustomEditors.GUI;
using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.GUI;
using FlaxEngine.Utilities;
using Newtonsoft.Json;
using JsonSerializer = FlaxEngine.Json.JsonSerializer;
@@ -147,7 +148,7 @@ namespace FlaxEditor.CustomEditors
return;
// Special case for root objects to run normal layout build
if (_presenter.Selection == Values)
if (_presenter != null && _presenter.Selection == Values)
{
_presenter.BuildLayout();
return;
@@ -158,7 +159,7 @@ namespace FlaxEditor.CustomEditors
var layout = _layout;
var control = layout.ContainerControl;
var parent = _parent;
var parentScrollV = (_presenter.Panel.Parent as Panel)?.VScrollBar?.Value ?? -1;
var parentScrollV = (_presenter?.Panel.Parent as Panel)?.VScrollBar?.Value ?? -1;
control.IsLayoutLocked = true;
control.DisposeChildren();
@@ -248,6 +249,28 @@ namespace FlaxEditor.CustomEditors
internal virtual void RefreshRootChild()
{
// Check if need to update value
if (_hasValueDirty)
{
IsSettingValue = true;
try
{
// Cleanup (won't retry update in case of exception)
object val = _valueToSet;
_hasValueDirty = false;
_valueToSet = null;
// Assign value
for (int i = 0; i < _values.Count; i++)
_values[i] = val;
}
finally
{
OnUnDirty();
IsSettingValue = false;
}
}
Refresh();
for (int i = 0; i < _children.Count; i++)
@@ -603,9 +626,7 @@ namespace FlaxEditor.CustomEditors
JsonSerializer.Deserialize(obj, text);
}
}
#pragma warning disable 618
else if (Newtonsoft.Json.Schema.JsonSchema.Parse(text) == null)
#pragma warning restore 618
else if (!text.StartsWith("{") || !text.EndsWith("}"))
{
return false;
}
@@ -628,7 +649,14 @@ namespace FlaxEditor.CustomEditors
else
{
// Default
obj = JsonConvert.DeserializeObject(text, TypeUtils.GetType(Values.Type), JsonSerializer.Settings);
try
{
obj = JsonConvert.DeserializeObject(text, TypeUtils.GetType(Values.Type), JsonSerializer.Settings);
}
catch
{
obj = null;
}
}
if (obj == null || Values.Type.IsInstanceOfType(obj))
@@ -795,6 +823,8 @@ namespace FlaxEditor.CustomEditors
/// <returns>True if allow to handle this event, otherwise false.</returns>
protected virtual bool OnDirty(CustomEditor editor, object value, object token = null)
{
if (ParentEditor == null)
return false;
return ParentEditor.OnDirty(editor, value, token);
}
@@ -6,6 +6,7 @@ using System.Linq;
using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.GUI;
using FlaxEngine.Utilities;
namespace FlaxEditor.CustomEditors
{
@@ -13,7 +13,6 @@
#include "Engine/Scripting/ManagedCLR/MClass.h"
#include "Engine/Scripting/ManagedCLR/MUtils.h"
#include "FlaxEngine.Gen.h"
#include <ThirdParty/mono-2.0/mono/metadata/reflection.h>
#define TRACK_ASSEMBLY(assembly) \
if (assembly->IsLoaded()) \
@@ -49,24 +48,24 @@ struct Entry
}
};
Dictionary<MonoType*, Entry> Cache(512);
Dictionary<MType*, Entry> Cache(512);
void OnAssemblyLoaded(MAssembly* assembly);
void OnAssemblyUnloading(MAssembly* assembly);
void OnBinaryModuleLoaded(BinaryModule* module);
MonoReflectionType* CustomEditorsUtil::GetCustomEditor(MonoReflectionType* refType)
MTypeObject* CustomEditorsUtil::GetCustomEditor(MTypeObject* refType)
{
if (!refType)
return nullptr;
MonoType* type = mono_reflection_type_get_type(refType);
MType* type = INTERNAL_TYPE_OBJECT_GET(refType);
Entry result;
if (Cache.TryGet(type, result))
{
const auto editor = result.CustomEditor ? result.CustomEditor : result.DefaultEditor;
MClass* editor = result.CustomEditor ? result.CustomEditor : result.DefaultEditor;
if (editor)
{
return MUtils::GetType(editor->GetNative());
return MUtils::GetType(editor);
}
}
return nullptr;
@@ -123,19 +122,19 @@ void OnAssemblyLoaded(MAssembly* assembly)
continue;
const auto attribute = mclass->GetAttribute(customEditorAttribute);
if (attribute == nullptr || mono_object_get_class(attribute) != customEditorAttribute->GetNative())
if (attribute == nullptr || MCore::Object::GetClass(attribute) != customEditorAttribute)
continue;
// Check if attribute references a valid class
MonoReflectionType* refType = nullptr;
MTypeObject* refType = nullptr;
customEditorTypeField->GetValue(attribute, &refType);
if (refType == nullptr)
continue;
MonoType* type = mono_reflection_type_get_type(refType);
MType* type = INTERNAL_TYPE_OBJECT_GET(refType);
if (type == nullptr)
continue;
MonoClass* typeClass = mono_type_get_class(type);
MClass* typeClass = MCore::Type::GetClass(type);
// Check if it's a custom editor class
if (mclass->IsSubClassOf(customEditor))
@@ -152,18 +151,14 @@ void OnAssemblyLoaded(MAssembly* assembly)
entry.CustomEditor = mclass;
}
//LOG(Info, "Custom Editor {0} for type {1} (default: {2})", String(mclass->GetFullName()), String(mono_type_get_name(type)), isDefault);
//LOG(Info, "Custom Editor {0} for type {1} (default: {2})", String(mclass->GetFullName()), MCore::Type::ToString(type), isDefault);
}
else if (typeClass)
{
MClass* referencedClass = Scripting::FindClass(typeClass);
if (referencedClass)
{
auto& entry = Cache[mono_class_get_type(mclass->GetNative())];
entry.CustomEditor = referencedClass;
auto& entry = Cache[mclass->GetType()];
entry.CustomEditor = typeClass;
//LOG(Info, "Custom Editor {0} for type {1}", String(referencedClass->GetFullName()), String(mclass->GetFullName()));
}
//LOG(Info, "Custom Editor {0} for type {1}", String(typeClass->GetFullName()), String(mclass->GetFullName()));
}
}
@@ -183,17 +178,16 @@ void OnAssemblyUnloading(MAssembly* assembly)
// Remove entries with user classes
for (auto i = Cache.Begin(); i.IsNotEnd(); ++i)
{
MonoClass* monoClass = (MonoClass*)(void*)i->Key;
if (assembly->GetClass(monoClass))
MClass* mClass = MCore::Type::GetClass(i->Key);
if (mClass && mClass->GetAssembly() == assembly)
{
Cache.Remove(i);
}
else
{
if (i->Value.DefaultEditor && assembly->GetClass(i->Value.DefaultEditor->GetNative()))
if (i->Value.DefaultEditor && i->Value.DefaultEditor->GetAssembly() == assembly)
i->Value.DefaultEditor = nullptr;
if (i->Value.CustomEditor && assembly->GetClass(i->Value.CustomEditor->GetNative()))
if (i->Value.CustomEditor && i->Value.CustomEditor->GetAssembly() == assembly)
i->Value.CustomEditor = nullptr;
}
}
@@ -3,14 +3,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.Marshalling;
using FlaxEditor.CustomEditors.Dedicated;
using FlaxEditor.CustomEditors.Editors;
using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.Interop;
using FlaxEngine.Utilities;
namespace FlaxEditor.CustomEditors
{
internal static class CustomEditorsUtil
internal static partial class CustomEditorsUtil
{
internal static readonly Dictionary<Type, string> InBuildTypeNames = new Dictionary<Type, string>()
{
@@ -107,7 +111,7 @@ namespace FlaxEditor.CustomEditors
// Select default editor (based on type)
if (targetType.IsEnum)
return new EnumEditor();
if (targetType.IsGenericType)
if (targetType.IsGenericType)
{
if (targetTypeType.GetGenericTypeDefinition() == typeof(Dictionary<,>))
return new DictionaryEditor();
@@ -118,12 +122,15 @@ namespace FlaxEditor.CustomEditors
if (customEditorType != null)
return (CustomEditor)Activator.CreateInstance(customEditorType);
}
if (typeof(FlaxEngine.Object).IsAssignableFrom(targetTypeType))
return new ScriptingObjectEditor();
// The most generic editor
return new GenericEditor();
}
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern Type Internal_GetCustomEditor(Type targetType);
[LibraryImport("FlaxEngine", EntryPoint = "CustomEditorsUtilInternal_GetCustomEditor", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(StringMarshaller))]
[return: MarshalUsing(typeof(SystemTypeMarshaller))]
internal static partial Type Internal_GetCustomEditor([MarshalUsing(typeof(SystemTypeMarshaller))] Type targetType);
}
}
@@ -11,7 +11,7 @@ class CustomEditorsUtil
{
public:
#if USE_MONO
static MonoReflectionType* GetCustomEditor(MonoReflectionType* refType);
#if USE_CSHARP
static MTypeObject* GetCustomEditor(MTypeObject* refType);
#endif
};
@@ -12,6 +12,7 @@ using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.GUI;
using FlaxEngine.Json;
using FlaxEngine.Utilities;
namespace FlaxEditor.CustomEditors.Dedicated
{
@@ -20,7 +21,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
/// </summary>
/// <seealso cref="FlaxEditor.CustomEditors.Editors.GenericEditor" />
[CustomEditor(typeof(Actor)), DefaultEditor]
public class ActorEditor : GenericEditor
public class ActorEditor : ScriptingObjectEditor
{
private Guid _linkedPrefabId;
@@ -94,19 +95,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
{
if (actor != null)
group.Panel.TooltipText = Surface.SurfaceUtils.GetVisualScriptTypeDescription(TypeUtils.GetObjectType(actor));
float settingsButtonSize = group.Panel.HeaderHeight;
var settingsButton = new Image
{
TooltipText = "Settings",
AutoFocus = true,
AnchorPreset = AnchorPresets.TopRight,
Parent = group.Panel,
Bounds = new Rectangle(group.Panel.Width - settingsButtonSize, 0, settingsButtonSize, settingsButtonSize),
IsScrollable = false,
Color = FlaxEngine.GUI.Style.Current.ForegroundGrey,
Margin = new Margin(1),
Brush = new SpriteBrush(FlaxEngine.GUI.Style.Current.Settings),
};
var settingsButton = group.AddSettingsButton();
settingsButton.Clicked += OnSettingsButtonClicked;
break;
}
@@ -218,7 +207,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
node.Text = Utilities.Utils.GetPropertyNameUI(sceneObject.GetType().Name);
}
// Array Item
else if (editor.ParentEditor?.Values?.Type.IsArray ?? false)
else if (editor.ParentEditor is CollectionEditor)
{
node.Text = "Element " + editor.ParentEditor.ChildrenEditors.IndexOf(editor);
}
@@ -261,16 +250,14 @@ namespace FlaxEditor.CustomEditors.Dedicated
}
// Skip if no change detected
if (!editor.Values.IsReferenceValueModified && skipIfNotModified)
var isRefEdited = editor.Values.IsReferenceValueModified;
if (!isRefEdited && skipIfNotModified)
return null;
TreeNode result = null;
if (editor.ChildrenEditors.Count == 0)
if (editor.ChildrenEditors.Count == 0 || (isRefEdited && editor is CollectionEditor))
result = CreateDiffNode(editor);
bool isScriptEditorWithRefValue = editor is ScriptsEditor && editor.Values.HasReferenceValue;
for (int i = 0; i < editor.ChildrenEditors.Count; i++)
{
var child = ProcessDiff(editor.ChildrenEditors[i], !isScriptEditorWithRefValue);
@@ -278,7 +265,6 @@ namespace FlaxEditor.CustomEditors.Dedicated
{
if (result == null)
result = CreateDiffNode(editor);
result.AddChild(child);
}
}
@@ -0,0 +1,69 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.CustomEditors.Dedicated
{
/// <summary>
/// Custom editor for <see cref="AudioSource"/>.
/// </summary>
[CustomEditor(typeof(AudioSource)), DefaultEditor]
public class AudioSourceEditor : ActorEditor
{
private Label _infoLabel;
/// <inheritdoc />
public override void Initialize(LayoutElementsContainer layout)
{
base.Initialize(layout);
// Show playback options during simulation
if (Editor.IsPlayMode)
{
var playbackGroup = layout.Group("Playback");
playbackGroup.Panel.Open();
_infoLabel = playbackGroup.Label(string.Empty).Label;
_infoLabel.AutoHeight = true;
var grid = playbackGroup.CustomContainer<UniformGridPanel>();
var gridControl = grid.CustomControl;
gridControl.ClipChildren = false;
gridControl.Height = Button.DefaultHeight;
gridControl.SlotsHorizontally = 3;
gridControl.SlotsVertically = 1;
grid.Button("Play").Button.Clicked += () => Foreach(x => x.Play());
grid.Button("Pause").Button.Clicked += () => Foreach(x => x.Pause());
grid.Button("Stop").Button.Clicked += () => Foreach(x => x.Stop());
}
}
/// <inheritdoc />
public override void Refresh()
{
base.Refresh();
if (_infoLabel != null)
{
var text = string.Empty;
foreach (var value in Values)
{
if (value is AudioSource audioSource && audioSource.Clip)
text += $"Time: {audioSource.Time:##0.0}s / {audioSource.Clip.Length:##0.0}s\n";
}
_infoLabel.Text = text;
}
}
private void Foreach(Action<AudioSource> func)
{
foreach (var value in Values)
{
if (value is AudioSource audioSource)
func(audioSource);
}
}
}
}
@@ -45,7 +45,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
var upperRightCell = new VerticalPanel
{
ClipChildren = false,
Pivot = new Float2(0.0f, 0.0f),
Pivot = new Float2(0.00001f, 0.0f),
Offset = new Float2(-labelsWidth, 0),
Rotation = -90,
Spacing = 0,
@@ -145,7 +145,10 @@ namespace FlaxEditor.CustomEditors.Dedicated
else
{
// No localization so initialize with empty table
var path = Path.Combine(Path.Combine(Path.GetDirectoryName(GameSettings.Load().Localization.Path), "Localization", culture.Name + ".json"));
var folder = Path.Combine(Path.GetDirectoryName(GameSettings.Load().Localization.Path), "Localization");
if (!Directory.Exists(folder))
Directory.CreateDirectory(folder);
var path = Path.Combine(Path.Combine(folder, culture.Name + ".json"));
var table = FlaxEngine.Content.CreateVirtualAsset<LocalizedStringTable>();
table.Locale = culture.Name;
if (!table.Save(path))
@@ -1,8 +1,10 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
using FlaxEditor.Surface;
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.CustomEditors.Dedicated
{
@@ -13,6 +15,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
[CustomEditor(typeof(ParticleEffect)), DefaultEditor]
public class ParticleEffectEditor : ActorEditor
{
private Label _infoLabel;
private bool _isValid;
private bool _isActive;
private uint _parametersVersion;
@@ -48,6 +51,15 @@ namespace FlaxEditor.CustomEditors.Dedicated
return null;
}
private void Foreach(Action<ParticleEffect> func)
{
foreach (var value in Values)
{
if (value is ParticleEffect player)
func(player);
}
}
/// <inheritdoc />
public override void Initialize(LayoutElementsContainer layout)
{
@@ -60,6 +72,26 @@ namespace FlaxEditor.CustomEditors.Dedicated
_parametersVersion = effect.ParametersVersion;
_isActive = effect.IsActive;
// Show playback options during simulation
if (Editor.IsPlayMode)
{
var playbackGroup = layout.Group("Playback");
playbackGroup.Panel.Open();
_infoLabel = playbackGroup.Label(string.Empty).Label;
_infoLabel.AutoHeight = true;
var grid = playbackGroup.CustomContainer<UniformGridPanel>();
var gridControl = grid.CustomControl;
gridControl.ClipChildren = false;
gridControl.Height = Button.DefaultHeight;
gridControl.SlotsHorizontally = 3;
gridControl.SlotsVertically = 1;
grid.Button("Play").Button.Clicked += () => Foreach(x => x.Play());
grid.Button("Pause").Button.Clicked += () => Foreach(x => x.Pause());
grid.Button("Stop").Button.Clicked += () => Foreach(x => x.Stop());
}
// Show all effect parameters grouped by the emitter track name
var groups = layout.Group("Parameters");
groups.Panel.Open();
@@ -99,7 +131,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
base.RefreshRootChild();
return;
}
for (int i = 0; i < ChildrenEditors.Count; i++)
{
if (_isActive != effect.IsActive || _parametersVersion != effect.ParametersVersion)
@@ -167,7 +167,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
Presenter.Undo?.AddAction(new MultiUndoAction(actions));
// Build ragdoll
SceneGraph.Actors.AnimatedModelNode.BuildRagdoll(animatedModel, options, ragdoll);
AnimatedModelNode.BuildRagdoll(animatedModel, options, ragdoll);
}
private void OnRebuildBone(Button button)
@@ -191,7 +191,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
}
// Build ragdoll
SceneGraph.Actors.AnimatedModelNode.BuildRagdoll(animatedModel, new AnimatedModelNode.RebuildOptions(), ragdoll, name);
AnimatedModelNode.BuildRagdoll(animatedModel, new AnimatedModelNode.RebuildOptions(), ragdoll, name);
}
private void OnRemoveBone(Button button)
@@ -0,0 +1,69 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.CustomEditors.Dedicated
{
/// <summary>
/// Custom editor for <see cref="SceneAnimationPlayer"/>.
/// </summary>
[CustomEditor(typeof(SceneAnimationPlayer)), DefaultEditor]
public class SceneAnimationPlayerEditor : ActorEditor
{
private Label _infoLabel;
/// <inheritdoc />
public override void Initialize(LayoutElementsContainer layout)
{
base.Initialize(layout);
// Show playback options during simulation
if (Editor.IsPlayMode)
{
var playbackGroup = layout.Group("Playback");
playbackGroup.Panel.Open();
_infoLabel = playbackGroup.Label(string.Empty).Label;
_infoLabel.AutoHeight = true;
var grid = playbackGroup.CustomContainer<UniformGridPanel>();
var gridControl = grid.CustomControl;
gridControl.ClipChildren = false;
gridControl.Height = Button.DefaultHeight;
gridControl.SlotsHorizontally = 3;
gridControl.SlotsVertically = 1;
grid.Button("Play").Button.Clicked += () => Foreach(x => x.Play());
grid.Button("Pause").Button.Clicked += () => Foreach(x => x.Pause());
grid.Button("Stop").Button.Clicked += () => Foreach(x => x.Stop());
}
}
/// <inheritdoc />
public override void Refresh()
{
base.Refresh();
if (_infoLabel != null)
{
var text = string.Empty;
foreach (var value in Values)
{
if (value is SceneAnimationPlayer player && player.Animation)
text += $"Time: {player.Time:##0.0}s / {player.Animation.Duration:##0.0}s\n";
}
_infoLabel.Text = text;
}
}
private void Foreach(Action<SceneAnimationPlayer> func)
{
foreach (var value in Values)
{
if (value is SceneAnimationPlayer player)
func(player);
}
}
}
}
@@ -0,0 +1,29 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors.Editors;
using FlaxEngine.Networking;
namespace FlaxEditor.CustomEditors.Dedicated
{
/// <summary>
/// Custom editor for <see cref="FlaxEngine.Object"/>.
/// </summary>
public class ScriptingObjectEditor : GenericEditor
{
/// <inheritdoc />
public override void Initialize(LayoutElementsContainer layout)
{
// Network objects debugging
var obj = Values[0] as FlaxEngine.Object;
if (Editor.IsPlayMode && NetworkManager.IsConnected && NetworkReplicator.HasObject(obj))
{
var group = layout.Group("Network");
group.Panel.Open();
group.Label("Role", Utilities.Utils.GetPropertyNameUI(NetworkReplicator.GetObjectRole(obj).ToString()));
group.Label("Owner Client Id", NetworkReplicator.GetObjectOwnerClientId(obj).ToString());
}
base.Initialize(layout);
}
}
}
@@ -3,7 +3,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using FlaxEditor.Actions;
using FlaxEditor.Content;
using FlaxEditor.GUI;
@@ -12,6 +11,7 @@ using FlaxEditor.GUI.Drag;
using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.GUI;
using FlaxEngine.Utilities;
using Object = FlaxEngine.Object;
namespace FlaxEditor.CustomEditors.Dedicated
@@ -462,20 +462,8 @@ namespace FlaxEditor.CustomEditors.Dedicated
var group = layout.Group("Missing script");
// Add settings button to the group
const float settingsButtonSize = 14;
var settingsButton = new Image
{
TooltipText = "Settings",
AutoFocus = true,
AnchorPreset = AnchorPresets.TopRight,
Parent = group.Panel,
Bounds = new Rectangle(group.Panel.Width - settingsButtonSize, 0, settingsButtonSize, settingsButtonSize),
IsScrollable = false,
Color = FlaxEngine.GUI.Style.Current.ForegroundGrey,
Margin = new Margin(1),
Brush = new SpriteBrush(FlaxEngine.GUI.Style.Current.Settings),
Tag = index,
};
var settingsButton = group.AddSettingsButton();
settingsButton.Tag = index;
settingsButton.Clicked += MissingSettingsButtonOnClicked;
}
@@ -665,19 +653,8 @@ namespace FlaxEditor.CustomEditors.Dedicated
};
// Add settings button to the group
var settingsButton = new Image
{
TooltipText = "Settings",
AutoFocus = true,
AnchorPreset = AnchorPresets.TopRight,
Parent = group.Panel,
Bounds = new Rectangle(group.Panel.Width - headerHeight, 0, headerHeight, headerHeight),
IsScrollable = false,
Color = FlaxEngine.GUI.Style.Current.ForegroundGrey,
Margin = new Margin(1),
Brush = new SpriteBrush(FlaxEngine.GUI.Style.Current.Settings),
Tag = script,
};
var settingsButton = group.AddSettingsButton();
settingsButton.Tag = script;
settingsButton.Clicked += OnSettingsButtonClicked;
group.Panel.HeaderTextMargin = new Margin(scriptDrag.Right - 12, 15, 2, 2);
@@ -408,6 +408,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
{
private Type _cachedType;
private bool _anchorDropDownClosed = true;
private Button _pivotRelativeButton;
/// <inheritdoc />
public override void Initialize(LayoutElementsContainer layout)
@@ -484,13 +485,54 @@ namespace FlaxEditor.CustomEditors.Dedicated
horDown.CustomControl.Height = TextBoxBase.DefaultHeight;
GetAnchorEquality(out _cachedXEq, out _cachedYEq, valueTypes);
BuildLocationSizeOffsets(horUp, horDown, _cachedXEq, _cachedYEq, valueTypes);
BuildExtraButtons(group);
main.Space(10);
BuildAnchorsDropper(main, valueTypes);
}
private void BuildExtraButtons(VerticalPanelElement group)
{
var control = (Control)Values[0];
var pivotRelative = Editor.Instance.Windows.PropertiesWin.UIPivotRelative;
control.PivotRelative = pivotRelative;
var panel = group.CustomContainer<Panel>();
panel.CustomControl.Height = TextBoxBase.DefaultHeight;
panel.CustomControl.ClipChildren = false;
panel.CustomControl.Parent = group.ContainerControl;
_pivotRelativeButton = new Button
{
TooltipText = "Toggles UI control resizing based on where the pivot is rather than just the top-left.",
Size = new Float2(18),
Parent = panel.ContainerControl,
BackgroundBrush = new SpriteBrush(Editor.Instance.Icons.Scale32),
AnchorPreset = AnchorPresets.TopRight,
X = 77,
};
SetStyle(pivotRelative);
_pivotRelativeButton.Clicked += PivotRelativeClicked;
}
private void PivotRelativeClicked()
{
var control = (Control)Values[0];
var pivotRelative = control.PivotRelative;
control.PivotRelative = !pivotRelative;
Editor.Instance.Windows.PropertiesWin.UIPivotRelative = !pivotRelative;
SetStyle(control.PivotRelative);
}
private void SetStyle(bool current)
{
var style = FlaxEngine.GUI.Style.Current;
var backgroundColor = current ? style.Foreground : style.ForegroundDisabled;
_pivotRelativeButton.SetColors(backgroundColor);
}
private void BuildAnchorsDropper(LayoutElementsContainer main, ScriptType[] valueTypes)
{
ScriptMemberInfo minInfo = valueTypes[0].GetProperty("AnchorMin");
@@ -655,7 +697,9 @@ namespace FlaxEditor.CustomEditors.Dedicated
if (uiControl.Name.StartsWith(previousName))
{
string newName = controlType.Name + uiControl.Name.Substring(previousName.Length);
uiControl.Name = StringUtils.IncrementNameNumber(newName, x => uiControl.Parent.GetChild(x) == null);
if (uiControl.Parent != null)
newName = Utilities.Utils.IncrementNameNumber(newName, x => uiControl.Parent.GetChild(x) == null);
uiControl.Name = newName;
}
}
@@ -27,16 +27,6 @@ namespace FlaxEditor.CustomEditors.Editors
element.ComboBox.SelectedIndexChanged += OnSelectedIndexChanged;
}
private void GetActorsTree(List<Actor> list, Actor a)
{
list.Add(a);
int cnt = a.ChildrenCount;
for (int i = 0; i < cnt; i++)
{
GetActorsTree(list, a.GetChild(i));
}
}
private void OnSelectedIndexChanged(ComboBox comboBox)
{
int value = comboBox.SelectedIndex;
@@ -60,7 +50,7 @@ namespace FlaxEditor.CustomEditors.Editors
// Note: this possibly breaks the design a little bit
// But it's the easiest way to set value for selected actor and its children with one undo action
List<Actor> actors = new List<Actor>(32);
GetActorsTree(actors, actor);
Utilities.Utils.GetActorsTree(actors, actor);
if (Presenter.Undo != null)
{
using (new UndoMultiBlock(Presenter.Undo, actors.ToArray(), "Change layer"))

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