Delete Unused Nodes via MEL?

Hi all, I was wondering if anyone knows of a solid trick to delete all unused nodes from the Hypeshader? The command printed out in the script editor (with and without ‘echo all commands’ on) doesn’t produce anything useful.

And since the command is in the hypershader menu, I am unable to ctrl drag it to the shelf to investigate the mel there either.

I have a silly workaround, which involves deleting shaders without shader engines attached… and then I delete shaders with shading engines attached but that have NO polys assigned to it.

wtf, isnt there just a command for this???

Thanks for any help you can give folks,
Ken

you can use http://download.autodesk.com/us/maya/2011help/index.html?url=./files/File__Optimize_Scene_Size.htm,topicNumber=d0e99942

Optimize scene size settings for shaders only.

Customizing the Optimize Scene Size Operation

You can edit the MEL script invoked by the Optimize Scene Size command to add your own cleanup operations to the Optimize Scene Size Options. The script is called cleanUpScene.mel, and you can find it in the /scripts/startup directory of Maya.

When you open the script, you will notice that there is a set functions defined near the end of the script to help you add and manage your own scene cleanup operations. These functions are as follows:

Registering a new cleanup operation

cleanUp_AddUserCleanUp()

This function registers a new user-defined cleanup operation. This routine can actually be found in the userCleanUp_AddUserCleanUp.mel script, found in the /scripts/startup directory of Maya.

Configuring a cleanup operation