From 818582d389f504c915be0c9052fafa33e3e76c92 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 7 Mar 2012 16:48:48 -0800 Subject: File IO --- js/lib/geom/circle.js | 3 ++- js/lib/geom/geom-obj.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ js/lib/geom/rectangle.js | 4 ++-- 3 files changed, 51 insertions(+), 3 deletions(-) (limited to 'js/lib/geom') diff --git a/js/lib/geom/circle.js b/js/lib/geom/circle.js index dd82a4cc..ad77383b 100755 --- a/js/lib/geom/circle.js +++ b/js/lib/geom/circle.js @@ -577,9 +577,10 @@ var Circle = function GLCircle() { } else { rtnStr += "flatMaterial"; } - rtnStr += "\n"; + rtnStr += this.exportMaterials(); + return rtnStr; }; diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js index c5880843..852aab89 100755 --- a/js/lib/geom/geom-obj.js +++ b/js/lib/geom/geom-obj.js @@ -204,6 +204,53 @@ var GeomObj = function GLGeomObj() { return fillMaterial; }; + this.exportMaterials = function() + { + var rtnStr = ""; + if (this._materialArray && this._materialNodeArray) + { + var nMats = this._materialArray.length; + rtnStr += "nMaterials: " + nMats + "\n"; + for (var i=0; i