Paint Vertex Color Tool

Has anyone been able to modify to Paint Vertex Color Tool to be able to paint in a single color channel? Out of the box it only supports RGB, RGBA or A. But we need R, B and G options so I’ve been trying to modify it. Apply Color supports individual channels but not Paint Vertex Color Tool for some reason.

Looking in the console it looks like it calls polyColorPerVertex with separate r g and b flags, so at first though I figured it would be easy. But I have not been able to modify it, so just wondering if anyone else has been able to.

Feels like a basic functionality that should be int eh software out of the box…

Would using “scriptCtx” be enough? You could pre-process the result then pass it to Paint.

I’ve had some limited success with this. You need to figure out what Ctx it calls, and tweak that.

I have my code at home. I’ll post what I came up with then once I’m back if nobody else has

hi Wolfsong

I wonder weather this might help you in any way :rolleyes:
recently I wrote Terrain painting tool with MEL and CGFX for our in-house engine were the artist sculpt a terrain out of a plane in maya and then paint and blend upto 4 textures corresponding to RGBA vertex color channels of the terrain mesh which is then exported to our custom terrain format for the engine.

this was the context i used

 artAttrPaintVertexCtx -e -colorRGBAValue $colorR  $colorG  $colorB  $colorA  $tool ;

regards
Mayur

Hmm… I’ve seen that context but haven’t had any success using it for what I want.

When I paint in the red channel, it still requires a green and blue value. So the only way that would work is if I also can check per vertex what the green and blue value is and enter that… I guess it should be possible, but feels like an ugly work-around.

if it took you more than an afternoon to write you might consider chameleon.
http://www.renderheads.com/portfolio/VertexChameleon/#Features
its awsome. and <100$

failing that you might be able to mod the brush script tool to do it.
the brush script tools are all built on mel scripts.
i was under the impression that the paint vertex tool was made from it
somewhat complicate but powerfull

location…
C:\Program Files\Autodesk\Maya2010\scripts\others\

check out …
artAttrColorPerVertexValues.mel
artAttrColorPerVertexToolScript.mel

documentation…
http://download.autodesk.com/us/maya/2010help/index.html?url=PwMsatPST_Write_MEL_Scripts_for_the_Paint_Scripts_Tool.htm,topicNumber=d0e152915

We’ve looked at Chameleon and it doesn’t provide per channel painting with brush, but has a lot of other fun features.

Will continue looking into this at a later stage. Got some other tools with higher priority to work on now.

I was faced with a similar problem earlier this month as a coworker needed to paint specifically and only on the alpha component of a single RGBA colorSet (without changing the RGB values at those vertices), which it seems you cannot do (with 2009 that is).
I ended up having to create an extra Alpha only colorSet, and wrap a quick script to merge the alpha from the A channel and the RGB from the RGBA channel into the composited final colorSet. Not very production friendly.

I would really be interested to know your finds on this :wink:

I’ve likewise made some mel-based copying and swizzling tools for vertex colors. We use individual color channels all the time as varying shader inputs (texture blends, motion controls for custom animation skinning, etc - as examples, see some of the animating seaweed or pennants in RIFT). After making a couple of different special-case scripts I made two general ones: one to combine color set channels into a new channel, and one to split-apart channels from an existing color set. Both scripts can be triggered by shelf buttons, and recognize standard names like “Green,” “Alpha,” “RGB,” or “RGBA,” along with several common names that we use here specifically to our own materials, like “detail” or “weight” – if the script can figure out what the user wants just from the names of the color sets associated with the model/selection, it just does it. If not, it asks.

At least in 2011 you can paint in alpha only. The context allows input in RGBA, RGB or A, and those options are in the paint tool interface out of the box. Although A is grayed out so you would need to find the parameters that cause that and then painting in alpha only shouldn’t be a problem.

I’ve been playing around with an idea to paint in the alpha and moving it to the desired R, G or B channel, but that as well is not very production friendly so we put the tool on hold for a while in hope that we figure something out for Maya… or we have time to build our own in the entity editor.

Not sure if this is still an issue, but you should try using that 3dpaint context, we just got a tool going here that paints R, G, or B. But you either have R or G, you can’t have both at the same time.

If you do need to have both at the same time, you should change the brush to be additive, as opposed to replace, that way it shouldn’t nuke your other channels away.

Thanks, but the feature it was needed for was actually canceled shortly after my last post.

But we are going to look into VC painting tools again at some point as they are still nice to have in general.

EDIT: for some reason i thought this was 3dsmax, ignore me :stuck_out_tongue:

Personally i just fill the mesh with black vc’s and apply three different vertexpaint modifiers then set them all to additive blend, and paint one color in each modifier.

Well, you can use multiple color sets in Maya. But it’s not that workflow friendly having to switch set back and forth.

[QUOTE=Wolfsong;11811]Well, you can use multiple color sets in Maya. But it’s not that workflow friendly having to switch set back and forth.[/QUOTE]Depends on your desired result. Is it a color, in which case it’s important to see the actual result ASAP, or is it just a way to bundle extra vertex data, in which case you only need to combine channels at the time of final export to the game engine?

I have implemented channel view modes in a per-vert paint tool. Though it IS hacky the solution was to write the painted vert data(RGBA) to a secondary buffer while setting the actual vert color(whats displayed) to whats in the buffer and zeroing out the channels that aren’t set to display.
i.e.
toggle channel display: R=True, G=False, B=False
update vert colors: R=(buffer.R), G=0, B=0
paint vert values
update value in buffer in the channels displayed
update vert color: R=(color from buffer), G=0, B=0
exit tool
update vert color: R=(buffer.R), G=(buffer.G), B=(buffer.B)

other possible important details:
I used the dragger context, python, and much API
brag points+= the “brush” is volume based
brag points-= no undo