Jump to content

Build error after 2.18 upgrade


photo

Recommended Posts

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]

Link to comment

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?

Link to comment

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

image.png

In interactions folder, delete

image.png

In interacrable folder, delete VRNodeSwitchEnableByKey.cs file

image.png

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

image.png

In the layers folder, delete vr_layer.node file

image.png

 

 

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

image.png

 

After that your project should build correctly.

image.png

image.png

image.png

image.png

vr_layer.upackage VRPhysicMovableObject.cs VRTransformMovableObject.cs VRKinematicMovableObject.cs

Link to comment

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
 

Link to comment

To run VR from the IDE you should add run arguments, in Visual Studio you can do this way:

Open project Debug Properties

image.png

In Command line arguments add -vr_app openvr at the end of the line

image.png

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

image.png

After this, the application will not stop working after switching focus.

Link to comment

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.

image.png

 

image.png

Link to comment

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...

Link to comment

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:

  1. In the SDK Browser before launching Editor make sure that you have no stereo set in Global Options -> Stereo 3D;
  2. Also make sure that you have no additional start-up arguments set in Open Editor custom run options that will enable VR;
  3. Start the Editor and load your world that you want to run in VR;
  4. In application start-up settings modify Arguments field and add -vr_app openvr:
    image.png
     
  5. Don't forget to choose correct Configuration (Debug / Release) as well;
  6. 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:

Link to comment
×
×
  • Create New...