From 797016f497728b47da20f33d635f26dcc1dbaad1 Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Wed, 15 Nov 2017 10:12:13 -0800 Subject: [PATCH 01/12] changed url for blocks app --- unpublishedScripts/marketplace/blocks/blocksApp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpublishedScripts/marketplace/blocks/blocksApp.js b/unpublishedScripts/marketplace/blocks/blocksApp.js index c9e8682b23..813a77c74a 100644 --- a/unpublishedScripts/marketplace/blocks/blocksApp.js +++ b/unpublishedScripts/marketplace/blocks/blocksApp.js @@ -14,7 +14,7 @@ (function () { var APP_NAME = "BLOCKS"; - var APP_URL = "https://vr.google.com/objects/"; + var APP_URL = "https://poly.google.com/"; var APP_OUTDATED_URL = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/updateToBlocks.html"; var APP_ICON = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-i.svg"; var APP_ICON_ACTIVE = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-a.svg"; From 9f9c1e2d97e702d7fcf8685e36a8bf1431e5d3b4 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Wed, 15 Nov 2017 15:04:24 -0700 Subject: [PATCH 02/12] 9267 Fix not restoring animations after changing view modes --- libraries/animation/src/Rig.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index f06156874b..78aa1f4ba8 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -179,6 +179,11 @@ void Rig::restoreRoleAnimation(const QString& role) { } else { qCWarning(animation) << "Rig::restoreRoleAnimation could not find role " << role; } + + auto statesIter = _roleAnimStates.find(role); + if (statesIter != _roleAnimStates.end()) { + _roleAnimStates.erase(statesIter); + } } } else { qCWarning(animation) << "Rig::overrideRoleAnimation avatar not ready yet"; From 93fd2a6a6b042e5dd69d232c2069856ea4657c55 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 15 Nov 2017 20:10:05 -0800 Subject: [PATCH 03/12] clear garbage out of avatar-entity settings array before writing it to disk. when changing domains, re-rez avatar-entities after octree is cleared --- interface/src/Application.cpp | 2 ++ interface/src/avatar/MyAvatar.cpp | 6 +----- libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp | 5 +++++ libraries/avatars-renderer/src/avatars-renderer/Avatar.h | 2 ++ libraries/avatars/src/AvatarData.h | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 26ed279150..f449d2a6fb 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5495,6 +5495,8 @@ void Application::clearDomainOctreeDetails() { DependencyManager::get()->clearUnusedResources(); DependencyManager::get()->clearUnusedResources(); DependencyManager::get()->clearUnusedResources(); + + getMyAvatar()->setAvatarEntityDataChanged(true); } void Application::clearDomainAvatars() { diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 0dfcf93a65..6b2795fc90 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -951,11 +951,7 @@ void MyAvatar::saveData() { } settings.endArray(); - if (_avatarEntityData.size() == 0) { - // HACK: manually remove empty 'avatarEntityData' else deleted avatarEntityData may show up in settings file - settings.remove("avatarEntityData"); - } - + settings.remove("avatarEntityData"); settings.beginWriteArray("avatarEntityData"); int avatarEntityIndex = 0; auto hmdInterface = DependencyManager::get(); diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp index 6bf9cc1666..d00af4dd1e 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp @@ -198,6 +198,11 @@ void Avatar::setTargetScale(float targetScale) { } } +void Avatar::setAvatarEntityDataChanged(bool value) { + AvatarData::setAvatarEntityDataChanged(value); + _avatarEntityDataHashes.clear(); +} + void Avatar::updateAvatarEntities() { PerformanceTimer perfTimer("attachments"); // - if queueEditEntityMessage sees clientOnly flag it does _myAvatar->updateAvatarEntity() diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h index a5ec307c50..8069c6b604 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h @@ -265,6 +265,8 @@ public: virtual float getModelScale() const { return _modelScale; } virtual void setModelScale(float scale) { _modelScale = scale; } + virtual void setAvatarEntityDataChanged(bool value) override; + public slots: // FIXME - these should be migrated to use Pose data instead diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 4dabbb3ff5..bf3bb20ef9 100644 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -603,7 +603,7 @@ public: Q_INVOKABLE AvatarEntityMap getAvatarEntityData() const; Q_INVOKABLE void setAvatarEntityData(const AvatarEntityMap& avatarEntityData); - void setAvatarEntityDataChanged(bool value) { _avatarEntityDataChanged = value; } + virtual void setAvatarEntityDataChanged(bool value) { _avatarEntityDataChanged = value; } void insertDetachedEntityID(const QUuid entityID); AvatarEntityIDs getAndClearRecentlyDetachedIDs(); From 0755e4aa214031b95733a6dcd6c69478bb178110 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 16 Nov 2017 08:53:12 -0800 Subject: [PATCH 04/12] Fix for black screen on HMD derived display plugins --- interface/src/Application.cpp | 3 +++ interface/src/Application.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index bd31fc398e..4b99d50761 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1825,6 +1825,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo // Preload Tablet sounds DependencyManager::get()->preloadSounds(); + _pendingIdleEvent = false; + _pendingRenderEvent = false; + qCDebug(interfaceapp) << "Metaverse session ID is" << uuidStringWithoutCurlyBraces(accountManager->getSessionID()); } diff --git a/interface/src/Application.h b/interface/src/Application.h index fbfb3979be..19a6dfdac1 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -708,7 +708,7 @@ private: friend class RenderEventHandler; - std::atomic _pendingIdleEvent { false }; - std::atomic _pendingRenderEvent { false }; + std::atomic _pendingIdleEvent { true }; + std::atomic _pendingRenderEvent { true }; }; #endif // hifi_Application_h From f47f259816987cb26c4960de6f7c9805686cd290 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 17 Nov 2017 15:12:49 -0800 Subject: [PATCH 05/12] Turn Commerce on by default --- interface/src/ui/overlays/ContextOverlayInterface.cpp | 4 ++-- libraries/ui/src/ui/types/RequestFilters.cpp | 2 +- scripts/system/commerce/wallet.js | 2 +- scripts/system/marketplaces/marketplaces.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/src/ui/overlays/ContextOverlayInterface.cpp b/interface/src/ui/overlays/ContextOverlayInterface.cpp index d40c0972e9..0a5b43cc7e 100644 --- a/interface/src/ui/overlays/ContextOverlayInterface.cpp +++ b/interface/src/ui/overlays/ContextOverlayInterface.cpp @@ -203,7 +203,7 @@ bool ContextOverlayInterface::createOrDestroyContextOverlay(const EntityItemID& bool ContextOverlayInterface::contextOverlayFilterPassed(const EntityItemID& entityItemID) { EntityItemProperties entityProperties = _entityScriptingInterface->getEntityProperties(entityItemID, _entityPropertyFlags); - Setting::Handle _settingSwitch{ "commerce", false }; + Setting::Handle _settingSwitch{ "commerce", true }; if (_settingSwitch.get()) { return (entityProperties.getCertificateID().length() != 0); } else { @@ -233,7 +233,7 @@ bool ContextOverlayInterface::destroyContextOverlay(const EntityItemID& entityIt void ContextOverlayInterface::contextOverlays_mousePressOnOverlay(const OverlayID& overlayID, const PointerEvent& event) { if (overlayID == _contextOverlayID && event.getButton() == PointerEvent::PrimaryButton) { qCDebug(context_overlay) << "Clicked Context Overlay. Entity ID:" << _currentEntityWithContextOverlay << "Overlay ID:" << overlayID; - Setting::Handle _settingSwitch{ "commerce", false }; + Setting::Handle _settingSwitch{ "commerce", true }; if (_settingSwitch.get()) { openInspectionCertificate(); } else { diff --git a/libraries/ui/src/ui/types/RequestFilters.cpp b/libraries/ui/src/ui/types/RequestFilters.cpp index b1deec47c8..0a0e67756d 100644 --- a/libraries/ui/src/ui/types/RequestFilters.cpp +++ b/libraries/ui/src/ui/types/RequestFilters.cpp @@ -62,7 +62,7 @@ void RequestFilters::interceptHFWebEngineRequest(QWebEngineUrlRequestInfo& info) // During the period in which we have HFC commerce in the system, but not applied everywhere: const QString tokenStringCommerce{ "Chrome/48.0 (HighFidelityInterface WithHFC)" }; - Setting::Handle _settingSwitch{ "commerce", false }; + Setting::Handle _settingSwitch{ "commerce", true }; bool isMoney = _settingSwitch.get(); const QString tokenString = !isAuthable ? tokenStringMobile : (isMoney ? tokenStringCommerce : tokenStringMetaverse); diff --git a/scripts/system/commerce/wallet.js b/scripts/system/commerce/wallet.js index 8e4a3215fd..a4cdc5b097 100644 --- a/scripts/system/commerce/wallet.js +++ b/scripts/system/commerce/wallet.js @@ -145,7 +145,7 @@ var button; var buttonName = "WALLET"; var tablet = null; - var walletEnabled = Settings.getValue("commerce", false); + var walletEnabled = Settings.getValue("commerce", true); function startup() { if (walletEnabled) { tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); diff --git a/scripts/system/marketplaces/marketplaces.js b/scripts/system/marketplaces/marketplaces.js index 80990402d7..646e5452df 100644 --- a/scripts/system/marketplaces/marketplaces.js +++ b/scripts/system/marketplaces/marketplaces.js @@ -160,7 +160,7 @@ type: "marketplaces", action: "commerceSetting", data: { - commerceMode: Settings.getValue("commerce", false), + commerceMode: Settings.getValue("commerce", true), userIsLoggedIn: Account.loggedIn, walletNeedsSetup: Wallet.walletStatus === 1, metaverseServerURL: Account.metaverseServerURL From ec16f167578dcbc73d79c3afb3e280796f6c1c43 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 17 Nov 2017 15:21:18 -0800 Subject: [PATCH 06/12] Remove debug buttons from wallet --- .../qml/hifi/commerce/wallet/Help.qml | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/interface/resources/qml/hifi/commerce/wallet/Help.qml b/interface/resources/qml/hifi/commerce/wallet/Help.qml index 0026bf6cdb..0c6b84752c 100644 --- a/interface/resources/qml/hifi/commerce/wallet/Help.qml +++ b/interface/resources/qml/hifi/commerce/wallet/Help.qml @@ -55,37 +55,6 @@ Item { // Style color: hifi.colors.blueHighlight; } - HifiControlsUit.Button { - id: clearCachedPassphraseButton; - visible: root.showDebugButtons; - color: hifi.buttons.black; - colorScheme: hifi.colorSchemes.dark; - anchors.top: parent.top; - anchors.left: helpTitleText.right; - anchors.leftMargin: 20; - height: 40; - width: 150; - text: "DBG: Clear Pass"; - onClicked: { - commerce.setPassphrase(""); - sendSignalToWallet({method: 'passphraseReset'}); - } - } - HifiControlsUit.Button { - id: resetButton; - visible: root.showDebugButtons; - color: hifi.buttons.red; - colorScheme: hifi.colorSchemes.dark; - anchors.top: clearCachedPassphraseButton.top; - anchors.left: clearCachedPassphraseButton.right; - height: 40; - width: 150; - text: "DBG: RST Wallet"; - onClicked: { - commerce.reset(); - sendSignalToWallet({method: 'walletReset'}); - } - } ListModel { id: helpModel; From be0d4646fac4e3fcdd0e45a88ae78e6a3510d479 Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Fri, 17 Nov 2017 15:54:41 -0800 Subject: [PATCH 07/12] file structures in zip files replicated, more useful unzip debug print, updated blocks tablet app url --- interface/src/Application.cpp | 27 ++++++++++--------- .../src/FileScriptingInterface.cpp | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b21588958e..ccf9b98a7a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6324,20 +6324,19 @@ void Application::addAssetToWorldUnzipFailure(QString filePath) { addAssetToWorldError(filename, "Couldn't unzip file " + filename + "."); } -void Application::addAssetToWorld(QString filePath, QString zipFile, bool isZip, bool isBlocks) { +void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, bool isBlocks) { // Automatically upload and add asset to world as an alternative manual process initiated by showAssetServerWidget(). QString mapping; - QString path = filePath; QString filename = filenameFromPath(path); - if (isZip) { - QString assetFolder = zipFile.section("/", -1); - assetFolder.remove(".zip"); - mapping = "/" + assetFolder + "/" + filename; - } else if (isBlocks) { - qCDebug(interfaceapp) << "Path to asset folder: " << zipFile; - QString assetFolder = zipFile.section('/', -1); - assetFolder.remove(".zip?noDownload=false"); - mapping = "/" + assetFolder + "/" + filename; + if (isZip || isBlocks) { + QString assetName; + if (isZip) { + assetName = zipFile.section("/", -1).remove(".zip"); + } else if (isBlocks) { + assetName = zipFile.section("/", -1).remove(".zip?noDownload=false"); + } + QString assetFolder = path.section("model_repo/", -1); + mapping = "/" + assetName + "/" + assetFolder; } else { mapping = "/" + filename; } @@ -6723,8 +6722,10 @@ void Application::handleUnzip(QString zipFile, QStringList unzipFile, bool autoA if (autoAdd) { if (!unzipFile.isEmpty()) { for (int i = 0; i < unzipFile.length(); i++) { - qCDebug(interfaceapp) << "Preparing file for asset server: " << unzipFile.at(i); - addAssetToWorld(unzipFile.at(i), zipFile, isZip, isBlocks); + if (QFileInfo(unzipFile.at(i)).isFile()) { + qCDebug(interfaceapp) << "Preparing file for asset server: " << unzipFile.at(i); + addAssetToWorld(unzipFile.at(i), zipFile, isZip, isBlocks); + } } } else { addAssetToWorldUnzipFailure(zipFile); diff --git a/libraries/script-engine/src/FileScriptingInterface.cpp b/libraries/script-engine/src/FileScriptingInterface.cpp index 68a141ad97..fdae04f267 100644 --- a/libraries/script-engine/src/FileScriptingInterface.cpp +++ b/libraries/script-engine/src/FileScriptingInterface.cpp @@ -55,7 +55,7 @@ void FileScriptingInterface::runUnzip(QString path, QUrl url, bool autoAdd, bool QStringList fileList = unzipFile(path, tempDir); if (!fileList.isEmpty()) { - qCDebug(scriptengine) << "File to upload: " + fileList.first(); + qCDebug(scriptengine) << "First file to upload: " + fileList.first(); } else { qCDebug(scriptengine) << "Unzip failed"; } From 07d52306c4f677211a7c53519b1e32fab21a3f11 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Sun, 19 Nov 2017 22:51:36 -0800 Subject: [PATCH 08/12] consolidated blockchain history log --- interface/src/commerce/Ledger.cpp | 47 +++++++++++++------------------ 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/interface/src/commerce/Ledger.cpp b/interface/src/commerce/Ledger.cpp index 904847cb5f..b0d293584c 100644 --- a/interface/src/commerce/Ledger.cpp +++ b/interface/src/commerce/Ledger.cpp @@ -111,14 +111,23 @@ void Ledger::inventory(const QStringList& keys) { keysQuery("inventory", "inventorySuccess", "inventoryFailure"); } -QString nameFromKey(const QString& key, const QStringList& publicKeys) { - if (key.isNull() || key.isEmpty()) { - return "Marketplace"; +QString amountString(const QString& label, const QString&color, const QJsonValue& moneyValue, const QJsonValue& certsValue) { + int money = moneyValue.toInt(); + int certs = certsValue.toInt(); + if (money <= 0 && certs <= 0) { + return QString(); } - if (publicKeys.contains(key)) { - return "You"; + QString result(QString(" %2").arg(color, label)); + if (money > 0) { + result += QString(" %1 HFC").arg(money); } - return "Someone"; + if (certs > 0) { + if (money > 0) { + result += QString(","); + } + result += QString((certs == 1) ? " %1 certificate" : " %1 certificates").arg(certs); + } + return result + QString(""); } static const QString MARKETPLACE_ITEMS_BASE_URL = NetworkingConstants::METAVERSE_SERVER_URL.toString() + "/marketplace/items/"; @@ -129,6 +138,7 @@ void Ledger::historySuccess(QNetworkReply& reply) { // public key(s) are. Let's keep it that way QByteArray response = reply.readAll(); QJsonObject data = QJsonDocument::fromJson(response).object(); + qInfo(commerce) << "history" << "response" << QJsonDocument(data).toJson(QJsonDocument::Compact); // we will need the array of public keys from the wallet auto wallet = DependencyManager::get(); @@ -141,32 +151,15 @@ void Ledger::historySuccess(QNetworkReply& reply) { // TODO: do this with 0 copies if possible for (auto it = historyArray.begin(); it != historyArray.end(); it++) { auto valueObject = (*it).toObject(); - QString from = nameFromKey(valueObject["sender_key"].toString(), keys); - QString to = nameFromKey(valueObject["recipient_key"].toString(), keys); - bool isHfc = valueObject["asset_title"].toString() == "HFC"; - bool iAmReceiving = to == "You"; - QString coloredQuantityAndAssetTitle = QString::number(valueObject["quantity"].toInt()) + " " + valueObject["asset_title"].toString(); - if (isHfc) { - if (iAmReceiving) { - coloredQuantityAndAssetTitle = QString("") + coloredQuantityAndAssetTitle + QString(""); - } else { - coloredQuantityAndAssetTitle = QString("") + coloredQuantityAndAssetTitle + QString(""); - } - } else { - coloredQuantityAndAssetTitle = QString("\"") + - coloredQuantityAndAssetTitle + - QString("\""); - } + QString sent = amountString("sent", "EA4C5F", valueObject["sent_money"], valueObject["sent_certs"]); + QString received = amountString("received", "1FC6A6", valueObject["received_money"], valueObject["received_certs"]); + // turns out on my machine, toLocalTime convert to some weird timezone, yet the // systemTimeZone is correct. To avoid a strange bug with other's systems too, lets // be explicit QDateTime createdAt = QDateTime::fromSecsSinceEpoch(valueObject["created_at"].toInt(), Qt::UTC); QDateTime localCreatedAt = createdAt.toTimeZone(QTimeZone::systemTimeZone()); - valueObject["text"] = QString("%1 sent %2 %3 with message \"%4\""). - arg(from, to, coloredQuantityAndAssetTitle, valueObject["message"].toString()); + valueObject["text"] = QString("%1%2%3").arg(valueObject["message"].toString(), sent, received); newHistoryArray.push_back(valueObject); } // now copy the rest of the json -- this is inefficient From 88823a169b216e6498b30916dd9c0a67283bf9e4 Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Wed, 15 Nov 2017 10:12:13 -0800 Subject: [PATCH 09/12] changed url for blocks app --- unpublishedScripts/marketplace/blocks/blocksApp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpublishedScripts/marketplace/blocks/blocksApp.js b/unpublishedScripts/marketplace/blocks/blocksApp.js index c9e8682b23..813a77c74a 100644 --- a/unpublishedScripts/marketplace/blocks/blocksApp.js +++ b/unpublishedScripts/marketplace/blocks/blocksApp.js @@ -14,7 +14,7 @@ (function () { var APP_NAME = "BLOCKS"; - var APP_URL = "https://vr.google.com/objects/"; + var APP_URL = "https://poly.google.com/"; var APP_OUTDATED_URL = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/updateToBlocks.html"; var APP_ICON = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-i.svg"; var APP_ICON_ACTIVE = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-a.svg"; From 3aa7cb440db4600126b09f340ee883edfd92b54f Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Fri, 17 Nov 2017 15:54:41 -0800 Subject: [PATCH 10/12] file structures in zip files replicated, more useful unzip debug print, updated blocks tablet app url --- interface/src/Application.cpp | 27 ++++++++++--------- .../src/FileScriptingInterface.cpp | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 2624aa376f..f20f6a2995 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6328,20 +6328,19 @@ void Application::addAssetToWorldUnzipFailure(QString filePath) { addAssetToWorldError(filename, "Couldn't unzip file " + filename + "."); } -void Application::addAssetToWorld(QString filePath, QString zipFile, bool isZip, bool isBlocks) { +void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, bool isBlocks) { // Automatically upload and add asset to world as an alternative manual process initiated by showAssetServerWidget(). QString mapping; - QString path = filePath; QString filename = filenameFromPath(path); - if (isZip) { - QString assetFolder = zipFile.section("/", -1); - assetFolder.remove(".zip"); - mapping = "/" + assetFolder + "/" + filename; - } else if (isBlocks) { - qCDebug(interfaceapp) << "Path to asset folder: " << zipFile; - QString assetFolder = zipFile.section('/', -1); - assetFolder.remove(".zip?noDownload=false"); - mapping = "/" + assetFolder + "/" + filename; + if (isZip || isBlocks) { + QString assetName; + if (isZip) { + assetName = zipFile.section("/", -1).remove(".zip"); + } else if (isBlocks) { + assetName = zipFile.section("/", -1).remove(".zip?noDownload=false"); + } + QString assetFolder = path.section("model_repo/", -1); + mapping = "/" + assetName + "/" + assetFolder; } else { mapping = "/" + filename; } @@ -6727,8 +6726,10 @@ void Application::handleUnzip(QString zipFile, QStringList unzipFile, bool autoA if (autoAdd) { if (!unzipFile.isEmpty()) { for (int i = 0; i < unzipFile.length(); i++) { - qCDebug(interfaceapp) << "Preparing file for asset server: " << unzipFile.at(i); - addAssetToWorld(unzipFile.at(i), zipFile, isZip, isBlocks); + if (QFileInfo(unzipFile.at(i)).isFile()) { + qCDebug(interfaceapp) << "Preparing file for asset server: " << unzipFile.at(i); + addAssetToWorld(unzipFile.at(i), zipFile, isZip, isBlocks); + } } } else { addAssetToWorldUnzipFailure(zipFile); diff --git a/libraries/script-engine/src/FileScriptingInterface.cpp b/libraries/script-engine/src/FileScriptingInterface.cpp index 68a141ad97..fdae04f267 100644 --- a/libraries/script-engine/src/FileScriptingInterface.cpp +++ b/libraries/script-engine/src/FileScriptingInterface.cpp @@ -55,7 +55,7 @@ void FileScriptingInterface::runUnzip(QString path, QUrl url, bool autoAdd, bool QStringList fileList = unzipFile(path, tempDir); if (!fileList.isEmpty()) { - qCDebug(scriptengine) << "File to upload: " + fileList.first(); + qCDebug(scriptengine) << "First file to upload: " + fileList.first(); } else { qCDebug(scriptengine) << "Unzip failed"; } From a54f4eca93511de032da628c30ff1815e39d8062 Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Mon, 20 Nov 2017 14:02:46 -0800 Subject: [PATCH 11/12] simplified naming of zip folders --- interface/src/Application.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index fb54983d39..41353208f7 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6336,12 +6336,7 @@ void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, boo QString mapping; QString filename = filenameFromPath(path); if (isZip || isBlocks) { - QString assetName; - if (isZip) { - assetName = zipFile.section("/", -1).remove(".zip"); - } else if (isBlocks) { - assetName = zipFile.section("/", -1).remove(".zip?noDownload=false"); - } + QString assetName = zipFile.section("/", -1).remove(QRegExp("\.zip(.*)$")); QString assetFolder = path.section("model_repo/", -1); mapping = "/" + assetName + "/" + assetFolder; } else { From fb6287503edbf70e7f443ee6da9a4832b93c3ff5 Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Mon, 20 Nov 2017 15:12:11 -0800 Subject: [PATCH 12/12] hopefully fixed build error resulting from escape sequence --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 41353208f7..a7b0c4af3e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6336,7 +6336,7 @@ void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, boo QString mapping; QString filename = filenameFromPath(path); if (isZip || isBlocks) { - QString assetName = zipFile.section("/", -1).remove(QRegExp("\.zip(.*)$")); + QString assetName = zipFile.section("/", -1).remove(QRegExp("[.]zip(.*)$")); QString assetFolder = path.section("model_repo/", -1); mapping = "/" + assetName + "/" + assetFolder; } else {