Giter Club home page Giter Club logo

mixed-reality-extension-unity's Introduction

Mixed Reality Extension SDK Unity

The Mixed Reality Extension SDK Unity library makes it easy for any Unity3D app or game to support user generated content (UGC) built with the Mixed Reality Extension SDK. It also makes it easy to test an MRE within a simple environment inside the Unity3D editor.

Prerequisites

  • Install Git
  • Use Unity Hub to Install Unity 2018.1.9f2 (or later) - Set environment variable UNITY_ROOT to the installation path.
  • Install Visual Studio 2017, including Visual Studio Tools for Unity and .NET development tools

How to build and run Hello World in the Unity3D editor

From command prompt:

  • git clone http://github.com/microsoft/mixed-reality-extension-unity
  • Run buildMREUnityRuntimeDLL.bat
  • Open Unity3D, project folder mixed-reality-extension-unity/MRETestBed
  • open the scene Assets/Scenes/HelloWorld.unity
  • click play You should now see a slowly spinning Hello World label and a clickable cube.

Scene Descriptions

The MRETestbed project contains 4 Unity3d scenes set up for different testing purposes

  • HelloWorld.Unity: Connects to a single MRE in the cloud on startup, no interaction needed
  • FunctionalTest-localhost.Unity. Requires a locally deployed functional test MRE from the SDK Repository. Generates a launch pad for each of the functional tests - just walk close to trigger them. Or touch the "run all" trigger to load every single functional test. There is also a pad for changing the global root - it moves, scales, and rotates everything in the world, which simplifies checking the 3d math.
  • TriggerVolumeTestBed-localhost.Unity: Connects to a localhost MRE when you walk close - useful for testing user join/leave.
  • SynchronizationTest-localhost.Unity: Connects twice to twice to a localhost MREs with the same session ID. When you click on the two spheres you will see 2 different connections to the same server, so you can perform basic multiuser testing without multiple machines or multiple unity instances.

The Localhost samples requires a local node server running, see the Sample repository for localhost deployment.

To Debug the Unity Runtime DLL

  • From within the Unity3D editor click Assets->Open C# Project. This opens Visual Studio and generates a solution file and project files
  • In the Solution Explorer, right click on Solution 'MRETestBed' (3 projects), click Add->Existing Project..., and select MREUnityRuntime\MREUnityRuntimeLib\MREUnityRuntimeLib.csproj
  • Press play in the editor
  • Select Debug->Attach Unity Debugger (requires the Visual Studio Unity Tools installed to show up), and choose Project MRETestBed, type Editor

Putting breakpoints inside the MREUnityRuntimeLib DLL is not always working, but pressing stop in Unity Editor, rebuilding the MREUnityRuntimeLib project in Visual Studio, and pressing play in the Unity Editor tends to fix it.

Integration guide

If you want to integrate the MRE SDK into your own Unity3D project, please see INTEGRATING.md

Overview

  • For more information, please see the Mixed Reality Extension SDK repository's README.md is the best source of information about features, current state, limitations, goal, major known issues, and roadmap.
  • We welcome contributions. Please see CONTRIBUTING.md if you are interested in helping out.

Getting In Touch

To report issues and feature requests: Github issues page.

To chat with the team and other users: join the MRE SDK discord community.

Or attend the biweekly AltspaceVR developer meetups.


Reporting Security Issues

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at [email protected]. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

License

Code licensed under the MIT License.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

mixed-reality-extension-unity's People

Contributors

anthonyneacevr avatar eanders-ms avatar in2dair avatar influnza avatar jabenk avatar microsoftopensource avatar msftgits avatar nik0la31 avatar olga-microsoft avatar radworx avatar sorenhan avatar sorenhannibal avatar stevenvergenz avatar tombums avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mixed-reality-extension-unity's Issues

SerializedCacheRoot in AssetCache is not assigned.

While I was running the ticktacktoe example, I found there is an issue which didn't show the altspace cube.
it's because of
AssetLoader.cs line 291
importer.SceneParent = MREAPI.AppsAPI.AssetCache.CacheRootGO.transform;
CacheRootGo is not assigned and it should be assigned as gameobject.
It seems cacheRoot in AssetManager is not assigned to AssetCache.
if so and my analysis is right, could we move the cacheRoot to AssetCache and reference the object in AssetManager?
I could make PR for this, and thank you for reading.

CapsuleCollider properties not aligned with Unity capsule collider component

There's this diff between how MRE and Unity look at capsule colliders. MRE says a capsule collider has a Vector3 size and then pulls out Height and Direction according to relations of components of that vector, assuming that height is always bigger than radius and Direction always being the index of the biggest component of that vector. I believe this leads to unwanted behavior when initializing colliders.

Should this be more aligned to how Unity treats it, Direction being an axis, height a float along that axis, and radius being perpendicular to it ?

issue running buildMREUnityRuntimeDLL.bat

C:\Users{myusername}\workspace\mixed-reality-extension-unity>msbuild buildMREUnityRuntimeDLL.bat
Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 9/3/2020 1:18:15 PM.
Project "C:\Users{myusername}\workspace\mixed-reality-extension-unity\buildMREUnityRuntimeDLL.bat" on node 1 (default targets).
C:\Users{myusername}\workspace\mixed-reality-extension-unity\buildMREUnityRuntimeDLL.bat(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
Done Building Project "C:\Users{myusername}\workspace\mixed-reality-extension-unity\buildMREUnityRuntimeDLL.bat" (default targets) -- FAILED.

Build FAILED.

"C:\Users{myusername}\workspace\mixed-reality-extension-unity\buildMREUnityRuntimeDLL.bat" (default target) (1) ->
C:\Users{myusername}\workspace\mixed-reality-extension-unity\buildMREUnityRuntimeDLL.bat(1,1): error MSB4025: The projectfile could not be loaded. Data at the root level is invalid. Line 1, position 1.

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.14

Stuck at the buildMREUnityRuntimeDLL.bat build stage

(For multiple reasons which I'd rather not go into right now...)

Rather my question is "why not distribute a compiled DLL?"

Installing an entire C++ build tool-chain is a fairly onerous requirement for something aimed at Unity devs.

MRE timeouts will affect other objects in scene

If there is an issue loading elements inside an MRE then other objects will affected and may not instantiate inside scene
Was able to reproduce this issue inside a TestBed, used an MRE I found online "ws://piano.norybiak.com" and duplicated 8 MicroAppRoot objects pointing to the server

Loading the Piano once will store it in cache and scene will continue to instantiate other objects on failure
Clearing cache may be necessary for reproducing error

Logs will fill with Timeout errors, and other objects will fail to be instantiated in to the scene in an unreliable manner

Here is a preview of the last error message, others are fairly similar

TimeoutException: Failed to acquire exclusive loading rights for http://piano.norybiak.com/notes/108.ogg
MixedRealityExtension.Assets.AssetFetcher`1+d__1[T].MoveNext () (at <16e38f6fcabd4ab4a3262f081b6e2453>:0)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at :0)
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at :0)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at :0)
System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at :0)
System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () (at :0)
MixedRealityExtension.Assets.AssetLoader+d__13.MoveNext () (at <16e38f6fcabd4ab4a3262f081b6e2453>:0)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at :0)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__6_0 (System.Object state) (at :0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at :0)
UnityEngine.UnitySynchronizationContext:ExecuteTasks()

HelloWorld not working.

I've encountered a series of issues following the "How to build and run Hello World in the Unity3D editor" instructions.

Your instructions mention a 'RunHelloWorld.bat' in the getting started section. However this bat file seems to be missing from both master and red branches.

I then tried to run the 'buildMREUnityRuntimeDLL.bat' file directly. However this encounters issues when you have both VS2017 and VS2019 installed. As this section in the .bat file:

for /f "usebackq tokens=*" %%i in (`"%~dp0tools\vswhere" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
  set VSInstallDir=%%i
)

Sets the VSInstallDir environment variable to the VS2019 directory and then MSBuild does not work.

Deleting that section from the .bat will get a build going. But it fails with these errors:

BUILD FAILED: Failed Visual Studio build
Make sure you have Visual Studio 2017, and Visual Studio's Unity Tools installed

I can see further up in the log it is looking all around for UnityEngine.dll, then if I open MREUnityRuntime.sln I can see that it is missing the path to the UnityEngine.dll

I presume I shouldn't be following these issues down the rabbit hole of debugging. Is there something that should be done differently to get this to work?

Getting started / readme updates

It seems the process for using / testing with Unity is broken as the Unity project pieces have been removed as well as the buildMREUnityRuntimeDLL.bat, MRETestBed directory etc. Can we get an updated readme or instructions on how to use/integrate/test this Unity Extension?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.