From 3055359d4ccad5a53645b30dafd5efdc18700050 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 17 Apr 2015 13:40:18 -0700 Subject: [PATCH 1/7] remove visage references from Application --- interface/src/Application.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 0227003cb1..c3677696f5 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -108,7 +108,6 @@ #include "devices/MIDIManager.h" #include "devices/OculusManager.h" #include "devices/TV3DManager.h" -#include "devices/Visage.h" #include "gpu/Batch.h" #include "gpu/GLBackend.h" @@ -242,7 +241,6 @@ bool setupEssentials(int& argc, char** argv) { auto ambientOcclusionEffect = DependencyManager::set(); auto textureCache = DependencyManager::set(); auto animationCache = DependencyManager::set(); - auto visage = DependencyManager::set(); auto ddeFaceTracker = DependencyManager::set(); auto modelBlender = DependencyManager::set(); auto audioToolBox = DependencyManager::set(); @@ -1735,12 +1733,10 @@ int Application::getMouseDragStartedY() const { FaceTracker* Application::getActiveFaceTracker() { auto faceshift = DependencyManager::get(); - auto visage = DependencyManager::get(); auto dde = DependencyManager::get(); return (dde->isActive() ? static_cast(dde.data()) : - (faceshift->isActive() ? static_cast(faceshift.data()) : - (visage->isActive() ? static_cast(visage.data()) : NULL))); + (faceshift->isActive() ? static_cast(faceshift.data()) : NULL)); } void Application::setActiveFaceTracker() { @@ -1753,9 +1749,6 @@ void Application::setActiveFaceTracker() { Menu::getInstance()->getActionForOption(MenuOption::ResetDDETracking)->setVisible(isUsingDDE); DependencyManager::get()->setEnabled(isUsingDDE); #endif -#ifdef HAVE_VISAGE - DependencyManager::get()->updateEnabled(); -#endif } bool Application::exportEntities(const QString& filename, const QVector& entityIDs) { @@ -1929,7 +1922,6 @@ void Application::init() { // initialize our face trackers after loading the menu settings DependencyManager::get()->init(); DependencyManager::get()->init(); - DependencyManager::get()->init(); Leapmotion::init(); RealSense::init(); @@ -3263,7 +3255,6 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { void Application::resetSensors() { DependencyManager::get()->reset(); - DependencyManager::get()->reset(); DependencyManager::get()->reset(); OculusManager::reset(); From 604bc2abe15b6572712ae82f711dcc38c8dae4bd Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 17 Apr 2015 13:40:31 -0700 Subject: [PATCH 2/7] remove visage related files --- .gitignore | 4 - interface/external/visage/readme.txt | 14 -- interface/src/devices/Visage.cpp | 191 --------------------------- interface/src/devices/Visage.h | 63 --------- 4 files changed, 272 deletions(-) delete mode 100644 interface/external/visage/readme.txt delete mode 100644 interface/src/devices/Visage.cpp delete mode 100644 interface/src/devices/Visage.h diff --git a/.gitignore b/.gitignore index 44561daabc..b0c99080c7 100644 --- a/.gitignore +++ b/.gitignore @@ -32,10 +32,6 @@ DerivedData interface/external/*/* !interface/external/*/readme.txt -# ignore interface optional resources -interface/resources/visage/* -!interface/resources/visage/tracker.cfg - # Ignore interfaceCache for Linux users interface/interfaceCache/ diff --git a/interface/external/visage/readme.txt b/interface/external/visage/readme.txt deleted file mode 100644 index 3aff1039dc..0000000000 --- a/interface/external/visage/readme.txt +++ /dev/null @@ -1,14 +0,0 @@ - -Instructions for adding the Visage driver to Interface -Andrzej Kapolka, February 11, 2014 - -1. Copy the Visage sdk folders (lib, include, dependencies) into the interface/external/visage folder. - This readme.txt should be there as well. - -2. Copy the contents of the Visage configuration data folder (visageSDK-MacOS/Samples/MacOSX/data/) to - interface/resources/visage (i.e., so that interface/resources/visage/candide3.wfm is accessible) - -3. Copy the Visage license file to interface/resources/visage/license.vlc. - -4. Delete your build directory, run cmake and build, and you should be all set. - diff --git a/interface/src/devices/Visage.cpp b/interface/src/devices/Visage.cpp deleted file mode 100644 index 010b872bc6..0000000000 --- a/interface/src/devices/Visage.cpp +++ /dev/null @@ -1,191 +0,0 @@ -// -// Visage.cpp -// interface/src/devices -// -// Created by Andrzej Kapolka on 2/11/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#include - - -#include -#include -#include -#include -#include - -#include "Application.h" -#include "Faceshift.h" -#include "Visage.h" - -// this has to go after our normal includes, because its definition of HANDLE conflicts with Qt's -#ifdef HAVE_VISAGE -#include -#endif - -namespace VisageSDK { -#ifdef WIN32 - void __declspec(dllimport) initializeLicenseManager(char* licenseKeyFileName); -#else - void initializeLicenseManager(char* licenseKeyFileName); -#endif -} - -using namespace VisageSDK; - -const glm::vec3 DEFAULT_HEAD_ORIGIN(0.0f, 0.0f, 0.7f); - -Visage::Visage() : - _enabled(false), - _headOrigin(DEFAULT_HEAD_ORIGIN) { - -#ifdef HAVE_VISAGE -#ifdef WIN32 - QByteArray licensePath = PathUtils::resourcesPath().toLatin1() + "visage"; -#else - QByteArray licensePath = PathUtils::resourcesPath().toLatin1() + "visage/license.vlc"; -#endif - initializeLicenseManager(licensePath.data()); - _tracker = new VisageTracker2(PathUtils::resourcesPath().toLatin1() + "visage/tracker.cfg"); - _data = new FaceData(); -#endif -} - -Visage::~Visage() { -#ifdef HAVE_VISAGE - _tracker->stop(); - // deleting the tracker crashes windows; disable for now - //delete _tracker; - delete _data; -#endif -} - -#ifdef HAVE_VISAGE -static int leftEyeBlinkIndex = 0; -static int rightEyeBlinkIndex = 1; - -static QMultiHash > createActionUnitNameMap() { - QMultiHash > blendshapeMap; - blendshapeMap.insert("JawFwd", QPair("au_jaw_z_push", 1.0f)); - blendshapeMap.insert("JawLeft", QPair("au_jaw_x_push", 1.0f)); - blendshapeMap.insert("JawOpen", QPair("au_jaw_drop", 1.0f)); - blendshapeMap.insert("LipsLowerDown", QPair("au_lower_lip_drop", 1.0f)); - blendshapeMap.insert("LipsUpperOpen", QPair("au_upper_lip_raiser", 1.0f)); - blendshapeMap.insert("LipsStretch_R", QPair("au_lip_stretcher_left", 0.5f)); - blendshapeMap.insert("MouthSmile_L", QPair("au_lip_corner_depressor", -1.0f)); - blendshapeMap.insert("MouthSmile_R", QPair("au_lip_corner_depressor", -1.0f)); - blendshapeMap.insert("BrowsU_R", QPair("au_left_outer_brow_raiser", 1.0f)); - blendshapeMap.insert("BrowsU_C", QPair("au_left_inner_brow_raiser", 1.0f)); - blendshapeMap.insert("BrowsD_R", QPair("au_left_brow_lowerer", 1.0f)); - blendshapeMap.insert("EyeBlink_L", QPair("au_leye_closed", 1.0f)); - blendshapeMap.insert("EyeBlink_R", QPair("au_reye_closed", 1.0f)); - blendshapeMap.insert("EyeOpen_L", QPair("au_upper_lid_raiser", 1.0f)); - blendshapeMap.insert("EyeOpen_R", QPair("au_upper_lid_raiser", 1.0f)); - blendshapeMap.insert("LipLowerOpen", QPair("au_lower_lip_x_push", 1.0f)); - blendshapeMap.insert("LipsStretch_L", QPair("au_lip_stretcher_right", 0.5f)); - blendshapeMap.insert("BrowsU_L", QPair("au_right_outer_brow_raiser", 1.0f)); - blendshapeMap.insert("BrowsU_C", QPair("au_right_inner_brow_raiser", 1.0f)); - blendshapeMap.insert("BrowsD_L", QPair("au_right_brow_lowerer", 1.0f)); - - QMultiHash > actionUnitNameMap; - for (int i = 0;; i++) { - QByteArray blendshape = FACESHIFT_BLENDSHAPES[i]; - if (blendshape.isEmpty()) { - break; - } - if (blendshape == "EyeBlink_L") { - leftEyeBlinkIndex = i; - - } else if (blendshape == "EyeBlink_R") { - rightEyeBlinkIndex = i; - } - for (QMultiHash >::const_iterator it = blendshapeMap.constFind(blendshape); - it != blendshapeMap.constEnd() && it.key() == blendshape; it++) { - actionUnitNameMap.insert(it.value().first, QPair(i, it.value().second)); - } - } - - return actionUnitNameMap; -} - -static const QMultiHash >& getActionUnitNameMap() { - static QMultiHash > actionUnitNameMap = createActionUnitNameMap(); - return actionUnitNameMap; -} -#endif - - -#ifdef HAVE_VISAGE -const float TRANSLATION_SCALE = 20.0f; -void Visage::init() { - connect(DependencyManager::get().data(), SIGNAL(connectionStateChanged()), SLOT(updateEnabled())); - updateEnabled(); -} - -void Visage::update(float deltaTime) { - if (!isActive()) { - return; - } - FaceTracker::update(deltaTime); - - _headRotation = glm::quat(glm::vec3(-_data->faceRotation[0], -_data->faceRotation[1], _data->faceRotation[2])); - _headTranslation = (glm::vec3(_data->faceTranslation[0], _data->faceTranslation[1], _data->faceTranslation[2]) - - _headOrigin) * TRANSLATION_SCALE; - _estimatedEyePitch = glm::degrees(-_data->gazeDirection[1]); - _estimatedEyeYaw = glm::degrees(-_data->gazeDirection[0]); - - if (_actionUnitIndexMap.isEmpty()) { - int maxIndex = -1; - for (int i = 0; i < _data->actionUnitCount; i++) { - QByteArray name = _data->actionUnitsNames[i]; - for (QMultiHash >::const_iterator it = getActionUnitNameMap().constFind(name); - it != getActionUnitNameMap().constEnd() && it.key() == name; it++) { - _actionUnitIndexMap.insert(i, it.value()); - maxIndex = qMax(maxIndex, it.value().first); - } - } - _blendshapeCoefficients.resize(maxIndex + 1); - } - - qFill(_blendshapeCoefficients.begin(), _blendshapeCoefficients.end(), 0.0f); - for (int i = 0; i < _data->actionUnitCount; i++) { - if (!_data->actionUnitsUsed[i]) { - continue; - } - for (QMultiHash >::const_iterator it = _actionUnitIndexMap.constFind(i); - it != _actionUnitIndexMap.constEnd() && it.key() == i; it++) { - _blendshapeCoefficients[it.value().first] += _data->actionUnits[i] * it.value().second; - } - } - _blendshapeCoefficients[leftEyeBlinkIndex] = 1.0f - _data->eyeClosure[1]; - _blendshapeCoefficients[rightEyeBlinkIndex] = 1.0f - _data->eyeClosure[0]; -} - -void Visage::reset() { - _headOrigin += _headTranslation / TRANSLATION_SCALE; -} -#endif - -void Visage::updateEnabled() { - setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Visage) && - !(Menu::getInstance()->isOptionChecked(MenuOption::Faceshift) && - DependencyManager::get()->isConnectedOrConnecting()) && - !Menu::getInstance()->isOptionChecked(MenuOption::DDEFaceRegression)); -} - -void Visage::setEnabled(bool enabled) { -#ifdef HAVE_VISAGE - if (_enabled == enabled) { - return; - } - if ((_enabled = enabled)) { - _tracker->trackFromCam(); - } else { - _tracker->stop(); - } -#endif -} diff --git a/interface/src/devices/Visage.h b/interface/src/devices/Visage.h deleted file mode 100644 index 3ff1ea8c27..0000000000 --- a/interface/src/devices/Visage.h +++ /dev/null @@ -1,63 +0,0 @@ -// -// Visage.h -// interface/src/devices -// -// Created by Andrzej Kapolka on 2/11/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#ifndef hifi_Visage_h -#define hifi_Visage_h - -#include -#include -#include - -#include - -#include "FaceTracker.h" - -namespace VisageSDK { - class VisageTracker2; - struct FaceData; -} - -/// Handles input from the Visage webcam feature tracking software. -class Visage : public FaceTracker, public Dependency { - Q_OBJECT - SINGLETON_DEPENDENCY - -public: -#ifdef HAVE_VISAGE - virtual void init(); - virtual void update(float deltaTime); - virtual void reset(); - - virtual bool isActive() const { return _tracker->getTrackingData(_data) == TRACK_STAT_OK; } - virtual bool isTracking() const { return isActive(); } -#endif - -public slots: - void updateEnabled(); - -private: - Visage(); - virtual ~Visage(); - -#ifdef HAVE_VISAGE - VisageSDK::VisageTracker2* _tracker; - VisageSDK::FaceData* _data; - QMultiHash > _actionUnitIndexMap; -#endif - - void setEnabled(bool enabled); - - bool _enabled; - - glm::vec3 _headOrigin; -}; - -#endif // hifi_Visage_h From 30e580e207581077a54c80c3e01d36c3e92aaa5f Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 17 Apr 2015 13:42:30 -0700 Subject: [PATCH 3/7] remove visage from Menu --- interface/src/Menu.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 8d6a1e3184..7789ddda4a 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -30,7 +30,6 @@ #include "devices/Faceshift.h" #include "devices/RealSense.h" #include "devices/SixenseManager.h" -#include "devices/Visage.h" #include "MainWindow.h" #include "scripting/MenuScriptingInterface.h" #if defined(Q_OS_MAC) || defined(Q_OS_WIN) @@ -376,12 +375,6 @@ Menu::Menu() { 0, false, qApp, SLOT(setActiveFaceTracker())); faceTrackerGroup->addAction(ddeFaceTracker); -#endif -#ifdef HAVE_VISAGE - QAction* visageFaceTracker = addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::Visage, - 0, false, - qApp, SLOT(setActiveFaceTracker())); - faceTrackerGroup->addAction(visageFaceTracker); #endif } #ifdef HAVE_DDE From 63a81bdcb40260803662f3a296973220a6c803fd Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 17 Apr 2015 14:27:58 -0700 Subject: [PATCH 4/7] remove VISAGE handling in interface CMakeLists --- interface/CMakeLists.txt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index f4f390607b..885e4ed4b5 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -170,15 +170,6 @@ foreach(EXTERNAL ${OPTIONAL_EXTERNALS}) endif () endforeach() -# special APPLE modifications for Visage library -if (VISAGE_FOUND AND NOT DISABLE_VISAGE AND APPLE) - add_definitions(-DMAC_OS_X) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-comment") - find_library(AVFoundation AVFoundation) - find_library(CoreMedia CoreMedia) - target_link_libraries(${TARGET_NAME} ${AVFoundation} ${CoreMedia} ${NEW_STD_LIBRARY}) -endif () - # special OS X modifications for RtMidi library if (RTMIDI_FOUND AND NOT DISABLE_RTMIDI AND APPLE) find_library(CoreMIDI CoreMIDI) From 6b615c1ba145665db75d14737341de99ff558f2a Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 17 Apr 2015 14:28:20 -0700 Subject: [PATCH 5/7] remove Visage from menu header --- interface/src/Menu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/Menu.h b/interface/src/Menu.h index ea34664eaa..1db97c1250 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -251,7 +251,6 @@ namespace MenuOption { const QString TransmitterDrive = "Transmitter Drive"; const QString TurnWithHead = "Turn using Head"; const QString PackageModel = "Package Model..."; - const QString Visage = "Visage"; const QString VisibleToEveryone = "Everyone"; const QString VisibleToFriends = "Friends"; const QString VisibleToNoOne = "No one"; From cfac4fe9c16307559f23fd82a5695ab5fb996223 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 17 Apr 2015 14:28:41 -0700 Subject: [PATCH 6/7] remove the Visage find module --- cmake/modules/FindVisage.cmake | 68 ---------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 cmake/modules/FindVisage.cmake diff --git a/cmake/modules/FindVisage.cmake b/cmake/modules/FindVisage.cmake deleted file mode 100644 index 2b288f4681..0000000000 --- a/cmake/modules/FindVisage.cmake +++ /dev/null @@ -1,68 +0,0 @@ -# -# FindVisage.cmake -# -# Try to find the Visage controller library -# -# You must provide a VISAGE_ROOT_DIR which contains lib and include directories -# -# Once done this will define -# -# VISAGE_FOUND - system found Visage -# VISAGE_INCLUDE_DIRS - the Visage include directory -# VISAGE_LIBRARIES - Link this to use Visage -# -# Created on 2/11/2014 by Andrzej Kapolka -# Copyright 2014 High Fidelity, Inc. -# -# Distributed under the Apache License, Version 2.0. -# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -# - -include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") -hifi_library_search_hints("visage") - -find_path(VISAGE_BASE_INCLUDE_DIR VisageTracker2.h PATH_SUFFIXES include HINTS ${VISAGE_SEARCH_DIRS}) - -if (APPLE) - find_path(VISAGE_XML_INCLUDE_DIR libxml/xmlreader.h HINTS /usr/include/libxml2 ${VISAGE_SEARCH_DIRS}) - find_path(VISAGE_OPENCV_INCLUDE_DIR cv.h PATH_SUFFIXES dependencies/OpenCV_MacOSX/include HINTS ${VISAGE_SEARCH_DIRS}) - find_path(VISAGE_OPENCV2_INCLUDE_DIR opencv.hpp PATH_SUFFIXES dependencies/OpenCV_MacOSX/include/opencv2 HINTS ${VISAGE_SEARCH_DIRS}) - - find_library(VISAGE_CORE_LIBRARY NAME vscore PATH_SUFFIXES lib HINTS ${VISAGE_SEARCH_DIRS}) - find_library(VISAGE_VISION_LIBRARY NAME vsvision PATH_SUFFIXES lib HINTS ${VISAGE_SEARCH_DIRS}) - find_library(VISAGE_OPENCV_LIBRARY NAME OpenCV PATH_SUFFIXES dependencies/OpenCV_MacOSX/lib HINTS ${VISAGE_SEARCH_DIRS}) - - find_library(CoreVideo CoreVideo) - find_library(QTKit QTKit) - find_library(IOKit IOKit) - -elseif (WIN32) - find_path(VISAGE_XML_INCLUDE_DIR libxml/xmlreader.h PATH_SUFFIXES dependencies/libxml2/include HINTS ${VISAGE_SEARCH_DIRS}) - find_path(VISAGE_OPENCV_INCLUDE_DIR opencv/cv.h PATH_SUFFIXES dependencies/OpenCV/include HINTS ${VISAGE_SEARCH_DIRS}) - find_path(VISAGE_OPENCV2_INCLUDE_DIR cv.h PATH_SUFFIXES dependencies/OpenCV/include/opencv HINTS ${VISAGE_SEARCH_DIRS}) - - find_library(VISAGE_CORE_LIBRARY NAME vscore PATH_SUFFIXES lib HINTS ${VISAGE_SEARCH_DIRS}) - find_library(VISAGE_VISION_LIBRARY NAME vsvision PATH_SUFFIXES lib HINTS ${VISAGE_SEARCH_DIRS}) - find_library(VISAGE_OPENCV_LIBRARY NAME opencv_core243 PATH_SUFFIXES dependencies/OpenCV/lib HINTS ${VISAGE_SEARCH_DIRS}) -endif () - -include(FindPackageHandleStandardArgs) - -list(APPEND VISAGE_ARGS_LIST VISAGE_BASE_INCLUDE_DIR VISAGE_XML_INCLUDE_DIR - VISAGE_OPENCV_INCLUDE_DIR VISAGE_OPENCV2_INCLUDE_DIR - VISAGE_CORE_LIBRARY VISAGE_VISION_LIBRARY) - -if (APPLE) - list(APPEND VISAGE_ARGS_LIST CoreVideo QTKit IOKit) -endif () - -find_package_handle_standard_args(Visage DEFAULT_MSG ${VISAGE_ARGS_LIST}) - -set(VISAGE_INCLUDE_DIRS "${VISAGE_XML_INCLUDE_DIR}" "${VISAGE_OPENCV_INCLUDE_DIR}" "${VISAGE_OPENCV2_INCLUDE_DIR}" "${VISAGE_BASE_INCLUDE_DIR}") -set(VISAGE_LIBRARIES "${VISAGE_CORE_LIBRARY}" "${VISAGE_VISION_LIBRARY}") - -if (APPLE) - list(APPEND VISAGE_LIBRARIES "${CoreVideo}" "${QTKit}" "${IOKit}") -endif () - -mark_as_advanced(VISAGE_INCLUDE_DIRS VISAGE_LIBRARIES) From 511240da5ad37626b25c3ac3707c85a16cbe17b3 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 17 Apr 2015 14:29:51 -0700 Subject: [PATCH 7/7] remove Visage from FaceTracker comment --- interface/src/devices/FaceTracker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/devices/FaceTracker.h b/interface/src/devices/FaceTracker.h index 362099aaf6..db6fdd74b9 100644 --- a/interface/src/devices/FaceTracker.h +++ b/interface/src/devices/FaceTracker.h @@ -18,7 +18,7 @@ #include #include -/// Base class for face trackers (Faceshift, Visage, DDE). +/// Base class for face trackers (Faceshift, DDE). class FaceTracker : public QObject { Q_OBJECT