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 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'js/lib/rdge') 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) { -- cgit v1.2.3