OpenXR
11 TopicsHololens2 Unity App is displayed in a 2D Window (MRTK 2.8.2.0 Unity Version : 2020.3.28 f1)
Hi I have been trying to deploy to Hololens 2. But the app opens in a 2d window inside hololens. I am following the Hololens 2 fundamental tutorial here https://learn.microsoft.com/en-us/training/modules/learn-mrtk-tutorials/1-7-exercise-hand-interaction-with-objectmanipulator Versions are MRTK 2.8.2.0 , Unity Version 2020.3.28 f1 , Visual Studio 2022 17.4 I have been deploying it as a remote machineSolved1.8KViews0likes1CommentQR code tracking on Android with MRTK3: IL2CPPLinkage error when building library
Unity Building Library failed, IL2CPPLinkage error, with MRTK3 and QR Code Tracking on Android I tried to track a QR code with MRTK 3 and Andriod. https://localjoost.github.io/MRTK2-to-MRTK3-migrating-the-QRCode-sample/ The following error occurs when building on Android: Building Library\Bee\artifacts\Android\d8kzr\libil2cpp.so failed with output: Library/Bee/artifacts/Android/d8kzr/soo2_.QR.DotNet.o: In function `IL2CPPLinkage_WindowsGetStringRawBuffer_m43E89486907592139AB0D52752B2D8D483E4FEE6': H:/projects/**/Library/Bee/artifacts/Android/il2cppOutput/cpp/Microsoft.MixedReality.QR.DotNet.cpp:1395: undefined reference to `WindowsGetStringRawBuffer' H:/projects/**/Library/Bee/artifacts/Android/il2cppOutput/cpp/Microsoft.MixedReality.QR.DotNet.cpp:1395: undefined reference to `WindowsGetStringRawBuffer' Library/Bee/artifacts/Android/d8kzr/soo2_.QR.DotNet.o: In function `IL2CPPLinkage_WindowsDeleteString_m8175860EEA9E79F2F530A1EC165CE65FDD475933': H:/projects/**/Library/Bee/artifacts/Android/il2cppOutput/cpp/Microsoft.MixedReality.QR.DotNet.cpp:1405: undefined reference to `WindowsDeleteString' H:/projects/**/Library/Bee/artifacts/Android/il2cppOutput/cpp/Microsoft.MixedReality.QR.DotNet.cpp:1405: undefined reference to `WindowsDeleteString' clang++: error: linker command failed with exit code 1 (use -v to see invocation) UnityEditor.GenericMenu:CatchMenu (object,string[],int) I have tried the following to fix the error: [DllImport("__Internal")] Metodes removed from IL2CPPLinkage class in the Platform.cs file Search for "WindowsGetStringRawBuffer_m43E89486907592139AB0D52752B2D8D483E4FEE6" in the build output, but nothing found1.6KViews1like2CommentsHOLOLENS GEN1 UNITY 2022
Hi! I'm using hololens 1 with unity 2022 and the MRTK version 2.8.2. When I am in the project in unity everything is ok, it exports the appx file fine but when I add it from windows device portal and start there is a window, it is not even in full screen, it does not start with the unity logo and it is all black! Does anyone know why? I have been investigating for two weeks now, I have no knowledge of programming and I know very little about unity for that reason. but hey, some help would be good, thanks! PS: I have windows 11 HOME1.1KViews0likes1CommentHololens2-Unity project & build settings
I am following the instructions on https://docs.microsoft.com/en-us/windows/mixed-reality/develop/unity/new-openxr-project-with-mrtk page to set up my Unity project for developing an app for Hololens2. Once I switched platform and saved the new settings, I was curious to see what changes had been made under the hood by looking at my SourceTree modified files, but there is none. Is this normal (i.e. are such settings supposed to be ignored) or there is something wrong with my gitignore file that stops these changes from being tracked and registered? I do not know where these settings would be stored. My guess would be in the XRSettings.asset file, but not sure at all. The command git check-ignore -v -- XRSettings.asset does not return anything... Where are the changes to Build Settings and Player Settings stored? Should they be kept under version control?Solved906Views0likes1CommentHololens 2 QRCode Sample in MRTK3
Hello. For an application we built in our laboratory, we used MRTK 2.7.2 and this sample https://github.com/microsoft/MixedReality-QRCode-Sample , with unity 2021.1.22. The sample works really well in our case. Now, we are creating a new application with latest version of MRTK3 and Unity 2021.3.19, but seems that the sample doesn't work with MRTK3. Is there a way to let it work with MRTK3? Thank you, Nicolas.726Views1like0CommentsOpen PDF Document in Hololens 2 from the file browser
I am trying to open a pdf document located in the persistent data path, in the file explorer, in the hololens 2 device but when trying to open it by c# code in Unity, nothing happens. I've tried with the code provided in the question locted in https://stackoverflow.com/questions/71382025/open-pdf-in-hololens-unity and it appear to happen an exception that sais this: "Exception of type 'System.Exception' was thrown". Does anyone know what is happening and how can I fix it? This is the code I've used to do it: using UnityEngine; using UnityEngine.Networking; using System; using System.IO; using System.Collections; using System.Diagnostics; using TMPro; using System.Threading.Tasks; #if !UNITY_EDITOR && UNITY_WSA using System; using System.Threading.Tasks; using Windows.System; using Windows.Storage; using Windows.Storage.Streams; using Windows.Data.Pdf; #endif public class PdfDownloader : MonoBehaviour { public string pdfUrl = "https://grados.ugr.es/primaria/pages/infoacademica/archivos/ejemplostfg/!"; public string destinationPath = "my-file.pdf"; int pg = 0; // Definir e inicializar la variable pg [SerializeField] private GameObject PDFPlane = null; [SerializeField] private TextMeshProUGUI text = null; #if !UNITY_EDITOR && UNITY_WSA PdfDocument pdfDocument; #endif public void download() { StartCoroutine(DownloadPdf()); } IEnumerator DownloadPdf() { UnityWebRequest www = UnityWebRequest.Get(pdfUrl); yield return www.SendWebRequest(); if (www.result != UnityWebRequest.Result.Success) { UnityEngine.Debug.LogError("Error al descargar el archivo PDF: " + www.error); } else { string filePath = Path.Combine(Application.persistentDataPath, destinationPath); SaveFile(filePath, www.downloadHandler.data); UnityEngine.Debug.Log("Archivo PDF descargado correctamente en: " + filePath); text.text += "Archivo PDF descargado correctamente en: " + filePath+ "\n"; // Abrir el archivo PDF LoadAsync(); text.text += "Abierto" + "\n"; } } void SaveFile(string path, byte[] data) { try { // Crear el directorio si no existe string directory = Path.GetDirectoryName(path); if (!Directory.Exists(directory)) { Directory.CreateDirectory(directory); text.text += "Creado" + "\n"; } // Escribir los datos del archivo en el archivo especificado File.WriteAllBytes(path, data); text.text += "Escrito" + "\n"; } catch (Exception e) { UnityEngine.Debug.LogError("Error al guardar el archivo: " + e.Message); text.text += "Error al guardar el archivo: " + e.Message+ "\n"; } } public async void LoadAsync() { string path = Application.persistentDataPath; #if !UNITY_EDITOR && UNITY_WSA text.text += "Empiezo "+ "\n"; try { StorageFolder storageFolder = await StorageFolder.GetFolderFromPathAsync(path); /*StorageFolder storageFolder = KnownFolders.CameraRoll;*/ text.text += "Empiezo 2 "+ "\n"; StorageFile sampleFile = await storageFolder.GetFileAsync("my-file.pdf"); text.text += "Empiezo 3 "+ "\n"; //pdfDocument is an instanced object of type PdfDocument pdfDocument = await PdfDocument.LoadFromFileAsync(sampleFile); text.text += "Folder path 2: " + storageFolder + "\n"; } catch (Exception e) { text.text += "1: " + e.Message; } text.text += "listo"; #endif } public async void ChangePageAsync() { text.text += "Voy" + "\n"; #if !UNITY_EDITOR && UNITY_WSA text.text += "Empiezo "+ "\n"; //pg is the page to load using (PdfPage firstPage = pdfDocument.GetPage((uint)pg)) { InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream(); await firstPage.RenderToStreamAsync(stream); MemoryStream tempStream = new MemoryStream(); await stream.AsStream().CopyToAsync(tempStream); byte[] imgBytes = new byte[16 * 1024]; imgBytes = tempStream.ToArray(); Texture2D imgTex = new Texture2D(2048, 2048, TextureFormat.BC7, false); imgTex.LoadImage(imgBytes); imgTex.filterMode = FilterMode.Bilinear; imgTex.wrapMode = TextureWrapMode.Clamp; MeshRenderer meshRenderer = PDFPlane.GetComponent<MeshRenderer>(); Material mat = meshRenderer.material; mat.SetTexture("_MainTex", imgTex); mat.mainTextureScale = new Vector2(1, 1); text.text += "pg: " + pg + "\n"; } #endif } } In the code, I first download it and then try open it. The text.text are debugging lines I've added. The pdf URL is an example pdf obtained from google. I want to show using an Unity app a pdf that has been downloaded before a pdf, avoiding the limitations tah hololens 2 has when opening a local file.639Views1like0CommentsUrgent: My App 3d content are not showing in the HoloLens
Hello Everyone, I have been facing an issue for trying the app I made using Unity in the HoloLens, when I test the app through Microsoft Visual, I can see for example the cube but when I publish the app and upload it to the portal, when I run the app using the HoloLens, no any 3d objects are showing. Can any one please help me in this urgent issue. Thanks in advance. Sam631Views0likes1CommentAdding scenes to a mixed reality application (Unity project with MRTK and OpenXR)
We are developing a Unity app for HoloLens2 with MRTK and OpenXR. We understand adding new scenes is recommended (as opposed to putting everything in one crowded and heavy scene) the larger a HoloLens Unity project becomes. Does this advice also hold when you always have to import all the MRTK assets into your every scene? We started off creating a simple HoloLens app with Unity and of course in every scene you import the required and fundamental MRTK components. Can we have 10 scenes with each scene containing these components? Is that sustainable? Or should we have one giant scene and just move the camera around? Is there any documentation containing tips and guidelines like this?500Views0likes0CommentsHololens 2 app reading data from PLC
Hello, I am working on an application for my final project. The application is very simple, I work with a PLC S7 1200 to obtain data from the DB variables of the program and represent this data in Hololens 2. The PLC will be connected via ethertnet to a Wifi router. For the communication with the plc from unity, I use a library called S7netplus. In the simulation inside unity it works correctly as the PC is connected to the router and I get the data from the PLC. The problem comes when importing the application to the hololens 2. When trying to communicate with the ip of the PLC it never works. We have realised that it is not possible to ping the glasses from the computer. If someone could help me I would be very grateful.394Views0likes0CommentsWatch Kubota Environmental Engineering Use Cases Leveraging HoloLens 2!
Kubota Environmental Engineering (Japan) and Meister Corporation teamed up to develop technology for optimized inspections of infrastructure with HoloLens 2. Read the full story and video: English: Story + Video Japanese: Story + Video332Views0likes0Comments