Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Display vertex color in the viewport using MEL

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
ivan.antonovRTYBF
424 Views, 2 Replies

Display vertex color in the viewport using MEL

Hi there.

Probably I am looking for something evident for technical artists.
But I can't figure out how to switch vertex color in the viewport using mel.

 

I tried to use the command I found in the ColorSet Editor.
colorSetDisplay 1"-colorShadedDisplay" 1;
But it causes the following assertions.
// Error: line 1: Cannot find procedure "colorSetDisplay". //


Probably the problem is the ColorSet Editor has to be run somehow before calling a command placed in it. But I have no idea how to do that.

 

I would appreciate any help or explanation.
Thank you.

2 REPLIES 2
Message 2 of 3
Kahylan
in reply to: ivan.antonovRTYBF

Hi!

 

vertexColor isn't a viewport attribute, it's a per object attribute that can be turned on by setting the "displayColors" attriubte on a mesh shapenod to 1.

 

This Mel command will turn this command on for all meshes in the scene:

proc switchOnColorDisplay(){
    string $geo[] = `ls -type "mesh"`;
    for ($g in $geo){
        setAttr ($g + ".displayColors") 1;
    }
}
switchOnColorDisplay()

 

This will turn it off for all the meshes in the scene:

proc switchOffColorDisplay(){
    string $geo[] = `ls -type "mesh"`;
    for ($g in $geo){
        setAttr ($g + ".displayColors") 0;
    }
}
switchOffColorDisplay()

 

I hope it helps!

Message 3 of 3
ivan.antonovRTYBF
in reply to: Kahylan

Thank you so much

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report