Compare commits

..

200 Commits

Author SHA1 Message Date
mafiesto4 f15f7ff59f Bump up version 2021-01-29 00:36:15 +01:00
mafiesto4 0d0279a1f8 Merge branch 'stefnotch-fix-asset-viewports' 2021-01-28 23:30:11 +01:00
mafiesto4 bb8a6e5c8d Merge branch 'fix-asset-viewports' of git://github.com/stefnotch/FlaxEngine into stefnotch-fix-asset-viewports 2021-01-28 23:30:05 +01:00
mafiesto4 beecbffdc3 Fix error when opening Anim Graph with node name not existing in skeleton anymore
Fixes #176
2021-01-28 21:59:30 +01:00
stefnotch 06f07c2903 Fix EditorViewport zooming
Fix #162
Also improves cases like LeftMouseDown + Scroll
2021-01-28 17:17:17 +01:00
stefnotch 164da0f87a Fix spelling error 2021-01-28 16:24:36 +01:00
stefnotch a250a23259 Fix TexturePreview zooming
Fix #164
2021-01-28 16:13:45 +01:00
mafiesto4 50f6a01f83 Fix plane model normals 2021-01-28 01:28:13 +01:00
mafiesto4 aedc619009 Fix crash when opening prefab that fails to load root ObjectsLookupIdMapping
Fixes #126
2021-01-28 01:11:02 +01:00
mafiesto4 a226ff8762 Fix plane model incorrect rotation in material preview (#165) 2021-01-28 00:52:06 +01:00
mafiesto4 a1cee0f0bf Fix crash when applying changes to prefab 2021-01-28 00:38:08 +01:00
mafiesto4 bb84ad0f79 Add missing doc comment 2021-01-28 00:10:41 +01:00
mafiesto4 0de380ad3a Optimize Variant typename loading if length is zero 2021-01-28 00:02:37 +01:00
mafiesto4 4b11725226 Fix crash when creating Empty particle emitter
Fixes #174
2021-01-27 23:59:24 +01:00
mafiesto4 971ab7b8e7 Merge branch 'stefnotch-improve-first-time-setup' 2021-01-27 23:36:59 +01:00
mafiesto4 b57ce2bd56 Merge branch 'improve-first-time-setup' of git://github.com/stefnotch/FlaxEngine into stefnotch-improve-first-time-setup 2021-01-27 23:36:54 +01:00
mafiesto4 876a728b41 Fix scene animation rendering issue with game window is not selected tab
Fixes #170
2021-01-27 23:27:19 +01:00
mafiesto4 b411539717 Merge branch 'stefnotch-fix-disable-ctrl-w-ingame' 2021-01-27 22:41:28 +01:00
mafiesto4 4cb5574a2e Merge branch 'fix-disable-ctrl-w-ingame' of git://github.com/stefnotch/FlaxEngine into stefnotch-fix-disable-ctrl-w-ingame 2021-01-27 22:41:24 +01:00
mafiesto4 1aceab3783 Merge branch 'W2Wizard-DDX-DDY-Nodes' 2021-01-27 22:39:23 +01:00
mafiesto4 c583b6a1a7 Merge branch 'DDX-DDY-Nodes' of git://github.com/W2Wizard/FlaxEngine into W2Wizard-DDX-DDY-Nodes 2021-01-27 22:39:19 +01:00
mafiesto4 3c3b47f5b4 Fix Get Node Transform ndoe in anim graph 2021-01-27 22:37:25 +01:00
mafiesto4 36bd398136 Fix error when animated model skeleton has duplicated node name 2021-01-27 22:37:19 +01:00
stefnotch c820e87d4a Slightly tweak the key processing code 2021-01-27 22:08:17 +01:00
stefnotch f00ae7fb21 Disable CTRL+W during the game
Fix #96
2021-01-27 21:30:22 +01:00
stefnotch 18e3d51914 Check LFS using file size 2021-01-27 18:08:38 +01:00
stefnotch 691d9d9b88 Document the GitHub basics 2021-01-27 14:34:38 +01:00
stefnotch 81865bd97e Move Flax plugin up, since it's currently required 2021-01-27 14:32:25 +01:00
stefnotch 80e0b0b0e5 Document the "set as startup project" 2021-01-27 14:32:10 +01:00
stefnotch da3a54d184 Pause on error
On Windows, because people using Windows will double click on the file
2021-01-27 14:06:36 +01:00
W2.Wizard 1925fe5724 Added DDX / DDY nodes 2021-01-27 01:39:50 +01:00
mafiesto4 f1763840c9 Fix exporting textures in format R10G10B10A2 and R11G11B10 on Windows 2021-01-27 00:28:38 +01:00
mafiesto4 bbeab83b29 Merge branch 'GoaLitiuM-folder_dialog' 2021-01-27 00:27:41 +01:00
mafiesto4 cb8ba2d757 Fix WindowsFileSystem::ShowBrowseFolderDialog path length 2021-01-27 00:27:32 +01:00
mafiesto4 1679458094 Merge branch 'folder_dialog' of git://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-folder_dialog 2021-01-27 00:05:57 +01:00
mafiesto4 c9992ef7d0 Merge branch 'GoaLitiuM-faster_dev_builds' 2021-01-26 23:47:10 +01:00
mafiesto4 02dde50071 Merge branch 'faster_dev_builds' of git://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-faster_dev_builds 2021-01-26 23:02:59 +01:00
mafiesto4 854d0147dd Fix Visject Node layout when adding boxes from code 2021-01-26 22:52:35 +01:00
mafiesto4 59858ecb27 Fix Visual Script invoke method node signature check for output params passed via reference 2021-01-26 22:52:08 +01:00
mafiesto4 269f1fc8c1 Fix ResizeAuto in SurfaceNode to include custom controls 2021-01-26 22:16:19 +01:00
mafiesto4 4330eb5e4a Merge branch 'W2Wizard-UVTilingOffset' 2021-01-26 21:48:14 +01:00
W2.Wizard db17c80e0a Use approriate fields instead 2021-01-26 19:41:29 +01:00
W2.Wizard 62b3f7c9c2 Adjusted node size 2021-01-26 19:37:06 +01:00
W2.Wizard 96e5e20e66 Added Node 2021-01-26 19:26:38 +01:00
mafiesto4 054aa18e31 Merge branch 'W2Wizard-RemapMaterialNode' 2021-01-26 00:16:17 +01:00
mafiesto4 b6fe228b85 Merge branch 'RemapMaterialNode' of git://github.com/W2Wizard/FlaxEngine into W2Wizard-RemapMaterialNode 2021-01-26 00:16:13 +01:00
W2.Wizard c703064add Added also tryGetValue to ShaderGraph
Since @mafiesto4 requested in the review to use tryGetValye in the VisjectGraph to get the bool param I also did it to the shader one
2021-01-26 00:12:43 +01:00
mafiesto4 4be7e2ad46 Fix 2021-01-26 00:11:25 +01:00
mafiesto4 5260efc7b8 Fixes for editor viewport View context menu 2021-01-26 00:11:20 +01:00
W2.Wizard 44d636520b Applied review changes 2021-01-26 00:04:04 +01:00
mafiesto4 c5934e0dfe Merge branch 'Vizepi-master' 2021-01-26 00:02:12 +01:00
mafiesto4 571c802d49 Merge branch 'master' of git://github.com/Vizepi/FlaxEngine into Vizepi-master 2021-01-26 00:02:08 +01:00
mafiesto4 d098c6cee7 Merge branch 'W2Wizard-SphereMaskNode' 2021-01-25 23:59:14 +01:00
mafiesto4 31e53d5efa Merge branch 'SphereMaskNode' of git://github.com/W2Wizard/FlaxEngine into W2Wizard-SphereMaskNode 2021-01-25 23:59:10 +01:00
mafiesto4 ca32d0d825 Add Mesh::UpdateMesh methods similar to C# API 2021-01-25 23:52:29 +01:00
mafiesto4 5b4dbfa121 Fix name (was causing docs build warning) 2021-01-25 23:52:07 +01:00
W2.Wizard 602fb44a23 Formatting 2021-01-25 22:30:55 +01:00
W2.Wizard 5845bc3fca Added Spheremask node 2021-01-25 22:03:30 +01:00
W2.Wizard f331191e3d Refactored 2021-01-25 19:31:12 +01:00
W2.Wizard c0c2da34d7 Specified variants 2021-01-25 12:37:42 +01:00
W2.Wizard ee166bafed Added initial remap node 2021-01-25 00:51:47 +01:00
mafiesto4 f6085c7479 Fix crash when reloading scripts with opened custom json asset 2021-01-24 23:31:24 +01:00
mafiesto4 f714afc180 Tweak Rotator node 2021-01-24 19:01:25 +01:00
mafiesto4 f6065c4463 Merge branch 'W2Wizard-RotationMaterialNode' 2021-01-24 18:57:53 +01:00
mafiesto4 1824715626 Merge branch 'RotationMaterialNode' of git://github.com/W2Wizard/FlaxEngine into W2Wizard-RotationMaterialNode
# Conflicts:
#	Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp
2021-01-24 18:57:44 +01:00
mafiesto4 b59008182f Merge branch 'stefnotch-document-index-order' 2021-01-24 18:52:13 +01:00
mafiesto4 e99c4abe5e Merge branch 'document-index-order' of git://github.com/stefnotch/FlaxEngine into stefnotch-document-index-order 2021-01-24 18:52:10 +01:00
mafiesto4 f9ba789af3 Add missing node type comment 2021-01-24 18:51:26 +01:00
stefnotch 6f0a556af8 Document the clockwise order of the indices 2021-01-24 16:42:13 +01:00
W2.Wizard bcb38dc2ca Added rotator node 2021-01-24 15:10:38 +01:00
mafiesto4 3a33d6ff84 Fix code style 2021-01-24 14:14:30 +01:00
mafiesto4 cb0518d75a Merge branch 'Evildea-master' 2021-01-24 14:11:58 +01:00
mafiesto4 31ae464d93 Merge branch 'master' of git://github.com/Evildea/FlaxEngine into Evildea-master 2021-01-24 14:11:55 +01:00
mafiesto4 8ff12d079c Merge branch 'W2Wizard-patch-1' 2021-01-24 14:06:17 +01:00
mafiesto4 1969854ed0 Merge branch 'patch-1' of git://github.com/W2Wizard/FlaxEngine into W2Wizard-patch-1 2021-01-24 14:06:13 +01:00
mafiesto4 4c05f8a222 Merge branch 'TalkingWallnut-patch-1' 2021-01-24 14:04:59 +01:00
mafiesto4 6313c8520c Merge branch 'patch-1' of git://github.com/TalkingWallnut/FlaxEngine into TalkingWallnut-patch-1 2021-01-24 14:04:54 +01:00
mafiesto4 f1819ee35c Fix code style 2021-01-24 14:01:42 +01:00
mafiesto4 2563409e6f Merge branch 'intolerantape-CollisionsHelper-Enhancement' 2021-01-24 13:57:51 +01:00
mafiesto4 f64eead2d7 Merge branch 'CollisionsHelper-Enhancement' of git://github.com/intolerantape/FlaxEngine into intolerantape-CollisionsHelper-Enhancement 2021-01-24 13:57:47 +01:00
mafiesto4 67b0e0410c Merge branch 'stefnotch-fix-fade-distance' 2021-01-24 13:55:51 +01:00
mafiesto4 6a6e7195f5 Merge branch 'fix-fade-distance' of git://github.com/stefnotch/FlaxEngine into stefnotch-fix-fade-distance 2021-01-24 13:55:48 +01:00
mafiesto4 b04e1381dc Fix Unsigned Integer value field to prevent negative values 2021-01-24 13:30:48 +01:00
mafiesto4 47bff456e0 Fix foot offset in Character Controller 2021-01-24 13:09:40 +01:00
Richard 7de56304c8 Remove change as it only works for the editor 2021-01-24 22:40:03 +11:00
Richard 843a04604d Added Material Node to Blend Normals 2021-01-24 22:31:45 +11:00
Vizepi 018e751bf6 Added option to invert panning direction in editor viewport 2021-01-24 12:03:38 +01:00
GoaLitiuM 4457bcf4a7 Use more modern file dialog for browsing folders 2021-01-24 02:33:08 +02:00
W2.Wizard bf147ba13a Sentence restructuring 2021-01-23 17:15:46 +01:00
TalkingWallnut 9674f276d3 Fixed the issue when slope limit was set to 90 degrees flax crashed.
I fixed the issue when slope limit was set to 90 degrees flax would commit suicide (crash) (: . I just changed the clamp limit from 90 to 89 degrees.
2021-01-23 15:56:18 +01:00
Richard 71110c9f29 Fixed issue High DPI Issue 2021-01-23 23:39:24 +11:00
intolerantape 54e544a0f2 In CollisionsHelper, added versions of functions with output parameters that return the outputs as said.
Also added a 3D version of ClosestPointPointLine() because why wasn't that a thing?
2021-01-23 03:47:01 -08:00
intolerantape f3f25836e2 Added 3D version of CollisionsHelper::ClosestPointPointLine(). 2021-01-23 03:46:34 -08:00
GoaLitiuM 1a51752ca4 Disable whole program optimization and enable incremental linking in development builds 2021-01-23 12:40:54 +02:00
GoaLitiuM 8c6dbf2e30 Disable linker optimizations with incremental linking 2021-01-23 12:40:53 +02:00
GoaLitiuM d901c11570 Add compile flag for whole program optimization 2021-01-23 12:40:53 +02:00
stefnotch b208b7066b Fix fade distance (use input box as well) 2021-01-23 11:35:50 +01:00
W2.Wizard 83ceb31967 Added contribution guidelines
Since there were no set out guidelines for contributing, I decided to add them.

The guidelines overall are very straightforward.
2021-01-23 01:37:46 +01:00
mafiesto4 049450e31b Fix node widths for anim nodes 2021-01-22 23:45:19 +01:00
mafiesto4 e4fced44a9 Merge branch 'W2Wizard-AnimationArchetypeFix' 2021-01-22 23:42:11 +01:00
mafiesto4 19c65bec33 Merge branch 'AnimationArchetypeFix' of git://github.com/W2Wizard/FlaxEngine into W2Wizard-AnimationArchetypeFix 2021-01-22 23:42:08 +01:00
mafiesto4 0db0fb24c9 Merge branch 'stefnotch-visject-improvements-5' 2021-01-22 23:35:13 +01:00
mafiesto4 704d42869d Merge branch 'visject-improvements-5' of git://github.com/stefnotch/FlaxEngine into stefnotch-visject-improvements-5 2021-01-22 23:35:09 +01:00
W2.Wizard 236a5a2f6f Update Animation.cs 2021-01-22 14:13:45 +01:00
mafiesto4 8680aba897 Fix missing public empty constructor for UICanvas 2021-01-20 13:45:49 +01:00
mafiesto4 8dce3c0fb7 Fix missing animated model parameter error 2021-01-20 13:38:42 +01:00
mafiesto4 f236338311 Merge branch 'stefnotch-patch-1' 2021-01-20 13:19:55 +01:00
mafiesto4 0b1ac3d0fe Merge branch 'patch-1' of git://github.com/stefnotch/FlaxEngine into stefnotch-patch-1 2021-01-20 13:19:52 +01:00
mafiesto4 ec4ccaeba5 Merge branch 'intolerantape-bugfixes' 2021-01-20 13:18:49 +01:00
mafiesto4 214ae3c440 Merge branch 'bugfixes' of git://github.com/intolerantape/FlaxEngine into intolerantape-bugfixes 2021-01-20 13:18:46 +01:00
mafiesto4 ef5e98efaa Fix assertion during engine shutdown after crash during rendering 2021-01-20 13:12:11 +01:00
mafiesto4 ea489fbf2a Fix crash in motion blur tile size calculation 2021-01-20 13:11:45 +01:00
intolerantape 75d197cb84 Spelling fixes. 2021-01-19 23:02:33 -08:00
mafiesto4 6b5ce8c6e2 Merge branch 'stefnotch-patch-2' 2021-01-19 21:53:10 +01:00
mafiesto4 db6a02e20f Merge branch 'patch-2' of git://github.com/stefnotch/FlaxEngine into stefnotch-patch-2 2021-01-19 21:53:07 +01:00
mafiesto4 0a0c856a64 Add more splash screen quotes 2021-01-19 21:10:45 +01:00
stefnotch bd7a681700 Add more descriptive error message 2021-01-19 21:08:26 +01:00
mafiesto4 c4e6d013c1 Add more splash screen quotes 2021-01-18 22:47:31 +01:00
mafiesto4 d17d93c8a5 Merge branch 'jb-perrier-nearequalnode' 2021-01-18 21:10:09 +01:00
mafiesto4 6caffdc23f Merge branch 'nearequalnode' of git://github.com/jb-perrier/FlaxEngine into jb-perrier-nearequalnode 2021-01-18 21:10:05 +01:00
mafiesto4 99b011df8b Merge branch 'W2Wizard-AboutFlaxAdjustment' 2021-01-18 21:07:53 +01:00
mafiesto4 c02faf51a0 Merge branch 'AboutFlaxAdjustment' of git://github.com/W2Wizard/FlaxEngine into W2Wizard-AboutFlaxAdjustment 2021-01-18 21:07:49 +01:00
jb-perrier 50f87c8bfb Remove unused (). 2021-01-17 12:36:53 +01:00
jb-perrier edb103f8e7 Fix NearEqual (GPU Particle) missing implementation. 2021-01-17 12:13:48 +01:00
W2.Wizard 8fd0af3f39 Fixed Typos and padding 2021-01-17 10:18:30 +01:00
stefnotch 4db3c6ca71 Increase default distance between nodes 2021-01-16 19:23:35 +01:00
stefnotch aa4ecab271 Improve Visject bracket positioning 2021-01-16 19:20:36 +01:00
stefnotch 3356013858 Improve empty space finding 2021-01-16 18:16:48 +01:00
stefnotch 8003055ba6 Improve node layout algorithm 2021-01-15 20:23:40 +01:00
stefnotch c112274666 Add additional comments to the formatting algorithm 2021-01-15 19:51:23 +01:00
mafiesto4 f80f7cdd33 Fix crash on Android if GPU doesn't support linear sampling of the shadow map 2021-01-14 22:23:22 +01:00
mafiesto4 b76d5d34ea Fix lambda 2021-01-14 21:21:08 +01:00
mafiesto4 9e3c413c91 Fix crash when using Byte, Int16 or UInt16 as VS parameters 2021-01-13 00:22:52 +01:00
mafiesto4 fd6158e1a9 Fix loading VariantType.Blob 2021-01-12 23:36:50 +01:00
mafiesto4 932de300e4 Fix missing focus for SliderControl 2021-01-12 23:07:20 +01:00
mafiesto4 a3fa8ff9f0 Optimize some includes 2021-01-12 19:17:08 +01:00
mafiesto4 259c419c36 Fix crash when resizing existing MaterialSlots collection for model 2021-01-12 19:09:42 +01:00
mafiesto4 d7696c4765 Split VectorInt into separate files for Int2, Int3 and Int4 2021-01-12 19:09:22 +01:00
mafiesto4 89f25516fc Add inline for float16 compression and add code reference note 2021-01-12 19:05:17 +01:00
mafiesto4 fd268f4e15 Add missing FLAXENGINE_API expose macro to engine math types 2021-01-12 19:00:54 +01:00
stefnotch 5679d86683 Fix tracking mouse offset on high DPI screens 2021-01-12 12:04:30 +01:00
mafiesto4 6252c111b4 Tweak BatteryInfo 2021-01-11 16:38:12 +01:00
stefnotch ab4195ab6c Fix right clicking on Visject boxes
Previously, the primary context menu would get triggered when right clicking on a box, causing some issues
2021-01-11 16:24:41 +01:00
mafiesto4 1d2e2e5575 Merge branch 'jb-perrier-batteryinfo' 2021-01-11 16:13:21 +01:00
mafiesto4 7de0010772 Merge branch 'batteryinfo' of git://github.com/jb-perrier/FlaxEngine into jb-perrier-batteryinfo 2021-01-11 16:13:17 +01:00
mafiesto4 ebe0b9c8c9 Merge branch 'jb-perrier-opendialog' 2021-01-11 15:39:09 +01:00
mafiesto4 fa3b2af0ca Merge branch 'opendialog' of git://github.com/jb-perrier/FlaxEngine into jb-perrier-opendialog 2021-01-11 15:39:06 +01:00
mafiesto4 b446790438 Update shaders 2021-01-11 15:38:22 +01:00
mafiesto4 7ddf98abaa Merge branch 'W2Wizard-typo-fix' 2021-01-11 15:34:46 +01:00
mafiesto4 fb84aa2c4b Merge branch 'typo-fix' of git://github.com/W2Wizard/FlaxEngine into W2Wizard-typo-fix 2021-01-11 15:34:41 +01:00
mafiesto4 023c4f4726 Merge branch 'VNNCC-typo-fix' 2021-01-11 15:33:49 +01:00
mafiesto4 ba1a246a90 Merge branch 'typo-fix' of git://github.com/VNNCC/FlaxEngine into VNNCC-typo-fix 2021-01-11 15:33:45 +01:00
mafiesto4 a664e27772 Add missing event unregister for foliage/terrain tabs 2021-01-11 15:13:47 +01:00
mafiesto4 75b8e0a0f2 Merge branch 'VNNCC-fix-create-terrain-check' 2021-01-11 15:06:48 +01:00
mafiesto4 fc38aff46b Merge branch 'fix-create-terrain-check' of git://github.com/VNNCC/FlaxEngine into VNNCC-fix-create-terrain-check 2021-01-11 15:06:39 +01:00
mafiesto4 1ca31224e2 Fix code style 2021-01-11 15:03:23 +01:00
mafiesto4 c89479b5e7 Merge branch 'jb-perrier-windowstartpos' 2021-01-11 15:00:52 +01:00
mafiesto4 a691f15e1f Merge branch 'windowstartpos' of git://github.com/jb-perrier/FlaxEngine into jb-perrier-windowstartpos 2021-01-11 15:00:48 +01:00
mafiesto4 f0f1863124 Fix code style and move Camera Orientation widget below 2021-01-11 14:58:46 +01:00
mafiesto4 0823e00dfe Merge branch 'jb-perrier-cameraviews' 2021-01-11 14:52:23 +01:00
mafiesto4 43631ceb93 Merge branch 'cameraviews' of git://github.com/jb-perrier/FlaxEngine into jb-perrier-cameraviews 2021-01-11 14:52:19 +01:00
mafiesto4 4bd383f412 Merge branch 'W2Wizard-GoldenRatio' 2021-01-11 14:50:48 +01:00
mafiesto4 caa426767c Merge branch 'GoldenRatio' of git://github.com/W2Wizard/FlaxEngine into W2Wizard-GoldenRatio 2021-01-11 14:50:45 +01:00
stefnotch 7112160de5 Fix dragging existing connection
Undo stack
2021-01-11 13:00:24 +01:00
stefnotch 419ca4e630 Reduce width of mask nodes 2021-01-10 09:56:10 +01:00
jb-perrier 01e904e702 Fixing Windows position (on startup) being always on the top left corner. 2021-01-10 00:17:47 +01:00
stefnotch 9e1c1ecb9a Implement basic node formatter 2021-01-09 21:46:41 +01:00
jb-perrier cd5db384a4 Adding Camera Orientation to editor view menu. 2021-01-09 19:40:06 +01:00
mafiesto4 d586f828b2 Disable Linux CI for now 2021-01-09 18:39:56 +01:00
mafiesto4 f073e07de7 Fix error on CI running on Linux machine 2021-01-09 18:37:05 +01:00
mafiesto4 3f278b603d Fix path separators 2021-01-09 18:24:19 +01:00
mafiesto4 6d0f2b9083 Add CI build action for Linux 2021-01-09 18:21:09 +01:00
mafiesto4 3060a2664d Add executable flag for scripts 2021-01-09 18:20:47 +01:00
mafiesto4 698cfd0c0a Fix BlurPanel crashes due to slider for BlurStrength 2021-01-09 18:09:39 +01:00
mafiesto4 e6bffde301 Merge branch 'gh-actions' 2021-01-09 18:09:09 +01:00
mafiesto4 1b0e57408c Separate checkout steps 2021-01-09 17:43:07 +01:00
mafiesto4 442135047f Use manual LFS checkout 2021-01-09 17:41:56 +01:00
stefnotch ef2dbb7818 Fix double context menu invokation
SurfaceNode.cs already takes care of opening the context menu
2021-01-09 11:26:29 +01:00
W2.Wizard 2d2d45f568 Increased precision by 5 digits 2021-01-08 23:14:09 +01:00
mafiesto4 617e25eb4c Add lfs t repo clone 2021-01-08 23:08:51 +01:00
mafiesto4 24874376c3 Add initial build script for Windows editor and game 2021-01-08 23:00:08 +01:00
W2.Wizard 0d0340e11a Added golden ratio value 2021-01-08 12:06:17 +01:00
VNC 2252cd73f9 Removed unnecessary check 2021-01-07 00:06:43 +01:00
VNC 6deb64e587 Fix to disable terrain and foliage buttons if no scene is present
This will fix the issues described in #99.
2021-01-07 00:02:04 +01:00
mafiesto4 0e768694b5 Add using additional temporary temp param in scripting bindings glue code for array parameters using BytesContainer 2021-01-07 00:01:53 +01:00
mafiesto4 dca6736a6f Inline Vulkan func 2021-01-06 23:53:22 +01:00
W2.Wizard 6f727aa483 Corrected additional typos 2021-01-06 22:20:16 +01:00
VNC 6da5c704b1 Change 'for' to 'to' 2021-01-06 01:03:19 +01:00
W2.Wizard 4d8cc9aef7 Fixed additional typos
Went through the source with VNNCC to correct as many found typos as possible

Co-Authored-By: VNC <52937757+VNNCC@users.noreply.github.com>
2021-01-05 02:14:21 +01:00
VNC 6ab300025b Fixed a ton of typos 2021-01-05 02:13:15 +01:00
W2.Wizard f7c17d96ce Fixed a typo 2021-01-05 01:06:42 +01:00
jb-perrier f5ac18915a Fixing open save dialog. 2021-01-04 22:44:40 +01:00
jb-perrier ed92489a60 Fixing open file dialog. 2021-01-04 21:59:57 +01:00
stefnotch 10cdbc8fbc Add dragging existing connection from input box 2021-01-04 12:33:29 +01:00
jb-perrier 21ec0f103e Implementing GetBatteryInfo() in PlatformBase. 2021-01-02 18:41:00 +01:00
jb-perrier 3ed2e010fa Bumping new file copyright to 2021. 2021-01-02 14:55:30 +01:00
jb-perrier e9f72dbbbf Adding ACLineStatus enum. 2021-01-02 13:15:15 +01:00
jb-perrier 624ab4b8dd Implementing GetBatteryInfo() to Win32Platform. 2021-01-02 12:54:16 +01:00
jb-perrier a4607385fd Adding GetBatteryInfo() to PlatformBase. 2021-01-02 12:53:20 +01:00
jb-perrier 0f2e579674 Create BatteryInfo struct. 2021-01-02 12:51:32 +01:00
243 changed files with 2576 additions and 1218 deletions
+19
View File
@@ -0,0 +1,19 @@
name: Build Linux
on: [push, pull_request]
jobs:
# Game
game-linux:
name: Game (Linux, Release x64)
runs-on: "ubuntu-20.04"
steps:
- name: Checkout repo
uses: actions/checkout@v2
- 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
+34
View File
@@ -0,0 +1,34 @@
name: Build Windows
on: [push, pull_request]
jobs:
# Editor
editor-windows:
name: Editor (Windows, Development x64)
runs-on: "windows-latest"
steps:
- name: Checkout repo
uses: actions/checkout@v2
- 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
# Game
game-windows:
name: Game (Windows, Release x64)
runs-on: "windows-latest"
steps:
- name: Checkout repo
uses: actions/checkout@v2
- 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
+34
View File
@@ -0,0 +1,34 @@
# How to contribute to the FlaxEngine
For any questions, suggestions or help join our discord!
<a href="https://flaxengine.com/discord"><img src="https://discordapp.com/api/guilds/437989205315158016/widget.png"/></a>
Want to see whats planned for Flax?
Go check out our [Trello](https://trello.com/b/NQjLXRCP/flax-roadmap).
## **Found a bug?**
* Avoid opening any new issues without having checked if your problem has already been reported. If there are no currently open issues that fit your problem's description, feel free to [add it](https://github.com/FlaxEngine/FlaxEngine/issues/new).
* When writing an issue make sure to include a clear title and description as well as having filled out all the necessary information, depending on the severity of the issue also include the necessary log files and minidump.
* Try to following the given template when writing a new issue if possible.
## **Want to contribute?**
* Fork the FlaxEngine, create a new branch and push your changes there. Then, create a pull request.
* When creating a PR for fixing an issue/bug make sure to describe as to what led to the fix for better understanding, for small and obvious fixes this is not really needed.
However make sure to mention the relevant issue where it was first reported if possible.
* For feature PR's the first thing you should evaluate is the value of your contribution, as in, what would it bring to this engine? Is it really required?
If its a small change you could preferably suggest it to us on our discord, else feel free to open up a PR for it.
* Ensure when creating a PR that your contribution is well explained with a adequate description and title.
* Generally, good code quality is expected, make sure your contribution works as intended and is appropriately commented where necessary.
Thank you for taking interest in contributing to Flax!
Binary file not shown.
Binary file not shown.
Binary file not shown.
+6
View File
@@ -3,6 +3,12 @@
set -e
testfilesize=$(wc -c < 'Source/Logo.png')
if [ $testfilesize -le 1000 ]; then
echo "CallBuildTool ERROR: Repository was not cloned using Git LFS" 1>&2
exit 1
fi
# Compile the build tool.
xbuild /nologo /verbosity:quiet "Source/Tools/Flax.Build/Flax.Build.csproj" /property:Configuration=Release /property:Platform=AnyCPU /target:Build
@@ -4,6 +4,10 @@ rem Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
if not exist "Development\Scripts\Windows\GetMSBuildPath.bat" goto Error_InvalidLocation
for %%I in (Source\Logo.png) do if %%~zI LSS 2000 (
goto Error_MissingLFS
)
call "Development\Scripts\Windows\GetMSBuildPath.bat"
if errorlevel 1 goto Error_NoVisualStudioEnvironment
@@ -33,6 +37,9 @@ Binaries\Tools\Flax.Build.exe %*
if errorlevel 1 goto Error_FlaxBuildFailed
exit /B 0
:Error_MissingLFS
echo CallBuildTool ERROR: Repository was not cloned using Git LFS
goto Exit
:Error_InvalidLocation
echo CallBuildTool ERROR: The script is in invalid directory.
goto Exit
+1 -1
View File
@@ -3,7 +3,7 @@
"Version": {
"Major": 1,
"Minor": 0,
"Build": 6215
"Build": 6216
},
"Company": "Flax",
"Copyright": "Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.",
+1
View File
@@ -16,6 +16,7 @@ exit /B 0
:BuildToolFailed
echo Flax.Build tool failed.
pause
goto Exit
:Exit
Regular → Executable
View File
Regular → Executable
View File
+6 -5
View File
@@ -26,6 +26,10 @@ This repository contains full source code of the Flax (excluding NDA-protected p
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
@@ -34,7 +38,8 @@ Follow the instructions below to compile and run the engine from source.
* Clone repo (with LFS)
* Run **GenerateProjectFiles.bat**
* Open `Flax.sln` and set solution configuration to **Editor.Development** and solution platform to **Win64**
* Compile Flax project (hit F7 key)
* Set Flax or FlaxEngine as startup project
* Compile Flax project (hit F7 or CTRL+Shift+B)
* Run Flax (hit F5 key)
## Linux
@@ -49,10 +54,6 @@ Follow the instructions below to compile and run the engine from source.
* Open workspace with Visual Code
* Build and run
# 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).
## Workspace directory
- **Binaries/** - executable files
@@ -262,9 +262,9 @@ namespace FlaxEditor.Content.Import
public int BaseLOD { get; set; } = 0;
/// <summary>
/// The amount of LODs to include in the model (all reaming ones starting from Base LOD will be generated).
/// The amount of LODs to include in the model (all remaining ones starting from Base LOD will be generated).
/// </summary>
[EditorOrder(1120), DefaultValue(4), Limit(1, Model.MaxLODs), EditorDisplay("Level Of Detail", "LOD Count"), Tooltip("The amount of LODs to include in the model (all reaming ones starting from Base LOD will be generated).")]
[EditorOrder(1120), DefaultValue(4), Limit(1, Model.MaxLODs), EditorDisplay("Level Of Detail", "LOD Count"), Tooltip("The amount of LODs to include in the model (all remaining ones starting from Base LOD will be generated).")]
public int LODCount { get; set; } = 4;
/// <summary>
@@ -141,7 +141,7 @@ bool AndroidPlatformTools::OnPostProcess(CookingData& data)
const auto c = packageName[i];
if (c != '_' && c != '.' && !StringUtils::IsAlnum(c))
{
LOG(Error, "Android Package Name \'{0}\' contains invalid chaarcter. Only letters, numbers, dots and underscore characters are allowed.", packageName);
LOG(Error, "Android Package Name \'{0}\' contains invalid character. Only letters, numbers, dots and underscore characters are allowed.", packageName);
return true;
}
}
@@ -24,7 +24,7 @@ bool UWPPlatformTools::OnScriptsStepDone(CookingData& data)
const String assembliesPath = data.OutputPath;
if (FileSystem::CopyFile(assembliesPath / TEXT("Newtonsoft.Json.dll"), customBinPath))
{
data.Error(TEXT("Failed to copy deloy custom assembly."));
data.Error(TEXT("Failed to copy deploy custom assembly."));
return true;
}
FileSystem::DeleteFile(assembliesPath / TEXT("Newtonsoft.Json.pdb"));
+1 -1
View File
@@ -48,7 +48,7 @@ public:
/// <summary>
/// Gets the value indicating whenever platform requires AOT.
/// </summary>
/// <returns>True if platform uses AOT and needs C# assemblies to be be precompiled, otherwise false.</returns>
/// <returns>True if platform uses AOT and needs C# assemblies to be precompiled, otherwise false.</returns>
virtual bool UseAOT() const
{
return false;
+1 -1
View File
@@ -60,7 +60,7 @@ bool ValidateStep::Perform(CookingData& data)
AssetInfo info;
if (!Content::GetAssetInfo(GameSettings::FirstScene, info))
{
data.Error(TEXT("Missing first scene."));
data.Error(TEXT("Missing first scene. Set it in the game settings."));
return true;
}
}
@@ -23,7 +23,7 @@ namespace FlaxEditor.CustomEditors.Editors
/// <inheritdoc />
protected override void OnValueChanged()
{
var value = (StaticFlags)element.EnumComboBox.EnumTypeValue;
var value = (StaticFlags)element.ComboBox.EnumTypeValue;
// If selected is single actor that has children, ask if apply flags to the sub objects as well
if (Values.IsSingleObject && (StaticFlags)Values[0] != value && ParentEditor.Values[0] is Actor actor && actor.HasChildren)
@@ -40,7 +40,7 @@ namespace FlaxEditor.CustomEditors.Editors
{
var enumType = Values.Type.Type != typeof(object) || Values[0] == null ? TypeUtils.GetType(Values.Type) : Values[0].GetType();
element = layout.Enum(enumType, null, mode);
element.EnumComboBox.ValueChanged += OnValueChanged;
element.ComboBox.ValueChanged += OnValueChanged;
}
}
@@ -49,7 +49,7 @@ namespace FlaxEditor.CustomEditors.Editors
/// </summary>
protected virtual void OnValueChanged()
{
SetValue(element.EnumComboBox.EnumTypeValue);
SetValue(element.ComboBox.EnumTypeValue);
}
/// <inheritdoc />
@@ -63,7 +63,7 @@ namespace FlaxEditor.CustomEditors.Editors
}
else
{
element.EnumComboBox.EnumTypeValue = Values[0];
element.ComboBox.EnumTypeValue = Values[0];
}
}
}
@@ -16,7 +16,7 @@ namespace FlaxEditor.CustomEditors.Elements
/// <summary>
/// The combo box used to show enum values.
/// </summary>
public EnumComboBox EnumComboBox;
public EnumComboBox ComboBox;
/// <summary>
/// Initializes a new instance of the <see cref="EnumElement"/> class.
@@ -26,10 +26,10 @@ namespace FlaxEditor.CustomEditors.Elements
/// <param name="formatMode">The formatting mode.</param>
public EnumElement(Type type, EnumComboBox.BuildEntriesDelegate customBuildEntriesDelegate = null, EnumDisplayAttribute.FormatMode formatMode = EnumDisplayAttribute.FormatMode.Default)
{
EnumComboBox = new EnumComboBox(type, customBuildEntriesDelegate, formatMode);
ComboBox = new EnumComboBox(type, customBuildEntriesDelegate, formatMode);
}
/// <inheritdoc />
public override Control Control => EnumComboBox;
public override Control Control => ComboBox;
}
}
+1 -1
View File
@@ -43,7 +43,7 @@ public:
public:
/// <summary>
/// The flag used to determine if a project was used with the older engine version last time it was opened. Some cached data should be regenerated to prevent version difference issues. The version number comparision is based on major and minor part of the version. Build number is ignored.
/// The flag used to determine if a project was used with the older engine version last time it was opened. Some cached data should be regenerated to prevent version difference issues. The version number comparison is based on major and minor part of the version. Build number is ignored.
/// </summary>
static bool IsOldProjectOpened;
+1 -1
View File
@@ -221,7 +221,7 @@ namespace FlaxEditor.GUI
}
/// <summary>
/// Filters teh given value using the the <see cref="UseMode"/>.
/// Filters the given value using the <see cref="UseMode"/>.
/// </summary>
/// <param name="mode">The mode.</param>
/// <param name="value">The value to process.</param>
+1 -1
View File
@@ -186,7 +186,7 @@ namespace FlaxEditor.GUI.Dialogs
// Clean up
_window = null;
// Check if any thead is blocked during ShowDialog, then wait for it
// Check if any thread is blocked during ShowDialog, then wait for it
bool wait = true;
while (wait)
{
+1 -1
View File
@@ -64,7 +64,7 @@ namespace FlaxEditor.GUI.Docking
for (int i = 0; i < childPanels.Length; i++)
childPanels[i].Dispose();
// Delete reaming controls (except tabs proxy)
// Delete remaining controls (except tabs proxy)
if (TabsProxy != null)
TabsProxy.Parent = null;
DisposeChildren();
+1 -1
View File
@@ -168,6 +168,7 @@ namespace FlaxEditor.GUI.Input
{
if (button == MouseButton.Left)
{
Focus();
float mousePosition = location.X;
if (_thumbRect.Contains(ref location))
@@ -208,7 +209,6 @@ namespace FlaxEditor.GUI.Input
{
if (button == MouseButton.Left && _isSliding)
{
// End sliding
EndSliding();
return true;
}
+2
View File
@@ -143,6 +143,8 @@ namespace FlaxEditor.GUI.Input
try
{
var value = ShuntingYard.Parse(Text);
if (value < 0)
value = 0;
Value = (uint)value;
}
catch (Exception ex)
+1 -1
View File
@@ -120,7 +120,7 @@ namespace FlaxEditor.GUI
/// <summary>
/// Draws the column.
/// </summary>
/// <param name="rect">The the header area rectangle.</param>
/// <param name="rect">The header area rectangle.</param>
/// <param name="columnIndex">The zero-based index of the column.</param>
protected virtual void DrawColumn(ref Rectangle rect, int columnIndex)
{
@@ -401,7 +401,7 @@ namespace FlaxEditor.GUI
}
/// <summary>
/// Converts the input point from editor editor contents control space into the keyframes time/value coordinates.
/// Converts the input point from editor contents control space into the keyframes time/value coordinates.
/// </summary>
/// <param name="point">The point.</param>
/// <param name="keyframesContentAreaBounds">The keyframes contents area bounds.</param>
@@ -179,7 +179,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
}
/// <summary>
/// Evaluates the member value value at the specified time.
/// Evaluates the member value at the specified time.
/// </summary>
/// <param name="time">The time to evaluate the member at.</param>
/// <returns>The member value at provided time.</returns>
+1 -1
View File
@@ -7,7 +7,7 @@ using FlaxEngine;
namespace FlaxEditor.Gizmo
{
/// <summary>
/// Represents collection of Gizmo tools where one is active and in use.
/// Represents collection of gizmo tools where one is active and in use.
/// </summary>
/// <seealso cref="GizmoBase" />
[HideInEditor]
@@ -45,7 +45,7 @@ namespace FlaxEditor.Gizmo
)
{
// Error
Platform.Fatal("Failed to load Transform Gizmo resources.");
Platform.Fatal("Failed to load transform gizmo resources.");
}
}
@@ -104,7 +104,7 @@ namespace FlaxEditor.Gizmo
public Axis ActiveAxis => _activeAxis;
/// <summary>
/// Gets or sts the current gizmo mode.
/// Gets or sets the current gizmo mode.
/// </summary>
public Mode ActiveMode
{
+2 -2
View File
@@ -151,7 +151,7 @@ namespace FlaxEditor.Gizmo
// Set positions of the gizmo
UpdateGizmoPosition();
// Scale Gizmo to fit on-screen
// Scale gizmo to fit on-screen
Vector3 vLength = Owner.ViewPosition - Position;
float gizmoSize = Editor.Instance.Options.Options.Visual.GizmoSize;
_screenScale = vLength.Length / GizmoScaleFactor * gizmoSize;
@@ -318,7 +318,7 @@ namespace FlaxEditor.Gizmo
}
else if (_activeMode == Mode.Scale)
{
// Apply Scale
// Apply scale
_scaleDelta = delta;
}
}
+1 -1
View File
@@ -74,7 +74,7 @@ namespace FlaxEditor.History
_reverseActions.PushBack(reverse[i]);
}
// Cleanup reaming actions
// Cleanup remaining actions
for (int i = _historyActionsLimit; i < history.Length; i++)
{
history[i].Dispose();
@@ -108,7 +108,7 @@ namespace FlaxEditor.Modules
/// <summary>
/// Removes a quick action by name.
/// </summary>
/// <param name="name">Thr action's name.</param>
/// <param name="name">The action's name.</param>
/// <returns>True when it succeed, false if there is no Quick Action with this name.</returns>
public bool RemoveQuickAction(string name)
{
@@ -410,7 +410,7 @@ namespace FlaxEditor.Modules
{
if (request.Settings != null && entry.TryOverrideSettings(request.Settings))
{
// Use overriden settings
// Use overridden settings
}
else if (!request.SkipSettingsDialog)
{
+3 -3
View File
@@ -276,8 +276,8 @@ namespace FlaxEditor.Modules
// Get metadata
int version = int.Parse(root.Attributes["Version"].Value, CultureInfo.InvariantCulture);
var virtualDesktopBounds = Platform.VirtualDesktopBounds;
var virtualDesktopSafeLeftCorner = virtualDesktopBounds.Location + new Vector2(0, 23); // 23 is a window strip size
var virtualDesktopSafeRightCorner = virtualDesktopBounds.BottomRight - new Vector2(50, 50); // apply some safe area
var virtualDesktopSafeLeftCorner = virtualDesktopBounds.Location;
var virtualDesktopSafeRightCorner = virtualDesktopBounds.BottomRight;
switch (version)
{
@@ -971,7 +971,7 @@ namespace FlaxEditor.Modules
}
#region Window Events
private void OnEditorStateChanged()
{
for (int i = 0; i < Windows.Count; i++)
+28 -10
View File
@@ -143,7 +143,31 @@ namespace FlaxEditor.Options
{
var root = control.Root;
if (root.GetKeyDown(Key))
if (root.GetKey(Key))
{
if (Modifier1 == KeyboardKeys.None || root.GetKey(Modifier1))
{
if (Modifier2 == KeyboardKeys.None || root.GetKey(Modifier2))
{
return true;
}
}
}
return false;
}
/// <summary>
/// Processes this input binding to check if state matches.
/// </summary>
/// <param name="control">The input providing control.</param>
/// <param name="key">The input key.</param>
/// <returns>True if input has been processed, otherwise false.</returns>
public bool Process(Control control, KeyboardKeys key)
{
var root = control.Root;
if (key == Key)
{
if (Modifier1 == KeyboardKeys.None || root.GetKey(Modifier1))
{
@@ -435,16 +459,10 @@ namespace FlaxEditor.Options
for (int i = 0; i < _bindings.Count; i++)
{
var binding = _bindings[i].Binder(options);
if (binding.Key == key)
if (binding.Process(control, key))
{
if (binding.Modifier1 == KeyboardKeys.None || root.GetKey(binding.Modifier1))
{
if (binding.Modifier2 == KeyboardKeys.None || root.GetKey(binding.Modifier2))
{
_bindings[i].Callback();
return true;
}
}
_bindings[i].Callback();
return true;
}
}
+1 -1
View File
@@ -41,7 +41,7 @@ namespace FlaxEditor.Options
private readonly Dictionary<string, CreateCustomSettingsDelegate> _customSettings = new Dictionary<string, CreateCustomSettingsDelegate>();
/// <summary>
/// Gets the custom settings factories. Each entry defines the custom settings type identified by teh given key name. The value si a factory function that returns the default options fpr a given type.
/// Gets the custom settings factories. Each entry defines the custom settings type identified by the given key name. The value is a factory function that returns the default options for a given type.
/// </summary>
public IReadOnlyDictionary<string, CreateCustomSettingsDelegate> CustomSettings => _customSettings;
+7
View File
@@ -45,5 +45,12 @@ namespace FlaxEditor.Options
[DefaultValue(60.0f), Limit(35.0f, 160.0f, 0.1f)]
[EditorDisplay("Defaults", "Default Field Of View"), EditorOrder(140), Tooltip("The default field of view angle (in degrees) for the viewport camera.")]
public float DefaultFieldOfView { get; set; } = 60.0f;
/// <summary>
/// Gets or sets if the panning direction is inverted for the viewport camera.
/// </summary>
[DefaultValue(false)]
[EditorDisplay("Defaults"), EditorOrder(150), Tooltip( "Invert the panning direction for the viewport camera." )]
public bool DefaultInvertPanning { get; set; } = false;
}
}
+1 -1
View File
@@ -79,7 +79,7 @@ namespace FlaxEditor.Progress
}
/// <summary>
/// Called when progress action gets updated (changed nfo text or progress value).
/// Called when progress action gets updated (changed info text or progress value).
/// </summary>
/// <param name="progress">The progress (normalized to range [0;1]).</param>
/// <param name="infoText">The information text.</param>
+2 -2
View File
@@ -204,7 +204,7 @@ bool ProjectInfo::LoadProject(const String& projectPath)
reference.Project = Load(referencePath);
if (reference.Project == nullptr)
{
LOG(Error, "Faield to load referenced project ({0}, from {1})", reference.Name, referencePath);
LOG(Error, "Failed to load referenced project ({0}, from {1})", reference.Name, referencePath);
return true;
}
}
@@ -277,7 +277,7 @@ bool ProjectInfo::LoadOldProject(const String& projectPath)
flaxReference.Project = Load(Globals::StartupFolder / TEXT("Flax.flaxproj"));
if (!flaxReference.Project)
{
ShowProjectLoadError(TEXT("Failed to load Flax Engien project."), projectPath);
ShowProjectLoadError(TEXT("Failed to load Flax Engine project."), projectPath);
return true;
}
@@ -49,7 +49,7 @@ public:
{
if (dwRejectType == SERVERCALL_RETRYLATER)
{
// Retry immediatey
// Retry immediately
return 99;
}
+1 -1
View File
@@ -567,7 +567,7 @@ bool ScriptsBuilderService::Init()
LOG(Warning, "Missing EditorTarget property in opened project, using deducted target name {0}", Editor::Project->EditorTarget);
}
// Remove any reaming files from previous Editor run hot-reloads
// Remove any remaining files from previous Editor run hot-reloads
const Char *target, *platform, *architecture, *configuration;
ScriptsBuilder::GetBinariesConfiguration(target, platform, architecture, configuration);
if (target)
+2 -2
View File
@@ -65,8 +65,8 @@ namespace FlaxEditor.Surface
NodeElementArchetype.Factory.Output(0, "Length", typeof(float), 0),
NodeElementArchetype.Factory.Output(1, "Time", typeof(float), 1),
NodeElementArchetype.Factory.Output(2, "Normalized Time", typeof(float), 2),
NodeElementArchetype.Factory.Output(3, "Reaming Time", typeof(float), 3),
NodeElementArchetype.Factory.Output(4, "Reaming Normalized Time", typeof(float), 4),
NodeElementArchetype.Factory.Output(3, "Remaining Time", typeof(float), 3),
NodeElementArchetype.Factory.Output(4, "Remaining Normalized Time", typeof(float), 4),
}
},
}
@@ -1046,7 +1046,7 @@ namespace FlaxEditor.Surface.Archetypes
startPos += nrm;
endPos += nrm;
// Swap fo the other arrow
// Swap to the other arrow
if (!diff)
{
var tmp = startPos;
@@ -764,8 +764,8 @@ namespace FlaxEditor.Surface.Archetypes
NodeElementArchetype.Factory.Output(0, "Length", typeof(float), 0),
NodeElementArchetype.Factory.Output(1, "Time", typeof(float), 1),
NodeElementArchetype.Factory.Output(2, "Normalized Time", typeof(float), 2),
NodeElementArchetype.Factory.Output(3, "Reaming Time", typeof(float), 3),
NodeElementArchetype.Factory.Output(4, "Reaming Normalized Time", typeof(float), 4),
NodeElementArchetype.Factory.Output(3, "Remaining Time", typeof(float), 3),
NodeElementArchetype.Factory.Output(4, "Remaining Normalized Time", typeof(float), 4),
}
},
new NodeArchetype
@@ -791,7 +791,7 @@ namespace FlaxEditor.Surface.Archetypes
Title = "Transform Node (local space)",
Description = "Transforms the skeleton node",
Flags = NodeFlags.AnimGraph,
Size = new Vector2(270, 130),
Size = new Vector2(280, 130),
DefaultValues = new object[]
{
string.Empty,
@@ -816,7 +816,7 @@ namespace FlaxEditor.Surface.Archetypes
Title = "Transform Node (model space)",
Description = "Transforms the skeleton node",
Flags = NodeFlags.AnimGraph,
Size = new Vector2(270, 130),
Size = new Vector2(280, 130),
DefaultValues = new object[]
{
string.Empty,
@@ -872,7 +872,7 @@ namespace FlaxEditor.Surface.Archetypes
Title = "Get Node Transform (model space)",
Description = "Samples the skeleton node transformation (in model space)",
Flags = NodeFlags.AnimGraph,
Size = new Vector2(250, 40),
Size = new Vector2(324, 40),
DefaultValues = new object[]
{
string.Empty,
@@ -880,7 +880,7 @@ namespace FlaxEditor.Surface.Archetypes
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, string.Empty, true, typeof(void), 0),
NodeElementArchetype.Factory.SkeletonNodeNameSelect(40, Surface.Constants.LayoutOffsetY * 1, 120, 0),
NodeElementArchetype.Factory.SkeletonNodeNameSelect(40, Surface.Constants.LayoutOffsetY * 1, 160, 0),
NodeElementArchetype.Factory.Text(0, Surface.Constants.LayoutOffsetY * 1, "Node:"),
NodeElementArchetype.Factory.Output(0, "Transform", typeof(Transform), 1),
}
@@ -903,7 +903,7 @@ namespace FlaxEditor.Surface.Archetypes
NodeElementArchetype.Factory.Input(0, string.Empty, true, typeof(void), 1),
NodeElementArchetype.Factory.Input(1, "Target", true, typeof(Vector3), 2),
NodeElementArchetype.Factory.Input(2, "Weight", true, typeof(float), 3, 1),
NodeElementArchetype.Factory.SkeletonNodeNameSelect(40, Surface.Constants.LayoutOffsetY * 3, 120, 0),
NodeElementArchetype.Factory.SkeletonNodeNameSelect(40, Surface.Constants.LayoutOffsetY * 3, 160, 0),
NodeElementArchetype.Factory.Text(0, Surface.Constants.LayoutOffsetY * 3, "Node:"),
}
},
@@ -913,7 +913,7 @@ namespace FlaxEditor.Surface.Archetypes
Title = "Get Node Transform (local space)",
Description = "Samples the skeleton node transformation (in local space)",
Flags = NodeFlags.AnimGraph,
Size = new Vector2(250, 40),
Size = new Vector2(316, 40),
DefaultValues = new object[]
{
string.Empty,
@@ -379,7 +379,7 @@ namespace FlaxEditor.Surface.Archetypes
Elements = new[]
{
NodeElementArchetype.Factory.Output(0, "Value", typeof(uint), 0),
NodeElementArchetype.Factory.Integer(0, 0, 0)
NodeElementArchetype.Factory.UnsignedInteger(0, 0, 0, -1, 0, int.MaxValue)
}
},
};
+10 -3
View File
@@ -867,8 +867,15 @@ namespace FlaxEditor.Surface.Archetypes
for (int i = 0; i < signature.Params.Length; i++)
{
ref var param = ref signature.Params[i];
if (param.Type != memberParameters[i].Type || param.IsOut != memberParameters[i].IsOut)
ref var paramMember = ref memberParameters[i];
if (param.Type != paramMember.Type || param.IsOut != paramMember.IsOut)
{
// Special case: param.Type is serialized as just a type while paramMember.Type might be a reference for output parameters (eg. `out Int32` vs `out Int32&`)
var paramMemberTypeName = paramMember.Type.TypeName;
if (param.IsOut && param.IsOut == paramMember.IsOut && paramMember.Type.IsReference && !param.Type.IsReference &&
paramMemberTypeName.Substring(0, paramMemberTypeName.Length - 1) == param.Type.TypeName)
continue;
isInvalid = true;
break;
}
@@ -1176,7 +1183,7 @@ namespace FlaxEditor.Surface.Archetypes
[EditorOrder(0), Tooltip("The name of the parameter."), ExpandGroups]
public string Name;
[EditorOrder(1), Tooltip("The type fo the parameter value.")]
[EditorOrder(1), Tooltip("The type for the parameter value.")]
[TypeReference(typeof(object), nameof(IsTypeValid))]
public ScriptType Type;
@@ -1547,7 +1554,7 @@ namespace FlaxEditor.Surface.Archetypes
// Check if return type has been changed
if (_signature.ReturnType != prevReturnType)
{
// Update all return nodes used by this function to match teh new type
// Update all return nodes used by this function to match the new type
var usedNodes = DepthFirstTraversal(false);
var hasAnyReturnNode = false;
foreach (var node in usedNodes)
@@ -642,6 +642,117 @@ namespace FlaxEditor.Surface.Archetypes
NodeElementArchetype.Factory.Output(0, "XYZ", typeof(Vector3), 0),
}
},
new NodeArchetype
{
TypeID = 26,
Title = "Blend Normals",
Description = "Blend two normal maps to create a single normal map",
Flags = NodeFlags.MaterialGraph,
Size = new Vector2(170, 40),
ConnectionsHints = ConnectionsHint.Vector,
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Base Normal", true, typeof(Vector3), 0),
NodeElementArchetype.Factory.Input(1, "Additional Normal", true, typeof(Vector3), 1),
NodeElementArchetype.Factory.Output(0, "Result", typeof(Vector3), 2)
}
},
new NodeArchetype
{
TypeID = 27,
Title = "Rotator",
Description = "Rotates UV coordinates according to a scalar angle (0-1)",
Flags = NodeFlags.MaterialGraph,
Size = new Vector2(150, 55),
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "UV", true, typeof(Vector2), 0),
NodeElementArchetype.Factory.Input(1, "Center", true, typeof(Vector2), 1),
NodeElementArchetype.Factory.Input(2, "Rotation Angle", true, typeof(float), 2),
NodeElementArchetype.Factory.Output(0, string.Empty, typeof(Vector2), 3),
}
},
new NodeArchetype
{
TypeID = 28,
Title = "Sphere Mask",
Description = "Creates a sphere mask",
Flags = NodeFlags.MaterialGraph,
Size = new Vector2(150, 100),
ConnectionsHints = ConnectionsHint.Vector,
IndependentBoxes = new[]
{
0,
1
},
DefaultValues = new object[]
{
0.3f,
0.5f,
false
},
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "A", true, null, 0),
NodeElementArchetype.Factory.Input(1, "B", true, null, 1),
NodeElementArchetype.Factory.Input(2, "Radius", true, typeof(float), 2, 0),
NodeElementArchetype.Factory.Input(3, "Hardness", true, typeof(float), 3, 1),
NodeElementArchetype.Factory.Input(4, "Invert", true, typeof(bool), 4, 2),
NodeElementArchetype.Factory.Output(0, string.Empty, typeof(float), 5),
}
},
new NodeArchetype
{
TypeID = 29,
Title = "UV Tiling & Offset",
Description = "Takes UVs and applies tiling and offset",
Flags = NodeFlags.MaterialGraph,
Size = new Vector2(175, 60),
DefaultValues = new object[]
{
Vector2.One,
Vector2.Zero
},
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "UV", true, typeof(Vector2), 0),
NodeElementArchetype.Factory.Input(1, "Tiling", true, typeof(Vector2), 1, 0),
NodeElementArchetype.Factory.Input(2, "Offset", true, typeof(Vector2), 2, 1),
NodeElementArchetype.Factory.Output(0, string.Empty, typeof(Vector2), 3),
}
},
new NodeArchetype
{
TypeID = 30,
Title = "DDX",
Description = "Returns the partial derivative of the specified value with respect to the screen-space x-coordinate.",
Flags = NodeFlags.MaterialGraph,
Size = new Vector2(90, 25),
ConnectionsHints = ConnectionsHint.Numeric,
IndependentBoxes = new[] { 0 },
DependentBoxes = new[] { 1 },
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Value", true, null, 0),
NodeElementArchetype.Factory.Output(0, string.Empty, null, 1),
}
},
new NodeArchetype
{
TypeID = 31,
Title = "DDY",
Description = "Returns the partial derivative of the specified value with respect to the screen-space y-coordinate.",
Flags = NodeFlags.MaterialGraph,
Size = new Vector2(90, 25),
ConnectionsHints = ConnectionsHint.Numeric,
IndependentBoxes = new[] { 0 },
DependentBoxes = new[] { 1 },
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Value", true, null, 0),
NodeElementArchetype.Factory.Output(0, string.Empty, null, 1),
}
},
};
}
}
+23
View File
@@ -404,6 +404,29 @@ namespace FlaxEditor.Surface.Archetypes
NodeElementArchetype.Factory.Output(0, "A | B", null, 2),
}
},
new NodeArchetype
{
TypeID = 48,
Title = "Remap",
Description = "Remaps a value from one range to another, so for example having 25 in a range of 0 to 100 being remapped to 0 to 1 would return 0.25",
Flags = NodeFlags.AllGraphs,
Size = new Vector2(175, 75),
DefaultValues = new object[]
{
25.0f,
new Vector2(0.0f, 100.0f),
new Vector2(0.0f, 1.0f),
false
},
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Value", true, typeof(float), 0, 0),
NodeElementArchetype.Factory.Input(1, "In Range", true, typeof(Vector2), 1, 1),
NodeElementArchetype.Factory.Input(2, "Out Range", true, typeof(Vector2), 2, 2),
NodeElementArchetype.Factory.Input(3, "Clamp", true, typeof(bool), 3, 3),
NodeElementArchetype.Factory.Output(0, string.Empty, typeof(float), 4),
}
},
};
}
}
+8 -8
View File
@@ -486,7 +486,7 @@ namespace FlaxEditor.Surface.Archetypes
Description = "Unpack X component from Vector",
Flags = NodeFlags.AllGraphs,
ConnectionsHints = ConnectionsHint.Vector,
Size = new Vector2(160, 30),
Size = new Vector2(110, 30),
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Value", true, null, 0),
@@ -500,7 +500,7 @@ namespace FlaxEditor.Surface.Archetypes
Description = "Unpack Y component from Vector",
Flags = NodeFlags.AllGraphs,
ConnectionsHints = ConnectionsHint.Vector,
Size = new Vector2(160, 30),
Size = new Vector2(110, 30),
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Value", true, null, 0),
@@ -514,7 +514,7 @@ namespace FlaxEditor.Surface.Archetypes
Description = "Unpack Z component from Vector",
Flags = NodeFlags.AllGraphs,
ConnectionsHints = ConnectionsHint.Vector,
Size = new Vector2(160, 30),
Size = new Vector2(110, 30),
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Value", true, null, 0),
@@ -528,7 +528,7 @@ namespace FlaxEditor.Surface.Archetypes
Description = "Unpack W component from Vector",
Flags = NodeFlags.AllGraphs,
ConnectionsHints = ConnectionsHint.Vector,
Size = new Vector2(160, 30),
Size = new Vector2(110, 30),
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Value", true, null, 0),
@@ -544,7 +544,7 @@ namespace FlaxEditor.Surface.Archetypes
Description = "Unpack XY components from Vector",
Flags = NodeFlags.AllGraphs,
ConnectionsHints = ConnectionsHint.Vector,
Size = new Vector2(160, 30),
Size = new Vector2(110, 30),
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Value", true, null, 0),
@@ -558,7 +558,7 @@ namespace FlaxEditor.Surface.Archetypes
Description = "Unpack XZ components from Vector",
Flags = NodeFlags.AllGraphs,
ConnectionsHints = ConnectionsHint.Vector,
Size = new Vector2(160, 30),
Size = new Vector2(110, 30),
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Value", true, null, 0),
@@ -572,7 +572,7 @@ namespace FlaxEditor.Surface.Archetypes
Description = "Unpack YZ components from Vector",
Flags = NodeFlags.AllGraphs,
ConnectionsHints = ConnectionsHint.Vector,
Size = new Vector2(160, 30),
Size = new Vector2(110, 30),
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Value", true, null, 0),
@@ -588,7 +588,7 @@ namespace FlaxEditor.Surface.Archetypes
Description = "Unpack XYZ components from Vector",
Flags = NodeFlags.AllGraphs,
ConnectionsHints = ConnectionsHint.Vector,
Size = new Vector2(160, 30),
Size = new Vector2(110, 30),
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Value", true, null, 0),
@@ -32,7 +32,7 @@ namespace FlaxEditor.Surface.Archetypes
public Dictionary<Type, NodeElementArchetype[]> Prototypes = DefaultPrototypes;
/// <summary>
/// The default prototypes for thr node elements to use for the given parameter type.
/// The default prototypes for the node elements to use for the given parameter type.
/// </summary>
public static readonly Dictionary<Type, NodeElementArchetype[]> DefaultPrototypes = new Dictionary<Type, NodeElementArchetype[]>
{
@@ -338,7 +338,7 @@ namespace FlaxEditor.Surface.Archetypes
Size = new Vector2(300, 600),
DefaultValues = new object[]
{
500, // Capacity
1000, // Capacity
(int)ParticlesSimulationMode.Default, // Simulation Mode
(int)ParticlesSimulationSpace.Local, // Simulation Space
true, // Enable Pooling
+23 -2
View File
@@ -97,7 +97,7 @@ namespace FlaxEditor.Surface.Elements
var connections = Connections.ToArray();
for (int i = 0; i < connections.Length; i++)
{
var targetBox = Connections[i];
var targetBox = connections[i];
// Break connection
Connections.Remove(targetBox);
@@ -565,7 +565,28 @@ namespace FlaxEditor.Surface.Elements
{
_isMouseDown = false;
if (Surface.CanEdit)
Surface.ConnectingStart(this);
{
if (!IsOutput && HasSingleConnection)
{
var connectedBox = Connections[0];
if (Surface.Undo != null)
{
var action = new ConnectBoxesAction((InputBox)this, (OutputBox)connectedBox, false);
BreakConnection(connectedBox);
action.End();
Surface.Undo.AddAction(action);
}
else
{
BreakConnection(connectedBox);
}
Surface.ConnectingStart(connectedBox);
}
else
{
Surface.ConnectingStart(this);
}
}
}
base.OnMouseLeave();
}
@@ -32,8 +32,8 @@ namespace FlaxEditor.Surface.Elements
}
set
{
if (!string.IsNullOrEmpty(value))
SelectedIndex = _nodeNameToIndex[value];
if (!string.IsNullOrEmpty(value) && _nodeNameToIndex.TryGetValue(value, out var index))
SelectedIndex = index;
else
SelectedIndex = -1;
}
@@ -60,8 +60,8 @@ namespace FlaxEditor.Surface.Elements
{
_selectedIndices.Clear();
var selectedNode = (string)ParentNode.Values[Archetype.ValueIndex];
if (!string.IsNullOrEmpty(selectedNode))
_selectedIndices.Add(_nodeNameToIndex[selectedNode]);
if (!string.IsNullOrEmpty(selectedNode) && _nodeNameToIndex.TryGetValue(selectedNode, out var index))
_selectedIndices.Add(index);
OnSelectedIndexChanged();
}
@@ -92,7 +92,7 @@ namespace FlaxEditor.Surface.Elements
{
sb.Clear();
var node = nodes[nodeIndex];
_nodeNameToIndex.Add(node.Name, nodeIndex);
_nodeNameToIndex[node.Name] = nodeIndex;
int parent = node.ParentIndex;
while (parent != -1)
{
@@ -85,7 +85,7 @@ namespace FlaxEditor.Surface.Elements
else if (value is Vector4 valueVec4)
result = (uint)(arch.BoxID == 0 ? valueVec4.X : arch.BoxID == 1 ? valueVec4.Y : arch.BoxID == 2 ? valueVec4.Z : valueVec4.W);
else
result = 0;
result = 0u;
return result;
}
@@ -239,6 +239,32 @@ namespace FlaxEditor.Surface
};
}
/// <summary>
/// Creates new Unsigned Integer value element description.
/// </summary>
/// <param name="x">The x location (in node area space).</param>
/// <param name="y">The y location (in node area space).</param>
/// <param name="valueIndex">The index of the node variable linked as the input. Useful to make a physical connection between input box and default value for it.</param>
/// <param name="component">The index of the component to edit. For vectors this can be set to modify only single component of it. Eg. for vec2 value component set to 1 will edit only Y component. Default value -1 will be used to edit whole value.</param>
/// <param name="valueMin">The minimum value range.</param>
/// <param name="valueMax">The maximum value range.</param>
/// <returns>The archetype.</returns>
public static NodeElementArchetype UnsignedInteger(float x, float y, int valueIndex = -1, int component = -1, uint valueMin = 0, uint valueMax = 1000000)
{
return new NodeElementArchetype
{
Type = NodeElementType.UnsignedIntegerValue,
Position = new Vector2(Constants.NodeMarginX + x, Constants.NodeMarginY + Constants.NodeHeaderSize + y),
Text = null,
Single = false,
ValueIndex = valueIndex,
ValueMin = valueMin,
ValueMax = valueMax,
BoxID = -1,
ConnectionsType = ScriptType.Null
};
}
/// <summary>
/// Creates new Float value element description.
/// </summary>
+5
View File
@@ -94,5 +94,10 @@ namespace FlaxEditor.Surface
/// The actor picker.
/// </summary>
Actor = 19,
/// <summary>
/// The unsigned integer value.
/// </summary>
UnsignedIntegerValue = 20,
}
}
+26 -6
View File
@@ -185,9 +185,9 @@ namespace FlaxEditor.Surface
var rightWidth = 40.0f;
var boxLabelFont = Style.Current.FontSmall;
var titleLabelFont = Style.Current.FontLarge;
for (int i = 0; i < Elements.Count; i++)
for (int i = 0; i < Children.Count; i++)
{
if (Elements[i] is InputBox inputBox)
if (Children[i] is InputBox inputBox)
{
var boxWidth = boxLabelFont.MeasureText(inputBox.Text).X + 20;
if (inputBox.DefaultValueEditor != null)
@@ -195,15 +195,23 @@ namespace FlaxEditor.Surface
leftWidth = Mathf.Max(leftWidth, boxWidth);
leftHeight = Mathf.Max(leftHeight, inputBox.Archetype.Position.Y - Constants.NodeMarginY - Constants.NodeHeaderSize + 20.0f);
}
else if (Elements[i] is OutputBox outputBox)
else if (Children[i] is OutputBox outputBox)
{
rightWidth = Mathf.Max(rightWidth, boxLabelFont.MeasureText(outputBox.Text).X + 20);
rightHeight = Mathf.Max(rightHeight, outputBox.Archetype.Position.Y - Constants.NodeMarginY - Constants.NodeHeaderSize + 20.0f);
}
else if (Elements[i] is Control control)
else if (Children[i] is Control control)
{
width = Mathf.Max(width, control.Width + 10);
height = Mathf.Max(height, control.Height + 10);
if (control.AnchorPreset == AnchorPresets.TopLeft)
{
width = Mathf.Max(width, control.Right + 4 - Constants.NodeMarginX);
height = Mathf.Max(height, control.Bottom + 4 - Constants.NodeMarginY - Constants.NodeHeaderSize);
}
else
{
width = Mathf.Max(width, control.Width + 4);
height = Mathf.Max(height, control.Height + 4);
}
}
}
width = Mathf.Max(width, leftWidth + rightWidth + 10);
@@ -267,6 +275,9 @@ namespace FlaxEditor.Surface
case NodeElementType.Actor:
element = new ActorSelect(this, arch);
break;
case NodeElementType.UnsignedIntegerValue:
element = new UnsignedIntegerValue(this, arch);
break;
//default: throw new NotImplementedException("Unknown node element type: " + arch.Type);
}
if (element != null)
@@ -303,12 +314,16 @@ namespace FlaxEditor.Surface
{
if (type == ScriptType.Null)
type = new ScriptType(typeof(object));
// Try to reuse box
var box = GetBox(id);
if ((isOut && box is InputBox) || (!isOut && box is OutputBox))
{
box.Dispose();
box = null;
}
// Create new if missing
if (box == null)
{
if (isOut)
@@ -319,10 +334,15 @@ namespace FlaxEditor.Surface
}
else
{
// Sync properties for exiting box
box.Text = text;
box.CurrentType = type;
box.Y = Constants.NodeMarginY + Constants.NodeHeaderSize + yLevel * Constants.LayoutOffsetY;
}
// Update box
box.OnConnectionsChanged();
return box;
}
@@ -15,6 +15,7 @@ namespace FlaxEditor.Surface
{
private ContextMenuButton _cmCopyButton;
private ContextMenuButton _cmDuplicateButton;
private ContextMenuButton _cmFormatNodesConnectionButton;
private ContextMenuButton _cmRemoveNodeConnectionsButton;
private ContextMenuButton _cmRemoveBoxConnectionsButton;
private readonly Vector2 ContextMenuOffset = new Vector2(5);
@@ -216,6 +217,13 @@ namespace FlaxEditor.Surface
}
}).Enabled = Nodes.Any(x => x.Breakpoint.Set && x.Breakpoint.Enabled);
}
menu.AddSeparator();
_cmFormatNodesConnectionButton = menu.AddButton("Format node(s)", () =>
{
FormatGraph(SelectedNodes);
});
_cmFormatNodesConnectionButton.Enabled = HasNodesSelection;
menu.AddSeparator();
_cmRemoveNodeConnectionsButton = menu.AddButton("Remove all connections to that node(s)", () =>
@@ -107,7 +107,7 @@ namespace FlaxEditor.Surface
/// Validates the parameter drag operation.
/// </summary>
/// <param name="parameterName">Name of the parameter.</param>
/// <returns>Tre if can drag that parameter, otherwise false.</returns>
/// <returns>True if can drag that parameter, otherwise false.</returns>
protected virtual bool ValidateDragParameter(string parameterName)
{
return GetParameter(parameterName) != null;
@@ -0,0 +1,287 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FlaxEngine;
using FlaxEditor.Surface.Elements;
using FlaxEditor.Surface.Undo;
namespace FlaxEditor.Surface
{
public partial class VisjectSurface
{
// Reference https://github.com/stefnotch/xnode-graph-formatter/blob/812e08e71c7b9b7eb0810dbdfb0a9a1034da6941/Assets/Examples/MathGraph/Editor/MathGraphEditor.cs
private class NodeFormattingData
{
/// <summary>
/// Starting from 0 at the main nodes
/// </summary>
public int Layer;
/// <summary>
/// Position in the layer
/// </summary>
public int Offset;
/// <summary>
/// How far the subtree needs to be moved additionally
/// </summary>
public int SubtreeOffset;
}
/// <summary>
/// Formats a graph where the nodes can be disjointed.
/// Uses the Sugiyama method
/// </summary>
/// <param name="nodes">List of nodes</param>
protected void FormatGraph(List<SurfaceNode> nodes)
{
if (nodes.Count <= 1 || !CanEdit) return;
var nodesToVisit = new HashSet<SurfaceNode>(nodes);
// While we haven't formatted every node
while (nodesToVisit.Count > 0)
{
// Run a search in both directions
var connectedNodes = new List<SurfaceNode>();
var queue = new Queue<SurfaceNode>();
var startNode = nodesToVisit.First();
nodesToVisit.Remove(startNode);
queue.Enqueue(startNode);
while (queue.Count > 0)
{
var node = queue.Dequeue();
connectedNodes.Add(node);
for (int i = 0; i < node.Elements.Count; i++)
{
if (node.Elements[i] is Box box)
{
for (int j = 0; j < box.Connections.Count; j++)
{
if (nodesToVisit.Contains(box.Connections[j].ParentNode))
{
nodesToVisit.Remove(box.Connections[j].ParentNode);
queue.Enqueue(box.Connections[j].ParentNode);
}
}
}
}
}
FormatConnectedGraph(connectedNodes);
}
}
/// <summary>
/// Formats a graph where all nodes are connected
/// </summary>
/// <param name="nodes">List of connected nodes</param>
protected void FormatConnectedGraph(List<SurfaceNode> nodes)
{
if (nodes.Count <= 1 || !CanEdit) return;
var boundingBox = GetNodesBounds(nodes);
var nodeData = nodes.ToDictionary(n => n, n => new NodeFormattingData { });
// Rightmost nodes with none of our nodes to the right of them
var endNodes = nodes
.Where(n => !n.GetBoxes().Any(b => b.IsOutput && b.Connections.Any(c => nodeData.ContainsKey(c.ParentNode))))
.OrderBy(n => n.Top) // Keep their relative order
.ToList();
// Longest path layering
int maxLayer = SetLayers(nodeData, endNodes);
// Set the vertical offsets
int maxOffset = SetOffsets(nodeData, endNodes, maxLayer);
// Layout the nodes
// Get the largest nodes in the Y and X direction
float[] widths = new float[maxLayer + 1];
float[] heights = new float[maxOffset + 1];
for (int i = 0; i < nodes.Count; i++)
{
if (nodeData.TryGetValue(nodes[i], out var data))
{
if (nodes[i].Width > widths[data.Layer])
{
widths[data.Layer] = nodes[i].Width;
}
if (nodes[i].Height > heights[data.Offset])
{
heights[data.Offset] = nodes[i].Height;
}
}
}
Vector2 minDistanceBetweenNodes = new Vector2(30, 30);
// Figure out the node positions (aligned to a grid)
float[] nodeXPositions = new float[widths.Length];
for (int i = 1; i < widths.Length; i++)
{
// Go from right to left (backwards) through the nodes
nodeXPositions[i] = nodeXPositions[i - 1] + minDistanceBetweenNodes.X + widths[i];
}
float[] nodeYPositions = new float[heights.Length];
for (int i = 1; i < heights.Length; i++)
{
// Go from top to bottom through the nodes
nodeYPositions[i] = nodeYPositions[i - 1] + heights[i - 1] + minDistanceBetweenNodes.Y;
}
// Set the node positions
var undoActions = new List<MoveNodesAction>();
var topRightPosition = endNodes[0].Location;
for (int i = 0; i < nodes.Count; i++)
{
if (nodeData.TryGetValue(nodes[i], out var data))
{
Vector2 newLocation = new Vector2(-nodeXPositions[data.Layer], nodeYPositions[data.Offset]) + topRightPosition;
Vector2 locationDelta = newLocation - nodes[i].Location;
nodes[i].Location = newLocation;
if (Undo != null)
undoActions.Add(new MoveNodesAction(Context, new[] { nodes[i].ID }, locationDelta));
}
}
MarkAsEdited(false);
Undo?.AddAction(new MultiUndoAction(undoActions, "Format nodes"));
}
/// <summary>
/// Assigns a layer to every node
/// </summary>
/// <param name="nodeData">The exta node data</param>
/// <param name="endNodes">The end nodes</param>
/// <returns>The number of the maximum layer</returns>
private int SetLayers(Dictionary<SurfaceNode, NodeFormattingData> nodeData, List<SurfaceNode> endNodes)
{
// Longest path layering
int maxLayer = 0;
var stack = new Stack<SurfaceNode>(endNodes);
while (stack.Count > 0)
{
var node = stack.Pop();
int layer = nodeData[node].Layer;
for (int i = 0; i < node.Elements.Count; i++)
{
if (node.Elements[i] is InputBox box && box.HasAnyConnection)
{
var childNode = box.Connections[0].ParentNode;
if (nodeData.TryGetValue(childNode, out var data))
{
int nodeLayer = Math.Max(data.Layer, layer + 1);
data.Layer = nodeLayer;
if (nodeLayer > maxLayer)
{
maxLayer = nodeLayer;
}
stack.Push(childNode);
}
}
}
}
return maxLayer;
}
/// <summary>
/// Sets the node offsets
/// </summary>
/// <param name="nodeData">The exta node data</param>
/// <param name="endNodes">The end nodes</param>
/// <param name="maxLayer">The number of the maximum layer</param>
/// <returns>The number of the maximum offset</returns>
private int SetOffsets(Dictionary<SurfaceNode, NodeFormattingData> nodeData, List<SurfaceNode> endNodes, int maxLayer)
{
int maxOffset = 0;
// Keeps track of the largest offset (Y axis) for every layer
int[] offsets = new int[maxLayer + 1];
var visitedNodes = new HashSet<SurfaceNode>();
void SetOffsets(SurfaceNode node, NodeFormattingData straightParentData)
{
if (!nodeData.TryGetValue(node, out var data)) return;
// If we realize that the current node would collide with an already existing node in this layer
if (data.Layer >= 0 && offsets[data.Layer] > data.Offset)
{
// Move the entire sub-tree down
straightParentData.SubtreeOffset = Math.Max(straightParentData.SubtreeOffset, offsets[data.Layer] - data.Offset);
}
// Keeps track of the offset of the last direct child we visited
int childOffset = data.Offset;
bool straightChild = true;
// Run the algorithm for every child
for (int i = 0; i < node.Elements.Count; i++)
{
if (node.Elements[i] is InputBox box && box.HasAnyConnection)
{
var childNode = box.Connections[0].ParentNode;
if (!visitedNodes.Contains(childNode) && nodeData.TryGetValue(childNode, out var childData))
{
visitedNodes.Add(childNode);
childData.Offset = childOffset;
SetOffsets(childNode, straightChild ? straightParentData : childData);
childOffset = childData.Offset + 1;
straightChild = false;
}
}
}
if (data.Layer >= 0)
{
// When coming out of the recursion, apply the extra subtree offsets
data.Offset += straightParentData.SubtreeOffset;
if (data.Offset > maxOffset)
{
maxOffset = data.Offset;
}
offsets[data.Layer] = data.Offset + 1;
}
}
{
// An imaginary final node
var endNodeData = new NodeFormattingData { Layer = -1 };
int childOffset = 0;
bool straightChild = true;
for (int i = 0; i < endNodes.Count; i++)
{
if (nodeData.TryGetValue(endNodes[i], out var childData))
{
visitedNodes.Add(endNodes[i]);
childData.Offset = childOffset;
SetOffsets(endNodes[i], straightChild ? endNodeData : childData);
childOffset = childData.Offset + 1;
straightChild = false;
}
}
}
return maxOffset;
}
}
}
+28 -42
View File
@@ -24,7 +24,9 @@ namespace FlaxEditor.Surface
private class InputBracket
{
private readonly float DefaultWidth = 120f;
private readonly Margin _padding = new Margin(10f);
public Box Box { get; }
public Vector2 EndBracketPosition { get; }
public List<SurfaceNode> Nodes { get; } = new List<SurfaceNode>();
@@ -33,7 +35,7 @@ namespace FlaxEditor.Surface
public InputBracket(Box box, Vector2 nodePosition)
{
Box = box;
EndBracketPosition = nodePosition;
EndBracketPosition = nodePosition + new Vector2(DefaultWidth, 0);
Update();
}
@@ -47,11 +49,10 @@ namespace FlaxEditor.Surface
}
else
{
area = new Rectangle(EndBracketPosition, new Vector2(120f, 80f));
area = new Rectangle(EndBracketPosition, new Vector2(DefaultWidth, 80f));
}
_padding.ExpandRectangle(ref area);
Vector2 endPoint = area.Location + new Vector2(area.Width, area.Height / 2f);
Vector2 offset = EndBracketPosition - endPoint;
Vector2 offset = EndBracketPosition - area.UpperRight;
area.Location += offset;
Area = area;
if (!offset.IsZero)
@@ -99,18 +100,6 @@ namespace FlaxEditor.Surface
/// </summary>
public event Window.MouseWheelDelegate CustomMouseWheel;
/// <summary>
/// Gets the node under the mouse location.
/// </summary>
/// <returns>The node or null if no intersection.</returns>
public SurfaceNode GetNodeUnderMouse()
{
var pos = _rootControl.PointFromParent(ref _mousePos);
if (_rootControl.GetChildAt(pos) is SurfaceNode node)
return node;
return null;
}
/// <summary>
/// Gets the control under the mouse location.
/// </summary>
@@ -118,9 +107,7 @@ namespace FlaxEditor.Surface
public SurfaceControl GetControlUnderMouse()
{
var pos = _rootControl.PointFromParent(ref _mousePos);
if (_rootControl.GetChildAtRecursive(pos) is SurfaceControl control)
return control;
return null;
return _rootControl.GetChildAt(pos) as SurfaceControl;
}
private void UpdateSelectionRectangle()
@@ -464,15 +451,7 @@ namespace FlaxEditor.Surface
{
// Check if any control is under the mouse
_cmStartPos = location;
if (controlUnderMouse != null)
{
if (!HasNodesSelection)
Select(controlUnderMouse);
// Show secondary context menu
ShowSecondaryCM(_cmStartPos, controlUnderMouse);
}
else
if (controlUnderMouse == null)
{
// Show primary context menu
ShowPrimaryMenu(_cmStartPos);
@@ -708,31 +687,38 @@ namespace FlaxEditor.Surface
private Vector2 FindEmptySpace(Box box)
{
int boxIndex = 0;
Vector2 distanceBetweenNodes = new Vector2(30, 30);
var node = box.ParentNode;
// Same height as node
float yLocation = node.Top;
for (int i = 0; i < node.Elements.Count; i++)
{
// Box on the same side above the current box
if (node.Elements[i] is Box nodeBox && nodeBox.IsOutput == box.IsOutput && nodeBox.Y < box.Y)
{
boxIndex++;
// Below connected node
yLocation = Mathf.Max(yLocation, nodeBox.ParentNode.Bottom + distanceBetweenNodes.Y);
}
}
// TODO: Dodge the other nodes
Vector2 distanceBetweenNodes = new Vector2(40, 20);
const float NodeHeight = 120;
float xLocation = node.Location.X;
if (box.IsOutput)
{
xLocation += node.Width + distanceBetweenNodes.X;
}
else
{
xLocation += -120 - distanceBetweenNodes.X;
}
float direction = box.IsOutput ? 1 : -1;
Vector2 newNodeLocation = node.Location +
new Vector2(
(node.Width + distanceBetweenNodes.X) * direction,
boxIndex * (NodeHeight + distanceBetweenNodes.Y)
);
return newNodeLocation;
return new Vector2(
xLocation,
yLocation
);
}
}
}
+1 -1
View File
@@ -71,7 +71,7 @@ namespace FlaxEditor.Surface
// Check if has cached groups
if (_cache.Count != 0)
{
// Check if context menu doesn;t have the recent cached groups
// Check if context menu doesn't have the recent cached groups
if (!contextMenu.Groups.Any(g => g.Archetype.Tag is int asInt && asInt == _version))
{
var groups = contextMenu.Groups.Where(g => g.Archetype.Tag is int).ToArray();
+32 -2
View File
@@ -21,6 +21,7 @@ namespace FlaxEditor.Tools.Foliage
private readonly Tabs _modes;
private readonly ContainerControl _noFoliagePanel;
private int _selectedFoliageTypeIndex = -1;
private Button _createNewFoliage;
/// <summary>
/// The editor instance.
@@ -99,6 +100,7 @@ namespace FlaxEditor.Tools.Foliage
public FoliageTab(SpriteHandle icon, Editor editor)
: base(string.Empty, icon)
{
Level.SceneLoaded += OnSceneLoaded;
Editor = editor;
Editor.SceneEditing.SelectionChanged += OnSelectionChanged;
@@ -135,14 +137,31 @@ namespace FlaxEditor.Tools.Foliage
Offsets = Margin.Zero,
Parent = _noFoliagePanel
};
var noFoliageButton = new Button
_createNewFoliage = new Button
{
Text = "Create new foliage",
AnchorPreset = AnchorPresets.MiddleCenter,
Offsets = new Margin(-60, 120, -12, 24),
Parent = _noFoliagePanel,
Enabled = false
};
noFoliageButton.Clicked += OnCreateNewFoliageClicked;
_createNewFoliage.Clicked += OnCreateNewFoliageClicked;
}
private void OnSceneLoaded(Scene arg1, Guid arg2)
{
_createNewFoliage.Enabled = true;
Level.SceneUnloaded += OnSceneUnloaded;
Level.SceneLoaded -= OnSceneLoaded;
}
private void OnSceneUnloaded(Scene arg1, Guid arg2)
{
_createNewFoliage.Enabled = false;
Level.SceneLoaded += OnSceneLoaded;
Level.SceneUnloaded -= OnSceneUnloaded;
}
private void OnSelected(Tab tab)
@@ -248,5 +267,16 @@ namespace FlaxEditor.Tools.Foliage
{
SelectedFoliageTypesChanged?.Invoke();
}
/// <inheritdoc />
public override void OnDestroy()
{
if (_createNewFoliage.Enabled)
Level.SceneUnloaded -= OnSceneUnloaded;
else
Level.SceneLoaded -= OnSceneLoaded;
base.OnDestroy();
}
}
}
+33 -3
View File
@@ -18,6 +18,7 @@ namespace FlaxEditor.Tools.Terrain
{
private readonly Tabs _modes;
private readonly ContainerControl _noTerrainPanel;
private readonly Button _createTerrainButton;
/// <summary>
/// The editor instance.
@@ -57,6 +58,7 @@ namespace FlaxEditor.Tools.Terrain
public CarveTab(SpriteHandle icon, Editor editor)
: base(string.Empty, icon)
{
Level.SceneLoaded += OnSceneLoaded;
Editor = editor;
Editor.SceneEditing.SelectionChanged += OnSelectionChanged;
@@ -93,14 +95,31 @@ namespace FlaxEditor.Tools.Terrain
Offsets = Margin.Zero,
Parent = _noTerrainPanel
};
var noTerrainButton = new Button
_createTerrainButton = new Button
{
Text = "Create new terrain",
AnchorPreset = AnchorPresets.MiddleCenter,
Offsets = new Margin(-60, 120, -12, 24),
Parent = _noTerrainPanel
Parent = _noTerrainPanel,
Enabled = false
};
noTerrainButton.Clicked += OnCreateNewTerrainClicked;
_createTerrainButton.Clicked += OnCreateNewTerrainClicked;
}
private void OnSceneLoaded(Scene arg1, Guid arg2)
{
_createTerrainButton.Enabled = true;
Level.SceneUnloaded += OnSceneUnloaded;
Level.SceneLoaded -= OnSceneLoaded;
}
private void OnSceneUnloaded(Scene arg1, Guid arg2)
{
_createTerrainButton.Enabled = false;
Level.SceneLoaded += OnSceneLoaded;
Level.SceneUnloaded -= OnSceneUnloaded;
}
private void OnSelected(Tab tab)
@@ -183,5 +202,16 @@ namespace FlaxEditor.Tools.Terrain
default: throw new IndexOutOfRangeException("Invalid carve tab mode.");
}
}
/// <inheritdoc />
public override void OnDestroy()
{
if (_createTerrainButton.Enabled)
Level.SceneUnloaded -= OnSceneUnloaded;
else
Level.SceneLoaded -= OnSceneLoaded;
base.OnDestroy();
}
}
}
+1 -1
View File
@@ -33,7 +33,7 @@ namespace FlaxEditor.Tools.Terrain.Paint
}
/// <summary>
/// The tool strength (normalized to range 0-1). Defines the intensity of the paint operation to make it stronger or mre subtle.
/// The tool strength (normalized to range 0-1). Defines the intensity of the paint operation to make it stronger or more subtle.
/// </summary>
[EditorOrder(0), Limit(0, 10, 0.01f), Tooltip("The tool strength (normalized to range 0-1). Defines the intensity of the paint operation to make it stronger or more subtle.")]
public float Strength = 1.0f;
+1 -1
View File
@@ -33,7 +33,7 @@ namespace FlaxEditor.Tools.Terrain.Sculpt
}
/// <summary>
/// The tool strength (normalized to range 0-1). Defines the intensity of the sculpt operation to make it stronger or mre subtle.
/// The tool strength (normalized to range 0-1). Defines the intensity of the sculpt operation to make it stronger or more subtle.
/// </summary>
[EditorOrder(0), Limit(0, 6, 0.01f), Tooltip("The tool strength (normalized to range 0-1). Defines the intensity of the sculpt operation to make it stronger or more subtle.")]
public float Strength = 1.2f;
+1 -1
View File
@@ -2,7 +2,7 @@
#include "TerrainTools.h"
#include "Engine/Core/Cache.h"
#include "Engine/Core/Math/VectorInt.h"
#include "Engine/Core/Math/Int2.h"
#include "Engine/Core/Math/Color32.h"
#include "Engine/Core/Collections/CollectionPoolCache.h"
#include "Engine/Terrain/TerrainPatch.h"
+1 -1
View File
@@ -49,7 +49,7 @@ namespace FlaxEditor.Tools
set => Tab._gizmoMode.BrushStrength = value;
}
[EditorOrder(20), EditorDisplay("Brush"), Limit(0.0f, 1.0f, 0.01f), Tooltip("The falloff parameter fo the brush. Adjusts the paint strength for the vertices that are far from the brush center. Use lower values to make painting smoother and softer.")]
[EditorOrder(20), EditorDisplay("Brush"), Limit(0.0f, 1.0f, 0.01f), Tooltip("The falloff parameter for the brush. Adjusts the paint strength for the vertices that are far from the brush center. Use lower values to make painting smoother and softer.")]
public float BrushFalloff
{
get => Tab._gizmoMode.BrushFalloff;
+1 -3
View File
@@ -6,10 +6,8 @@
#include "Engine/Core/Log.h"
#include "Engine/Graphics/Textures/TextureData.h"
#include "Engine/Graphics/PixelFormatExtensions.h"
#include "Engine/Serialization/FileReadStream.h"
#include "Engine/Tools/TextureTool/TextureTool.h"
#include "Engine/Core/Math/Color32.h"
#include "Engine/Core/Math/VectorInt.h"
#include "Engine/Core/Config/GameSettings.h"
#include "Engine/Content/Content.h"
#include "Engine/Content/AssetReference.h"
@@ -247,7 +245,7 @@ void UpdateIconData(uint8* iconData, const TextureData* icon)
iconTexSize = Math::RoundUpToPowerOf2(width);
}
// Try to pick a proper mip (requrie the same size)
// Try to pick a proper mip (require the same size)
const TextureMipData* srcPixels = nullptr;
int32 mipLevels = icon->GetMipLevels();
for (int32 mipIndex = 0; mipIndex < mipLevels; mipIndex++)
+1 -1
View File
@@ -251,7 +251,7 @@ namespace FlaxEditor.Utilities
var list = new List<MemberComparison>();
#if DEBUG_OBJECT_SNAPSHOT_COMPARISION
Debug.Logger.LogHandler.LogWrite(LogType.Warning, "-------------- Comparision --------------");
Debug.Logger.LogHandler.LogWrite(LogType.Warning, "-------------- Comparison --------------");
#endif
for (int i = _members.Count - 1; i >= 0; i--)
{
@@ -126,7 +126,7 @@ namespace FlaxEditor.Utilities
/// </summary>
/// <param name="oper1">The first operator.</param>
/// <param name="oper2">The second operator.</param>
/// <returns>The comparision result.</returns>
/// <returns>The comparison result.</returns>
private static bool CompareOperators(string oper1, string oper2)
{
var op1 = Operators[oper1];
+2
View File
@@ -742,6 +742,7 @@ namespace FlaxEditor.Utilities
case VariantType.Array: return new ScriptType(typeof(object[]));
case VariantType.Dictionary: return new ScriptType(typeof(Dictionary<object, object>));
case VariantType.ManagedObject: return new ScriptType(typeof(object));
case VariantType.Blob: return new ScriptType(typeof(byte[]));
default: throw new ArgumentOutOfRangeException($"Unknown Variant Type {variantType} without typename.");
}
}
@@ -805,6 +806,7 @@ namespace FlaxEditor.Utilities
case VariantType.Array: return typeof(object[]);
case VariantType.Dictionary: return typeof(Dictionary<object, object>);
case VariantType.ManagedObject: return typeof(object);
case VariantType.Blob: return typeof(byte[]);
default: throw new ArgumentOutOfRangeException($"Unknown Variant Type {variantType} without typename.");
}
}
+11 -3
View File
@@ -24,7 +24,7 @@ namespace FlaxEditor.Viewport.Cameras
public bool IsAnimatingMove => _moveStartTime > Mathf.Epsilon;
/// <summary>
/// The target point location. It's used to orbit around it whe user clicks Alt+LMB.
/// The target point location. It's used to orbit around it when user clicks Alt+LMB.
/// </summary>
public Vector3 TargetPoint = new Vector3(-200);
@@ -188,8 +188,16 @@ namespace FlaxEditor.Viewport.Cameras
if (input.IsPanning)
{
var panningSpeed = 0.8f;
position -= right * (mouseDelta.X * panningSpeed);
position -= up * (mouseDelta.Y * panningSpeed);
if (Viewport.InvertPanning)
{
position += up * (mouseDelta.Y * panningSpeed);
position += right * (mouseDelta.X * panningSpeed);
}
else
{
position -= right * (mouseDelta.X * panningSpeed);
position -= up * (mouseDelta.Y * panningSpeed);
}
}
// Move
@@ -32,9 +32,9 @@ namespace FlaxEditor.Viewport.Cameras
/// </summary>
/// <param name="objectBounds">The target object bounds.</param>
/// <param name="marginDistanceScale">The margin distance scale of the orbit radius.</param>
public void SerArcBallView(BoundingBox objectBounds, float marginDistanceScale = 2.0f)
public void SetArcBallView(BoundingBox objectBounds, float marginDistanceScale = 2.0f)
{
SerArcBallView(BoundingSphere.FromBox(objectBounds), marginDistanceScale);
SetArcBallView(BoundingSphere.FromBox(objectBounds), marginDistanceScale);
}
/// <summary>
@@ -42,18 +42,18 @@ namespace FlaxEditor.Viewport.Cameras
/// </summary>
/// <param name="objectBounds">The target object bounds.</param>
/// <param name="marginDistanceScale">The margin distance scale of the orbit radius.</param>
public void SerArcBallView(BoundingSphere objectBounds, float marginDistanceScale = 2.0f)
public void SetArcBallView(BoundingSphere objectBounds, float marginDistanceScale = 2.0f)
{
SerArcBallView(new Quaternion(-0.08f, -0.92f, 0.31f, -0.23f), objectBounds.Center, objectBounds.Radius * marginDistanceScale);
SetArcBallView(new Quaternion(-0.08f, -0.92f, 0.31f, -0.23f), objectBounds.Center, objectBounds.Radius * marginDistanceScale);
}
/// <summary>
/// Sets view orientation and position to match the arc ball camera style view for the given orbit radius.
/// </summary>
/// <param name="orbitRadius">The orbit radius.</param>
public void SerArcBallView(float orbitRadius)
public void SetArcBallView(float orbitRadius)
{
SerArcBallView(new Quaternion(-0.08f, -0.92f, 0.31f, -0.23f), Vector3.Zero, orbitRadius);
SetArcBallView(new Quaternion(-0.08f, -0.92f, 0.31f, -0.23f), Vector3.Zero, orbitRadius);
}
/// <summary>
@@ -62,7 +62,7 @@ namespace FlaxEditor.Viewport.Cameras
/// <param name="orientation">The view rotation.</param>
/// <param name="orbitCenter">The orbit center location.</param>
/// <param name="orbitRadius">The orbit radius.</param>
public void SerArcBallView(Quaternion orientation, Vector3 orbitCenter, float orbitRadius)
public void SetArcBallView(Quaternion orientation, Vector3 orbitCenter, float orbitRadius)
{
// Rotate
Viewport.ViewOrientation = orientation;
+85 -21
View File
@@ -138,9 +138,7 @@ namespace FlaxEditor.Viewport
private bool _isControllingMouse;
private int _deltaFilteringStep;
private Vector2 _startPosMiddle;
private Vector2 _startPosRight;
private Vector2 _startPosLeft;
private Vector2 _startPos;
private Vector2 _mouseDeltaRightLast;
private Vector2[] _deltaFilteringBuffer = new Vector2[FpsCameraFilteringFrames];
@@ -180,6 +178,7 @@ namespace FlaxEditor.Viewport
private float _orthoSize = 1.0f;
private bool _isOrtho = false;
private float _wheelMovementChangeDeltaSum = 0;
private bool _invertPanning;
/// <summary>
/// Speed of the mouse.
@@ -403,6 +402,15 @@ namespace FlaxEditor.Viewport
set => _isOrtho = value;
}
/// <summary>
/// Gets or sets if the panning direction is inverted.
/// </summary>
public bool InvertPanning
{
get => _invertPanning;
set => _invertPanning = value;
}
/// <summary>
/// The input actions collection to processed during user input.
/// </summary>
@@ -434,6 +442,7 @@ namespace FlaxEditor.Viewport
_nearPlane = options.Viewport.DefaultNearPlane;
_farPlane = options.Viewport.DefaultFarPlane;
_fieldOfView = options.Viewport.DefaultFieldOfView;
_invertPanning = options.Viewport.DefaultInvertPanning;
Editor.Instance.Options.OptionsChanged += OnEditorOptionsChanged;
OnEditorOptionsChanged(options);
@@ -454,7 +463,7 @@ namespace FlaxEditor.Viewport
var button = camSpeedCM.AddButton(v.ToString());
button.Tag = v;
}
camSpeedCM.ButtonClicked += (button) => MovementSpeed = (float)button.Tag;
camSpeedCM.ButtonClicked += button => MovementSpeed = (float)button.Tag;
camSpeedCM.VisibleChanged += WidgetCamSpeedShowHide;
camSpeedButton.Parent = camSpeed;
camSpeed.Parent = this;
@@ -515,9 +524,9 @@ namespace FlaxEditor.Viewport
// Orthographic
{
var ortho = ViewWidgetButtonMenu.AddButton("Orthographic");
var orthoValue = new CheckBox(75, 2, _isOrtho);
var orthoValue = new CheckBox(90, 2, _isOrtho);
orthoValue.Parent = ortho;
orthoValue.StateChanged += (checkBox) =>
orthoValue.StateChanged += checkBox =>
{
if (checkBox.Checked != _isOrtho)
{
@@ -528,13 +537,25 @@ namespace FlaxEditor.Viewport
ViewWidgetButtonMenu.VisibleChanged += control => orthoValue.Checked = _isOrtho;
}
// Cara Orientation
{
var cameraView = ViewWidgetButtonMenu.AddChildMenu("Orientation").ContextMenu;
for (int i = 0; i < EditorViewportCameraOrientationValues.Length; i++)
{
var co = EditorViewportCameraOrientationValues[i];
var button = cameraView.AddButton(co.Name);
button.Tag = co.Orientation;
}
cameraView.ButtonClicked += button => ViewOrientation = Quaternion.Euler((Vector3)button.Tag);
}
// Field of View
{
var fov = ViewWidgetButtonMenu.AddButton("Field Of View");
var fovValue = new FloatValueBox(1, 75, 2, 50.0f, 35.0f, 160.0f, 0.1f);
var fovValue = new FloatValueBox(1, 90, 2, 70.0f, 35.0f, 160.0f, 0.1f);
fovValue.Parent = fov;
fovValue.ValueChanged += () => _fieldOfView = fovValue.Value;
ViewWidgetButtonMenu.VisibleChanged += (control) =>
ViewWidgetButtonMenu.VisibleChanged += control =>
{
fov.Visible = !_isOrtho;
fovValue.Value = _fieldOfView;
@@ -544,10 +565,10 @@ namespace FlaxEditor.Viewport
// Ortho Scale
{
var orthoSize = ViewWidgetButtonMenu.AddButton("Ortho Scale");
var orthoSizeValue = new FloatValueBox(_orthoSize, 75, 2, 50.0f, 0.001f, 100000.0f, 0.01f);
var orthoSizeValue = new FloatValueBox(_orthoSize, 90, 2, 70.0f, 0.001f, 100000.0f, 0.01f);
orthoSizeValue.Parent = orthoSize;
orthoSizeValue.ValueChanged += () => _orthoSize = orthoSizeValue.Value;
ViewWidgetButtonMenu.VisibleChanged += (control) =>
ViewWidgetButtonMenu.VisibleChanged += control =>
{
orthoSize.Visible = _isOrtho;
orthoSizeValue.Value = _orthoSize;
@@ -557,7 +578,7 @@ namespace FlaxEditor.Viewport
// Near Plane
{
var nearPlane = ViewWidgetButtonMenu.AddButton("Near Plane");
var nearPlaneValue = new FloatValueBox(2.0f, 75, 2, 50.0f, 0.001f, 1000.0f);
var nearPlaneValue = new FloatValueBox(2.0f, 90, 2, 70.0f, 0.001f, 1000.0f);
nearPlaneValue.Parent = nearPlane;
nearPlaneValue.ValueChanged += () => _nearPlane = nearPlaneValue.Value;
ViewWidgetButtonMenu.VisibleChanged += control => nearPlaneValue.Value = _nearPlane;
@@ -566,7 +587,7 @@ namespace FlaxEditor.Viewport
// Far Plane
{
var farPlane = ViewWidgetButtonMenu.AddButton("Far Plane");
var farPlaneValue = new FloatValueBox(1000, 75, 2, 50.0f, 10.0f);
var farPlaneValue = new FloatValueBox(1000, 90, 2, 70.0f, 10.0f);
farPlaneValue.Parent = farPlane;
farPlaneValue.ValueChanged += () => _farPlane = farPlaneValue.Value;
ViewWidgetButtonMenu.VisibleChanged += control => farPlaneValue.Value = _farPlane;
@@ -575,7 +596,7 @@ namespace FlaxEditor.Viewport
// Brightness
{
var brightness = ViewWidgetButtonMenu.AddButton("Brightness");
var brightnessValue = new FloatValueBox(1.0f, 75, 2, 50.0f, 0.001f, 10.0f, 0.001f);
var brightnessValue = new FloatValueBox(1.0f, 90, 2, 70.0f, 0.001f, 10.0f, 0.001f);
brightnessValue.Parent = brightness;
brightnessValue.ValueChanged += () => Brightness = brightnessValue.Value;
ViewWidgetButtonMenu.VisibleChanged += control => brightnessValue.Value = Brightness;
@@ -584,11 +605,26 @@ namespace FlaxEditor.Viewport
// Resolution
{
var resolution = ViewWidgetButtonMenu.AddButton("Resolution");
var resolutionValue = new FloatValueBox(1.0f, 75, 2, 50.0f, 0.1f, 4.0f, 0.001f);
var resolutionValue = new FloatValueBox(1.0f, 90, 2, 70.0f, 0.1f, 4.0f, 0.001f);
resolutionValue.Parent = resolution;
resolutionValue.ValueChanged += () => ResolutionScale = resolutionValue.Value;
ViewWidgetButtonMenu.VisibleChanged += control => resolutionValue.Value = ResolutionScale;
}
// Invert Panning
{
var invert = ViewWidgetButtonMenu.AddButton("Invert Panning");
var invertValue = new CheckBox(90, 2, _invertPanning);
invertValue.Parent = invert;
invertValue.StateChanged += checkBox =>
{
if (checkBox.Checked != _invertPanning)
{
_invertPanning = checkBox.Checked;
}
};
ViewWidgetButtonMenu.VisibleChanged += control => invertValue.Checked = _invertPanning;
}
}
// Link for task event
@@ -812,7 +848,7 @@ namespace FlaxEditor.Viewport
/// </summary>
protected virtual void OnLeftMouseButtonDown()
{
_startPosLeft = _viewMousePos;
_startPos = _viewMousePos;
}
/// <summary>
@@ -827,7 +863,7 @@ namespace FlaxEditor.Viewport
/// </summary>
protected virtual void OnRightMouseButtonDown()
{
_startPosRight = _viewMousePos;
_startPos = _viewMousePos;
}
/// <summary>
@@ -842,7 +878,7 @@ namespace FlaxEditor.Viewport
/// </summary>
protected virtual void OnMiddleMouseButtonDown()
{
_startPosMiddle = _viewMousePos;
_startPos = _viewMousePos;
}
/// <summary>
@@ -1013,7 +1049,13 @@ namespace FlaxEditor.Viewport
moveDelta *= 0.3f;
// Calculate smooth mouse delta not dependant on viewport size
Vector2 offset = _viewMousePos - (_input.IsMouseMiddleDown ? _startPosMiddle : _startPosRight);
Vector2 offset = _viewMousePos - _startPos;
if (_input.IsZooming && !_input.IsMouseRightDown && !_input.IsMouseLeftDown && !_input.IsMouseMiddleDown)
{
offset = Vector2.Zero;
}
offset.X = offset.X > 0 ? Mathf.Floor(offset.X) : Mathf.Ceil(offset.X);
offset.Y = offset.Y > 0 ? Mathf.Floor(offset.Y) : Mathf.Ceil(offset.Y);
_mouseDeltaRight = offset / size;
@@ -1055,7 +1097,7 @@ namespace FlaxEditor.Viewport
// Move mouse back to the root position
if (centerMouse && (_input.IsMouseRightDown || _input.IsMouseLeftDown || _input.IsMouseMiddleDown))
{
Vector2 center = PointToWindow(_input.IsMouseMiddleDown ? _startPosMiddle : _startPosRight);
Vector2 center = PointToWindow(_startPos);
win.MousePosition = center;
}
}
@@ -1101,11 +1143,11 @@ namespace FlaxEditor.Viewport
if (_input.IsMouseLeftDown)
{
// Calculate smooth mouse delta not dependant on viewport size
Vector2 offset = _viewMousePos - _startPosLeft;
Vector2 offset = _viewMousePos - _startPos;
offset.X = offset.X > 0 ? Mathf.Floor(offset.X) : Mathf.Ceil(offset.X);
offset.Y = offset.Y > 0 ? Mathf.Floor(offset.Y) : Mathf.Ceil(offset.Y);
_mouseDeltaLeft = offset / size;
_startPosLeft = _viewMousePos;
_startPos = _viewMousePos;
}
else
{
@@ -1193,6 +1235,28 @@ namespace FlaxEditor.Viewport
base.OnDestroy();
}
private struct CameraOrientation
{
public readonly string Name;
public readonly Vector3 Orientation;
public CameraOrientation(string name, Vector3 orientation)
{
Name = name;
Orientation = orientation;
}
}
private readonly CameraOrientation[] EditorViewportCameraOrientationValues =
{
new CameraOrientation("Front", new Vector3(0, 0, 0)),
new CameraOrientation("Back", new Vector3(0, 180, 0)),
new CameraOrientation("Left", new Vector3(0, 90, 0)),
new CameraOrientation("Right", new Vector3(0, -90, 0)),
new CameraOrientation("Top", new Vector3(-90, 0, 0)),
new CameraOrientation("Bottom", new Vector3(90, 0, 0))
};
private readonly float[] EditorViewportCameraSpeedValues =
{
0.1f,
@@ -84,7 +84,7 @@ namespace FlaxEditor.Viewport.Previews
// Preview LOD
{
var previewLOD = ViewWidgetButtonMenu.AddButton("Preview LOD");
var previewLODValue = new IntValueBox(-1, 75, 2, 50.0f, -1, 10, 0.02f);
var previewLODValue = new IntValueBox(-1, 90, 2, 70.0f, -1, 10, 0.02f);
previewLODValue.Parent = previewLOD;
previewLODValue.ValueChanged += () => _previewModel.ForcedLOD = previewLODValue.Value;
ViewWidgetButtonMenu.VisibleChanged += control => previewLODValue.Value = _previewModel.ForcedLOD;
@@ -85,7 +85,7 @@ namespace FlaxEditor.Viewport.Previews
var orbitRadius = 200.0f;
if (camera is ArcBallCamera arcBallCamera)
orbitRadius = arcBallCamera.OrbitRadius;
camera.SerArcBallView(new Quaternion(-0.08f, -0.92f, 0.31f, -0.23f), Vector3.Zero, orbitRadius);
camera.SetArcBallView(new Quaternion(-0.08f, -0.92f, 0.31f, -0.23f), Vector3.Zero, orbitRadius);
if (useWidgets)
{
@@ -23,6 +23,15 @@ namespace FlaxEditor.Viewport.Previews
"Cone"
};
private static readonly Transform[] Transforms =
{
new Transform(Vector3.Zero, Quaternion.RotationY(Mathf.Pi), new Vector3(0.45f)),
new Transform(Vector3.Zero, Quaternion.RotationY(Mathf.Pi), new Vector3(0.45f)),
new Transform(Vector3.Zero, Quaternion.Identity, new Vector3(0.45f)),
new Transform(Vector3.Zero, Quaternion.RotationY(Mathf.Pi), new Vector3(0.45f)),
new Transform(Vector3.Zero, Quaternion.RotationY(Mathf.Pi), new Vector3(0.45f)),
};
private StaticModel _previewModel;
private Decal _decal;
private Terrain _terrain;
@@ -65,6 +74,7 @@ namespace FlaxEditor.Viewport.Previews
_selectedModelIndex = value;
_previewModel.Model = FlaxEngine.Content.LoadAsyncInternal<Model>("Editor/Primitives/" + Models[value]);
_previewModel.Transform = Transforms[value];
}
}
@@ -77,7 +87,6 @@ namespace FlaxEditor.Viewport.Previews
{
// Setup preview scene
_previewModel = new StaticModel();
_previewModel.Transform = new Transform(Vector3.Zero, Quaternion.RotationY(Mathf.Pi), new Vector3(0.45f));
SelectedModelIndex = 0;
// Link actors for rendering
@@ -53,7 +53,7 @@ namespace FlaxEditor.Viewport.Previews
// Preview LOD
{
var previewLOD = ViewWidgetButtonMenu.AddButton("Preview LOD");
var previewLODValue = new IntValueBox(-1, 75, 2, 50.0f, -1, 10, 0.02f);
var previewLODValue = new IntValueBox(-1, 90, 2, 70.0f, -1, 10, 0.02f);
previewLODValue.Parent = previewLOD;
previewLODValue.ValueChanged += () => _previewModel.ForcedLOD = previewLODValue.Value;
ViewWidgetButtonMenu.VisibleChanged += control => previewLODValue.Value = _previewModel.ForcedLOD;
@@ -67,7 +67,7 @@ namespace FlaxEditor.Viewport.Previews
if (useWidgets)
{
var playbackDuration = ViewWidgetButtonMenu.AddButton("Duration");
var playbackDurationValue = new FloatValueBox(_playbackDuration, 75, 2, 50.0f, 0.1f, 1000000.0f, 0.1f);
var playbackDurationValue = new FloatValueBox(_playbackDuration, 90, 2, 70.0f, 0.1f, 1000000.0f, 0.1f);
playbackDurationValue.Parent = playbackDuration;
playbackDurationValue.ValueChanged += () => PlaybackDuration = playbackDurationValue.Value;
ViewWidgetButtonMenu.VisibleChanged += control => playbackDurationValue.Value = PlaybackDuration;
@@ -159,13 +159,14 @@ namespace FlaxEditor.Viewport.Previews
float prevScale = _viewScale;
_viewScale = Mathf.Clamp(_viewScale + delta * 0.24f, 0.001f, 20.0f);
// Move view to make use of the control much more soother
//float coeff = (prevScale + (_viewScale - prevScale)) / prevScale;
//_viewPos += (location * coeff - location) / _viewScale;
//_viewPos += location / _viewScale;
Vector2 sizeDelta = (_viewScale - prevScale) * _textureRect.Size;
// Compensate for the Rectangle.MakeScaled
Vector2 sizeDelta = (_viewScale - prevScale) * _textureRect.Size * 0.5f;
_viewPos += sizeDelta * 0.5f;
// Move to zoom position
Vector2 locationOnTexture = (location - _textureRect.Location) / _textureRect.Size;
_viewPos -= sizeDelta * locationOnTexture;
return true;
}
+1 -1
View File
@@ -115,7 +115,7 @@ namespace FlaxEditor.Windows
{
var thirdPartyPanel = new Panel(ScrollBars.Vertical)
{
Bounds = new Rectangle(0, topParentControl.Bottom + 4, Width, Height - topParentControl.Bottom - 24),
Bounds = new Rectangle(4, topParentControl.Bottom + 4, Width - 8, Height - topParentControl.Bottom - 24),
Parent = this
};
var thirdPartyEntries = new[]
@@ -288,7 +288,7 @@ namespace FlaxEditor.Windows.Assets
public abstract class AssetEditorWindowBase<T> : AssetEditorWindow where T : Asset
{
/// <summary>
/// Flag set to true if window is is waiting for asset to be loaded (to send <see cref="OnAssetLoaded"/> or <see cref="OnAssetLoadFailed"/> events).
/// Flag set to true if window is waiting for asset to be loaded (to send <see cref="OnAssetLoaded"/> or <see cref="OnAssetLoadFailed"/> events).
/// </summary>
protected bool _isWaitingForLoaded;
@@ -430,7 +430,7 @@ namespace FlaxEditor.Windows.Assets
/// <summary>
/// Gets the original asset. Note: <see cref="AssetEditorWindowBase{T}.Asset"/> is the cloned asset for local editing. Use <see cref="SaveToOriginal"/> to apply changes to the original asset.
/// </summary>
public T OriginalAsset => (T)FlaxEngine.Content.GetAsset(_item.ID);
public T OriginalAsset => (T)FlaxEngine.Content.Load(_item.ID);
/// <inheritdoc />
protected ClonedAssetEditorWindowBase(Editor editor, AssetItem item)
@@ -40,6 +40,12 @@ namespace FlaxEditor.Windows.Assets
_presenter.Modified += MarkAsEdited;
}
private void OnScriptsReloadBegin()
{
Close();
ScriptsBuilder.ScriptsReloadBegin -= OnScriptsReloadBegin;
}
/// <inheritdoc />
public override void Save()
{
@@ -76,6 +82,10 @@ namespace FlaxEditor.Windows.Assets
_presenter.Select(_object);
ClearEditedFlag();
// Auto-close on scripting reload if json asset is from game scripts (it might be reloaded)
if (_object != null && FlaxEngine.Scripting.IsTypeFromGameScripts(_object.GetType()))
ScriptsBuilder.ScriptsReloadBegin += OnScriptsReloadBegin;
base.OnAssetLoaded();
}
+1 -1
View File
@@ -1004,7 +1004,7 @@ namespace FlaxEditor.Windows.Assets
protected override void OnAssetLoaded()
{
_refreshOnLODsLoaded = true;
_preview.ViewportCamera.SerArcBallView(Asset.GetBox());
_preview.ViewportCamera.SetArcBallView(Asset.GetBox());
UpdateEffectsOnAsset();
// TODO: disable streaming for this model
@@ -277,6 +277,7 @@ namespace FlaxEditor.Windows.Assets
private readonly StagingTexture[] _stagingTextures = new StagingTexture[FrameLatency + 1];
private RenderProgress _progress;
private RenderEditorState _editorState;
private GameWindow _gameWindow;
public RenderOptions Options => _options;
@@ -373,6 +374,9 @@ namespace FlaxEditor.Windows.Assets
gameWin.Viewport.Task.PostRender += OnPostRender;
if (!gameWin.Visible)
gameWin.Show();
else if (!gameWin.IsFocused)
gameWin.Focus();
_gameWindow = gameWin;
_warmUpTimeLeft = _options.WarmUpTime;
_animationFrame = 0;
var stagingTextureDesc = GPUTextureDescription.New2D(resolution.X, resolution.Y, gameWin.Viewport.Task.Output.Format, GPUTextureFlags.None);
@@ -385,6 +389,12 @@ namespace FlaxEditor.Windows.Assets
_stagingTextures[i].TaskFrame = -1;
}
_player.Play();
if (!_player.IsPlaying)
{
Editor.LogError("Scene Animation Player failed to start playing.");
CancelRendering();
return;
}
if (_warmUpTimeLeft > 0.0f)
{
// Start warmup time
@@ -438,8 +448,11 @@ namespace FlaxEditor.Windows.Assets
_stagingTextures[i].Texture.ReleaseGPU();
Object.Destroy(ref _stagingTextures[i].Texture);
}
_progress.End();
editor.ProgressReporting.UnregisterHandler(_progress);
if (_progress != null)
{
_progress.End();
editor.ProgressReporting.UnregisterHandler(_progress);
}
if (_editorState != null)
{
editor.StateMachine.GoToState(editor.StateMachine.EditingSceneState);
@@ -452,6 +465,7 @@ namespace FlaxEditor.Windows.Assets
gameWin.Viewport.BackgroundColor = Color.Transparent;
gameWin.Viewport.KeepAspectRatio = false;
gameWin.Viewport.Task.PostRender -= OnPostRender;
_gameWindow = null;
_isRendering = false;
_presenter.Panel.Enabled = true;
_presenter.BuildLayoutOnUpdate();
@@ -467,6 +481,11 @@ namespace FlaxEditor.Windows.Assets
{
// Render first frame
_player.Play();
if (!_player.IsPlaying)
{
Editor.LogError("Scene Animation Player failed to start playing.");
CancelRendering();
}
_warmUpTimeLeft = -1;
_state = States.Render;
}
@@ -490,7 +509,7 @@ namespace FlaxEditor.Windows.Assets
}
if (_player.IsStopped || _player.Time >= _options.EndTime)
{
// End rendering but perform reaming copies of the staging textures so all data is captured (from GPU to CPU)
// End rendering but perform remaining copies of the staging textures so all data is captured (from GPU to CPU)
_state = States.Staging;
break;
}
@@ -503,8 +522,7 @@ namespace FlaxEditor.Windows.Assets
private void OnPostRender(GPUContext context, RenderContext renderContext)
{
var gameWin = Editor.Instance.Windows.GameWin;
var task = gameWin.Viewport.Task;
var task = _gameWindow.Viewport.Task;
var taskFrame = task.FrameCount;
// Check all staging textures for finished GPU to CPU transfers
@@ -540,7 +558,7 @@ namespace FlaxEditor.Windows.Assets
ref var stagingTexture = ref _stagingTextures[textureIdx];
stagingTexture.AnimationFrame = _animationFrame;
stagingTexture.TaskFrame = taskFrame;
_options.VideoOutputFormat.RenderFrame(context, ref stagingTexture, _options, gameWin.Viewport.Task.Output);
_options.VideoOutputFormat.RenderFrame(context, ref stagingTexture, _options, _gameWindow.Viewport.Task.Output);
// Now wait for the next animation frame to be updated
_state = States.Update;
@@ -1097,7 +1097,7 @@ namespace FlaxEditor.Windows.Assets
protected override void OnAssetLoaded()
{
_refreshOnLODsLoaded = true;
_preview.ViewportCamera.SerArcBallView(Asset.GetBox());
_preview.ViewportCamera.SetArcBallView(Asset.GetBox());
UpdateEffectsOnAsset();
// TODO: disable streaming for this model
@@ -224,7 +224,7 @@ namespace FlaxEditor.Windows
/// </summary>
private void ExportSelection()
{
if(FileSystem.ShowBrowseFolderDialog(Editor.Windows.MainWindow, null, "Select the output folder", out var outputFolder))
if (FileSystem.ShowBrowseFolderDialog(Editor.Windows.MainWindow, null, "Select the output folder", out var outputFolder))
return;
var selection = _view.Selection;
+8 -2
View File
@@ -222,7 +222,7 @@ namespace FlaxEditor.Windows
private void PlayingStateOnSceneDuplicating()
{
// Remove reaming GUI controls so loaded scene can add own GUI
// Remove remaining GUI controls so loaded scene can add own GUI
//_guiRoot.DisposeChildren();
// Show GUI
@@ -231,7 +231,7 @@ namespace FlaxEditor.Windows
private void PlayingStateOnSceneRestored()
{
// Remove reaming GUI controls so loaded scene can add own GUI
// Remove remaining GUI controls so loaded scene can add own GUI
//_guiRoot.DisposeChildren();
// Hide GUI
@@ -387,6 +387,12 @@ namespace FlaxEditor.Windows
}
}
// Prevent closing the game window tab during a play session
if (Editor.StateMachine.IsPlayMode && Editor.Options.Options.Input.CloseTab.Process(this, key))
{
return true;
}
return base.OnKeyDown(key);
}
+5
View File
@@ -110,6 +110,11 @@ const Char* SplashScreenQuotes[] =
TEXT("You have my bow.\nAnd my axe!"),
TEXT("To the bridge of Khazad-dum."),
TEXT("One ring to rule them all.\nOne ring to find them."),
TEXT("Ladies and gentelman, we got him"),
TEXT("Cyberpunk of game engines"),
TEXT("That's what she said"),
TEXT("Compiling Shaders (93,788)"),
TEXT("Hi There"),
};
SplashScreen::~SplashScreen()
@@ -1489,11 +1489,11 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu
case 2:
value = transitionsData.Position / transitionsData.Length;
break;
// Reaming Time
// Remaining Time
case 3:
value = transitionsData.Length - transitionsData.Position;
break;
// Reaming Normalized Time
// Remaining Normalized Time
case 4:
value = 1.0f - (transitionsData.Position / transitionsData.Length);
break;
+1 -1
View File
@@ -199,7 +199,7 @@ public:
/// Gets the current state of the audio playback (playing/paused/stopped).
/// </summary>
/// <returns>The value.</returns>
API_PROPERTY() FORCE_INLINE States GetState() const
API_PROPERTY() FORCE_INLINE AudioSource::States GetState() const
{
return _state;
}
+8 -8
View File
@@ -22,7 +22,7 @@ bool CSG::Mesh::Triangulate(RawData& data, Array<RawModelVertex>& cacheVB) const
Array<RawModelVertex> surfaceCacheVB(32);
// Cache submeshes by material to lay them down
// key- brush index, value- direcotry for surafecs (key: surface index, value: list with start vertex per triangle)
// key- brush index, value- direcotry for surfaces (key: surface index, value: list with start vertex per triangle)
Dictionary<int32, Dictionary<int32, Array<int32>>> polygonsPerBrush(64);
// Build index buffer
@@ -115,8 +115,8 @@ bool CSG::Mesh::Triangulate(RawData& data, Array<RawModelVertex>& cacheVB) const
tangent.Normalize();
// Gram-Schmidt orthogonalize
Vector3 newTangentUnormalized = tangent - normal * Vector3::Dot(normal, tangent);
const float length = newTangentUnormalized.Length();
Vector3 newTangentUnnormalized = tangent - normal * Vector3::Dot(normal, tangent);
const float length = newTangentUnnormalized.Length();
// Workaround to handle degenerated case
if (Math::IsZero(length))
@@ -129,7 +129,7 @@ bool CSG::Mesh::Triangulate(RawData& data, Array<RawModelVertex>& cacheVB) const
}
else
{
tangent = newTangentUnormalized / length;
tangent = newTangentUnnormalized / length;
bitangent.Normalize();
}
@@ -217,12 +217,12 @@ bool CSG::Mesh::Triangulate(RawData& data, Array<RawModelVertex>& cacheVB) const
auto& vertex = cacheVB[triangleStartVertex + k];
Vector3 projected = Vector3::Project(vertex.Position, 0, 0, 1000, 1000, 0, 1, vp);
Vector2 projectecXY = Vector2(projected);
Vector2 projectedXY = Vector2(projected);
min = Vector2::Min(projectecXY, min);
max = Vector2::Max(projectecXY, max);
min = Vector2::Min(projectedXY, min);
max = Vector2::Max(projectedXY, max);
pointsCache.Add(projectecXY);
pointsCache.Add(projectedXY);
}
}
+4 -4
View File
@@ -38,7 +38,7 @@ void CSG::Mesh::PerformOperation(Mesh* other)
{
case Mode::Additive:
{
// Check if both meshes do not intesect
// Check if both meshes do not intersect
if (AABB::IsOutside(_bounds, other->GetBounds())) // TODO: test every sub bounds not whole _bounds
{
// Add vertices to the mesh without any additional calculations
@@ -57,7 +57,7 @@ void CSG::Mesh::PerformOperation(Mesh* other)
case Mode::Subtractive:
{
// Check if both meshes do not intesect
// Check if both meshes do not intersect
if (AABB::IsOutside(_bounds, other->GetBounds())) // TODO: test every sub bounds not whole _bounds
{
// Do nothing
@@ -141,7 +141,7 @@ void CSG::Mesh::intersect(const Mesh* other, PolygonOperation insideOp, PolygonO
// insideOp - operation for polygons being inside the other brush
// outsideOp - operation for polygons being outside the other brush
// Prevent from redudant action
// Prevent from redundant action
if (insideOp == Keep && outsideOp == Keep)
return;
@@ -180,7 +180,7 @@ void CSG::Mesh::intersectSubMesh(const Mesh* other, int32 subMeshIndex, PolygonO
int32 startBrushSurface = brushMeta.StartSurfaceIndex;
int32 endBrushSurface = startBrushSurface + brushMeta.SurfacesCount;
// Check every polygon (itereate fron end since we can ass new polygons and we don't want to process them)
// Check every polygon (iterate from end since we can ass new polygons and we don't want to process them)
for (int32 i = _polygons.Count() - 1; i >= 0; i--)
{
auto& polygon = _polygons[i];
+1 -1
View File
@@ -53,7 +53,7 @@ public:
ScopeLock lock(Locker);
const int32 prevCount = MaterialSlots.Count();
MaterialSlots.Resize(slotsCount);
MaterialSlots.Resize(slotsCount, false);
// Initialize slot names
for (int32 i = prevCount; i < slotsCount; i++)
@@ -208,7 +208,7 @@ void ContentLoadingManagerService::Dispose()
MainThread = nullptr;
ThisThread = nullptr;
// Cancel all reaming tasks (no chance to execute them)
// Cancel all remaining tasks (no chance to execute them)
Tasks.CancelAll();
}

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