// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== global proc textureWindowToggleEditorImage ( string $editor ) // // Description: // This script is to be used with: textureWindowBakeEditorImage.mel // and textureWindowEditorImageUtils.mel. // They were written, along with some c-plus-plus source changes, to // address the fact that the image displayed in the Texture Editor may // be cropped, or may not be the correct resolution. // // This procedure will load a previously baked texture into the // Texture Editor Window. The Image Range of the Texture Editor Window // will be set to the Image Range used when baking the texture to // ensure proper visualization. // // If a file texture has not been baked for the combination described // by the selected object, its current uv set, and assigned texture // then an error is issued. // // There will no notification, however, if a previously baked texture // has been invalidated. A baked texture will be invalidated by any // modification of the 2d Texture Placement Node associated with // the texture node. It is the responsibility of the user to rebake // all affected file textures after any modification of the Texture // Placement Node. // { int $draw = `optionVar -exists displayEditorImage` && `optionVar -q displayEditorImage`; if ( $draw == 0 ) { optionVar -intValue displayEditorImage 1; textureWindow -e -vpi 0 $editor; } else { optionVar -intValue displayEditorImage 0; textureWindow -e -vpi 1 $editor; } }