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

View file

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

View file

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