aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Materials
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Materials')
-rw-r--r--js/panels/Materials/materials-data.json95
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.html13
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.js13
-rwxr-xr-xjs/panels/Materials/materials-popup.reel/materials-popup.js124
4 files changed, 191 insertions, 54 deletions
diff --git a/js/panels/Materials/materials-data.json b/js/panels/Materials/materials-data.json
index f06ab6c8..ad0c1f56 100644
--- a/js/panels/Materials/materials-data.json
+++ b/js/panels/Materials/materials-data.json
@@ -5,37 +5,96 @@
5 "label": "Ninja Materials", 5 "label": "Ninja Materials",
6 "children": [ 6 "children": [
7 { 7 {
8 "label": "Uber", 8 "label": "Bump Metal",
9 "id" : "UberMaterial" 9 "id" : "Bump Metal"
10 }, 10 },
11 { 11 {
12 "label": "Bump Metal", 12 "label": "Deform",
13 "id" : "BumpMetalMaterial" 13 "id" : "Deform"
14 },
15 {
16 "label": "Flat",
17 "id" : "Flat"
18 },
19 {
20 "label": "Flag",
21 "id" : "Flag"
22 },
23 {
24 "label": "Fly",
25 "id" : "Fly"
26 },
27 {
28 "label": "Julia",
29 "id" : "Julia"
30 },
31 {
32 "label": "Keleidoscope",
33 "id" : "Keleidoscope"
14 }, 34 },
15 { 35 {
16 "label": "Linear Gradient", 36 "label": "Linear Gradient",
17 "id" : "LinearGradientMaterial" 37 "id" : "Linear Gradient"
38 },
39 {
40 "label": "Mandel",
41 "id" : "Mandel"
42 },
43 {
44 "label": "Plasma",
45 "id" : "Plasma"
46 },
47 {
48 "label": "Pulse",
49 "id" : "Pulse"
50 },
51 {
52 "label": "Radial Blur",
53 "id" : "Radial Blur"
18 }, 54 },
19 { 55 {
20 "label": "Radial Gradient", 56 "label": "Radial Gradient",
21 "id" : "RadialGradientMaterial" 57 "id" : "Radial Gradient"
22 }, 58 },
23 { 59 {
24 "label": "Flat", 60 "label": "Relief Tunnel",
25 "id" : "FlatMaterial" 61 "id" : "Relief Tunnel"
26 } 62 },
27 ] 63 {
28 }, 64 "label": "Square Tunnel",
29 { 65 "id" : "Square Tunnel"
30 "label": "Custom Materials", 66 },
31 "children": [ 67 {
68 "label": "Star",
69 "id" : "Star"
70 },
71 {
72 "label": "Taper",
73 "id" : "Taper"
74 },
75 {
76 "label": "Tunnel",
77 "id" : "Tunnel"
78 },
79 {
80 "label": "Twist",
81 "id" : "Twist"
82 },
83 {
84 "label": "Twist Vertex",
85 "id" : "Twist Vertex"
86 },
87 {
88 "label": "Uber",
89 "id" : "Uber"
90 },
32 { 91 {
33 "label": "Checker Board", 92 "label": "Water",
34 "id" : "CheckerBoard" 93 "id" : "Water"
35 }, 94 },
36 { 95 {
37 "label": "Shiny Metal", 96 "label": "Z-Invert",
38 "id" : "ShinyMetal" 97 "id" : "Z-Invert"
39 } 98 }
40 ] 99 ]
41 } 100 }
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
index b5d7a869..6fa54495 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
@@ -13,7 +13,8 @@
13 "addButton": { 13 "addButton": {
14 "prototype": "montage/ui/button.reel", 14 "prototype": "montage/ui/button.reel",
15 "properties": { 15 "properties": {
16 "element": {"#": "ml_add_btn"} 16 "element": {"#": "ml_add_btn"},
17 "enabled": false
17 }, 18 },
18 "listeners": [ 19 "listeners": [
19 { 20 {
@@ -25,8 +26,9 @@
25 "copyButton": { 26 "copyButton": {
26 "prototype": "montage/ui/button.reel", 27 "prototype": "montage/ui/button.reel",
27 "properties": { 28 "properties": {
28 "element": {"#": "ml_copy_btn"} 29 "element": {"#": "ml_copy_btn"},
29 }, 30 "enabled": false
31 },
30 "listeners": [ 32 "listeners": [
31 { 33 {
32 "type": "action", 34 "type": "action",
@@ -37,8 +39,9 @@
37 "deleteButton": { 39 "deleteButton": {
38 "prototype": "montage/ui/button.reel", 40 "prototype": "montage/ui/button.reel",
39 "properties": { 41 "properties": {
40 "element": {"#": "ml_delete_btn"} 42 "element": {"#": "ml_delete_btn"},
41 }, 43 "enabled": false
44 },
42 "listeners": [ 45 "listeners": [
43 { 46 {
44 "type": "action", 47 "type": "action",
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
index c600fd0d..cf0d4e93 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
@@ -51,14 +51,15 @@ exports.MaterialsLibraryPanel = Montage.create(Component, {
51 51
52 handleNodeActivation: { 52 handleNodeActivation: {
53 value:function(obj) { 53 value:function(obj) {
54 this._showMaterialPopup(obj.id); 54 this._showMaterialPopup({ materialId: obj.id });
55 } 55 }
56 }, 56 },
57 57
58 handleShowMaterialPopup: { 58 handleShowMaterialPopup: {
59 enumerable: false, 59 enumerable: false,
60 value: function (event) { 60 value: function (event) {
61 this._showMaterialPopup(event.detail.materialId); 61 //this._showMaterialPopup(event.detail.materialId);
62 this._showMaterialPopup(event.detail);
62 } 63 }
63 }, 64 },
64 65
@@ -74,9 +75,9 @@ exports.MaterialsLibraryPanel = Montage.create(Component, {
74 75
75 _showMaterialPopup: { 76 _showMaterialPopup: {
76 enumerable: false, 77 enumerable: false,
77 value: function (materialID) { 78 value: function (materialObj) {
78 79
79 if(!this._materialPopup) 80 if(!this._materialPopup)
80 { 81 {
81 this._materialPopup = Popup.create(); 82 this._materialPopup = Popup.create();
82 this._materialPopup.content = this._materialInfo; 83 this._materialPopup.content = this._materialInfo;
@@ -85,7 +86,9 @@ exports.MaterialsLibraryPanel = Montage.create(Component, {
85 this._materialPopup.addEventListener("show", this, false); 86 this._materialPopup.addEventListener("show", this, false);
86 } 87 }
87 this._materialPopup.show(); 88 this._materialPopup.show();
88 this._materialInfo.loadMaterials(materialID);