From f9de255fa7d294c08452591b2c81fa1471d87bca Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Fri, 23 Feb 2018 20:07:09 +0300 Subject: [PATCH 1/8] FB12523 - HMD: Commerce specific disabled preview is not dismissed when user leaves page without entering credentials --- .../resources/qml/hifi/commerce/wallet/PassphraseModal.qml | 4 ++++ scripts/system/marketplaces/marketplaces.js | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/commerce/wallet/PassphraseModal.qml b/interface/resources/qml/hifi/commerce/wallet/PassphraseModal.qml index f1692acb3d..1fa9054d69 100644 --- a/interface/resources/qml/hifi/commerce/wallet/PassphraseModal.qml +++ b/interface/resources/qml/hifi/commerce/wallet/PassphraseModal.qml @@ -69,6 +69,10 @@ Item { hoverEnabled: true; } + Component.onDestruction: { + sendSignalToParent({method: 'maybeEnableHmdPreview'}); + } + // This will cause a bug -- if you bring up passphrase selection in HUD mode while // in HMD while having HMD preview enabled, then move, then finish passphrase selection, // HMD preview will stay off. diff --git a/scripts/system/marketplaces/marketplaces.js b/scripts/system/marketplaces/marketplaces.js index 631b5e97ac..bb31d718e2 100644 --- a/scripts/system/marketplaces/marketplaces.js +++ b/scripts/system/marketplaces/marketplaces.js @@ -115,13 +115,15 @@ var selectionDisplay = null; // for gridTool.js to ignore var filterText; // Used for updating Purchases QML var onWalletScreen = false; + var onCommerceScreen = false; + function onScreenChanged(type, url) { onMarketplaceScreen = type === "Web" && url.indexOf(MARKETPLACE_URL) !== -1; var onWalletScreenNow = url.indexOf(MARKETPLACE_WALLET_QML_PATH) !== -1; - onCommerceScreen = type === "QML" && (url.indexOf(MARKETPLACE_CHECKOUT_QML_PATH) !== -1 || url === MARKETPLACE_PURCHASES_QML_PATH + var onCommerceScreenNow = type === "QML" && (url.indexOf(MARKETPLACE_CHECKOUT_QML_PATH) !== -1 || url === MARKETPLACE_PURCHASES_QML_PATH || url.indexOf(MARKETPLACE_INSPECTIONCERTIFICATE_QML_PATH) !== -1); - if (!onWalletScreenNow && onWalletScreen) { // exiting wallet screen + if ((!onWalletScreenNow && onWalletScreen) || (!onCommerceScreenNow && onCommerceScreen)) { // exiting wallet or commerce screen if (isHmdPreviewDisabledBySecurity) { DesktopPreviewProvider.setPreviewDisabledReason("USER"); Menu.setIsOptionChecked("Disable Preview", false); @@ -129,6 +131,7 @@ var selectionDisplay = null; // for gridTool.js to ignore } } + onCommerceScreen = onCommerceScreenNow; onWalletScreen = onWalletScreenNow; wireEventBridge(onMarketplaceScreen || onCommerceScreen || onWalletScreen); From 9f9214e808df300810b2eb7b610262caa137656e Mon Sep 17 00:00:00 2001 From: samcake Date: Thu, 1 Mar 2018 09:33:48 -0800 Subject: [PATCH 2/8] getting back the RC65 version for a few files --- interface/resources/qml/Stats.qml | 6 +--- interface/src/ui/Stats.cpp | 31 +------------------ interface/src/ui/Stats.h | 2 -- .../system/libraries/entitySelectionTool.js | 5 ++- 4 files changed, 4 insertions(+), 40 deletions(-) diff --git a/interface/resources/qml/Stats.qml b/interface/resources/qml/Stats.qml index a12bd4b2c0..4626d9bcda 100644 --- a/interface/resources/qml/Stats.qml +++ b/interface/resources/qml/Stats.qml @@ -257,11 +257,7 @@ Item { id: octreeCol spacing: 4; x: 4; y: 4; StatText { - text: "Render Engine: " + root.engineFrameTime.toFixed(1) + " ms" - } - StatText { - visible: root.expanded - text: root.renderEngineStats + text: "Engine: " + root.engineFrameTime.toFixed(1) + " ms" } StatText { text: "Batch: " + root.batchFrameTime.toFixed(1) + " ms" diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp index ff42ed09e7..80f57bfe0e 100644 --- a/interface/src/ui/Stats.cpp +++ b/interface/src/ui/Stats.cpp @@ -482,7 +482,7 @@ void Stats::updateStats(bool force) { float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC; _gameUpdateStats = QString("/idle/update = %1 ms").arg(dt); - QVector categories = { "devices", "physics", "otherAvatars", "MyAvatar", "pickManager", "postUpdateLambdas", "misc" }; + QVector categories = { "devices", "physics", "otherAvatars", "MyAvatar", "misc" }; for (int32_t j = 0; j < categories.size(); ++j) { QString recordKey = "/idle/update/" + categories[j]; itr = allRecords.find(recordKey); @@ -502,39 +502,10 @@ void Stats::updateStats(bool force) { _gameUpdateStats = ""; emit gameUpdateStatsChanged(); } - - itr = allRecords.find("/paintGL/display/EngineRun/Engine"); - std::priority_queue renderEngineStats; - if (itr != allRecords.end()) { - float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC; - _renderEngineStats = QString("/render = %1 ms").arg(dt); - - QVector categories = { "RenderMainView", "SecondaryCameraJob", "UpdateScene"}; - for (int32_t j = 0; j < categories.size(); ++j) { - QString recordKey = "/paintGL/display/EngineRun/Engine/" + categories[j]; - itr = allRecords.find(recordKey); - if (itr != allRecords.end()) { - float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC; - QString message = QString("\n %1 = %2").arg(categories[j]).arg(dt); - renderEngineStats.push(SortableStat(message, dt)); - } - } - while (!renderEngineStats.empty()) { - SortableStat stat = renderEngineStats.top(); - _renderEngineStats += stat.message; - renderEngineStats.pop(); - } - emit renderEngineStatsChanged(); - } else if (_renderEngineStats != "") { - _renderEngineStats = ""; - emit renderEngineStatsChanged(); - } } else if (_showGameUpdateStats) { _showGameUpdateStats = false; _gameUpdateStats = ""; - _renderEngineStats = ""; emit gameUpdateStatsChanged(); - emit renderEngineStatsChanged(); } } diff --git a/interface/src/ui/Stats.h b/interface/src/ui/Stats.h index e5fc0beaf6..af3189f20b 100644 --- a/interface/src/ui/Stats.h +++ b/interface/src/ui/Stats.h @@ -106,7 +106,6 @@ class Stats : public QQuickItem { STATS_PROPERTY(QString, lodStatus, QString()) STATS_PROPERTY(QString, timingStats, QString()) STATS_PROPERTY(QString, gameUpdateStats, QString()) - STATS_PROPERTY(QString, renderEngineStats, QString()) STATS_PROPERTY(int, serverElements, 0) STATS_PROPERTY(int, serverInternal, 0) STATS_PROPERTY(int, serverLeaves, 0) @@ -240,7 +239,6 @@ signals: void localLeavesChanged(); void timingStatsChanged(); void gameUpdateStatsChanged(); - void renderEngineStatsChanged(); void glContextSwapchainMemoryChanged(); void qmlTextureMemoryChanged(); void texturePendingTransfersChanged(); diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index a419e9d49c..8a07ff0d20 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -1322,9 +1322,8 @@ SelectionDisplay = (function() { isActiveTool(handleScaleRTFCube) || isActiveTool(handleStretchXSphere) || isActiveTool(handleStretchYSphere) || isActiveTool(handleStretchZSphere)); - var showOutlineForZone = (SelectionManager.selections.length === 1 && - typeof SelectionManager.savedProperties[SelectionManager.selections[0]] !== "undefined" && - SelectionManager.savedProperties[SelectionManager.selections[0]].type === "Zone"); + var showOutlineForZone = (SelectionManager.selections.length === 1 && + SelectionManager.savedProperties[SelectionManager.selections[0]].type === "Zone"); that.setHandleScaleEdgeVisible(showOutlineForZone || (!isActiveTool(handleRotatePitchRing) && !isActiveTool(handleRotateYawRing) && !isActiveTool(handleRotateRollRing))); From 5440f62860ae8ca02943e1f9d27f5b80f99b6963 Mon Sep 17 00:00:00 2001 From: samcake Date: Thu, 1 Mar 2018 10:46:47 -0800 Subject: [PATCH 3/8] fixing a bad key /pipeline pair --- libraries/render-utils/src/RenderPipelines.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/render-utils/src/RenderPipelines.cpp b/libraries/render-utils/src/RenderPipelines.cpp index b3a1d40257..84a144e6db 100644 --- a/libraries/render-utils/src/RenderPipelines.cpp +++ b/libraries/render-utils/src/RenderPipelines.cpp @@ -592,8 +592,8 @@ void initForwardPipelines(ShapePlumber& plumber, const render::ShapePipeline::Ba Key::Builder().withMaterial().withSkinned().withTangents().withDualQuatSkinned(), skinModelNormalMapDualQuatVertex, modelNormalMapPixel, nullptr, nullptr); addPipeline( - Key::Builder().withMaterial().withSkinned(), - skinModelDualQuatVertex, modelSpecularMapPixel, nullptr, nullptr); + Key::Builder().withMaterial().withSkinned().withSpecular().withDualQuatSkinned(), + skinModelDualQuatVertex, modelSpecularMapPixel, nullptr, nullptr); addPipeline( Key::Builder().withMaterial().withSkinned().withTangents().withSpecular().withDualQuatSkinned(), skinModelNormalMapDualQuatVertex, modelNormalSpecularMapPixel, nullptr, nullptr); From 70bdedc4b398293d30168666517f34904573cef3 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 1 Mar 2018 16:37:19 -0800 Subject: [PATCH 4/8] Fix Edit -> Export Entities exporting gzipped json We were not respecting the doGzip flag. --- libraries/octree/src/Octree.cpp | 21 +++++++++++--------- libraries/octree/src/Octree.h | 4 ++-- libraries/octree/src/OctreePersistThread.cpp | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/libraries/octree/src/Octree.cpp b/libraries/octree/src/Octree.cpp index 334299185e..7e0c82506b 100644 --- a/libraries/octree/src/Octree.cpp +++ b/libraries/octree/src/Octree.cpp @@ -1778,7 +1778,7 @@ bool Octree::writeToFile(const char* fileName, const OctreeElementPointer& eleme return success; } -bool Octree::toJSON(QJsonDocument* doc, const OctreeElementPointer& element) { +bool Octree::toJSONDocument(QJsonDocument* doc, const OctreeElementPointer& element) { QVariantMap entityDescription; OctreeElementPointer top; @@ -1804,18 +1804,22 @@ bool Octree::toJSON(QJsonDocument* doc, const OctreeElementPointer& element) { return true; } -bool Octree::toGzippedJSON(QByteArray* data, const OctreeElementPointer& element) { +bool Octree::toJSON(QByteArray* data, const OctreeElementPointer& element, bool doGzip) { QJsonDocument doc; - if (!toJSON(&doc, element)) { + if (!toJSONDocument(&doc, element)) { qCritical("Failed to convert Entities to QVariantMap while converting to json."); return false; } - QByteArray jsonData = doc.toJson(); + if (doGzip) { + QByteArray jsonData = doc.toJson(); - if (!gzip(jsonData, *data, -1)) { - qCritical("Unable to gzip data while saving to json."); - return false; + if (!gzip(jsonData, *data, -1)) { + qCritical("Unable to gzip data while saving to json."); + return false; + } + } else { + *data = doc.toJson(); } return true; @@ -1825,7 +1829,7 @@ bool Octree::writeToJSONFile(const char* fileName, const OctreeElementPointer& e qCDebug(octree, "Saving JSON SVO to file %s...", fileName); QByteArray jsonDataForFile; - if (!toGzippedJSON(&jsonDataForFile)) { + if (!toJSON(&jsonDataForFile, element, doGzip)) { return false; } @@ -1837,7 +1841,6 @@ bool Octree::writeToJSONFile(const char* fileName, const OctreeElementPointer& e qCritical("Could not write to JSON description of entities."); } - return success; } diff --git a/libraries/octree/src/Octree.h b/libraries/octree/src/Octree.h index cb281593b1..c4c4508138 100644 --- a/libraries/octree/src/Octree.h +++ b/libraries/octree/src/Octree.h @@ -284,8 +284,8 @@ public: void loadOctreeFile(const char* fileName); // Octree exporters - bool toJSON(QJsonDocument* doc, const OctreeElementPointer& element = nullptr); - bool toGzippedJSON(QByteArray* data, const OctreeElementPointer& element = nullptr); + bool toJSONDocument(QJsonDocument* doc, const OctreeElementPointer& element = nullptr); + bool toJSON(QByteArray* data, const OctreeElementPointer& element = nullptr, bool doGzip = false); bool writeToFile(const char* filename, const OctreeElementPointer& element = nullptr, QString persistAsFileType = "json.gz"); bool writeToJSONFile(const char* filename, const OctreeElementPointer& element = nullptr, bool doGzip = false); virtual bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues, diff --git a/libraries/octree/src/OctreePersistThread.cpp b/libraries/octree/src/OctreePersistThread.cpp index 23d6b6c2aa..7c5b7eb45c 100644 --- a/libraries/octree/src/OctreePersistThread.cpp +++ b/libraries/octree/src/OctreePersistThread.cpp @@ -341,7 +341,7 @@ void OctreePersistThread::sendLatestEntityDataToDS() { const DomainHandler& domainHandler = nodeList->getDomainHandler(); QByteArray data; - if (_tree->toGzippedJSON(&data)) { + if (_tree->toJSON(&data, nullptr, true)) { auto message = NLPacketList::create(PacketType::OctreeDataPersist, QByteArray(), true, true); message->write(data); nodeList->sendPacketList(std::move(message), domainHandler.getSockAddr()); From a5a109e4f1d25a4ff33e7dbd11598eb8e1a63f2b Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 1 Mar 2018 16:40:24 -0800 Subject: [PATCH 5/8] Fix undefined request from JS --- scripts/modules/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/modules/request.js b/scripts/modules/request.js index c7bf98d815..3516554567 100644 --- a/scripts/modules/request.js +++ b/scripts/modules/request.js @@ -71,7 +71,7 @@ module.exports = { } } httpRequest.open(options.method, options.uri, true); - httpRequest.send(options.body); + httpRequest.send(options.body || null); } }; From d7725f1d73e99870fffae195399556151e224777 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Sun, 4 Mar 2018 00:18:59 +0100 Subject: [PATCH 6/8] make the grabbable checkbox again, respect default true setting --- scripts/system/html/js/entityProperties.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index 2b29fbf041..7e87586b4f 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -1281,7 +1281,7 @@ function loaded() { if (elCloneable.checked) { elGrabbable.checked = false; } - userDataChanger("grabbableKey", "grabbable", elGrabbable, elUserData, properties.dynamic); + userDataChanger("grabbableKey", "grabbable", elGrabbable, elUserData, true); }); elCloneableDynamic.addEventListener('change', function(event) { userDataChanger("grabbableKey", "cloneDynamic", event.target, elUserData, -1); From 15c1f5ba307ad36562456c252e3d2a1fb27e4720 Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Tue, 27 Feb 2018 16:44:45 -0800 Subject: [PATCH 7/8] fixed log spam undefined error --- scripts/system/libraries/entitySelectionTool.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index 8a07ff0d20..a419e9d49c 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -1322,8 +1322,9 @@ SelectionDisplay = (function() { isActiveTool(handleScaleRTFCube) || isActiveTool(handleStretchXSphere) || isActiveTool(handleStretchYSphere) || isActiveTool(handleStretchZSphere)); - var showOutlineForZone = (SelectionManager.selections.length === 1 && - SelectionManager.savedProperties[SelectionManager.selections[0]].type === "Zone"); + var showOutlineForZone = (SelectionManager.selections.length === 1 && + typeof SelectionManager.savedProperties[SelectionManager.selections[0]] !== "undefined" && + SelectionManager.savedProperties[SelectionManager.selections[0]].type === "Zone"); that.setHandleScaleEdgeVisible(showOutlineForZone || (!isActiveTool(handleRotatePitchRing) && !isActiveTool(handleRotateYawRing) && !isActiveTool(handleRotateRollRing))); From 53e1a0cae5fa41ba691e65caace1058867f2da91 Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Thu, 1 Mar 2018 01:53:02 +0300 Subject: [PATCH 8/8] forward 'maybeEnableHmdPreview' if control is not visible --- interface/resources/qml/hifi/commerce/wallet/Wallet.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/resources/qml/hifi/commerce/wallet/Wallet.qml b/interface/resources/qml/hifi/commerce/wallet/Wallet.qml index ae42b8e3e1..e2f4385965 100644 --- a/interface/resources/qml/hifi/commerce/wallet/Wallet.qml +++ b/interface/resources/qml/hifi/commerce/wallet/Wallet.qml @@ -222,6 +222,8 @@ Rectangle { } else { sendToScript(msg); } + } else if (msg.method === 'maybeEnableHmdPreview') { + sendToScript(msg); } } }