particle panel in tool window

This commit is contained in:
ericrius1 2016-01-28 14:34:19 -08:00
parent 2acc88261f
commit 0511ff70ac
3 changed files with 75 additions and 78 deletions

View file

@ -16,7 +16,9 @@
<head>
<script type="text/javascript" src="dat.gui.min.js"></script>
<script type="text/javascript" src="underscore-min.js"></script>
<script type="text/javascript" src="main.js?123"></script>
<script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
<script type="text/javascript" src="../html/eventBridgeLoader.js"></script>
<script type="text/javascript" src="main.js?1234"></script>
<script>
</script>
<style>

View file

@ -34,49 +34,34 @@ var updateInterval;
var currentInputField;
var storedController;
var keysToIgnore = [
'importSettings',
'exportSettings',
'script',
'visible',
'locked',
'userData',
'position',
'dimensions',
'rotation',
'id',
'description',
'type',
'created',
'age',
'ageAsText',
'boundingBox',
'naturalDimensions',
'naturalPosition',
'velocity',
'gravity',
'acceleration',
'damping',
'restitution',
'friction',
'density',
'lifetime',
'scriptTimestamp',
'registrationPoint',
'angularVelocity',
'angularDamping',
'collisionless',
'dynamic',
'href',
'actionData',
'marketplaceID',
'collisionSoundURL',
'shapeType',
//CHANGE TO WHITELIST
var keysToAllow = [
'isEmitting',
'sittingPoints',
'originalTextures',
'parentJointIndex',
'parentID'
'maxParticles',
'lifespan',
'emitRate',
'emitSpeed',
'speedSpread',
'emitOrientation',
'emitDimensios',
'emitRadiusStart',
'polarStart',
'polarFinish',
'azimuthFinish',
'emitAcceleration',
'accelerationSpread',
'particleRadius',
'radiusSpread',
'radiusStart',
'radiusFinish',
'color',
'colorSpread',
'colorStart',
'colorFinish',
'alpha',
'alphaSpread',
'alphaFinish',
'emitterShouldTrail'
];
var individualKeys = [];
@ -85,8 +70,8 @@ var quatKeys = [];
var colorKeys = [];
window.onload = function() {
if (typeof EventBridge !== 'undefined') {
openEventBridge(function() {
var stringifiedData = JSON.stringify({
messageType: 'page_loaded'
});
@ -97,9 +82,9 @@ window.onload = function() {
listenForSettingsUpdates();
window.onresize = setGUIWidthToWindowWidth;
} else {
console.log('No event bridge, probably not in interface.');
}
console.log('JBP HAS EVENT BRIDGE');
})
};
function loadGUI() {
@ -120,12 +105,9 @@ function loadGUI() {
var keys = _.keys(settings);
_.each(keys, function(key) {
var shouldIgnore = _.contains(keysToIgnore, key);
if (shouldIgnore) {
return;
}
var shouldAllow = _.contains(keysToAllow, key);
if (shouldAllow) {
var subKeys = _.keys(settings[key]);
var hasX = _.contains(subKeys, 'x');
var hasY = _.contains(subKeys, 'y');
@ -145,6 +127,9 @@ function loadGUI() {
} else {
individualKeys.push(key);
}
}
});
@ -469,6 +454,7 @@ function removeListenerFromGUI(key) {
}
//the section below is to try to work at achieving two way bindings;
function addListenersBackToGUI() {
gui.__listening.push(storedController);
storedController = null;
@ -501,4 +487,3 @@ function registerDOMElementsForListenerBlocking() {
});
});
}

View file

@ -141,8 +141,19 @@ SettingsWindow = function() {
this.webWindow = null;
this.init = function() {
var url = Script.resolvePath('index.html');
_this.shnur = "bdur";
Script.update.connect(waitForObjectAuthorization);
_this.webWindow = new WebWindow('Particle Explorer', Script.resolvePath('index.html'), 400, 600, false);
_this.webWindow = new OverlayWebWindow({
title: 'Particle Explorer',
source: url,
toolWindow: true
});
// _this.webWindow.setVisible(false);
Script.setTimeout(function() {
print("EBL IN TIMEOUT! " + _this.shnur);
_this.webWindow.setVisible(true);
}, 2000)
_this.webWindow.eventBridge.webEventReceived.connect(_this.onWebEventReceived);
};
@ -161,7 +172,6 @@ SettingsWindow = function() {
editEntity(_data.updatedSettings);
return;
}
};
};