// =========================================================================== // 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. // =========================================================================== // // // Creation Date: // // Description: // // global proc updateFileTextures( string $filename ) { string $fname, $buf1[], $buf2[]; int $i, $j, $count; // Do we need to use "\" on NT?? int $numdirs = `tokenize $filename "/" $buf1`; string $textures[] = `ls -type file`; for( $i = 0; $i < size( $textures ); $i++ ) { $fname = `getAttr ($textures[$i] + ".fileTextureName")`; int $numdirs2 = `tokenize $fname "/" $buf2`; if( $numdirs > $numdirs2 ) { $count = $numdirs2; } else { $count = $numdirs; } int $match = true; for( $j = 1; $j <= $count; $j++ ) { if( $buf1[$numdirs - $j] != $buf2[$numdirs2 - $j] ) { $match = false; break; } } if( $match ) { setAttr -type "string" ($textures[$i] + ".fileTextureName") $fname; } } }