diff options
Diffstat (limited to 'js/panels')
3 files changed, 160 insertions, 37 deletions
diff --git a/js/panels/Materials/materials-data.json b/js/panels/Materials/materials-data.json index f06ab6c8..5e86793e 100644 --- a/js/panels/Materials/materials-data.json +++ b/js/panels/Materials/materials-data.json | |||
@@ -5,24 +5,96 @@ | |||
5 | "label": "Ninja Materials", | 5 | "label": "Ninja Materials", |
6 | "children": [ | 6 | "children": [ |
7 | { | 7 | { |
8 | "label": "Uber", | ||
9 | "id" : "UberMaterial" | ||
10 | }, | ||
11 | { | ||
12 | "label": "Bump Metal", | 8 | "label": "Bump Metal", |
13 | "id" : "BumpMetalMaterial" | 9 | "id" : "BumpMetalMaterial" |
14 | }, | 10 | }, |
15 | { | 11 | { |
12 | "label": "Deform", | ||
13 | "id" : "DeformMaterial" | ||
14 | }, | ||
15 | { | ||
16 | "label": "Flat", | ||
17 | "id" : "FlatMaterial" | ||
18 | }, | ||
19 | { | ||
20 | "label": "Flag", | ||
21 | "id" : "FlagMaterial" | ||
22 | }, | ||
23 | { | ||
24 | "label": "Fly", | ||
25 | "id" : "FlyMaterial" | ||
26 | }, | ||
27 | { | ||
28 | "label": "Julia", | ||
29 | "id" : "JuliaMaterial" | ||
30 | }, | ||
31 | { | ||
32 | "label": "Keleidoscope", | ||
33 | "id" : "KeleidoscopeMaterial" | ||
34 | }, | ||
35 | { | ||
16 | "label": "Linear Gradient", | 36 | "label": "Linear Gradient", |
17 | "id" : "LinearGradientMaterial" | 37 | "id" : "LinearGradientMaterial" |
18 | }, | 38 | }, |
19 | { | 39 | { |
40 | "label": "Mandel", | ||
41 | "id" : "MandelMaterial" | ||
42 | }, | ||
43 | { | ||
44 | "label": "Plasma", | ||
45 | "id" : "PlasmaMaterial" | ||
46 | }, | ||
47 | { | ||
48 | "label": "Pulse", | ||
49 | "id" : "PulseMaterial" | ||
50 | }, | ||
51 | { | ||
52 | "label": "Radial Blur", | ||
53 | "id" : "RadialBlurMaterial" | ||
54 | }, | ||
55 | { | ||
20 | "label": "Radial Gradient", | 56 | "label": "Radial Gradient", |
21 | "id" : "RadialGradientMaterial" | 57 | "id" : "RadialGradientMaterial" |
22 | }, | 58 | }, |
23 | { | 59 | { |
24 | "label": "Flat", | 60 | "label": "Relief Tunnel", |
25 | "id" : "FlatMaterial" | 61 | "id" : "ReliefTunnelMaterial" |
62 | }, | ||
63 | { | ||
64 | "label": "Square Tunnel", | ||
65 | "id" : "SquareTunnelMaterial" | ||
66 | }, | ||
67 | { | ||
68 | "label": "Star", | ||
69 | "id" : "StarMaterial" | ||
70 | }, | ||
71 | { | ||
72 | "label": "Taper", | ||
73 | "id" : "TaperMaterial" | ||
74 | }, | ||
75 | { | ||
76 | "label": "Tunnel", | ||
77 | "id" : "TunnelMaterial" | ||
78 | }, | ||
79 | { | ||
80 | "label": "Twist", | ||
81 | "id" : "TwistMaterial" | ||
82 | }, | ||
83 | { | ||
84 | "label": "Twist Vertex", | ||
85 | "id" : "TwistVertMaterial" | ||
86 | }, | ||
87 | { | ||
88 | "label": "Uber", | ||
89 | "id" : "UberMaterial" | ||
90 | }, | ||
91 | { | ||
92 | "label": "Water", | ||
93 | "id" : "WaterMaterial" | ||
94 | }, | ||
95 | { | ||
96 | "label": "Z-Invert", | ||
97 | "id" : "ZInvertMaterial" | ||
26 | } | 98 | } |
27 | ] | 99 | ] |
28 | }, | 100 | }, |
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 2176c6d5..205ecd90 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 | ||
@@ -73,9 +74,9 @@ exports.MaterialsLibraryPanel = Montage.create(Component, { | |||
73 | 74 | ||
74 | _showMaterialPopup: { | 75 | _showMaterialPopup: { |
75 | enumerable: false, | 76 | enumerable: false, |
76 | value: function (materialID) { | 77 | value: function (materialObj) { |
77 | 78 | ||
78 | if(!this._materialPopup) | 79 | if(!this._materialPopup) |
79 | { | 80 | { |
80 | this._materialPopup = Popup.create(); | 81 | this._materialPopup = Popup.create(); |
81 | this._materialPopup.content = this._materialInfo; | 82 | this._materialPopup.content = this._materialInfo; |
@@ -84,7 +85,9 @@ exports.MaterialsLibraryPanel = Montage.create(Component, { | |||
84 | this._materialPopup.addEventListener("show", this, false); | 85 | this._materialPopup.addEventListener("show", this, false); |
85 | } | 86 | } |
86 | this._materialPopup.show(); | 87 | this._materialPopup.show(); |
87 | this._materialInfo.loadMaterials(materialID); | 88 | |
89 | materialID = materialObj.materialId; | ||
90 | this._materialInfo.loadMaterials(materialID, materialObj.useSelection, materialObj.whichMaterial); | ||
88 | } | 91 | } |
89 | }, | 92 | }, |
90 | 93 | ||
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js index bd10f7a5..1e92e144 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.js +++ b/js/panels/Materials/materials-popup.reel/materials-popup.js | |||
@@ -18,6 +18,8 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
18 | value: "" | 18 | value: "" |
19 | }, | 19 | }, |
20 | 20 | ||
21 | _useSelection: { value: false, enumerable: true }, | ||
22 | |||
21 | captureAction: { | 23 | captureAction: { |
22 | value:function(event) { | 24 | value:function(event) { |
23 | switch(event._currentTarget.label) | 25 | switch(event._currentTarget.label) |
@@ -88,8 +90,9 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
88 | 90 | ||
89 | _handlePropertyChange: | 91 | _handlePropertyChange: |
90 | { | 92 | { |
91 | value: function(event) | 93 | value: function(theEvent) |
92 | { | 94 | { |
95 | var event = theEvent._event; | ||
93 | if(typeof event.propertyValue === "object") | 96 | if(typeof event.propertyValue === "object") |
94 | { | 97 | { |
95 | console.log(event.propertyLabel + " changed to "); | 98 | console.log(event.propertyLabel + " changed to "); |
@@ -133,6 +136,11 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
133 | var value = this.decodeValue( this._propTypes[index], propValue ); | 136 | var value = this.decodeValue( this._propTypes[index], propValue ); |
134 | this._material.setProperty( this._propNames[index], value ); | 137 | this._material.setProperty( this._propNames[index], value ); |
135 | } | 138 | } |
139 | |||
140 | if (this._useSelection) | ||
141 | { | ||
142 | console.log( "apply to selection" ); | ||
143 | } | ||
136 | } | 144 | } |
137 | } | 145 | } |
138 | }, | 146 | }, |
@@ -164,8 +172,10 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
164 | var index = value.lastIndexOf( "/" ); | 172 | var index = value.lastIndexOf( "/" ); |
165 | if (index < 0) index = value.lastIndexOf( "\\" ); | 173 | if (index < 0) index = value.lastIndexOf( "\\" ); |
166 | if (index >= 0) | 174 | if (index >= 0) |
175 | { | ||