material attributes Cmd MEL???

material attributes Cmd MEL???

jayantbhatt07
Advocate Advocate
1,349 Views
5 Replies
Message 1 of 6

material attributes Cmd MEL???

jayantbhatt07
Advocate
Advocate

Hi guys I want to see  the material attributes using #mel command because everytime I have to right click. Can anyone share that command.

0 Likes
Accepted solutions (1)
1,350 Views
5 Replies
Replies (5)
Message 2 of 6

kevin.picott
Alumni
Alumni

I used the "History -> Echo All Commands" feature of the script editor to show what happens when you select "Material Attributes..." and this is what it does.

showSG MyObject;

You might want it to instead to show the currently selected object rather than typing out the name so you can do something like this instead:

string $sl[] = `ls -sl`;
showSG $sl[0];


Kevin "Father of the DG" Picott

Senior Principal Engineer
0 Likes
Message 3 of 6

jayantbhatt07
Advocate
Advocate

Thanks for your reply. If our object has history it will not take you to the material attribute,It will take you to the mesh property and  if I run this command twice then It will open the material attribute. See the screenshot.auto.PNG

0 Likes
Message 4 of 6

kevin.picott
Alumni
Alumni

Interesting, though I can't seem to reproduce this. Would it be possible to show the exact steps you took to get this behaviour?



Kevin "Father of the DG" Picott

Senior Principal Engineer
0 Likes
Message 5 of 6

mspeer
Consultant
Consultant
Accepted solution

Hi!

 

This is not a problem of the script from @kevin.picott  as you get the same behavior in Maya when using the UI.

 

1. New scene.

2. Create polycube

3. Enable Channel Box (not Attribute Editor)

4. Run script or use UI to see the material

=> When the command opens the Attribute Editor, the last viewed Attribute Editor tab will be shown.

 

Select an other tab switch to Channel Box and try again.

 

(Maybe a bug?)

0 Likes
Message 6 of 6

jayantbhatt07
Advocate
Advocate

Thank you I think that is the bug in maya,Solution is that play the script twice it will take you to the material attribute. 

0 Likes