particleExplorer works in edit tab

This commit is contained in:
ericrius1 2016-02-15 09:41:47 -08:00
parent b92c5555fe
commit e4d4044a2b
3 changed files with 7 additions and 7 deletions

View file

@ -1893,17 +1893,18 @@ entityListTool.webView.eventBridge.webEventReceived.connect(function(data) {
if (Entities.getEntityProperties(ids[0], "type").type === "ParticleEffect") {
// Now we want to activate the partice explorer panel!
particleExplorerTool.createWebView();
print("EBL ACTIVATE PARTICLE EXPLORER");
var properties = Entities.getEntityProperties(ids[0]);
var data = {
messageType: "particle_settings",
currentProperties: properties
};
particleExplorerTool.setActiveParticleEntity(ids[0]);
particleExplorerTool.webView.eventBridge.emitScriptEvent(JSON.stringify(data));
Script.setTimeout(function() {
// Wait for event bridge on web side to open
particleExplorerTool.webView.eventBridge.emitScriptEvent(JSON.stringify(data));
}, 3000)
} else {
print("EBL CLOSE WEB VIEW")
particleExplorerTool.destroyWebView();
}
}

View file

@ -1,5 +1,5 @@
//
// main.js
// particleExplorer.js
//
// Created by James B. Pollack @imgntn on 9/26/2015
// Copyright 2015 High Fidelity, Inc.
@ -338,8 +338,9 @@ function writeVec3ToInterface(obj) {
}
function listenForSettingsUpdates() {
console.log("EBL LISTENING FOR EVENTS")
console.log("EBL LISTENING FOR EVENTS ON PARTICLE GUI WEB SIDE!")
EventBridge.scriptEventReceived.connect(function(data) {
console.log("EBL RECIEVED EVENT!! ON WEB SIDE - " + JSON.stringify(data));
data = JSON.parse(data);
if (data.messageType === 'particle_settings') {
_.each(data.currentProperties, function(value, key) {
@ -349,7 +350,6 @@ function listenForSettingsUpdates() {
loadGUI();
}
console.log("EBL RECIEVED EVENT - " + JSON.stringify(data));
});
}

View file

@ -27,7 +27,6 @@ ParticleExplorerTool = function() {
if (data.messageType === "settings_update") {
Entities.editEntity(that.activeParticleEntity, data.updatedSettings);
}
print("EBL WEB EVENT RECIEVED FROM PARTICLE GUI");
}
that.setActiveParticleEntity = function(id) {