Skip to content

Commit

Permalink
instantiate skysphere template for equirect dropped in build mode; re…
Browse files Browse the repository at this point in the history
…solves #1958 (#1962)

* instantiate skysphere template for equirect dropped in build mode
* add threesixty_photo_entity, replace 360 photo with upload
  • Loading branch information
kschzt committed Dec 20, 2016
1 parent 41b0d6c commit a03cb56
Show file tree
Hide file tree
Showing 18 changed files with 364 additions and 34 deletions.
258 changes: 258 additions & 0 deletions browser/patchTemplates/360photo.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
{
"nodes": [{
"plugin": "threesixty_photo_entity",
"x": 772,
"y": 672,
"uid": "3C9Em6xdrgEM",
"state": {
"always_update": true,
"input_sids": {},
"output_sids": {
"DYZgrPjpJgXJ": "mh0rTKkFm0nD"
}
},
"title": "{{name}}",
"graph": {
"uid": "9DJ4ZqszKFMU",
"parent_uid": "root",
"open": true,
"nodes": [{
"plugin": "three_mesh",
"x": 1252,
"y": 373,
"uid": "3rgf6r3xbYSA",
"state": {
"position": {
"x": 0,
"y": 0,
"z": 0
},
"scale": {
"x": 1,
"y": 1,
"z": 1
},
"quaternion": {
"_x": 0,
"_y": 0,
"_z": 0,
"_w": 1
}
}
}, {
"plugin": "output_proxy",
"x": 1438,
"y": 405,
"uid": "DYZgrPjpJgXJ",
"title": "object3d",
"dyn_in": [{
"name": "output",
"dt": 21,
"def": null,
"uid": "bEdPpC9C6Rh1",
"dynamic": true,
"type": 0,
"index": 0,
"is_connected": true,
"connected": true
}]
}, {
"plugin": "three_material",
"x": 974,
"y": 130,
"uid": "TD7n9my6NX9Z",
"state": {}
}, {
"plugin": "const_float_generator",
"x": 723,
"y": 214,
"uid": "wqrVfMSYYqwN",
"state": {
"val": 1
},
"title": "Side"
}, {
"plugin": "three_uv_modifier",
"x": 553,
"y": 87,
"uid": "NsYvEbNxsUR5",
"state": {}
}, {
"plugin": "const_float_generator",
"x": 297,
"y": 197,
"uid": "W8QSRNB4kueG",
"state": {
"val": -1
},
"title": "X repeat photo"
}, {
"plugin": "three_geometry_sphere",
"x": 939,
"y": 467,
"uid": "UQ9hvSqLBWRh"
}, {
"plugin": "const_float_generator",
"x": 675,
"y": 421,
"uid": "VGntdzyvgDQP",
"state": {
"val": 30
},
"title": "Radius"
}, {
"plugin": "const_float_generator",
"x": 676,
"y": 502,
"uid": "gFaz858pqbTt",
"state": {
"val": 40
},
"title": "Width Segments"
}, {
"plugin": "const_float_generator",
"x": 674,
"y": 584,
"uid": "AbeR7zbHJYMg",
"state": {
"val": 40
},
"title": "Height Segments"
}, {
"plugin": "toggle_button",
"x": 724,
"y": 292,
"uid": "N7d3TBFVFfDU",
"state": {
"enabled": false
},
"title": "Fog"
}, {
"plugin": "slider_float_generator",
"x": 301,
"y": 298,
"uid": "Tbsrebx2e3nd",
"state": {
"val": 0.25,
"min": 0,
"max": 1
}
}, {
"plugin": "photosphere_orientation_reader",
"x": 671,
"y": 380,
"uid": "3C3g2scg5WLj",
"open": false,
"state": {}
}, {
"plugin": "url_texture_generator",
"x": 239,
"y": 544,
"uid": "vtErWjYsRPJc",
"state": {
"url": "{{url}}"
}
}],
"conns": [{
"src_nuid": "3rgf6r3xbYSA",
"dst_nuid": "DYZgrPjpJgXJ",
"src_slot": "object3d",
"dst_slot": 0,
"uid": "Lb5jAPDD6xmp",
"dst_dyn": true
}, {
"src_nuid": "TD7n9my6NX9Z",
"dst_nuid": "3rgf6r3xbYSA",
"src_slot": "material",
"dst_slot": "material",
"uid": "WsBWYJ7TBCuS"
}, {
"src_nuid": "wqrVfMSYYqwN",
"dst_nuid": "TD7n9my6NX9Z",
"src_slot": "value",
"dst_slot": "side",
"uid": "EEP2DepqwGyK"
}, {
"src_nuid": "NsYvEbNxsUR5",
"dst_nuid": "TD7n9my6NX9Z",
"src_slot": "texture",
"dst_slot": "texture",
"uid": "bkBZEsb5vUtw"
}, {
"src_nuid": "W8QSRNB4kueG",
"dst_nuid": "NsYvEbNxsUR5",
"src_slot": "value",
"dst_slot": "u repeat",
"uid": "94jAD2Wpg6jf"
}, {
"src_nuid": "VGntdzyvgDQP",
"dst_nuid": "UQ9hvSqLBWRh",
"src_slot": "value",
"dst_slot": "radius",
"uid": "APbNVtDhPS4x"
}, {
"src_nuid": "gFaz858pqbTt",
"dst_nuid": "UQ9hvSqLBWRh",
"src_slot": "value",
"dst_slot": "widthSegments",
"uid": "3MyuJH2NXjad"
}, {
"src_nuid": "AbeR7zbHJYMg",
"dst_nuid": "UQ9hvSqLBWRh",
"src_slot": "value",
"dst_slot": "heightSegments",
"uid": "wL9VJtsZbVVm"
}, {
"src_nuid": "UQ9hvSqLBWRh",
"dst_nuid": "3rgf6r3xbYSA",
"src_slot": "geometry",
"dst_slot": "geometry",
"uid": "RknMhhgac8KN"
}, {
"src_nuid": "N7d3TBFVFfDU",
"dst_nuid": "TD7n9my6NX9Z",
"src_slot": "bool",
"dst_slot": "fog",
"uid": "ftAP7yb4aeuw"
}, {
"src_nuid": "Tbsrebx2e3nd",
"dst_nuid": "NsYvEbNxsUR5",
"src_slot": "value",
"dst_slot": "u offset",
"uid": "K9vxt2VJ55xc"
}, {
"src_nuid": "3C3g2scg5WLj",
"dst_nuid": "3rgf6r3xbYSA",
"src_slot": "rotation",
"dst_slot": "rotation",
"uid": "Swcu4favYStt"
}, {
"src_nuid": "vtErWjYsRPJc",
"dst_nuid": "NsYvEbNxsUR5",
"src_slot": "texture",
"dst_slot": "texture",
"uid": "ve4CHkAZ9RB9"
}, {
"src_nuid": "vtErWjYsRPJc",
"dst_nuid": "3C3g2scg5WLj",
"src_slot": "texture",
"dst_slot": "texture",
"uid": "TNxCvSAe4bKp"
}]
},
"dyn_out": [{
"name": "object3d",
"dt": 21,
"index": 0,
"uid": "mh0rTKkFm0nD",
"dynamic": true,
"type": 1,
"is_connected": false
}]
}],
"conns": [],
"x1": 822,
"y1": 722,
"x2": 977,
"y2": 781
}
19 changes: 3 additions & 16 deletions browser/plugins/entity.plugin.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
(function() {

var EntityPlugin = E2.plugins.entity = function(core) {
AbstractGraphPlugin.apply(this, arguments)
var EntityPlugin = E2.plugins.entity = function() {
AbstractEntityPlugin.apply(this, arguments)
this.desc = '3D Entity Patch'
}

EntityPlugin.prototype = Object.create(AbstractGraphPlugin.prototype)

EntityPlugin.prototype.getObjectNode = function() {
return this.graph.findNodeByPlugin('three_mesh')
}

EntityPlugin.prototype.getObject3D = function() {
var meshNode = this.getObjectNode()

if (!meshNode)
return

return meshNode.plugin.getObject3D()
}
EntityPlugin.prototype = Object.create(AbstractEntityPlugin.prototype)

})()
10 changes: 7 additions & 3 deletions browser/plugins/plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,17 @@

"Nested Patch": "graph",

"Entity": "entity",
"Entity Component": "entity_component",

"Loop": "loop",
"Array Function": "array_function"
},

"ENTITIES / COMPONENTS": {
"Entity": "entity",
"360 Photo Entity": "threesixty_photo_entity",

"Component for Entity": "entity_component"
},

"CAMERAS": {
"VR Camera": "three_vr_camera",
"Orbit Camera": "three_orbit_camera",
Expand Down
10 changes: 10 additions & 0 deletions browser/plugins/threesixty_photo_entity.plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(function() {

var ThreeSixtyPhotoEntityPlugin = E2.plugins.threesixty_photo_entity = function() {
AbstractEntityPlugin.apply(this, arguments)
this.desc = '360 Photo Entity Patch'
}

ThreeSixtyPhotoEntityPlugin.prototype = Object.create(AbstractEntityPlugin.prototype)

})()
27 changes: 27 additions & 0 deletions browser/scripts/abstractPlugins/abstractEntityPlugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
(function() {

function AbstractEntityPlugin() {
AbstractGraphPlugin.apply(this, arguments)
}

AbstractEntityPlugin.prototype = Object.create(AbstractGraphPlugin.prototype)

AbstractEntityPlugin.prototype.getObjectNode = function() {
return this.graph.findNodeByPlugin('three_mesh')
}

AbstractEntityPlugin.prototype.getObject3D = function() {
var meshNode = this.getObjectNode()

if (!meshNode)
return

return meshNode.plugin.getObject3D()
}

window.AbstractEntityPlugin = AbstractEntityPlugin

if (typeof(module) !== 'undefined')
module.exports = AbstractEntityPlugin

})()
4 changes: 2 additions & 2 deletions browser/scripts/abstractPlugins/abstractGraphPlugin.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(function() {
var AbstractGraphPlugin = function(core) {
var AbstractGraphPlugin = function() {
SubGraphPlugin.apply(this, arguments)

this.desc = 'Encapsulate a nested graph into- and out of which arbitrary data can be routed and the encapsulated logic. Add input / output proxies inside the graph to feed data in / out of the graph.'

this.input_slots = []
this.output_slots = []

this.state = {
always_update: true,
input_sids: {},
Expand Down
9 changes: 9 additions & 0 deletions browser/scripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,15 @@ Application.prototype.onCut = function(e) {
}
}

Application.prototype.removeEntityFromScene = function(entityName) {
var node = E2.core.root_graph.findNodeByPlugin(entityName)

if (!node)
return

this.graphApi.removeNode(E2.core.root_graph, node)
}

Application.prototype.pasteFromClipboard = function() {
return this.pasteJson(this.clipboard)
}
Expand Down
6 changes: 3 additions & 3 deletions browser/scripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ E2.erase_color = '#ff3b3b';
E2.COLOR_COMPATIBLE_SLOT = '#080';

E2.WORLD_PATCHES = [
'entity', 'entity_component'
'entity', 'threesixty_photo_entity',
'entity_component'
]

E2.GRAPH_NODES = [
'graph', 'loop',
'entity', 'entity_component',
'array_function', 'spawner'
]
].concat(E2.WORLD_PATCHES)

E2.LOADING_NODES = {
'three_loader_model': 'model',
Expand Down
Loading

0 comments on commit a03cb56

Please sign in to comment.