I am working on a small script to remove duplicate file textures in the hypershade. First I want to store all the duplicate files in a string array. I think my code should work (eg return in string $trashFiles all the duplicate textures with the same file directory ) but it doesn’t end up storing anything. If anyone could point out the flaw it would be much appreciated! -Thanks
clear $trashFiles;
string $trashFiles[];
string $fileTextures[] = `ls -type "file"`;
for ($file in $fileTextures)
{
string $newfileTextures[] = `ls -type "file"`;
for ($newfile in $newfileTextures)
{
string $path1 = `getAttr ($file+".ftn")`;
string $path2 = `getAttr ($newfile+".ftn")`;
if ($path1 == $path2) continue;
if ($file != $newfile) continue;
stringArrayInsertAtIndex( 0, $trashFiles, $newfile );
}
}