From a5a7f56a32e05b91fc412133e5d51512663b0921 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 3 Jul 2018 10:24:52 -0700 Subject: [PATCH 01/23] Fix crash when editing clientOnly entity with no myAvatar --- libraries/entities/src/EntityEditPacketSender.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libraries/entities/src/EntityEditPacketSender.cpp b/libraries/entities/src/EntityEditPacketSender.cpp index 9ca102d016..0982775b09 100644 --- a/libraries/entities/src/EntityEditPacketSender.cpp +++ b/libraries/entities/src/EntityEditPacketSender.cpp @@ -84,9 +84,15 @@ void EntityEditPacketSender::queueEditEntityMessage(PacketType type, EntityTreePointer entityTree, EntityItemID entityItemID, const EntityItemProperties& properties) { - if (properties.getClientOnly() && properties.getOwningAvatarID() == _myAvatar->getID()) { - // this is an avatar-based entity --> update our avatar-data rather than sending to the entity-server - queueEditAvatarEntityMessage(type, entityTree, entityItemID, properties); + if (properties.getClientOnly()) { + if (!_myAvatar) { + qCWarning(entities) << "Suppressing entity edit message: cannot send clientOnly edit with no myAvatar"; + } else if (properties.getOwningAvatarID() == _myAvatar->getID()) { + // this is an avatar-based entity --> update our avatar-data rather than sending to the entity-server + queueEditAvatarEntityMessage(type, entityTree, entityItemID, properties); + } else { + qCWarning(entities) << "Suppressing entity edit message: cannot send clientOnly edit for another avatar"; + } return; } From c11f4be5c15f5958760afcbbad6e54c90dd2dff8 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Wed, 11 Jul 2018 19:14:24 -0300 Subject: [PATCH 02/23] Make louder android mic --- libraries/audio-client/src/AudioClient.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index a6f0416a30..f325fe1273 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -482,6 +482,12 @@ bool nativeFormatForAudioDevice(const QAudioDeviceInfo& audioDevice, audioFormat.setSampleType(QAudioFormat::SignedInt); audioFormat.setByteOrder(QAudioFormat::LittleEndian); +#if defined(Q_OS_ANDROID) + if (audioDevice == QAudioDeviceInfo::defaultInputDevice()) { + audioFormat.setSampleRate(44100); + } +#endif + if (!audioDevice.isFormatSupported(audioFormat)) { qCWarning(audioclient) << "The native format is" << audioFormat << "but isFormatSupported() failed."; return false; From e039ef172958f5ba6b0273a5290aef2dee1951e3 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Thu, 12 Jul 2018 18:12:53 -0300 Subject: [PATCH 03/23] Use 24000Hz sample rate for Samsung only --- libraries/audio-client/CMakeLists.txt | 5 ++++- libraries/audio-client/src/AudioClient.cpp | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libraries/audio-client/CMakeLists.txt b/libraries/audio-client/CMakeLists.txt index d419a2fb7a..6ca7962c39 100644 --- a/libraries/audio-client/CMakeLists.txt +++ b/libraries/audio-client/CMakeLists.txt @@ -1,5 +1,8 @@ set(TARGET_NAME audio-client) -setup_hifi_library(Network Multimedia) +if (ANDROID) + set(PLATFORM_QT_COMPONENTS AndroidExtras) +endif () +setup_hifi_library(Network Multimedia ${PLATFORM_QT_COMPONENTS}) link_hifi_libraries(audio plugins) include_hifi_library_headers(shared) include_hifi_library_headers(networking) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index f325fe1273..b405a9f5ca 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -52,6 +52,10 @@ #include "AudioLogging.h" #include "AudioHelpers.h" +#if defined(Q_OS_ANDROID) +#include +#endif + const int AudioClient::MIN_BUFFER_FRAMES = 1; const int AudioClient::MAX_BUFFER_FRAMES = 20; @@ -483,8 +487,9 @@ bool nativeFormatForAudioDevice(const QAudioDeviceInfo& audioDevice, audioFormat.setByteOrder(QAudioFormat::LittleEndian); #if defined(Q_OS_ANDROID) - if (audioDevice == QAudioDeviceInfo::defaultInputDevice()) { - audioFormat.setSampleRate(44100); + QAndroidJniObject brand = QAndroidJniObject::getStaticObjectField("android/os/Build", "BRAND"); + if (audioDevice == QAudioDeviceInfo::defaultInputDevice() && brand.toString().contains("samsung", Qt::CaseInsensitive)) { + audioFormat.setSampleRate(24000); } #endif From d8af12152b6d1c29c6140be2ea74eb3e8f27fc27 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Fri, 13 Jul 2018 11:20:23 -0300 Subject: [PATCH 04/23] Add comment to explain the workaround --- libraries/audio-client/src/AudioClient.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index b405a9f5ca..b97ff77ad1 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -487,6 +487,8 @@ bool nativeFormatForAudioDevice(const QAudioDeviceInfo& audioDevice, audioFormat.setByteOrder(QAudioFormat::LittleEndian); #if defined(Q_OS_ANDROID) + // Using the HW sample rate (AUDIO_INPUT_FLAG_FAST) in some samsung phones causes a low volume at input stream + // Changing the sample rate forces a resampling that (in samsung) amplifies +18 dB QAndroidJniObject brand = QAndroidJniObject::getStaticObjectField("android/os/Build", "BRAND"); if (audioDevice == QAudioDeviceInfo::defaultInputDevice() && brand.toString().contains("samsung", Qt::CaseInsensitive)) { audioFormat.setSampleRate(24000); From c8a168c273f2a0f75a350230a2796b7f5fc23129 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Fri, 13 Jul 2018 16:48:28 -0300 Subject: [PATCH 05/23] Fix audio choppy. --- libraries/audio-client/src/AudioClient.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index b97ff77ad1..5a83286f3b 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -664,6 +664,7 @@ void AudioClient::stop() { switchOutputToAudioDevice(QAudioDeviceInfo(), true); #if defined(Q_OS_ANDROID) _checkInputTimer.stop(); + disconnect(&_checkInputTimer, &QTimer::timeout, 0, 0); #endif } From d230a634b27250693928abdf225871b7109f57b9 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Thu, 19 Jul 2018 14:50:40 -0300 Subject: [PATCH 06/23] Fix connects. Set down MIN_READS_TO_CONSIDER_INPUT_ALIVE to 10 --- libraries/audio-client/src/AudioClient.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index 5a83286f3b..161cf162b1 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -64,7 +64,7 @@ static const int RECEIVED_AUDIO_STREAM_CAPACITY_FRAMES = 100; #if defined(Q_OS_ANDROID) static const int CHECK_INPUT_READS_MSECS = 2000; -static const int MIN_READS_TO_CONSIDER_INPUT_ALIVE = 100; +static const int MIN_READS_TO_CONSIDER_INPUT_ALIVE = 10; #endif static const auto DEFAULT_POSITION_GETTER = []{ return Vectors::ZERO; }; @@ -239,7 +239,7 @@ AudioClient::AudioClient() : // start a thread to detect any device changes _checkDevicesTimer = new QTimer(this); - connect(_checkDevicesTimer, &QTimer::timeout, [this] { + connect(_checkDevicesTimer, &QTimer::timeout, this, [this] { QtConcurrent::run(QThreadPool::globalInstance(), [this] { checkDevices(); }); }); const unsigned long DEVICE_CHECK_INTERVAL_MSECS = 2 * 1000; @@ -247,7 +247,7 @@ AudioClient::AudioClient() : // start a thread to detect peak value changes _checkPeakValuesTimer = new QTimer(this); - connect(_checkPeakValuesTimer, &QTimer::timeout, [this] { + connect(_checkPeakValuesTimer, &QTimer::timeout, this, [this] { QtConcurrent::run(QThreadPool::globalInstance(), [this] { checkPeakValues(); }); }); const unsigned long PEAK_VALUES_CHECK_INTERVAL_MSECS = 50; @@ -648,9 +648,7 @@ void AudioClient::start() { qCDebug(audioclient) << "The closest format available is" << outputDeviceInfo.nearestFormat(_desiredOutputFormat); } #if defined(Q_OS_ANDROID) - connect(&_checkInputTimer, &QTimer::timeout, [this] { - checkInputTimeout(); - }); + connect(&_checkInputTimer, &QTimer::timeout, this, &AudioClient::checkInputTimeout); _checkInputTimer.start(CHECK_INPUT_READS_MSECS); #endif } @@ -1572,9 +1570,7 @@ bool AudioClient::switchInputToAudioDevice(const QAudioDeviceInfo inputDeviceInf #if defined(Q_OS_ANDROID) if (_audioInput) { _shouldRestartInputSetup = true; - connect(_audioInput, &QAudioInput::stateChanged, [this](QAudio::State state) { - audioInputStateChanged(state); - }); + connect(_audioInput, &QAudioInput::stateChanged, this, &AudioClient::audioInputStateChanged); } #endif _inputDevice = _audioInput->start(); From 988acdb3f9c0c44560e0e0c24771947d4343cd2b Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Thu, 19 Jul 2018 18:53:03 -0300 Subject: [PATCH 07/23] Set output sample rate at 24000 (with testing purposes only) --- libraries/audio-client/src/AudioClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index 161cf162b1..8c0862f184 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -490,7 +490,7 @@ bool nativeFormatForAudioDevice(const QAudioDeviceInfo& audioDevice, // Using the HW sample rate (AUDIO_INPUT_FLAG_FAST) in some samsung phones causes a low volume at input stream // Changing the sample rate forces a resampling that (in samsung) amplifies +18 dB QAndroidJniObject brand = QAndroidJniObject::getStaticObjectField("android/os/Build", "BRAND"); - if (audioDevice == QAudioDeviceInfo::defaultInputDevice() && brand.toString().contains("samsung", Qt::CaseInsensitive)) { + if (brand.toString().contains("samsung", Qt::CaseInsensitive)) { audioFormat.setSampleRate(24000); } #endif @@ -1774,7 +1774,7 @@ bool AudioClient::switchOutputToAudioDevice(const QAudioDeviceInfo outputDeviceI _outputScratchBuffer = new int16_t[_outputPeriod]; // size local output mix buffer based on resampled network frame size - int networkPeriod = _localToOutputResampler->getMaxOutput(AudioConstants::NETWORK_FRAME_SAMPLES_STEREO); + int networkPeriod = _localToOutputResampler ? _localToOutputResampler->getMaxOutput(AudioConstants::NETWORK_FRAME_SAMPLES_STEREO) : AudioConstants::NETWORK_FRAME_SAMPLES_STEREO; _localOutputMixBuffer = new float[networkPeriod]; // local period should be at least twice the output period, From 00e3de4e0ae5c3738a8eb5f8c7aba70733383c07 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Thu, 19 Jul 2018 19:13:28 -0300 Subject: [PATCH 08/23] Revert output sample rate to native rate --- libraries/audio-client/src/AudioClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index 8c0862f184..c57360b09f 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -490,7 +490,7 @@ bool nativeFormatForAudioDevice(const QAudioDeviceInfo& audioDevice, // Using the HW sample rate (AUDIO_INPUT_FLAG_FAST) in some samsung phones causes a low volume at input stream // Changing the sample rate forces a resampling that (in samsung) amplifies +18 dB QAndroidJniObject brand = QAndroidJniObject::getStaticObjectField("android/os/Build", "BRAND"); - if (brand.toString().contains("samsung", Qt::CaseInsensitive)) { + if (audioDevice == QAudioDeviceInfo::defaultInputDevice() && brand.toString().contains("samsung", Qt::CaseInsensitive)) { audioFormat.setSampleRate(24000); } #endif From 23050998745432a556ff721b4e20785e948b6486 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 19 Jul 2018 16:09:16 -0700 Subject: [PATCH 09/23] Fix the Create selection box not always matching outline --- scripts/system/libraries/entitySelectionTool.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index 96a3b2b015..9b3143054d 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -263,7 +263,7 @@ SelectionManager = (function() { that.worldDimensions = properties.boundingBox.dimensions; that.worldPosition = properties.boundingBox.center; - that.worldRotation = properties.boundingBox.rotation; + that.worldRotation = Quat.IDENTITY; that.entityType = properties.type; @@ -271,10 +271,6 @@ SelectionManager = (function() { SelectionDisplay.setSpaceMode(SPACE_LOCAL); } } else { - that.localRotation = null; - that.localDimensions = null; - that.localPosition = null; - properties = Entities.getEntityProperties(that.selections[0]); that.entityType = properties.type; @@ -293,6 +289,7 @@ SelectionManager = (function() { tfl.z = Math.max(bb.tfl.z, tfl.z); } + that.localRotation = null; that.localDimensions = null; that.localPosition = null; that.worldDimensions = { @@ -300,6 +297,7 @@ SelectionManager = (function() { y: tfl.y - brn.y, z: tfl.z - brn.z }; + that.worldRotation = Quat.IDENTITY; that.worldPosition = { x: brn.x + (that.worldDimensions.x / 2), y: brn.y + (that.worldDimensions.y / 2), From fb8640de4778fc2b58d663c559fea4f2b3a3fb71 Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Fri, 20 Jul 2018 01:30:22 +0300 Subject: [PATCH 10/23] FB16870: Avatar Wearables showing incorrect number --- interface/src/AvatarBookmarks.cpp | 37 ++++++++++++++++++++++++++++--- interface/src/avatar/MyAvatar.cpp | 6 +++-- interface/src/avatar/MyAvatar.h | 3 ++- scripts/system/avatarapp.js | 23 ++++++++++++++----- 4 files changed, 57 insertions(+), 12 deletions(-) diff --git a/interface/src/AvatarBookmarks.cpp b/interface/src/AvatarBookmarks.cpp index 4e3e539dea..e2d5b648bb 100644 --- a/interface/src/AvatarBookmarks.cpp +++ b/interface/src/AvatarBookmarks.cpp @@ -144,9 +144,16 @@ void AvatarBookmarks::removeBookmark(const QString& bookmarkName) { emit bookmarkDeleted(bookmarkName); } +bool isWearableEntity(const EntityItemPointer& entity) { + return entity->isVisible() && entity->getParentJointIndex() != INVALID_JOINT_INDEX && entity->getParentID() == DependencyManager::get()->getSessionUUID(); +} + void AvatarBookmarks::updateAvatarEntities(const QVariantList &avatarEntities) { auto myAvatar = DependencyManager::get()->getMyAvatar(); - myAvatar->removeAvatarEntities(); + myAvatar->removeAvatarEntities([&](const EntityTreePointer& entityTree, const QUuid& entityID) { + auto entity = entityTree->findEntityByID(entityID); + return entity && isWearableEntity(entity); + }); addAvatarEntities(avatarEntities); } @@ -163,7 +170,10 @@ void AvatarBookmarks::loadBookmark(const QString& bookmarkName) { QVariantMap bookmark = bookmarkEntry.value().toMap(); if (!bookmark.empty()) { auto myAvatar = DependencyManager::get()->getMyAvatar(); - myAvatar->removeAvatarEntities(); + myAvatar->removeAvatarEntities([&](const EntityTreePointer& entityTree, const QUuid& entityID) { + auto entity = entityTree->findEntityByID(entityID); + return entity && isWearableEntity(entity); + }); const QString& avatarUrl = bookmark.value(ENTRY_AVATAR_URL, "").toString(); myAvatar->useFullAvatarURL(avatarUrl); qCDebug(interfaceapp) << "Avatar On " << avatarUrl; @@ -233,6 +243,27 @@ QVariantMap AvatarBookmarks::getAvatarDataToBookmark() { bookmark.insert(ENTRY_AVATAR_URL, avatarUrl); bookmark.insert(ENTRY_AVATAR_SCALE, avatarScale); bookmark.insert(ENTRY_AVATAR_ATTACHMENTS, myAvatar->getAttachmentsVariant()); - bookmark.insert(ENTRY_AVATAR_ENTITIES, myAvatar->getAvatarEntitiesVariant()); + + QScriptEngine scriptEngine; + QVariantList wearableEntities; + auto treeRenderer = DependencyManager::get(); + EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr; + auto avatarEntities = myAvatar->getAvatarEntityData(); + for (auto entityID : avatarEntities.keys()) { + auto entity = entityTree->findEntityByID(entityID); + if (!entity || !isWearableEntity(entity)) { + continue; + } + QVariantMap avatarEntityData; + EncodeBitstreamParams params; + auto desiredProperties = entity->getEntityProperties(params); + desiredProperties += PROP_LOCAL_POSITION; + desiredProperties += PROP_LOCAL_ROTATION; + EntityItemProperties entityProperties = entity->getProperties(desiredProperties); + QScriptValue scriptProperties = EntityItemPropertiesToScriptValue(&scriptEngine, entityProperties); + avatarEntityData["properties"] = scriptProperties.toVariant(); + wearableEntities.append(QVariant(avatarEntityData)); + } + bookmark.insert(ENTRY_AVATAR_ENTITIES, wearableEntities); return bookmark; } diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index fd121055a1..fa3ce565a3 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1607,14 +1607,16 @@ void MyAvatar::setSkeletonModelURL(const QUrl& skeletonModelURL) { emit skeletonModelURLChanged(); } -void MyAvatar::removeAvatarEntities() { +void MyAvatar::removeAvatarEntities(const std::function& condition) { auto treeRenderer = DependencyManager::get(); EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr; if (entityTree) { entityTree->withWriteLock([&] { AvatarEntityMap avatarEntities = getAvatarEntityData(); for (auto entityID : avatarEntities.keys()) { - entityTree->deleteEntity(entityID, true, true); + if(!condition || condition(entityTree, entityID)) { + entityTree->deleteEntity(entityID, true, true); + } } }); } diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 9b5ddd360d..dfb4c4ab42 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -33,6 +33,7 @@ #include "MyCharacterController.h" #include "RingBufferHistory.h" #include +#include class AvatarActionHold; class ModelItemID; @@ -926,7 +927,7 @@ public: * @returns {object[]} */ Q_INVOKABLE QVariantList getAvatarEntitiesVariant(); - void removeAvatarEntities(); + void removeAvatarEntities(const std::function& condition = {}); /**jsdoc * @function MyAvatar.isFlying diff --git a/scripts/system/avatarapp.js b/scripts/system/avatarapp.js index f692128fa3..77fe1ea755 100644 --- a/scripts/system/avatarapp.js +++ b/scripts/system/avatarapp.js @@ -29,13 +29,24 @@ function executeLater(callback) { Script.setTimeout(callback, 300); } -function getMyAvatarWearables() { - var wearablesArray = MyAvatar.getAvatarEntitiesVariant(); +var INVALID_JOINT_INDEX = -1 +function isWearable(avatarEntity) { + return avatarEntity.properties.visible === true && avatarEntity.properties.parentJointIndex !== INVALID_JOINT_INDEX && avatarEntity.properties.parentID === MyAvatar.sessionUUID; +} - for(var i = 0; i < wearablesArray.length; ++i) { - var wearable = wearablesArray[i]; - var localRotation = wearable.properties.localRotation; - wearable.properties.localRotationAngles = Quat.safeEulerAngles(localRotation) +function getMyAvatarWearables() { + var entitiesArray = MyAvatar.getAvatarEntitiesVariant(); + var wearablesArray = []; + + for (var i = 0; i < entitiesArray.length; ++i) { + var entity = entitiesArray[i]; + if (!isWearable(entity)) { + continue; + } + + var localRotation = entity.properties.localRotation; + entity.properties.localRotationAngles = Quat.safeEulerAngles(localRotation) + wearablesArray.push(entity); } return wearablesArray; From 849c91d8f6fd92dcdf53263b9561658a205d6316 Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Fri, 20 Jul 2018 19:32:58 +0300 Subject: [PATCH 11/23] remove not necessary EntityTreeRenderer from removeAvatarEntities's condition --- interface/src/AvatarBookmarks.cpp | 8 ++++++-- interface/src/avatar/MyAvatar.cpp | 4 ++-- interface/src/avatar/MyAvatar.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/interface/src/AvatarBookmarks.cpp b/interface/src/AvatarBookmarks.cpp index e2d5b648bb..5a2a3b4623 100644 --- a/interface/src/AvatarBookmarks.cpp +++ b/interface/src/AvatarBookmarks.cpp @@ -150,7 +150,9 @@ bool isWearableEntity(const EntityItemPointer& entity) { void AvatarBookmarks::updateAvatarEntities(const QVariantList &avatarEntities) { auto myAvatar = DependencyManager::get()->getMyAvatar(); - myAvatar->removeAvatarEntities([&](const EntityTreePointer& entityTree, const QUuid& entityID) { + auto treeRenderer = DependencyManager::get(); + EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr; + myAvatar->removeAvatarEntities([&](const QUuid& entityID) { auto entity = entityTree->findEntityByID(entityID); return entity && isWearableEntity(entity); }); @@ -170,7 +172,9 @@ void AvatarBookmarks::loadBookmark(const QString& bookmarkName) { QVariantMap bookmark = bookmarkEntry.value().toMap(); if (!bookmark.empty()) { auto myAvatar = DependencyManager::get()->getMyAvatar(); - myAvatar->removeAvatarEntities([&](const EntityTreePointer& entityTree, const QUuid& entityID) { + auto treeRenderer = DependencyManager::get(); + EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr; + myAvatar->removeAvatarEntities([&](const QUuid& entityID) { auto entity = entityTree->findEntityByID(entityID); return entity && isWearableEntity(entity); }); diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index fa3ce565a3..81b3ab37e2 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1607,14 +1607,14 @@ void MyAvatar::setSkeletonModelURL(const QUrl& skeletonModelURL) { emit skeletonModelURLChanged(); } -void MyAvatar::removeAvatarEntities(const std::function& condition) { +void MyAvatar::removeAvatarEntities(const std::function& condition) { auto treeRenderer = DependencyManager::get(); EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr; if (entityTree) { entityTree->withWriteLock([&] { AvatarEntityMap avatarEntities = getAvatarEntityData(); for (auto entityID : avatarEntities.keys()) { - if(!condition || condition(entityTree, entityID)) { + if(!condition || condition(entityID)) { entityTree->deleteEntity(entityID, true, true); } } diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index dfb4c4ab42..add00962da 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -927,7 +927,7 @@ public: * @returns {object[]} */ Q_INVOKABLE QVariantList getAvatarEntitiesVariant(); - void removeAvatarEntities(const std::function& condition = {}); + void removeAvatarEntities(const std::function& condition = {}); /**jsdoc * @function MyAvatar.isFlying From f5717b764835fe3a112bdf2974e2585d3f763ece Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Fri, 20 Jul 2018 19:33:16 +0300 Subject: [PATCH 12/23] add check for SELF_ID --- interface/src/AvatarBookmarks.cpp | 3 ++- scripts/system/avatarapp.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/src/AvatarBookmarks.cpp b/interface/src/AvatarBookmarks.cpp index 5a2a3b4623..3e0e643bd8 100644 --- a/interface/src/AvatarBookmarks.cpp +++ b/interface/src/AvatarBookmarks.cpp @@ -145,7 +145,8 @@ void AvatarBookmarks::removeBookmark(const QString& bookmarkName) { } bool isWearableEntity(const EntityItemPointer& entity) { - return entity->isVisible() && entity->getParentJointIndex() != INVALID_JOINT_INDEX && entity->getParentID() == DependencyManager::get()->getSessionUUID(); + return entity->isVisible() && entity->getParentJointIndex() != INVALID_JOINT_INDEX && + (entity->getParentID() == DependencyManager::get()->getSessionUUID() || entity->getParentID() == DependencyManager::get()->getMyAvatar()->getSelfID()); } void AvatarBookmarks::updateAvatarEntities(const QVariantList &avatarEntities) { diff --git a/scripts/system/avatarapp.js b/scripts/system/avatarapp.js index 77fe1ea755..612fcccea2 100644 --- a/scripts/system/avatarapp.js +++ b/scripts/system/avatarapp.js @@ -31,7 +31,8 @@ function executeLater(callback) { var INVALID_JOINT_INDEX = -1 function isWearable(avatarEntity) { - return avatarEntity.properties.visible === true && avatarEntity.properties.parentJointIndex !== INVALID_JOINT_INDEX && avatarEntity.properties.parentID === MyAvatar.sessionUUID; + return avatarEntity.properties.visible === true && avatarEntity.properties.parentJointIndex !== INVALID_JOINT_INDEX && + (avatarEntity.properties.parentID === MyAvatar.sessionUUID || avatarEntity.properties.parentID === MyAvatar.SELF_ID); } function getMyAvatarWearables() { From 3c49e7783c767d60e5e6e365adb645bc2e6197c8 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Mon, 23 Jul 2018 14:03:58 -0300 Subject: [PATCH 13/23] Add logs to debug. Revert later --- libraries/audio-client/src/AudioClient.cpp | 1 + libraries/audio/src/InboundAudioStream.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index c57360b09f..fa44367d47 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -1639,6 +1639,7 @@ void AudioClient::audioInputStateChanged(QAudio::State state) { void AudioClient::checkInputTimeout() { #if defined(Q_OS_ANDROID) if (_audioInput && _inputReadsSinceLastCheck < MIN_READS_TO_CONSIDER_INPUT_ALIVE) { + qDebug() << "[CHOPPY-AUDIO] " << _inputReadsSinceLastCheck << " < MIN_READS_TO_CONSIDER_INPUT_ALIVE"; _audioInput->stop(); } else { _inputReadsSinceLastCheck = 0; diff --git a/libraries/audio/src/InboundAudioStream.cpp b/libraries/audio/src/InboundAudioStream.cpp index 7645a674e4..cf4ad25f1b 100644 --- a/libraries/audio/src/InboundAudioStream.cpp +++ b/libraries/audio/src/InboundAudioStream.cpp @@ -138,6 +138,7 @@ int InboundAudioStream::parseData(ReceivedMessage& message) { // handle this packet based on its arrival status. switch (arrivalInfo._status) { case SequenceNumberStats::Unreasonable: { + qDebug() << "[CHOPPY-AUDIO] Unreasonable lostAudioData"; lostAudioData(1); break; } @@ -147,6 +148,7 @@ int InboundAudioStream::parseData(ReceivedMessage& message) { // also result in allowing the codec to interpolate lost data. Then // fall through to the "on time" logic to actually handle this packet int packetsDropped = arrivalInfo._seqDiffFromExpected; + qDebug() << "[CHOPPY-AUDIO] Early lostAudioData " << packetsDropped; lostAudioData(packetsDropped); // fall through to OnTime case @@ -181,6 +183,7 @@ int InboundAudioStream::parseData(ReceivedMessage& message) { // Since the data in the stream is using a codec that we aren't prepared for, // we need to let the codec know that we don't have data for it, this will // allow the codec to interpolate missing data and produce a fade to silence. + qDebug() << "[CHOPPY-AUDIO] !pcm lostAudioData 1"; lostAudioData(1); } From 33c858774bc1db76e2fcb3e7d89c53f90b597db1 Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Mon, 23 Jul 2018 21:01:43 +0300 Subject: [PATCH 14/23] fix coding standard compliance --- interface/src/avatar/MyAvatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 81b3ab37e2..b5e0098b81 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1614,7 +1614,7 @@ void MyAvatar::removeAvatarEntities(const std::functionwithWriteLock([&] { AvatarEntityMap avatarEntities = getAvatarEntityData(); for (auto entityID : avatarEntities.keys()) { - if(!condition || condition(entityID)) { + if (!condition || condition(entityID)) { entityTree->deleteEntity(entityID, true, true); } } From 52e5bdb360858d48cf82545e726a57aca26deea9 Mon Sep 17 00:00:00 2001 From: MuteTab Date: Mon, 23 Jul 2018 14:27:38 -0700 Subject: [PATCH 15/23] Added _aboutToQuit guard on eventFilter() --- interface/src/Application.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 311c08b858..122227da2c 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3650,6 +3650,10 @@ bool Application::event(QEvent* event) { bool Application::eventFilter(QObject* object, QEvent* event) { + if (_aboutToQuit) { + return true; + } + if (event->type() == QEvent::Leave) { getApplicationCompositor().handleLeaveEvent(); } From f24cfebe88eb36c22bcfdf230e7941e2c0f72111 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Tue, 24 Jul 2018 14:57:48 -0300 Subject: [PATCH 16/23] Revert "Add logs to debug. Revert later" This reverts commit 3c49e7783c767d60e5e6e365adb645bc2e6197c8. --- libraries/audio-client/src/AudioClient.cpp | 1 - libraries/audio/src/InboundAudioStream.cpp | 3 --- 2 files changed, 4 deletions(-) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index fa44367d47..c57360b09f 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -1639,7 +1639,6 @@ void AudioClient::audioInputStateChanged(QAudio::State state) { void AudioClient::checkInputTimeout() { #if defined(Q_OS_ANDROID) if (_audioInput && _inputReadsSinceLastCheck < MIN_READS_TO_CONSIDER_INPUT_ALIVE) { - qDebug() << "[CHOPPY-AUDIO] " << _inputReadsSinceLastCheck << " < MIN_READS_TO_CONSIDER_INPUT_ALIVE"; _audioInput->stop(); } else { _inputReadsSinceLastCheck = 0; diff --git a/libraries/audio/src/InboundAudioStream.cpp b/libraries/audio/src/InboundAudioStream.cpp index cf4ad25f1b..7645a674e4 100644 --- a/libraries/audio/src/InboundAudioStream.cpp +++ b/libraries/audio/src/InboundAudioStream.cpp @@ -138,7 +138,6 @@ int InboundAudioStream::parseData(ReceivedMessage& message) { // handle this packet based on its arrival status. switch (arrivalInfo._status) { case SequenceNumberStats::Unreasonable: { - qDebug() << "[CHOPPY-AUDIO] Unreasonable lostAudioData"; lostAudioData(1); break; } @@ -148,7 +147,6 @@ int InboundAudioStream::parseData(ReceivedMessage& message) { // also result in allowing the codec to interpolate lost data. Then // fall through to the "on time" logic to actually handle this packet int packetsDropped = arrivalInfo._seqDiffFromExpected; - qDebug() << "[CHOPPY-AUDIO] Early lostAudioData " << packetsDropped; lostAudioData(packetsDropped); // fall through to OnTime case @@ -183,7 +181,6 @@ int InboundAudioStream::parseData(ReceivedMessage& message) { // Since the data in the stream is using a codec that we aren't prepared for, // we need to let the codec know that we don't have data for it, this will // allow the codec to interpolate missing data and produce a fade to silence. - qDebug() << "[CHOPPY-AUDIO] !pcm lostAudioData 1"; lostAudioData(1); } From 8224492d72b25ed2e2f0403d9f146eb143553ed9 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 24 Jul 2018 11:51:13 -0700 Subject: [PATCH 17/23] avoid thread-unsafe socket errorString call --- libraries/networking/src/udt/Socket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index 4d4303698b..a068a806ec 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -229,7 +229,7 @@ qint64 Socket::writeDatagram(const QByteArray& datagram, const HifiSockAddr& soc if (bytesWritten < 0) { // when saturating a link this isn't an uncommon message - suppress it so it doesn't bomb the debug - HIFI_FCDEBUG(networking(), "Socket::writeDatagram" << _udpSocket.error() << "-" << qPrintable(_udpSocket.errorString()) ); + HIFI_FCDEBUG(networking(), "Socket::writeDatagram" << _udpSocket.error()); } return bytesWritten; @@ -513,7 +513,7 @@ std::vector Socket::getConnectionSockAddrs() { } void Socket::handleSocketError(QAbstractSocket::SocketError socketError) { - HIFI_FCDEBUG(networking(), "udt::Socket error - " << socketError << _udpSocket.errorString()); + HIFI_FCDEBUG(networking(), "udt::Socket error - " << socketError); } void Socket::handleStateChanged(QAbstractSocket::SocketState socketState) { From eea4630d2bd4052b0c642e347b211aa1430f1003 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Tue, 24 Jul 2018 14:29:05 -0700 Subject: [PATCH 18/23] Fix MS16704: Remove worn Avatar/Wearable before updating --- .../hifi/commerce/purchases/PurchasedItem.qml | 3 +- .../qml/hifi/commerce/purchases/Purchases.qml | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml b/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml index b2338d08de..032d9b0199 100644 --- a/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml +++ b/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml @@ -335,7 +335,8 @@ Item { upgradeUrl: root.upgradeUrl, itemHref: root.itemHref, itemType: root.itemType, - isInstalled: root.isInstalled + isInstalled: root.isInstalled, + wornEntityID: root.wornEntityID }); } } diff --git a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml index 3569ce6767..3b8e2c0f4d 100644 --- a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml +++ b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml @@ -707,6 +707,12 @@ Rectangle { } } } else if (msg.method === "updateItemClicked") { + // These three cases are very similar to the conditionals below, under + // "if msg.method === "giftAsset". They differ in their popup's wording + // and the actions to take when continuing. + // I could see an argument for DRYing up this code, but I think the + // actions are different enough now and potentially moving forward such that I'm + // OK with "somewhat repeating myself". if (msg.itemType === "app" && msg.isInstalled) { lightboxPopup.titleText = "Uninstall App"; lightboxPopup.bodyText = "The app that you are trying to update is installed.

" + @@ -721,6 +727,35 @@ Rectangle { sendToScript(msg); }; lightboxPopup.visible = true; + } else if (msg.itemType === "wearable" && msg.wornEntityID !== '') { + lightboxPopup.titleText = "Remove Wearable"; + lightboxPopup.bodyText = "You are currently wearing the wearable that you are trying to update.

" + + "If you proceed, this wearable will be removed."; + lightboxPopup.button1text = "CANCEL"; + lightboxPopup.button1method = function() { + lightboxPopup.visible = false; + } + lightboxPopup.button2text = "CONFIRM"; + lightboxPopup.button2method = function() { + Entities.deleteEntity(msg.wornEntityID); + purchasesModel.setProperty(index, 'wornEntityID', ''); + sendToScript(msg); + }; + lightboxPopup.visible = true; + } else if (msg.itemType === "avatar" && MyAvatar.skeletonModelURL === msg.itemHref) { + lightboxPopup.titleText = "Change Avatar to Default"; + lightboxPopup.bodyText = "You are currently wearing the avatar that you are trying to update.

" + + "If you proceed, your avatar will be changed to the default avatar."; + lightboxPopup.button1text = "CANCEL"; + lightboxPopup.button1method = function() { + lightboxPopup.visible = false; + } + lightboxPopup.button2text = "CONFIRM"; + lightboxPopup.button2method = function() { + MyAvatar.useFullAvatarURL(''); + sendToScript(msg); + }; + lightboxPopup.visible = true; } else { sendToScript(msg); } From 6db46e84fff07b25b488520348322b54265d48fb Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Wed, 25 Jul 2018 01:11:26 +0300 Subject: [PATCH 19/23] FB17036 Avatar App causes error on cache reload (CTRL+R) --- scripts/system/avatarapp.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/system/avatarapp.js b/scripts/system/avatarapp.js index b598649f4f..5c7cb93aa6 100644 --- a/scripts/system/avatarapp.js +++ b/scripts/system/avatarapp.js @@ -455,10 +455,6 @@ startup(); var isWired = false; function off() { - if (isWired) { // It is not ok to disconnect these twice, hence guard. - isWired = false; - } - if(adjustWearables.opened) { adjustWearables.setOpened(false); ensureWearableSelected(null); @@ -468,16 +464,20 @@ function off() { Messages.unsubscribe('Hifi-Object-Manipulation'); } - AvatarBookmarks.bookmarkLoaded.disconnect(onBookmarkLoaded); - AvatarBookmarks.bookmarkDeleted.disconnect(onBookmarkDeleted); - AvatarBookmarks.bookmarkAdded.disconnect(onBookmarkAdded); + if (isWired) { // It is not ok to disconnect these twice, hence guard. + isWired = false; - MyAvatar.skeletonModelURLChanged.disconnect(onSkeletonModelURLChanged); - MyAvatar.dominantHandChanged.disconnect(onDominantHandChanged); - MyAvatar.collisionsEnabledChanged.disconnect(onCollisionsEnabledChanged); - MyAvatar.newCollisionSoundURL.disconnect(onNewCollisionSoundUrl); - MyAvatar.animGraphUrlChanged.disconnect(onAnimGraphUrlChanged); - MyAvatar.targetScaleChanged.disconnect(onTargetScaleChanged); + AvatarBookmarks.bookmarkLoaded.disconnect(onBookmarkLoaded); + AvatarBookmarks.bookmarkDeleted.disconnect(onBookmarkDeleted); + AvatarBookmarks.bookmarkAdded.disconnect(onBookmarkAdded); + + MyAvatar.skeletonModelURLChanged.disconnect(onSkeletonModelURLChanged); + MyAvatar.dominantHandChanged.disconnect(onDominantHandChanged); + MyAvatar.collisionsEnabledChanged.disconnect(onCollisionsEnabledChanged); + MyAvatar.newCollisionSoundURL.disconnect(onNewCollisionSoundUrl); + MyAvatar.animGraphUrlChanged.disconnect(onAnimGraphUrlChanged); + MyAvatar.targetScaleChanged.disconnect(onTargetScaleChanged); + } } function on() { From 04754d0dab1295f4728772ebf9715577ba3559d5 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Tue, 24 Jul 2018 15:28:37 -0700 Subject: [PATCH 20/23] Fix MS16820: Rate limit Snapshot Polaroids --- scripts/system/snapshot.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index 3ddbeb997d..3e58bc61ad 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -279,9 +279,21 @@ function onMessage(message) { } var POLAROID_PRINT_SOUND = SoundCache.getSound(Script.resourcesPath() + "sounds/snapshot/sound-print-photo.wav"); -var POLAROID_MODEL_URL = 'http://hifi-content.s3.amazonaws.com/alan/dev/Test/snapshot.fbx'; +var POLAROID_MODEL_URL = 'http://hifi-content.s3.amazonaws.com/alan/dev/Test/snapshot.fbx'; +var POLAROID_RATE_LIMIT_MS = 1000; +var polaroidPrintingIsRateLimited = false; function printToPolaroid(image_url) { + + // Rate-limit printing + if (polaroidPrintingIsRateLimited) { + return; + } + polaroidPrintingIsRateLimited = true; + Script.setTimeout(function () { + polaroidPrintingIsRateLimited = false; + }, POLAROID_RATE_LIMIT_MS); + var polaroid_url = image_url; var model_pos = Vec3.sum(MyAvatar.position, Vec3.multiply(1.25, Quat.getForward(MyAvatar.orientation))); From 8da1db31df94b6bbd953970f09aeef8d6dcc9c05 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 25 Jul 2018 08:44:11 -0700 Subject: [PATCH 21/23] fix audio page being in desktop when your in HMD --- interface/src/scripting/Audio.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/src/scripting/Audio.cpp b/interface/src/scripting/Audio.cpp index b27cc344c3..bcb7a6c10f 100644 --- a/interface/src/scripting/Audio.cpp +++ b/interface/src/scripting/Audio.cpp @@ -56,6 +56,7 @@ Audio::Audio() : _devices(_contextIsHMD) { connect(client, &AudioClient::inputVolumeChanged, this, &Audio::setInputVolume); connect(this, &Audio::contextChanged, &_devices, &AudioDevices::onContextChanged); enableNoiseReduction(enableNoiseReductionSetting.get()); + onContextChanged(); } bool Audio::startRecording(const QString& filepath) { From 630df7c2330d73b5ef86ead64620eb950fa00137 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 25 Jul 2018 13:28:23 -0700 Subject: [PATCH 22/23] Corrects loading of texture and default visibility. --- interface/src/ui/overlays/ModelOverlay.cpp | 10 ++++++---- interface/src/ui/overlays/ModelOverlay.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/interface/src/ui/overlays/ModelOverlay.cpp b/interface/src/ui/overlays/ModelOverlay.cpp index 71354002ea..802f9c2c77 100644 --- a/interface/src/ui/overlays/ModelOverlay.cpp +++ b/interface/src/ui/overlays/ModelOverlay.cpp @@ -27,10 +27,6 @@ ModelOverlay::ModelOverlay() { _model->setLoadingPriority(_loadPriority); _isLoaded = false; - - // Don't show overlay until textures have loaded - _visible = false; - render::ScenePointer scene = qApp->getMain3DScene(); _model->setVisibleInScene(false, scene); } @@ -136,6 +132,11 @@ void ModelOverlay::update(float deltatime) { } scene->enqueueTransaction(transaction); + if (_texturesDirty && !_modelTextures.isEmpty()) { + _texturesDirty = false; + _model->setTextures(_modelTextures); + } + if (!_texturesLoaded && _model->getGeometry() && _model->getGeometry()->areTexturesLoaded()) { _texturesLoaded = true; if (!_modelTextures.isEmpty()) { @@ -242,6 +243,7 @@ void ModelOverlay::setProperties(const QVariantMap& properties) { _texturesLoaded = false; QVariantMap textureMap = texturesValue.toMap(); _modelTextures = textureMap; + _texturesDirty = true; } auto groupCulledValue = properties["isGroupCulled"]; diff --git a/interface/src/ui/overlays/ModelOverlay.h b/interface/src/ui/overlays/ModelOverlay.h index f7a79c5615..76e4601021 100644 --- a/interface/src/ui/overlays/ModelOverlay.h +++ b/interface/src/ui/overlays/ModelOverlay.h @@ -94,6 +94,7 @@ private: ModelPointer _model; QVariantMap _modelTextures; bool _texturesLoaded { false }; + bool _texturesDirty{ false }; render::ItemIDs _subRenderItemIDs; From ce53b44b025e038a458bcf508cd1bc917a6e11e3 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 25 Jul 2018 15:58:46 -0700 Subject: [PATCH 23/23] CR comments. --- interface/src/ui/overlays/ModelOverlay.cpp | 3 --- interface/src/ui/overlays/ModelOverlay.h | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/interface/src/ui/overlays/ModelOverlay.cpp b/interface/src/ui/overlays/ModelOverlay.cpp index 802f9c2c77..641ad8a152 100644 --- a/interface/src/ui/overlays/ModelOverlay.cpp +++ b/interface/src/ui/overlays/ModelOverlay.cpp @@ -139,9 +139,6 @@ void ModelOverlay::update(float deltatime) { if (!_texturesLoaded && _model->getGeometry() && _model->getGeometry()->areTexturesLoaded()) { _texturesLoaded = true; - if (!_modelTextures.isEmpty()) { - _model->setTextures(_modelTextures); - } _model->setVisibleInScene(getVisible(), scene); _model->updateRenderItems(); diff --git a/interface/src/ui/overlays/ModelOverlay.h b/interface/src/ui/overlays/ModelOverlay.h index 76e4601021..32500576e2 100644 --- a/interface/src/ui/overlays/ModelOverlay.h +++ b/interface/src/ui/overlays/ModelOverlay.h @@ -94,7 +94,7 @@ private: ModelPointer _model; QVariantMap _modelTextures; bool _texturesLoaded { false }; - bool _texturesDirty{ false }; + bool _texturesDirty { false }; render::ItemIDs _subRenderItemIDs;