diff options
Diffstat (limited to 'js/lib')
-rwxr-xr-x | js/lib/NJUtils.js | 5 | ||||
-rwxr-xr-x | js/lib/drawing/world.js | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index 4f1082f9..cb877591 100755 --- a/js/lib/NJUtils.js +++ b/js/lib/NJUtils.js | |||
@@ -94,7 +94,10 @@ exports.NJUtils = Object.create(Object.prototype, { | |||
94 | ///// TODO: find a different place for this function | 94 | ///// TODO: find a different place for this function |
95 | makeElementModel: { | 95 | makeElementModel: { |
96 | value: function(el, selection, controller, isShape) { | 96 | value: function(el, selection, controller, isShape) { |
97 | var p3d = Montage.create(Properties3D).init(el); | 97 | var p3d = Montage.create(Properties3D); |
98 | if(selection === "Stage") { | ||
99 | p3d.init(el, true); | ||
100 | } | ||
98 | var shapeProps = null; | 101 | var shapeProps = null; |
99 | if(isShape) { | 102 | if(isShape) { |
100 | shapeProps = Montage.create(ShapeModel); | 103 | shapeProps = Montage.create(ShapeModel); |
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js index 049145ce..c1ee0cd0 100755 --- a/js/lib/drawing/world.js +++ b/js/lib/drawing/world.js | |||
@@ -810,14 +810,17 @@ World.prototype.findTransformNodeByMaterial = function( materialNode, trNode ) | |||
810 | return rtnNode; | 810 | return rtnNode; |
811 | }; | 811 | }; |
812 | 812 | ||
813 | World.prototype.import = function( importStr ) { | 813 | World.prototype.import = function( importStr, fromToggle ) { |
814 | // import the worldattributes - not currently used | 814 | // import the worldattributes - not currently used |
815 | 815 | ||
816 | // determine if the data was written for export (no Ninja objects) | 816 | // determine if the data was written for export (no Ninja objects) |
817 | // or for save/restore | 817 | // or for save/restore |
818 | //var index = importStr.indexOf( "scenedata: " ); | 818 | //var index = importStr.indexOf( "scenedata: " ); |
819 | var index = importStr.indexOf( "webGL: " ); | 819 | // Skip if we are toggling between canvas2d and WebGL since importStr doesn't have the correct webGL value yet |
820 | this._useWebGL = (index >= 0) | 820 | if(!fromToggle) { |
821 | var index = importStr.indexOf( "webGL: " ); | ||
822 | this._useWebGL = (index >= 0) | ||
823 | } | ||
821 | if (this._useWebGL) | 824 | if (this._useWebGL) |
822 | { | 825 | { |
823 | // start RDGE | 826 | // start RDGE |