History

Merge pull request #16400 from hyperlogic/feature/arkit-blendshapes

Extended avatar blendshape support for ARKit compatiblity

Anthony Thibault committed 7 years ago

Commit f99bb3e2 parents a035344 9325ea546 files · +950 −1750Browse files

Showing the changes to interface/src/Application.cpp (1 of 46 files). Show all

Unified · Split

interface/src/Application.cpp+1−112
@@ -170,7 +170,6 @@ · 169 unmodified lines
170170 #include "avatar/MyCharacterController.h"
171171 #include "CrashRecoveryHandler.h"
172172 #include "CrashHandler.h"
173−#include "devices/DdeFaceTracker.h"
174173 #include "DiscoverabilityManager.h"
175174 #include "GLCanvas.h"
176175 #include "InterfaceDynamicFactory.h"
@@ -888,11 +887,6 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 711 unmodified lines
888887 DependencyManager::set<ScriptCache>();
889888 DependencyManager::set<SoundCache>();
890889 DependencyManager::set<SoundCacheScriptingInterface>();
891−
892−#ifdef HAVE_DDE
893− DependencyManager::set<DdeFaceTracker>();
894−#endif
895−
896890 DependencyManager::set<AudioClient>();
897891 DependencyManager::set<AudioScope>();
898892 DependencyManager::set<DeferredLightingEffect>();
@@ -1069,7 +1063,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 170 unmodified lines
10691063 _lastSendDownstreamAudioStats(usecTimestampNow()),
10701064 _notifiedPacketVersionMismatchThisDomain(false),
10711065 _maxOctreePPS(maxOctreePacketsPerSecond.get()),
1072− _lastFaceTrackerUpdate(0),
10731066 _snapshotSound(nullptr),
10741067 _sampleSound(nullptr)
10751068 {
@@ -2019,13 +2012,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 943 unmodified lines
20192012 this->installEventFilter(this);
20202013
20212014
2022−
2023−#ifdef HAVE_DDE
2024− auto ddeTracker = DependencyManager::get<DdeFaceTracker>();
2025− ddeTracker->init();
2026− connect(ddeTracker.data(), &FaceTracker::muteToggled, this, &Application::faceTrackerMuteToggled);
2027−#endif
2028−
20292015 // If launched from Steam, let it handle updates
20302016 const QString HIFI_NO_UPDATER_COMMAND_LINE_KEY = "--no-updater";
20312017 bool noUpdater = arguments().indexOf(HIFI_NO_UPDATER_COMMAND_LINE_KEY) != -1;
@@ -2767,9 +2753,6 @@ void Application::cleanupBeforeQuit() { · 735 unmodified lines
27672753 }
27682754
27692755 // Stop third party processes so that they're not left running in the event of a subsequent shutdown crash.
2770−#ifdef HAVE_DDE
2771− DependencyManager::get<DdeFaceTracker>()->setEnabled(false);
2772−#endif
27732756 AnimDebugDraw::getInstance().shutdown();
27742757
27752758 // FIXME: once we move to shared pointer for the INputDevice we shoud remove this naked delete:
@@ -2840,10 +2823,6 @@ void Application::cleanupBeforeQuit() { · 64 unmodified lines
28402823 _window->saveGeometry();
28412824
28422825 // Destroy third party processes after scripts have finished using them.
2843−#ifdef HAVE_DDE
2844− DependencyManager::destroy<DdeFaceTracker>();
2845−#endif
2846−
28472826 DependencyManager::destroy<ContextOverlayInterface>(); // Must be destroyed before TabletScriptingInterface
28482827
28492828 // stop QML
@@ -3478,9 +3457,6 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { · 628 unmodified lines
34783457 surfaceContext->setContextProperty("AccountServices", AccountServicesScriptingInterface::getInstance());
34793458
34803459 surfaceContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface);
3481−#ifdef HAVE_DDE
3482− surfaceContext->setContextProperty("FaceTracker", DependencyManager::get<DdeFaceTracker>().data());
3483−#endif
34843460 surfaceContext->setContextProperty("AvatarManager", DependencyManager::get<AvatarManager>().data());
34853461 surfaceContext->setContextProperty("LODManager", DependencyManager::get<LODManager>().data());
34863462 surfaceContext->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data());
@@ -3747,16 +3723,6 @@ void Application::runTests() { · 260 unmodified lines
37473723 runUnitTests();
37483724 }
37493725
3750−void Application::faceTrackerMuteToggled() {
3751−
3752− QAction* muteAction = Menu::getInstance()->getActionForOption(MenuOption::MuteFaceTracking);
3753− Q_CHECK_PTR(muteAction);
3754− bool isMuted = getSelectedFaceTracker()->isMuted();
3755− muteAction->setChecked(isMuted);
3756− getSelectedFaceTracker()->setEnabled(!isMuted);
3757− Menu::getInstance()->getActionForOption(MenuOption::CalibrateCamera)->setEnabled(!isMuted);
3758−}
3759−
37603726 void Application::setFieldOfView(float fov) {
37613727 if (fov != _fieldOfView.get()) {
37623728 _fieldOfView.set(fov);
@@ -5331,43 +5297,6 @@ ivec2 Application::getMouse() const { · 1568 unmodified lines
53315297 return getApplicationCompositor().getReticlePosition();
53325298 }
53335299
5334−FaceTracker* Application::getActiveFaceTracker() {
5335−#ifdef HAVE_DDE
5336− auto dde = DependencyManager::get<DdeFaceTracker>();
5337−
5338− if (dde && dde->isActive()) {
5339− return static_cast<FaceTracker*>(dde.data());
5340− }
5341−#endif
5342−
5343− return nullptr;
5344−}
5345−
5346−FaceTracker* Application::getSelectedFaceTracker() {
5347− FaceTracker* faceTracker = nullptr;
5348−#ifdef HAVE_DDE
5349− if (Menu::getInstance()->isOptionChecked(MenuOption::UseCamera)) {
5350− faceTracker = DependencyManager::get<DdeFaceTracker>().data();
5351− }
5352−#endif
5353− return faceTracker;
5354−}
5355−
5356−void Application::setActiveFaceTracker() const {
5357−#ifdef HAVE_DDE
5358− bool isMuted = Menu::getInstance()->isOptionChecked(MenuOption::MuteFaceTracking);
5359− bool isUsingDDE = Menu::getInstance()->isOptionChecked(MenuOption::UseCamera);
5360− Menu::getInstance()->getActionForOption(MenuOption::BinaryEyelidControl)->setVisible(isUsingDDE);
5361− Menu::getInstance()->getActionForOption(MenuOption::CoupleEyelids)->setVisible(isUsingDDE);
5362− Menu::getInstance()->getActionForOption(MenuOption::UseAudioForMouth)->setVisible(isUsingDDE);
5363− Menu::getInstance()->getActionForOption(MenuOption::VelocityFilter)->setVisible(isUsingDDE);
5364− Menu::getInstance()->getActionForOption(MenuOption::CalibrateCamera)->setVisible(isUsingDDE);
5365− auto ddeTracker = DependencyManager::get<DdeFaceTracker>();
5366− ddeTracker->setIsMuted(isMuted);
5367− ddeTracker->setEnabled(isUsingDDE && !isMuted);
5368−#endif
5369−}
5370−
53715300 bool Application::exportEntities(const QString& filename,
53725301 const QVector<QUuid>& entityIDs,
53735302 const glm::vec3* givenOffset) {
@@ -5851,8 +5780,7 @@ void Application::updateMyAvatarLookAtPosition(float deltaTime) { · 477 unmodified lines
58515780 PerformanceWarning warn(showWarnings, "Application::updateMyAvatarLookAtPosition()");
58525781
58535782 auto myAvatar = getMyAvatar();
5854− FaceTracker* faceTracker = getActiveFaceTracker();
5855− myAvatar->updateEyesLookAtPosition(faceTracker, _myCamera, deltaTime);
5783+ myAvatar->updateEyesLookAtPosition(deltaTime);
58565784 }
58575785
58585786 void Application::updateThreads(float deltaTime) {
@@ -6278,37 +6206,6 @@ void Application::update(float deltaTime) { · 419 unmodified lines
62786206 auto myAvatar = getMyAvatar();
62796207 {
62806208 PerformanceTimer perfTimer("devices");
6281−
6282− FaceTracker* tracker = getSelectedFaceTracker();
6283− if (tracker && Menu::getInstance()->isOptionChecked(MenuOption::MuteFaceTracking) != tracker->isMuted()) {
6284− tracker->toggleMute();
6285− }
6286−
6287− tracker = getActiveFaceTracker();
6288− if (tracker && !tracker->isMuted()) {
6289− tracker->update(deltaTime);
6290−
6291− // Auto-mute microphone after losing face tracking?
6292− if (tracker->isTracking()) {
6293− _lastFaceTrackerUpdate = usecTimestampNow();
6294− } else {
6295− const quint64 MUTE_MICROPHONE_AFTER_USECS = 5000000; //5 secs
6296− Menu* menu = Menu::getInstance();
6297− auto audioClient = DependencyManager::get<AudioClient>();
6298− if (menu->isOptionChecked(MenuOption::AutoMuteAudio) && !audioClient->isMuted()) {
6299− if (_lastFaceTrackerUpdate > 0
6300− && ((usecTimestampNow() - _lastFaceTrackerUpdate) > MUTE_MICROPHONE_AFTER_USECS)) {
6301− audioClient->setMuted(true);
6302− _lastFaceTrackerUpdate = 0;
6303− }
6304− } else {
6305− _lastFaceTrackerUpdate = 0;
6306− }
6307− }
6308− } else {
6309− _lastFaceTrackerUpdate = 0;
6310− }
6311−
63126209 auto userInputMapper = DependencyManager::get<UserInputMapper>();
63136210
63146211 controller::HmdAvatarAlignmentType hmdAvatarAlignmentType;
@@ -7104,10 +7001,6 @@ void Application::copyDisplayViewFrustum(ViewFrustum& viewOut) const { · 789 unmodified lines
71047001 // feature. However, we still use this to reset face trackers, eye trackers, audio and to optionally re-load the avatar
71057002 // rig and animations from scratch.
71067003 void Application::resetSensors(bool andReload) {
7107−#ifdef HAVE_DDE
7108− DependencyManager::get<DdeFaceTracker>()->reset();
7109−#endif
7110−
71117004 _overlayConductor.centerUI();
71127005 getActiveDisplayPlugin()->resetSensors();
71137006 getMyAvatar()->reset(true, andReload);
@@ -7509,10 +7402,6 @@ void Application::registerScriptEngineWithApplicationServices(const ScriptEngine · 395 unmodified lines
75097402 scriptEngine->registerGlobalObject("AccountServices", AccountServicesScriptingInterface::getInstance());
75107403 qScriptRegisterMetaType(scriptEngine.data(), DownloadInfoResultToScriptValue, DownloadInfoResultFromScriptValue);
75117404
7512−#ifdef HAVE_DDE
7513− scriptEngine->registerGlobalObject("FaceTracker", DependencyManager::get<DdeFaceTracker>().data());
7514−#endif
7515−
75167405 scriptEngine->registerGlobalObject("AvatarManager", DependencyManager::get<AvatarManager>().data());
75177406
75187407 scriptEngine->registerGlobalObject("LODManager", DependencyManager::get<LODManager>().data());

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t