From f0f5f8871cbd83acdaf4e25ee027cc0eee7d8a04 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 23 Jan 2017 16:08:01 -0800 Subject: [PATCH 1/7] Fix Overlay-as-child of model entity with reg point This fixes as issue where when you set the parent of an overlay to be a model entity with a non-(0.5, 0.5, 0.5) registration point, the overlay would still be positioned relative to the center of the model. The issue is that the default parent joint index was 0, which is the center of the model. Entities had a default parent joint index of -1 (technically 65535 because it is a uint16). Avatars previously defaulted to 0, and that is maintained here. --- libraries/avatars/src/AvatarData.cpp | 1 + libraries/shared/src/SpatiallyNestable.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index 1fb68fce14..faac0224cf 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -133,6 +133,7 @@ AvatarData::AvatarData() : setBodyPitch(0.0f); setBodyYaw(-90.0f); setBodyRoll(0.0f); + setParentJointIndex(0); ASSERT(sizeof(AvatarDataPacket::Header) == AvatarDataPacket::HEADER_SIZE); ASSERT(sizeof(AvatarDataPacket::MinimalAvatarInfo) == AvatarDataPacket::MINIMAL_AVATAR_INFO_SIZE); diff --git a/libraries/shared/src/SpatiallyNestable.h b/libraries/shared/src/SpatiallyNestable.h index f58e2c906c..04ed14f72e 100644 --- a/libraries/shared/src/SpatiallyNestable.h +++ b/libraries/shared/src/SpatiallyNestable.h @@ -26,6 +26,8 @@ using SpatiallyNestableWeakConstPointer = std::weak_ptr using SpatiallyNestablePointer = std::shared_ptr; using SpatiallyNestableConstPointer = std::shared_ptr; +static const uint16_t INVALID_JOINT_INDEX = -1; + enum class NestableType { Entity, Avatar, @@ -180,7 +182,7 @@ protected: const NestableType _nestableType; // EntityItem or an AvatarData QUuid _id; QUuid _parentID; // what is this thing's transform relative to? - quint16 _parentJointIndex { 0 }; // which joint of the parent is this relative to? + quint16 _parentJointIndex { INVALID_JOINT_INDEX }; // which joint of the parent is this relative to? mutable SpatiallyNestableWeakPointer _parent; From 1b05ae8a82e87f7cfb1345891a9b8fd94a81f8be Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 25 Jan 2017 11:00:07 +1300 Subject: [PATCH 2/7] Make handling of Clara.io download-ready state transition more robust --- scripts/system/html/js/marketplacesInject.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index d5f0f4cb06..9af84455dd 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -241,11 +241,12 @@ return; } + isDownloading = false; + EventBridge.emitWebEvent(CLARA_IO_DOWNLOAD + " " + zipFileURL); console.log("Clara.io FBX: File download initiated for " + zipFileURL); xmlHttpRequest = null; - isDownloading = false; } isDownloading = true; From 7e56d0fae6d14fd70b721639bdda5e60f5a4de75 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 25 Jan 2017 16:36:06 +1300 Subject: [PATCH 3/7] Fix up Clara.io error handling --- scripts/system/html/js/marketplacesInject.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index 9af84455dd..a9b35a34e4 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -226,26 +226,22 @@ return; } + isDownloading = false; + var HTTP_OK = 200; if (this.status !== HTTP_OK) { statusMessage = "Zip file request terminated with " + this.status + " " + this.statusText; console.log("ERROR: Clara.io FBX: " + statusMessage); EventBridge.emitWebEvent(CLARA_IO_STATUS + " " + statusMessage); - return; - } - - if (zipFileURL.slice(-4) !== ".zip") { + } else if (zipFileURL.slice(-4) !== ".zip") { statusMessage = "Error creating zip file for download."; console.log("ERROR: Clara.io FBX: " + statusMessage + ": " + zipFileURL); EventBridge.emitWebEvent(CLARA_IO_STATUS + " " + statusMessage); - return; + } else { + EventBridge.emitWebEvent(CLARA_IO_DOWNLOAD + " " + zipFileURL); + console.log("Clara.io FBX: File download initiated for " + zipFileURL); } - isDownloading = false; - - EventBridge.emitWebEvent(CLARA_IO_DOWNLOAD + " " + zipFileURL); - console.log("Clara.io FBX: File download initiated for " + zipFileURL); - xmlHttpRequest = null; } From dcd632013f719076a14c0e05790628b10c06c3fc Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 25 Jan 2017 16:37:35 +1300 Subject: [PATCH 4/7] Better variable name --- scripts/system/html/js/marketplacesInject.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index a9b35a34e4..10970a7749 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -24,7 +24,7 @@ var canWriteAssets = false; var xmlHttpRequest = null; - var isDownloading = false; // Explicitly track download request status. + var isPreparing = false; // Explicitly track download request status. function injectCommonCode(isDirectoryPage) { @@ -139,7 +139,7 @@ function startAutoDownload() { // One file request at a time. - if (isDownloading) { + if (isPreparing) { console.log("WARNIKNG: Clara.io FBX: Prepare only one download at a time"); return; } @@ -178,7 +178,7 @@ var message = this.responseText.slice(responseTextIndex); var statusMessage = ""; - if (isDownloading) { // Ignore messages in flight after finished/cancelled. + if (isPreparing) { // Ignore messages in flight after finished/cancelled. var lines = message.split(/[\n\r]+/); for (var i = 0, length = lines.length; i < length; i++) { @@ -222,11 +222,11 @@ xmlHttpRequest.onload = function () { var statusMessage = ""; - if (!isDownloading) { + if (!isPreparing) { return; } - isDownloading = false; + isPreparing = false; var HTTP_OK = 200; if (this.status !== HTTP_OK) { @@ -245,7 +245,7 @@ xmlHttpRequest = null; } - isDownloading = true; + isPreparing = true; console.log("Clara.io FBX: Request zip file for " + uuid); EventBridge.emitWebEvent(CLARA_IO_STATUS + " Initiating download"); @@ -298,7 +298,7 @@ } function cancelClaraDownload() { - isDownloading = false; + isPreparing = false; if (xmlHttpRequest) { xmlHttpRequest.abort(); From 74b878a276778960d01f20d6650bafdff9743fe0 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 25 Jan 2017 17:48:58 +1300 Subject: [PATCH 5/7] Fix threading of message box updates --- .../src/scripting/WindowScriptingInterface.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/interface/src/scripting/WindowScriptingInterface.cpp b/interface/src/scripting/WindowScriptingInterface.cpp index 7cfbfb174e..fbeddf41e0 100644 --- a/interface/src/scripting/WindowScriptingInterface.cpp +++ b/interface/src/scripting/WindowScriptingInterface.cpp @@ -253,6 +253,16 @@ int WindowScriptingInterface::createMessageBox(QString title, QString text, int void WindowScriptingInterface::updateMessageBox(int id, QString title, QString text, int buttons, int defaultButton) { auto messageBox = _messageBoxes.value(id); if (messageBox) { + if (QThread::currentThread() != thread()) { + QMetaObject::invokeMethod(this, "updateMessageBox", + Q_ARG(int, id), + Q_ARG(QString, title), + Q_ARG(QString, text), + Q_ARG(int, buttons), + Q_ARG(int, defaultButton)); + return; + } + messageBox->setProperty("title", title); messageBox->setProperty("text", text); messageBox->setProperty("buttons", buttons); @@ -263,6 +273,12 @@ void WindowScriptingInterface::updateMessageBox(int id, QString title, QString t void WindowScriptingInterface::closeMessageBox(int id) { auto messageBox = _messageBoxes.value(id); if (messageBox) { + if (QThread::currentThread() != thread()) { + QMetaObject::invokeMethod(this, "closeMessageBox", + Q_ARG(int, id)); + return; + } + disconnect(messageBox); messageBox->setVisible(false); messageBox->deleteLater(); From 9e4f47d57f6101c2107e0f37ee1204f84140f182 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 25 Jan 2017 09:08:54 -0800 Subject: [PATCH 6/7] Update AvatarData to use the default parent joint index --- libraries/avatars/src/AvatarData.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index faac0224cf..1fb68fce14 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -133,7 +133,6 @@ AvatarData::AvatarData() : setBodyPitch(0.0f); setBodyYaw(-90.0f); setBodyRoll(0.0f); - setParentJointIndex(0); ASSERT(sizeof(AvatarDataPacket::Header) == AvatarDataPacket::HEADER_SIZE); ASSERT(sizeof(AvatarDataPacket::MinimalAvatarInfo) == AvatarDataPacket::MINIMAL_AVATAR_INFO_SIZE); From 7b896f961b2f7b5d6909bd3149b433684d1c8b4e Mon Sep 17 00:00:00 2001 From: kunalgosar Date: Wed, 25 Jan 2017 13:00:57 -0800 Subject: [PATCH 7/7] change server to default to not auto-muting --- assignment-client/src/audio/AudioMixer.cpp | 4 ++-- domain-server/resources/describe-settings.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index 07639867eb..06ab06116c 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -38,7 +38,7 @@ static const float LOUDNESS_TO_DISTANCE_RATIO = 0.00001f; static const float DEFAULT_ATTENUATION_PER_DOUBLING_IN_DISTANCE = 0.5f; // attenuation = -6dB * log2(distance) -static const float DEFAULT_NOISE_MUTING_THRESHOLD = 0.003f; +static const float DEFAULT_NOISE_MUTING_THRESHOLD = 1.0f; static const QString AUDIO_MIXER_LOGGING_TARGET_NAME = "audio-mixer"; static const QString AUDIO_ENV_GROUP_KEY = "audio_env"; static const QString AUDIO_BUFFER_GROUP_KEY = "audio_buffer"; @@ -69,7 +69,7 @@ AudioMixer::AudioMixer(ReceivedMessage& message) : packetReceiver.registerListener(PacketType::KillAvatar, this, "handleKillAvatarPacket"); packetReceiver.registerListener(PacketType::NodeMuteRequest, this, "handleNodeMuteRequestPacket"); packetReceiver.registerListener(PacketType::RadiusIgnoreRequest, this, "handleRadiusIgnoreRequestPacket"); - packetReceiver.registerListener(PacketType::RequestsDomainListData, this, "handleRequestsDomainListDataPacket"); + packetReceiver.registerListener(PacketType::RequestsDomainListData, this, "handleRequestsDomainListDataPacket"); packetReceiver.registerListener(PacketType::PerAvatarGainSet, this, "handlePerAvatarGainSetDataPacket"); connect(nodeList.data(), &NodeList::nodeKilled, this, &AudioMixer::handleNodeKilled); diff --git a/domain-server/resources/describe-settings.json b/domain-server/resources/describe-settings.json index 0084e51239..84fccdafe7 100644 --- a/domain-server/resources/describe-settings.json +++ b/domain-server/resources/describe-settings.json @@ -1089,9 +1089,9 @@ { "name": "noise_muting_threshold", "label": "Noise Muting Threshold", - "help": "Loudness value for noise background between 0 and 1.0 (0: mute everyone, 1.0: never mute)", - "placeholder": "0.003", - "default": "0.003", + "help": "Loudness value for noise background between 0 and 1.0 (0: mute everyone, 1.0: never mute). 0.003 is a typical setting to mute loud people.", + "placeholder": "1.0", + "default": "1.0", "advanced": false }, {