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