summaryrefslogtreecommitdiffstats
path: root/tools/MayaTools/Maya4.0/scripts/SimpsonsArt/selectInst.mel
blob: 3e01da596ccd81854c0a2e104606b32452d95216 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
global proc selectInst()
{
	string $orig[];
		clear($orig);
		$orig = `ls -sl -tr`;
	string $origShape[];
		clear($origShape);
		$origShape = `ls -sl -dag -lf`;
	string $token[];
		clear($token);
	int $numTok;
		$numTok = `tokenize $origShape[0] "|" $token`;
	string $select[];
		clear($select);
	int $index;
	int $count;
		$count = 0;
//	if(`strcmp $orig[0] $token[0]`!=0)
//	{	error "No Original Geometry Selected!!";}
//	else
//	{
		string $objects[]= `ls -tr`;
		for($object in $objects)
		{
			string $objShape[] = `ls -dag -lf $object`;
			if(`strcmp $origShape[0] $objShape[0]` == 0)
			{
				select -add $object;
				$select[$count] = $object;
				$count++;
			}
		}
//	}
	print "\n";
	print $select;
}