Skip to main content
Up and Coming
October 24, 2015

BUG + Workaround: VR Preview disabled in 4.10p2 + 0.8.0 SDK

If you're using the latest integration from Oculus (0.8.0 SDK) with UE4.10p2, there's a bug in the initialization code that prevents VR preview from working in the editor. Add the section within the comments for workaround in [UE4 Root]\Engine\Plugins\Runtime\OculusRift\Source\OculusRift\Private\OculusRiftHMD.cpp


virtual TSharedPtr< class IHeadMountedDisplay, ESPMode::ThreadSafe > CreateHeadMountedDisplay() override
{
#if OCULUS_RIFT_SUPPORTED_PLATFORMS

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//BUG: ikrimae: Under Editor mode, Initialize() is called in FOculusRiftPlugin::PreInit() but it's called before the FEngineLoop::PreInit() sets GIsEditor to false.
// This causes it to try to initialize the headset before it's ready and it fails. And then when we need to create the HMD in this function, this gets
// bypassed bc bInitializeCalled == true
// Workaround: Force it to create the hmd

#if WITH_EDITOR
if (bInitializeCalled == true && bInitialized == false)
{
bInitializeCalled = false;
}
#endif // WITH_EDITOR
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    This topic has been closed for replies.

    8 replies

    Up and Coming
    October 25, 2015
    Thanks for the heads up ikrima.

    Im just downloading 4.10 ATM and this work around will save me from bashing my head against my desk. :D
    DK2. Phenom 2 x4 4.2GHz,Asrock Extreme 3 970,8GB DDR3 1600, R9 270x 1180/1400.
    Inspiring
    October 25, 2015
    Are you using the official UE4 source, or the Oculus fork? Because this may be fixed already in the Oculus version.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    ikrimaAuthor
    Up and Coming
    October 26, 2015
    "cybereality" wrote:
    Are you using the official UE4 source, or the Oculus fork? Because this may be fixed already in the Oculus version.


    This is in the latest Oculus fork; the mainline branch may or may not be broken. Haven't tested that
    Cheers, Ikrima Twitter Blog Kite & Lightning
    Participant
    October 29, 2015
    sry where to add what? :) please a bit of help :)
    New Participant
    January 28, 2016
    Hi guys,

    I've been banging my head against the wall for two days now and can't figure it out. I'd really appreciate some advice.

    Everything was working fine up until last week. I am using runtime version 0.6.0.1 because any new version displays the HMD not connected error. I also tried installing engine 4.10 this week and I may have had a windows update.

    Initially my problems started where turning my head in unreal would cause my player to side step left and right. This started happening in every one of my projects and even brand new projects.

    Tried 4.10 of unreal, same problem.
    Removed 4.10, same problem.
    Reinstalled 4.9, lost the ability to use VR Preview but Oculus is identified by the config utility and I can run the demo scene.
    Tried every combination of driver I can think of, updated graphics, tried different engines, rolled back windows update, reinstalled Epic Games Launcher, tried every display configuration, tried every USB configuration, even tried a brand new oculus rift DK2. Still don't have VR Preview in anything.

    If I show log then type in ovrversion, I get ovrversion is not recognised.
    I've tried putting the code above for both 4.9 and 4.10 and it's not made any difference.
    Turning the plugins off and on makes no difference
    Toggling on simpleHMD plugin does enable the VR preview button but only for the SimpleHMD view.

    I'm considering a reformat of my machine but would really rather avoid the hassle if possible.
    Inspiring
    January 28, 2016
    I believe you need a newer Runtime to use 4.10, so that part makes sense.

    Not sure why you can't revert, though.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    New Participant
    January 29, 2016
    Thanks for replying cybereality. I think I've figured it out now so if anyone else is having a similar problem.

    - My PC isn't compatible with Oculus so that's probably why a runtime newer than v0.6.0.1 does not recognise my oculus rift. (Although v0.6.0.1 works perfectly fine with my elderly PC!)

    - It seems Unreal 4.9.1 and newer engines dropped support for runtime v0.6.0.1 so that is why I lost my ability to use VR Preview when I installed 4.9.2 in a bid to fix an unrelated problem.

    - Installing engine 4.8.3 with runtime v0.6.0.1 works as normal and as it always has done.

    - The issue now is that my project is 4.9 and I can only download 4.9.2. So I either need to buy a new PC (not ideal and may not fix the issue), find a way of getting 4.9 back on my machine, or rebuild the entire project in 4.8.3.
    New Participant
    April 19, 2016
    Thank you Ikrima, your solution works for me (UE 4.9.2, Oculus 0.7.0 SDK)