Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-platform editor rewrite - prototype #2034

Draft
wants to merge 256 commits into
base: xplat-editor
Choose a base branch
from

Conversation

Kryptos-FR
Copy link
Member

@Kryptos-FR Kryptos-FR commented Nov 13, 2023

PR Details

This PR contains the initial work on a new cross-platform editor using Avalonia for the UI framework.

Description

In order to keep the changes separate from the existing editor libraries, a new folder sources/xplat-editor has been created. In this folder, there are a bunch of new projects, some which have the same naming of existing ones. The idea is that at some point, it should be possible to replace the old projects with the new ones, adapt the existing WPF code and have two versions of the editor (one implemented with WPF, the other with Avalonia) that we can compare to ensure we have all the features ported from the old one to the new one.

Related issues

Feature highlights

Attributes and types registration

See documentation page

Services

See documentation page

Architectural changes

You will notice that the number of projects have greatly increased. But no panic, some are just duplicates while we work on the new editor. There are few new projects that will stay though. Those are directly related to Avalonia, and they have Avalonia in their name (e.g. Stride.Core.Assets.Editor.Avalonia. The reason is simple: such projects have a direct dependency with Avalonia and implements the UI/UX part of the editor, while those without that name are UI-agnostic and only have a dependency on the MVVM pattern. In other words, the latter could be reused with other MVVM-supporting UI libraries such as WPF, MAUI or any other that could come in the future (including, why not, our own Stride-implemented UI).

On top of that, some classes (esp. view models) that were previously implemented in Stride.Core.Assets.Editor are now relocated in more editor-agnostic libraries (such as Stride.Core.Assets.Presentation or Stride.Assets.Presentation. Again, the idea is that such libraries could be reused for more simple type of apps (such as viewers for instance) that don't require the full-fledged editing capabilities but just need a MVVM version of the Core or the Stride assets.

Motivation and Context

Why not?

Just kidding. There have been numerous wishes over the years to have an editor working on other platforms than Windows.
There is also a need to have a fully-fledged plugin system, and in order to achieve that similar changes to the one allowing cross-platform experience are needed. Hence, this project aims to achieve both.

Types of changes

  • Docs change / refactoring / dependency upgrade
    • There is a README per project, which surely counts as a doc change.
    • There will be a need to write or rewrite a lot of docs, once we have reached a stable point.
  • Bug fix (non-breaking change which fixes an issue)
    • While reworking how the different editor libraries interact with each others, some bugs are likely fixed (but hard to know which ones).
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • Likely some breaking changes in the way the editor libraries are working. However, the runtime libraries should be untouched for the most part.

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
    • Nope 😁.
  • All new and existing tests passed.
    • No idea. Not the point of this PR.
  • I have built and run the editor to try this change out.
    • The new one that is 😉.

@Kryptos-FR Kryptos-FR force-pushed the xplat-editor branch 2 times, most recently from 82a082a to d55536b Compare November 18, 2023 19:08
@Kryptos-FR Kryptos-FR mentioned this pull request Jan 6, 2024
8 tasks
Kryptos-FR and others added 17 commits January 11, 2024 17:46
)

* Enable to run Stride.Core.Tasks program on any OS

* Prevent from running "locate-devenv" opt on non-win platforms

* fix invalid OptionException arg

* Apply xplateditor variable to stride.core.tasks
The essential part here is that `OpenXRHmd.CanInitialize` will now return false if no device is present. This ensures that the `VRDeviceSystem` sets up a dummy device which in turn prevents many parts from crashing.

To truly know whether or not an actual device is connected we first need to establish contact with the OpenXR runtime. Therefor code has been moved around a bit to be able to call various parts individually.
Tested on two machines, one without any VR related things installed and another one with an actual device.

This commit also contains a bunch of code cleanups:
- Enables C# nullable feature on OpenXR files
- Adds null checks to various places
- Disposes XR API after shutting down the device
- Makes various fields and methods private
- Moves initialization code to a `OpenXRUtils` class to make dependencies more visible
- Turns OpenXRInput into a normal class holding a reference to the device
- Turns `CheckResult` into a extension method and simplifies its usage by letting C# infer the called method
- Introduced `OpenXRException` exception class carrying the inferred method and XR error code
This build regression was introduced by previous commit d72aef5
* [Samples] Update to 4.2

* [Samples] Remove Newtonsoft.Json dependency in CSharpIntermediate
* [Tests] Fixes random test failures

Some of the tests in Stride.GameStudio.Tests must not run in parallel as they access a shared class which is not thread safe.

* Sets wait time in TestFileVersionManager to 500ms (from 200)

Should make it less likely that unit tests on teamcity fail.
* use positive 77

* repair projectwatcher

* remove unused line

* undo -77 change

* undo -77

* order usings

* fix formatting

* remove unused solution

* remove unused async

* use previous cancelation method

* remove extra task

* add check to not throw assembly changes away

* rework distribution of assemblychanges

* remove unused using

* add broadcast back in

* remove assembly broadcast

* add cancelation

* replace cancelation location

* improve if nesting

* improve naming, fix reload on new references

* fix loading chain of assets

* refactor

* [Editor] Refactor initialization of CodeViewModel

---------

Co-authored-by: IXLLEGACYIXL <ixllegacy123@outlook.com>
Co-authored-by: Nicolas Musset <musset.nicolas@gmail.com>
dloe and others added 13 commits August 28, 2024 22:20
…ception (stride3d#2410)

* Added early warning and better error logging for CharacterComponent missing physical shapes

- Will now incorporate logger with a warning when Attachments of shapes for KinecticCharacter are skipped due to no ColliderShapes being present.
- errors given inside CharacterComponent will also include call info for users to trace and find what corresponding code is calling the physic method.

* Cleaned up comments

+ fixed typo in comment

* Added extra check for No Shapes warning

Found reference to older code that may have at one point had this check and warning. Added the extra check I had not accounted for

* Removed repetitive check for lack of collider shap

- Removed check that occurs after DisableSimulation check and now has it ahead of simulation check

* Moved comment to summary of PhysicsComponent OnAttach

Cosmetic change with comments and summary

* Reduced code reuse with dedicated function for logging

Maybe it could go ever farther and be put in the Logger class? May update
…3d#2422)

* Run proper Rigidbody setup when adding ColliderShape

* Added test case for proper setup with GetOrCreate

* Followed similar Bepu format with creation of ReAttach method

* Reformatted files edited

* Revert "Reformatted files edited"

This reverts commit 1c9b03e.
* fix: Correct reference added to BoundingBox

* fix: cref corrected - removed full stop

* fix: cref for AudioEmitterComponent corrected

* fix: param fixed from rotation to scale

* fix: RaiseException doesn't exist, most likely it should be SetException, which is present

* fix: cref corrected with full namespace

* fix: cref references corrected

* chore: Reversing the update because it's not working

* fix: Incorrect reference

* fix: The C# reference itself doesn't exist but the reference seems ok

* fix: Correcting the references

* fix: Fixed xml comment

* fix: xml summary corrected

* fix: cref reversed back, but added full namespace

* fix: Fixing see xml tag with appropriate html link to our manual
…3d#2423)

The comment for the `Entity` class has been updated to provide a more detailed description. It now specifies that the class represents a game entity that typically aggregates multiple `EntityComponent` instances. Additionally, it includes references to the Stride documentation for more information about adding and managing entities.
…(TFM) when passed to NuGet resolver to properly load NuGet libraries (stride3d#2432)

Co-authored-by: Basewq <Basewq@users.noreply.github.com>
…lete cross-platform functionality (stride3d#2435)

Co-authored-by: Basewq <Basewq@users.noreply.github.com>
…without causing crash (stride3d#2428)

* somewhat messy Unoptimized Solution for UAF exception fix

* Multiple physics properties carry over on KinematicCharacter reConstruction

* Forgot to remove unneeded reference to NativeCollisionObject in reconstruction

* grammar issues with comments
…rom glTF file (stride3d#2441)

Co-authored-by: Basewq <Basewq@users.noreply.github.com>
…ect node when a model has duplicate node names (stride3d#2444)

Co-authored-by: Basewq <Basewq@users.noreply.github.com>
# Conflicts:
#	sources/editor/Stride.Assets.Presentation.Wpf/AssetEditors/Gizmos/GizmoComponentAttribute.cs
#	sources/editor/Stride.Assets.Presentation.Wpf/AssetEditors/Gizmos/IEntityGizmo.cs
#	sources/editor/Stride.Assets.Presentation.Wpf/AssetEditors/Gizmos/IGizmo.cs
#	sources/editor/Stride.Assets.Presentation/AssetEditors/Gizmos/GizmoComponentAttribute.cs
#	sources/editor/Stride.Assets.Presentation/AssetEditors/Gizmos/IGizmo.cs
#	sources/editor/Stride.Assets.Presentation/StrideDefaultAssetsPlugin.cs
#	sources/engine/Stride.Engine/Engine/Gizmos/GizmoComponentAttribute.cs
#	sources/engine/Stride.Engine/Engine/Gizmos/IGizmo.cs
#	sources/launcher/Stride.Launcher/Assets/Images/opencollective.png
#	sources/launcher/Stride.Launcher/Assets/Images/opencollective_24.png
#	sources/launcher/Stride.Launcher/Assets/Images/twitch.png
#	sources/launcher/Stride.Launcher/Assets/Images/twitch_24.png
#	sources/launcher/Stride.Launcher/Assets/Images/twitter.png
#	sources/launcher/Stride.Launcher/Assets/Images/xtwitter_24.png
#	sources/launcher/Stride.Launcher/Launcher.cs
#	sources/launcher/Stride.Launcher/Properties/PublishProfiles/FolderProfile.pubxml
#	sources/launcher/Stride.Launcher/Stride.Launcher.csproj
#	sources/launcher/Stride.Launcher/ViewModels/RecentProjectViewModel.cs
#	sources/launcher/Stride.Launcher/ViewModels/StrideDevVersionViewModel.cs
#	sources/launcher/Stride.Launcher/Views/LauncherWindow.xaml
@MetalMaxMX
Copy link

Happy New Year! Any news on how the editor is doing like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.