From 7afe0ddcae8f2f0899bffd16ba171c927b3fca96 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Fri, 1 Jun 2012 14:09:05 -0700 Subject: Correction for texture paths. --- js/lib/rdge/texture.js | 7 +++++-- js/panels/Materials/materials-popup.reel/materials-popup.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/lib/rdge/texture.js b/js/lib/rdge/texture.js index 498dcf3b..bd8e6198 100644 --- a/js/lib/rdge/texture.js +++ b/js/lib/rdge/texture.js @@ -68,9 +68,12 @@ function Texture( dstWorld, texMapName, wrap, mips ) { // determine if the source is a canvas or an image file var viewUtils = require("js/helper-classes/3D/view-utils").ViewUtils; - var root = viewUtils.application.ninja.currentDocument.documentRoot; + //var root = viewUtils.application.ninja.currentDocument.documentRoot; + var root; + if (viewUtils.application.ninja.currentDocument) + root = viewUtils.application.ninja.currentDocument.model.documentRoot; var srcCanvas = this._srcCanvas; - if (!srcCanvas) + if (!srcCanvas && root) srcCanvas = this.findCanvas( this._texMapName, root ); if (srcCanvas) { diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js index db3f7652..3ef2e4ef 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.js +++ b/js/panels/Materials/materials-popup.reel/materials-popup.js @@ -178,7 +178,7 @@ exports.MaterialsPopup = Montage.create(Component, { if (index >= 0) { value = value.substr( index+1 ); - value = "assets\\images\\" + value; + value = "assets/images/" + value; } rtnValue = value.slice(0); } -- cgit v1.2.3