View Full Version : Selecting all objects in the scene one by one
09-16-2004, 03:09 PM
I have some scenes with a huge ammount of useless nodes which make them very heavy ( up to 15 megabytes of extra space when saved). I can't clean them with 'optimize scene' becuase it will destroy the rig/animation in the scene. However, I can identify the nodes that need to be deleted by the name. For example, all nodes with '*loopSplit*' can be delete.
If I try to select all the nodes named 'loopSplit' at once Maya hangs for a couple of minutes.
How can I select nodes (by name) one by one? That way I can make a script that deletes them in batches. Somehow this is faster than deleting them in huge numbers.
Other suggestions are also welcome ofcourse :)
09-16-2004, 03:50 PM
try delete "*loopSplit", selecion is (can be) a nasty thing.
09-16-2004, 03:57 PM
You could also use the ls command to list everything in the scene. Then iterate through it comparing the name to your names to be deleted. Might end up taking just as long being that your going to add EVERYTHING in the scene to the array.
Hope that helps,
09-16-2004, 07:58 PM
try delete "*loopSplit"
This is probably the best way and but do go out for a coffee after hitting enter.
Just to optimize things a bit you can launch maya with an added -batch flag. You'll just get a MEL command prompt without the added GUI. You can delete use the following command: delete "*loopSplit";file -save;quit;
09-17-2004, 01:31 AM
Have you selecting just what you need from the file and doing 'export selected' to a new maya file. That may or may not work.
09-17-2004, 10:29 AM
I managed to write a script that uses the 'ls' command to select everything. Then I process them backwards (start deleting at the end of the list) which seems to be faster. It deletes 6000 nodes in about 30 seconds, enough to make me happy :bounce:
I've attached the script. Be sure that you know what you are doing before you use it, and it's at your own risk ofcourse!
Thanks for all the help!
01-19-2006, 06:00 AM
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-2013, Jelsoft Enterprises Ltd.