Hi, I'm working on a script where I want to create a Button for "show material attribute" when we right click on the object. For eg.
I have selected one sphere and when I click on that button it will automatically open its material property.
I don't know Material attribute Command.
Thanks in Advance
Replies
this will mean that everything you do will now show up in the script editor. You can then either copy or paste these commands into your script or look them up on the documentation.
https://knowledge.autodesk.com/support/maya-lt/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/MayaLT/files/Running-MEL-See-or-record-the-MEL-commands-associated-with-actions-htm.html
but looks like I have to add something after showSG; so It can show it material properties.
first you should use listRelatives to get the shape node
https://download.autodesk.com/us/maya/2011help/Commands/listRelatives.html
then you should use listConnections to get the shading group and then again to get the material connected to the shading group
https://download.autodesk.com/us/maya/2009help/Commands/listConnections.html
at least that's how I'd do it. If you can already get the shading group you can just use listConnections to get the material.
http://download.autodesk.com/us/maya/2011help/Commands/whatIs.html
in the case of 'showSG' it tells me that it's a script written by the maya developers - so you can look at the code for it yourself.