Code:
global proc gen_unfilteredTextures(){
// list all shaders
string $materialList[] = `ls -type "shadingEngine"`;
// this variable will be assigned the value of the shader's
// material info node
string $matInfo;
// start cycling through the list
for ($shader in $materialList){
// start searching for material info node
string $connections[] = `listConnections $shader`;
for ($item in $connections){
if (`objectType $item` == "materialInfo")
$matInfo = $item;
}
// to avoid any script stopping errors, check if matInfo node exists
// before acting on it
if(`objExists $matInfo`)
setAttr ($matInfo + ".textureFilter") 2;
}
// panel needs to be redrawn to update textures
refresh;
}
// node that attaches script to scene, and will run whenever file loads
scriptNode -st 2 -bs gen_unfilteredTextures;