Message 1 of 3

Not applicable
04-24-2012
09:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I´m trying to make a script for rename imported objects automatically following certain rules, and I have problems with that using a stereo camera rig I made...
The code:
I import the file with the "-returnNewNodes" flag for have the list of the imported nodes, then I use this result to, select the imported nodes, and rename it.
It works for the first 2 items in the hierarchy of the rig but for the others don´t change anything and show an the error: // Error: No object matches name //
Do somebody know why?
I attached the camera rig file to check if the problem is in this file
http://dl.dropbox.com/u/42611656/rig_camara.ma
The code:
$imp = `file -import -type "mayaAscii" -ra true -rpr "cam" -options "v=0" -returnNewNodes -pr -loadReferenceDepth "all" "/192.168.41.11/proyectos/SECRETO MEDALLON/Useless/assets/tools/camara/rig_camara.ma"`;
select $imp;
for( $node in `ls -sl` )
{
rename $node ( `substitute "cam__scn" $node "cam_001"` );
}
I import the file with the "-returnNewNodes" flag for have the list of the imported nodes, then I use this result to, select the imported nodes, and rename it.
It works for the first 2 items in the hierarchy of the rig but for the others don´t change anything and show an the error: // Error: No object matches name //
Do somebody know why?
I attached the camera rig file to check if the problem is in this file
http://dl.dropbox.com/u/42611656/rig_camara.ma
Solved! Go to Solution.