diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 4a0bce5103..0e873cbb70 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -867,7 +867,11 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { DependencyManager::set(); DependencyManager::set(); DependencyManager::set(); + +#ifdef HAVE_DDE DependencyManager::set(); +#endif + DependencyManager::set(); DependencyManager::set(); DependencyManager::set(); @@ -3324,7 +3328,9 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { surfaceContext->setContextProperty("AccountServices", AccountServicesScriptingInterface::getInstance()); surfaceContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface); +#ifdef HAVE_DDE surfaceContext->setContextProperty("FaceTracker", DependencyManager::get().data()); +#endif surfaceContext->setContextProperty("AvatarManager", DependencyManager::get().data()); surfaceContext->setContextProperty("LODManager", DependencyManager::get().data()); surfaceContext->setContextProperty("HMD", DependencyManager::get().data()); @@ -5176,7 +5182,11 @@ ivec2 Application::getMouse() const { FaceTracker* Application::getActiveFaceTracker() { auto dde = DependencyManager::get(); - return dde->isActive() ? static_cast(dde.data()) : nullptr; + if (dde && dde->isActive()) { + return static_cast(dde.data()); + } + + return nullptr; } FaceTracker* Application::getSelectedFaceTracker() { @@ -7010,7 +7020,10 @@ void Application::copyDisplayViewFrustum(ViewFrustum& viewOut) const { // feature. However, we still use this to reset face trackers, eye trackers, audio and to optionally re-load the avatar // rig and animations from scratch. void Application::resetSensors(bool andReload) { +#ifdef HAVE_DDE DependencyManager::get()->reset(); +#endif + DependencyManager::get()->reset(); _overlayConductor.centerUI(); getActiveDisplayPlugin()->resetSensors(); @@ -7402,8 +7415,10 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe scriptEngine->registerGlobalObject("AccountServices", AccountServicesScriptingInterface::getInstance()); qScriptRegisterMetaType(scriptEngine.data(), DownloadInfoResultToScriptValue, DownloadInfoResultFromScriptValue); +#ifdef HAVE_DDE scriptEngine->registerGlobalObject("FaceTracker", DependencyManager::get().data()); - +#endif + scriptEngine->registerGlobalObject("AvatarManager", DependencyManager::get().data()); scriptEngine->registerGlobalObject("LODManager", DependencyManager::get().data()); diff --git a/interface/src/devices/DdeFaceTracker.h b/interface/src/devices/DdeFaceTracker.h index 0ad8d85c62..dc451134f0 100644 --- a/interface/src/devices/DdeFaceTracker.h +++ b/interface/src/devices/DdeFaceTracker.h @@ -14,8 +14,9 @@ #include +//Disabling dde due to random crashes with closing the socket on macos. all the accompanying code is wrapped with the ifdef HAVE_DDE. uncomment the define below to enable #if defined(Q_OS_WIN) || defined(Q_OS_OSX) - #define HAVE_DDE + //#define HAVE_DDE #endif #include diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index fb7b0ef993..e0505770f5 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -111,7 +111,7 @@ void setupPreferences() { auto setter = [](bool value) { qApp->setSettingConstrainToolbarPosition(value); }; preferences->addPreference(new CheckPreference(UI_CATEGORY, "Constrain Toolbar Position to Horizontal Center", getter, setter)); } - + { auto getter = []()->bool { return qApp->getAwayStateWhenFocusLostInVREnabled(); }; auto setter = [](bool value) { qApp->setAwayStateWhenFocusLostInVREnabled(value); }; @@ -231,7 +231,7 @@ void setupPreferences() { "installation and system details, and crash events. By allowing High Fidelity to collect " "this information you are helping to improve the product. ", getter, setter)); } - + static const QString AVATAR_TUNING { "Avatar Tuning" }; { auto getter = [myAvatar]()->QString { return myAvatar->getDominantHand(); }; @@ -247,8 +247,8 @@ void setupPreferences() { preference->setStep(0.05f); preference->setDecimals(2); preferences->addPreference(preference); - - // When the Interface is first loaded, this section setupPreferences(); is loaded - + + // When the Interface is first loaded, this section setupPreferences(); is loaded - // causing the myAvatar->getDomainMinScale() and myAvatar->getDomainMaxScale() to get set to incorrect values // which can't be changed across domain switches. Having these values loaded up when you load the Dialog each time // is a way around this, therefore they're not specified here but in the QML. @@ -271,10 +271,14 @@ void setupPreferences() { static const QString FACE_TRACKING{ "Face Tracking" }; { +#ifdef HAVE_DDE auto getter = []()->float { return DependencyManager::get()->getEyeClosingThreshold(); }; auto setter = [](float value) { DependencyManager::get()->setEyeClosingThreshold(value); }; preferences->addPreference(new SliderPreference(FACE_TRACKING, "Eye Closing Threshold", getter, setter)); +#endif } + + { auto getter = []()->float { return FaceTracker::getEyeDeflection(); }; auto setter = [](float value) { FaceTracker::setEyeDeflection(value); }; @@ -307,14 +311,14 @@ void setupPreferences() { preferences->addPreference(preference); } { - auto getter = [myAvatar]() -> bool { return myAvatar->hoverWhenUnsupported(); }; + auto getter = [myAvatar]()->bool { return myAvatar->hoverWhenUnsupported(); }; auto setter = [myAvatar](bool value) { myAvatar->setHoverWhenUnsupported(value); }; auto preference = new CheckPreference(VR_MOVEMENT, "Hover When Unsupported", getter, setter); preferences->addPreference(preference); } { auto getter = [myAvatar]()->int { return myAvatar->getMovementReference(); }; - auto setter = [myAvatar](int value) { myAvatar->setMovementReference(value); }; + auto setter = [myAvatar](int value) { myAvatar->setMovementReference(value); }; //auto preference = new CheckPreference(VR_MOVEMENT, "Hand-Relative Movement", getter, setter); auto preference = new RadioButtonsPreference(VR_MOVEMENT, "Movement Direction", getter, setter); QStringList items; @@ -520,6 +524,5 @@ void setupPreferences() { preference->setStep(10); preferences->addPreference(preference); } - } }