-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlscb.mel
52 lines (44 loc) · 1.48 KB
/
lscb.mel
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
global proc string[] lscb(){
//nb: only one shape's attributes could be selected
string $attrs_sn[];
$lssl = `ls -sl`;
$attrs_sn = `channelBox -q -sma mainChannelBox`;
$attrs_shps = `channelBox -q -ssa mainChannelBox`;
$shps = `channelBox -q -shp mainChannelBox`;
$attrs_sn = stringArrayCatenate($attrs_shps, $attrs_sn);
string $items[];
int $i;
for ($sel in $lssl){
for ($at in $attrs_sn){
$plg = $sel+"."+$at;
// print $at;
//$ls_at = `listAttr $plg`;
$ls_plg = `ls $plg`;
if (size($ls_plg))
$items[$i++] = $ls_plg[0];
/*
if (`attributeExists $at $sel`){
$at_ln = `attributeQuery -n $lssl[0] -ln $at`;
$items[$i++] = $sel + "." + $at_ln;
}
*/
}
}
// inputs
$inps = `channelBox -q -sha mainChannelBox`;
if (size($inps)){
$inp_plgs = $inps;
$inp_nd = `channelBox -q -hol mainChannelBox`;
stringArrayAddPrefix($inp_plgs, ($inp_nd[0] + "."));
$items = stringArrayCatenate($inp_plgs, $items);
}
// outputs
$outps = `channelBox -q -soa mainChannelBox`;
string $outp_plgs[] = $outps;
if (size($outps)){
$ls_out_node = `channelBox -q -ool mainChannelBox`;
stringArrayAddPrefix $outp_plgs ($ls_out_node[0]+".");
}
$items = stringArrayCatenate($outp_plgs, $items);
return $items;
}