Skip to content

Instantly share code, notes, and snippets.

@hmasato
Created November 13, 2013 12:38
Show Gist options
  • Select an option

  • Save hmasato/7448401 to your computer and use it in GitHub Desktop.

Select an option

Save hmasato/7448401 to your computer and use it in GitHub Desktop.
[MAYA, Mel] _getFileTextures
proc string[] _getFileTextures(string $node)
{
string $ret[] = {};
if($node=="") return($ret);
if(!objExists($node)) return($ret);
string $sels[]=`ls -sl`; //store config
select -hi -r $node;
hyperShade -smn;
string $mats[]=`ls -sl -mat`;
if(size($mats) > 0){
$ret = `listConnections -s 1 -d 0 -p 0 -type "file" $mats`;
$ret = stringArrayRemoveDuplicates($ret);
clear $mats;
}
if(size($sels)>0) select -r $sels; // restore config
clear $sels;
return($ret);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment