View Single Post
# 5 02-01-2014 , 03:37 AM
Registered User
Join Date: Aug 2011
Location: Sliema Malta
Posts: 497
// Global Texture Reloader

global proc reloader()

{
reloaderizer();
}

reloader;
global proc reloaderizer()

{

string $texturename[] = `ls -tex`;
int $nothing =0;
int $count= size($texturename);
string $whole;
while ($nothing < $count)

{

$whole = $texturename[$nothing] + ".fileTextureName";
TextureReload $whole;
++$nothing;

}

}

global proc TextureReload (string $ftn)

{
string $currFile = `getAttr $ftn`;
if ($currFile != "") {
int $i;
string $allTextures[] = `ls -textures`;

for ($i = 0; $i < size($allTextures); $i++) {
if (`nodeType $allTextures[$i]` == "file") {
string $ithFile = `getAttr ($allTextures[$i] + ".ftn")`;
if ($ithFile == $currFile)
setAttr ($allTextures[$i] + ".ftn") -type "string" $currFile;
}
}
}
}