Detecting Unused nodes in maya (Python)

3,077 views
Skip to first unread message

Mahmoodreza Aarabi

unread,
Jul 21, 2016, 5:03:33 AM7/21/16
to Python Programming for Autodesk Maya

Hey guys

I want to know how can we get a complete list of all unused nodes in maya, nodes that are detect with Optimize Menu, and after detecting it will remove them.
Now i want to get all unused nodes before deleting them.

there is any idea?

this command will delete unused node in maya
hyperShadePanelMenuCommand("hyperShadePanel1", "deleteUnusedNodes");

thanks in advance.

Justin Israel

unread,
Jul 21, 2016, 5:09:23 AM7/21/16
to Python Programming for Autodesk Maya
If you do some detective work you can find the way that command works:

// mel
whatIs hyperShadePanelMenuCommand
// path to a mel script

If you look through that mel script for the usage of "deleteUnusedNodes", it will bring you to a command like:
MLdeleteUnused

// mel
whatIs MLdeleteUnused
// path to another mel script

If you read that script, you will see that the process of finding unused nodes is multiple stages. It looks at shading groups, and connections, and texture nodes, .. 

Justin

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d7e8b811-2bbe-4dd3-971f-74d27fc8136e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mahmoodreza Aarabi

unread,
Jul 21, 2016, 5:22:05 AM7/21/16
to python_in...@googlegroups.com
Thank you Justin
I will explore this.
It takes time but this is a good way to find all commands in lowest level.



For more options, visit https://groups.google.com/d/optout.



--


Bests,
madoodia
Reply all
Reply to author
Forward
0 new messages