I do a lot of vertex painting in my workflow, and I’m trying to set up hotkeys for common actions. I’ve got pretty much everything set except one thing, which I can’t seem to figure out: switching between painting vertex | vertex face | face. There are three radio buttons in the Paint Vertex Colors tool settings to choose these options. Looking in the Script Editor (with Echo All Commands checked), when I choose any of the three options I see this:
artAttrPaintVertexOrFace artAttrPaintVertexCtx;
artPaintVertexInitPaintableAttr;
// Result: 0 //
artAttrPaintVertexOrFace artAttrPaintVertexCtx;
artPaintVertexInitPaintableAttr;
// Result: 0 //
I get the same thing when I choose vertex, vertex face, or face. I’d like to be able to save out a line of MEL to a hotkey for switching between these paint options, but I can’t quite figure it out. Not sure if this is helpful, but:
Replies
Really quick investigation got me this commands to set the paint mode to vertex, vertex face and face respectively:
artAttrPaintVertexCtx -q -paintComponent `currentCtx`;
Note that radiobuttons in Tool Settings will not update automatically after executing either one of this — probably because the command itself isn't complete. You may want to try and complement it with missing parts if you will figure them out. However, the mode will change and radiobuttons will update their status after the first stroke made in the new mode.Hope that helps.
Yep, a quick test shows that it works like a charm. This is going to make my work much easier. Thanks so much