View Full Version : Select polySmoothFace node???
Hi,
how can I select a specific polySmoothFace node?
I read through the select and ls documentation but I can't find what I need.
I could use ls -et polySmoothFace, but then I'd be selecting all the polySmoothFace nodes in the scene...
I also tried pickWalk, but it doesn't reach the node I need.
Thanks,
Bruno
|
|
If you know the object that has the polySmoothFace on it you can find it with something like this:
// assuming history hasn't been deleted!
string $hist[]=`listHistory $OBJECT`;
string $thisOne;
for($i=0;$i<size($hist);$i++)
{
if(`nodeType $hist[$i]` == " polySmoothFace")
{
$thisOne=$hist[$i];
break;
}
}
--g
MDuffy
08-07-2003, 06:51 PM
Or you can simplify that further with something like:
string $listHist [] = `listHistory $OBJECT`;
string $listSmooth [] = `ls -type polySmoothFace $listHist`;
And that will give you all of your polySmoothFace nodes in $listSmooth. You can use "size ($listSmooth) == 0" to test if the list is empty (and there aren't any polySmoothFace nodes), and $listSmooth[0] to grab the first one.
Cheers,
Michael Duffy
mduffy@ionet.net
boraddd
08-09-2003, 08:32 PM
handy animation script..
copy/paste the text and save as "keyEdit.mel" under your user\scripts folder. Type `keyEdit` to run the script in Maya
// keframeEditor v1.0
// Bora Dayioglu 2003
//
// Lists the keyframed channels for selected objects in a handy UI
// Doudle click on a list item sets selection to that item
// DEL or BACKSPACE key on a list item deletes that channel
//
// For comments & suggestions contact me at `thedayioglu@hotmail.com`
global proc keyEdit(){
if(`window -q -ex keyWinName`==0){
window -s 1 -tlb 1 -tb 1 -t "keyframeEditor" -w 200 -h 85 keyWinName;
paneLayout;
textScrollList -numberOfRows 4 -allowMultiSelection true -dcc "keyWinSelect()" -dkc "keyWinDelete" keyWinScroll;
showWindow keyWinName;
update_keyWinScroll;
scriptJob -p "keyWinName" -e "timeChanged" "update_keyWinScroll";
scriptJob -p "keyWinName" -ct "SomethingSelected" "update_keyWinScroll";
scriptJob -p "keyWinName" -e "SelectionChanged" "update_keyWinScroll";
scriptJob -p "keyWinName" -e "RecentCommandChanged" "update_keyWinScroll";
} else warning "keyframeEditor already open";
}
global proc keyWinSelect(){
string $ssel[];
string $tmp[];
$ssel=`textScrollList -q -si keyWinScroll`;
tokenize $ssel[0] "." $tmp;
select $tmp[0];
}
global proc keyWinDelete(){
string $cname[];
string $ssel[];
$ssel=`textScrollList -q -si keyWinScroll`;
for($n=0;$n<`size($ssel)`;$n++){
$cname=`keyframe -q -n $ssel[$n]`;
delete $cname[0];
}
update_keyWinScroll;
}
global proc update_keyWinScroll(){
window -e -t "no selection" keyWinName;
textScrollList -e -ra keyWinScroll;
string $sel[];
string $attr[];
int $kc;
float $ct;
float $fr[];
$ct=`currentTime -q`;
clear $sel;
$sel=`ls -sl`;
string $wstr;
if(`size($sel)`>0){
if(`size($sel)`==1){
window -e -t $sel[0] keyWinName;
} else {
$wstr="";
for($w=0;$w<`size($sel)`;$w++) $wstr+=$sel[$w]+" ";
window -e -t ($wstr) keyWinName;
}
for($j=0;$j<`size($sel)`;$j++){
$attr=`listAttr -k $sel[$j]`;
for($n=0;$n<`size($attr)`;$n++){
$kc=`keyframe -q -kc ($sel[$j]+"."+$attr[$n])`;
if($kc!=0){
for($k=0;$k<$kc;$k++){
$fr=`keyframe -index $k -query ($sel[$j]+"."+$attr[$n])`;
if($fr[0]==$ct){
textScrollList -e -append ($sel[$j]+"."+$attr[$n]) keyWinScroll;
}
}
}
}
}
}
}
CGTalk Moderation
01-15-2006, 07:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.