From 0ef623ba069818da60463a47188488c9fe58392c Mon Sep 17 00:00:00 2001 From: humbletim Date: Thu, 22 Jun 2017 12:45:53 -0400 Subject: [PATCH] * revert button icons and name * add new attachmentsUpdated signal and connect to 'doppleganger_attachments' logAction * fix typo in debug mode --- .../Pullover-lineart-inverted.svg | 647 ------------------ .../Pullover-lineart-normal.svg | 646 ----------------- .../app-doppleganger-attachments.js | 14 +- .../doppleganger-a.svg | 94 +++ .../doppleganger-attachments.js | 6 +- .../doppleganger-i.svg | 94 +++ .../doppleganger-attachments/doppleganger.js | 2 +- 7 files changed, 203 insertions(+), 1300 deletions(-) delete mode 100644 unpublishedScripts/marketplace/doppleganger-attachments/Pullover-lineart-inverted.svg delete mode 100644 unpublishedScripts/marketplace/doppleganger-attachments/Pullover-lineart-normal.svg create mode 100644 unpublishedScripts/marketplace/doppleganger-attachments/doppleganger-a.svg create mode 100644 unpublishedScripts/marketplace/doppleganger-attachments/doppleganger-i.svg diff --git a/unpublishedScripts/marketplace/doppleganger-attachments/Pullover-lineart-inverted.svg b/unpublishedScripts/marketplace/doppleganger-attachments/Pullover-lineart-inverted.svg deleted file mode 100644 index 52aed00285..0000000000 --- a/unpublishedScripts/marketplace/doppleganger-attachments/Pullover-lineart-inverted.svg +++ /dev/null @@ -1,647 +0,0 @@ - - - - - Pullover - - - - - - image/svg+xml - - Pullover - - 2014-02-03 - - - Frank Tremmel - - - - - pulli - pullover - sweater - shirt - clothes - clothings - kleidung - - - - outline pullover - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/unpublishedScripts/marketplace/doppleganger-attachments/Pullover-lineart-normal.svg b/unpublishedScripts/marketplace/doppleganger-attachments/Pullover-lineart-normal.svg deleted file mode 100644 index 9cab6592aa..0000000000 --- a/unpublishedScripts/marketplace/doppleganger-attachments/Pullover-lineart-normal.svg +++ /dev/null @@ -1,646 +0,0 @@ - - - - - Pullover - - - - - - image/svg+xml - - Pullover - - 2014-02-03 - - - Frank Tremmel - - - - - pulli - pullover - sweater - shirt - clothes - clothings - kleidung - - - - outline pullover - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/unpublishedScripts/marketplace/doppleganger-attachments/app-doppleganger-attachments.js b/unpublishedScripts/marketplace/doppleganger-attachments/app-doppleganger-attachments.js index 71be8d72af..4142ff332e 100644 --- a/unpublishedScripts/marketplace/doppleganger-attachments/app-doppleganger-attachments.js +++ b/unpublishedScripts/marketplace/doppleganger-attachments/app-doppleganger-attachments.js @@ -18,9 +18,9 @@ var DopplegangerClass = require('./doppleganger.js'), var tablet = Tablet.getTablet('com.highfidelity.interface.tablet.system'), button = tablet.addButton({ - icon: Script.resolvePath('./Pullover-lineart-normal.svg'), - activeIcon: Script.resolvePath('./Pullover-lineart-inverted.svg'), - text: 'Mannequin' + icon: Script.resolvePath('./doppleganger-i.svg'), + activeIcon: Script.resolvePath('./doppleganger-a.svg'), + text: 'MIRROR' }); Script.scriptEnding.connect(function() { @@ -97,11 +97,15 @@ doppleganger.modelLoaded.connect(function(error, result) { } }); +// ---------------------------------------------------------------------------- + // add debug indicators, but only if the user has configured the settings value if (Settings.getValue('debug.doppleganger', false)) { DopplegangerClass.addDebugControls(doppleganger); } +// ---------------------------------------------------------------------------- + UserActivityLogger.logAction('doppleganger_app_load'); doppleganger.activeChanged.connect(function(active, reason) { if (active) { @@ -116,3 +120,7 @@ doppleganger.activeChanged.connect(function(active, reason) { } } }); +dopplegangerAttachments.attachmentsUpdated.connect(function(attachments) { + UserActivityLogger.logAction('doppleganger_attachments', { count: attachments.length }); +}); + diff --git a/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger-a.svg b/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger-a.svg new file mode 100644 index 0000000000..100986647e --- /dev/null +++ b/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger-a.svg @@ -0,0 +1,94 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger-attachments.js b/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger-attachments.js index 894d627fc5..1d3847cad2 100644 --- a/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger-attachments.js +++ b/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger-attachments.js @@ -21,6 +21,7 @@ function DopplegangerAttachments(doppleganger, options) { doppleganger: doppleganger, attachments: undefined, manualJointSync: true, + attachmentsUpdated: utils.signal(function attachmentsUpdated(currentAttachments, previousAttachments){}), }); this._initialize(); log('DopplegangerAttachments...', JSON.stringify(options)); @@ -77,6 +78,7 @@ DopplegangerAttachments.prototype = { }); this.attachments = after; this._createAttachmentObjects(); + this.attachmentsUpdated(after, before); }, _createAttachmentObjects: function() { try { @@ -176,9 +178,7 @@ DopplegangerAttachments.prototype = { manualJointSync = this.manualJointSync; if (!this.attachments) { - this.attachments = this._getResolvedAttachments(); - this._createAttachmentObjects(); - log('created attachment objects #' + this.attachments.length); + this.refreshAttachments(); } var updatedObjects = this.attachments.reduce(function(updates, attachment, i) { if (!attachment.properties || !attachment._loaded) { diff --git a/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger-i.svg b/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger-i.svg new file mode 100644 index 0000000000..0c55e0e0c7 --- /dev/null +++ b/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger-i.svg @@ -0,0 +1,94 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger.js b/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger.js index c743357e0c..375105e722 100644 --- a/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger.js +++ b/unpublishedScripts/marketplace/doppleganger-attachments/doppleganger.js @@ -501,7 +501,7 @@ Doppleganger.addDebugControls = function(doppleganger) { if (hit.jointIndex < 0) { return; } - hit.mirroredJointName = Doppleganger.getMirroredJointNames([hit.jointName])[0]; + hit.mirroredJointName = modelHelper.deriveMirroredJointNames([hit.jointName])[0]; log('selected joint:', JSON.stringify(hit, 0, 2)); });