diff options
author | Pushkar Joshi | 2012-03-27 09:10:58 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-03-27 09:10:58 -0700 |
commit | 0c26aff9c19c2b39fca06fa6b3bc76b672204065 (patch) | |
tree | e778f2b9d5d525aa364360d5996536a0a06379bd /js/lib/rdge/materials/taper-material.js | |
parent | 753244b4713243ab19ca246be674f0b45fb85b72 (diff) | |
parent | 309dde5a8c4599cef6a1052c1ff9ee1ad8ec5858 (diff) | |
download | ninja-0c26aff9c19c2b39fca06fa6b3bc76b672204065.tar.gz |
Merge branch 'master' into brushtool
Conflicts:
js/controllers/elements/shapes-controller.js
Diffstat (limited to 'js/lib/rdge/materials/taper-material.js')
-rw-r--r-- | js/lib/rdge/materials/taper-material.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/js/lib/rdge/materials/taper-material.js b/js/lib/rdge/materials/taper-material.js index 03a7ba9c..15b7b2b0 100644 --- a/js/lib/rdge/materials/taper-material.js +++ b/js/lib/rdge/materials/taper-material.js | |||
@@ -96,6 +96,33 @@ function TaperMaterial() | |||
96 | } | 96 | } |
97 | } | 97 | } |
98 | /////////////////////////////////////////////////////////////////////// | 98 | /////////////////////////////////////////////////////////////////////// |
99 | this.exportJSON = function() | ||
100 | { | ||
101 | var jObj = | ||
102 | { | ||
103 | 'material' : this.getShaderName(), | ||
104 | 'name' : this.getName(), | ||
105 | 'color' : this._propValues["color"] | ||
106 | }; | ||
107 | |||
108 | return jObj; | ||
109 | } | ||
110 | |||
111 | this.importJSON = function( jObj ) | ||
112 | { | ||
113 | if (this.getShaderName() != jObj.material) throw new Error( "ill-formed material" ); | ||
114 | this.setName( jObj.name ); | ||
115 | |||
116 | try | ||
117 | { | ||
118 | var color = jObj.color; | ||
119 | this.setProperty( "color", color); | ||
120 | } | ||
121 | catch (e) | ||
122 | { | ||
123 | throw new Error( "could not import material: " + jObj ); | ||
124 | } | ||
125 | } | ||
99 | 126 | ||
100 | this.export = function() | 127 | this.export = function() |
101 | { | 128 | { |