aboutsummaryrefslogtreecommitdiff
path: root/js/models
diff options
context:
space:
mode:
Diffstat (limited to 'js/models')
-rwxr-xr-xjs/models/materials-model.js32
1 files changed, 31 insertions, 1 deletions
diff --git a/js/models/materials-model.js b/js/models/materials-model.js
index d8fb4016..a45b0c72 100755
--- a/js/models/materials-model.js
+++ b/js/models/materials-model.js
@@ -115,7 +115,31 @@ exports.MaterialsModel = Montage.create(Component, {
115 return this._materials[index]; 115 return this._materials[index];
116 } 116 }
117 } 117 }
118 }, 118 },
119
120 getMaterialByShader:
121 {
122 value: function( shaderName )
123 {
124 var index = this.getIndexOfMaterialByShader( shaderName );
125 if (index >= 0)
126 return this._materials[index];
127 }
128 },
129
130 getIndexOfMaterialByShader: {
131 value: function (shaderName) {
132 var len = this._materials.length;
133 for(var i=0; i<len; i++) {
134 var material = this._materials[i];
135 if(material.getShaderName() === shaderName) {
136 return i;
137 }
138 }
139
140 return -1;
141 }
142 },
119 143
120 getIndexOfMaterial: { 144 getIndexOfMaterial: {
121 value: function (materialName) { 145 value: function (materialName) {
@@ -143,6 +167,12 @@ exports.MaterialsModel = Montage.create(Component, {
143 } 167 }
144 }, 168 },
145 169
170 getDefaultMaterialName: {
171 value: function() {
172 return "FlatMaterial";
173 }
174 },
175
146 exportMaterials: { 176 exportMaterials: {
147 value: function() { 177 value: function() {
148 178