AaronBerney Posted January 9, 2024 Posted January 9, 2024 I upgraded my c# VR project from 2.17.0.1 to 2.18.0.0. It loads fine, but when I try to run it, in any mode, I now get the build errors below. I am aware that there are changes around the VR API but I'm not sure how to resolve this. How do I move my project to the new API? or failing that, continue with the deprecated API. Any pointers? Thanks C:\Users\aaron\Documents\UNIGINE Projects\PrioryCrescentCSharp\data\vr_template\components\vr_input\vive\ViveInput.cs(258,16): error CS0246: The type or namespace name 'OpenVR' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\aaron\Documents\UNIGINE Projects\PrioryCrescentCSharp\PrioryCrescentCSharp.csproj] C:\Users\aaron\Documents\UNIGINE Projects\PrioryCrescentCSharp\data\vr_template\components\vr_input\oculus\OculusInput.cs(258,16): error CS0246: The type or namespace name 'Oculus' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\aaron\Documents\UNIGINE Projects\PrioryCrescentCSharp\PrioryCrescentCSharp.csproj] C:\Users\aaron\Documents\UNIGINE Projects\PrioryCrescentCSharp\data\vr_template\components\vr_input\oculus\OculusInput.cs(588,70): error CS0246: The type or namespace name 'Oculus' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\aaron\Documents\UNIGINE Projects\PrioryCrescentCSharp\PrioryCrescentCSharp.csproj] C:\Users\aaron\Documents\UNIGINE Projects\PrioryCrescentCSharp\data\vr_template\components\vr_input\oculus\OculusInput.cs(607,17): error CS0246: The type or namespace name 'Oculus' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\aaron\Documents\UNIGINE Projects\PrioryCrescentCSharp\PrioryCrescentCSharp.csproj] C:\Users\aaron\Documents\UNIGINE Projects\PrioryCrescentCSharp\data\vr_template\components\vr_input\oculus\OculusInput.cs(627,17): error CS0246: The type or namespace name 'Oculus' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\aaron\Documents\UNIGINE Projects\PrioryCrescentCSharp\PrioryCrescentCSharp.csproj]
mifril Posted January 10, 2024 Posted January 10, 2024 Hello, can you please describe your situation in more detail. Have you modified your project's source files or is it just the content? If you changed the source code, can you send me the current state of your project?
mifril Posted January 10, 2024 Posted January 10, 2024 If you don't change the source files, you can do the following: Close opened world. In the vr_template/components folder, delete the following files In interactions folder, delete In interacrable folder, delete VRNodeSwitchEnableByKey.cs file Also in this folder you should replace VRKinematicMovableObject.cs, VRPhysicMovableObject.cs, VRTransformMovableObject.cs by files from project on 2.18 SDK version(or from attach), when you will replace the files better to delete this files in Asset Manger and drag and drop correct files. In transformations folder, delete VRAttachToHead.cs file In the layers folder, delete vr_layer.node file Then import into vr_template folder vr_layer.upackage. You can use file in attach or create this package itself, to do that just create empty c# vr project on 2.18 SDK version and click Export As Package on vr_layer.node file After that your project should build correctly. vr_layer.upackage VRPhysicMovableObject.cs VRTransformMovableObject.cs VRKinematicMovableObject.cs
AaronBerney Posted January 10, 2024 Author Posted January 10, 2024 Excellent, many thanks for your reply. It now builds, but is it still possible to run VR from the IDE? I've only been able to run it from the SDK Browser, and even then it stops working if I don't have it fullscreen (the split left and right view) on my monitor. Is there a solution to this? Thanks
mifril Posted January 11, 2024 Posted January 11, 2024 To run VR from the IDE you should add run arguments, in Visual Studio you can do this way: Open project Debug Properties In Command line arguments add -vr_app openvr at the end of the line No you can run your project VR should be uploaded. If I correctly understood the problem with fullscreen, your application stops working when you switch focus from the window with the application to another, for example, click something in the editor. If this is the problem, to fix it you should add the following lines to the AppSystemLogic.cs file to the Init method After this, the application will not stop working after switching focus.
mifril Posted January 11, 2024 Posted January 11, 2024 Also after fixing BackgroundUpdate, Run button in SDK Browser may not work as you expected, since by default it runs the Release build, and in the IDE, by default you create Debug builds. You can launch a Debug build from the SDK Browser by customizing the Run button.
AaronBerney Posted January 15, 2024 Author Posted January 15, 2024 Many thanks, I can now run from the IDE. Actually though, what I really meant to ask is how to run it from the Editor, not the IDE (sorry!). It's the green 'play' button that doesn't work for me. I've tried all of the options on the dropdown, including choosing 'OpenVR_Launcher'. It just launches in a window. The VR just continues with "Editor_double_x64, waiting..." I'm OK with running from the IDE or from the SDK Browser, but the problems is that it kills the Editor, I'm guessing because it has to steal the SteamVR session...
silent Posted January 17, 2024 Posted January 17, 2024 In order to launch your app from Editor in VR mode you need to add -vr_app openvr start-up parameter. However, if you already launched Editor with -vr_app openvr, SteamVR will force close Editor if it detects new application start. To fix this you need to do a few additional steps: In the SDK Browser before launching Editor make sure that you have no stereo set in Global Options -> Stereo 3D; Also make sure that you have no additional start-up arguments set in Open Editor custom run options that will enable VR; Start the Editor and load your world that you want to run in VR; In application start-up settings modify Arguments field and add -vr_app openvr: Don't forget to choose correct Configuration (Debug / Release) as well; Press Play button. If everything done correctly your application will start in VR mode and Editor will be still functional. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts