Vertex Color Master

add-ons

(Mr_Flamey) #1

I made a new add-on that is designed to help make working with vertex color data a little bit easier. The core functions of the add-on allow you to invert, fill, clear, remap or posterize individual channels of the vertex color data, as well as copy, swap and blend channel data from source to destination. Just for good measure, I added weights and uv data as a possible source or destination for data to be copied to and from.

Current Version 0.75 - Lots of new features and improvements:

  • Foreground and background colors both shown in UI and swappable in 2.79 (not just 2.79.1)
  • Gradient tool - Paint colored gradients using the foreground and background colors.
  • Random mesh coloring tool - A comprehensive tool for randomising mesh island colors. Useful for id map creation and other things.
  • HSV adjustment tool - Adjust vertex colors using a tool similar to that in 2d graphics apps like Photoshop.
  • Selection masking now uses Blender face and vertex masking.
  • Lots of tweaks and fixes :smiley:

v0.65 - Improved alpha support greatly, bug fixing and UI cleanup
v0.6 - Add ability to transfer data to and from UV layers, Fix version number
v0.05 - Add remap function to remap the range of values (similar to PS levels)
v0.04 - Add isolate channel mode, which allows you to paint a channel in grayscale mode and then apply those changes back to the original channel data.
v0.03 - Add support for operating on selected polygons or vertices.
v0.01 - Initial Release

It supports alpha, but only if you are using one of the latest Blender buildbot builds with the changes to Vertex Painting from GSOC 2017. The new version of Blender (2.79a) should support vertex alpha when it is released soon.

The add-on, along with usage instructions can be found on my GitHub page here: https://github.com/andyp123/blender_vertex_color_master
Or downloaded directly by clicking this link.

Feature suggestions or bugs reports are welcome, please let me know in the comments below, or on the issue tracker on Github.


Remove overlapping Geometry created from converting particle spheres to mesh
(IPv6) #2

Seems like it does not really “mask” channel on draw… i still can replace red color with blue even when masking set to green.
Is it intended to be so?

Channel masking really needed feature :slight_smile:


(Mr_Flamey) #3

IPv6: No, it doesn’t do that because I don’t know how to mask channels when painting… I think it would require modifying c++ code to enable real channel masking. Currently you can either use the active channel buttons with add and subtract blend modes. The UI is designed to make doing this a little easier than using the standard brush tools, as the color is set based on the channels you enable. Also, the active channels do alter the way the fill/clear, invert and posterize functions work.

Alternatively, you can paint in greyscale and then use the Channel transfer features to copy the result to the channel you’d like it to be in instead.

I’m thinking of adding a function to make this greyscale workflow easier. Basically, you’d press a button to isolate a selected channel, which copies that channel’s data to RGB of a new layer and sets the brush up for greyscale painting. Then you then paint it how you want, and press the button again to copy the data right back into the layer you isolated. Even though this wouldn’t be as good as real masking, as it would work on one channel at a time, that’s probably what you’d want most of the time. Does that make sense?


(Mr_Flamey) #4

I added a selection mask to the fill/clear function so you can set the value of each channel masked by a selection now. It works differently depending on whether you have faces or vertex/edges selected. Filling using face masking will leave sharp edges along the selection border, wheras filling with vertex masking will produce smooth edges.

I just put this feature in before I go to bed, but I will expand it to work with the other operations (probably not layer/weight transfer though, since that’s a bit more hassle, and probably less useful)



(Mr_Flamey) #5

I keep forgetting to increment the version number, but I guess this should be 0.03 now. I added support for the selection mask in all operators except channel transfer now, so invert and posterize also work properly when masking is enabled.


(Mr_Flamey) #6

Updated the addon to v0.03:

  • Add Isolate Mode. Isolate the active channel and work in greyscale before applying changes back to the original vertex colour layer, or just discard the changes instead.

(JoseConseco) #7

Great addon. I will be very helpful at work. Is there donate button?


(Mr_Flamey) #8

Not yet, but I can add one. Glad you like the addon :smiley: Let me know if there is anything you think needs fixing or would be a cool feature.

I’m thinking of adding UV layers to the channels you can transfer to vertex colors, and while I am not sure how useful it would be, it might be cool to visualise the UVs, and is probably not that hard to add. I’ll probably add a way to remap the value of channels too (scale 0-1 to 0.25-0.75 or whatever).


(JoseConseco) #9

+1 to remap values (something similar to level adjustment in PS).
gradient operator could be useful - verts at bottom would be black, on top white.
PS. I can give you random color per island function if you want to include it into your addon.


(Mr_Flamey) #10

v0.05 - Added remap function :smiley:

I’ll look into the UV data transfer thing I mentioned, as it could be interesting to transfer vertex colors to UV data, and maybe there are people who would want to use vertex color to store 2 sets of UVs for some weird reason :slight_smile:


(Mr_Flamey) #11

Try the isolate channel feature. It is about the closest I could get without having to understand Blender’s C code and get a patch approved :smiley:

I should make some videos to explain what the addon is actually for, since I feel like there are a few people that would benefit from it but I haven’t explained in a very clear way what it does.


(bkjernisted) #12

When installed should it read 0.0.5 and with an Alpha Support option. In the post above you call it v0.05. Is Andrew Palmer the author? Thanks


(Mr_Flamey) #13

Yes, I am Andrew Palmer. The version number was wrong, sorry. It doesn’t make any difference to the addon, but I’ve updated to 0.6 now :smiley:

To enable alpha support, you need to use one of the latest Blender buildbot builds available from https://builder.blender.org/download/ Once you are running the addon with a special version of Blender, you can enable alpha support from inside the addon settings in user preferences. If you try to enable alpha without a special build of Blender, you will encounter errors. I plan to improve the alpha support and make it automatically detect support is available, as well as make the alpha support and addon in general a bit more robust in future releases.

Let me know if you have any problems.


(Mr_Flamey) #14

v0.6 - Add support for transferring data to and from UV layers.

This was relatively easy to implement and although it doesn’t seem super useful right now, I guess it could be used to store extra UV data or to modify UV data with the vertex paint tools in a weird and technical way. In any case, the addon feels more complete with this feature, since UV layers are just another kind of vertex data.


(Mr_Flamey) #15

That would definitely be useful, and I thought about adding something like that, but I wouldn’t feel satisfied by just implementing single direction gradient and would most likely end up spending way more time on it than I initially expected. I’ll think about it though! For now, you can create a vertex group, then use the gradient tool in weight paint to create whatever gradient you like, then transfer the weight data to a colour channel. It’s a bit of a faff, but only takes a few seconds.

Thanks for the offer of random color per island. What do you use that for? Creating an id map? I’ll have a think about what I want to do to the addon tonight.


(Mr_Flamey) #16

v0.65 - Tested on buildbot blender and found and fixed a lot of problems with alpha support. Alpha support is now auto-detected too. Also cleaned up some parts of the UI.


(adamfarmer) #17

Hello Mr_Flamey,

Thanks for working on this. Does the current FBX exporter export the alpha vertex data?

Thanks,

Adam


(Mr_Flamey) #18

adamfarmer: Sorry, I didn’t see your comment. The exporter in the buildbot version of Blender (https://builder.blender.org/download/ - go here and get a 2.79 release) should be able to export vertex alpha. The release version of 2.79 does not support vertex alpha.


(Meceka) #19

Wow, I just decided to use vertex colors in our game for lot’s of different use cases, and this plugin is just what I was looking for.
When developing a game, saving some data on vertex color saves draw calls and performance by reducing the need for additional textures or materials.
For example, we are adding a detail texture only on faces that have red vertex color. This way we don’t need to make two materials, one with detail texture and one without.
And we are also planning to change only some parts of the meshes color by using another vertex color channel. For example, there will be a color property in our custom shader, and that color property will only affect if faces vertex color is blue.
These are just methods to use vertex color as a mask. It can be used as transparency or fake ambient occlusion or fake shadows too.
We just tried using this plugin one hour ago. If we are happy with it and continue using it frequently I will make a donation.

Do you know if future blender versions will support alpha channels for vertex color? I don’t want to use a beta version so we can wait for some time until a robust version comes out, and then use alpha as one extra channel.


(Mr_Flamey) #20

It seems probable that Blender 2.79a will have vertex alpha support, but I personally am not a Blender developer and am not 100% sure. Current alpha builds have support, and although a,b,c releases are meant to fix bugs, they do sometimes slip in new features and performance improvements.

Anyway, I have just updated the add-on, which now has a few new handy features thanks to JoseConseco, who gave me a bunch of code and also helped to iron out some bugs. Here is the list of new features in 0.75

  • Foreground and background colors both shown in UI and swappable in 2.79 (not just 2.79.1)
  • Gradient tool - Paint colored gradients using the foreground and background colors.
  • Random mesh island coloring - A comprehensive tool for randomising mesh island colors. Useful for id map creation and other things.
  • HSV adjustment tool - Adjust vertex colors using a tool similar to that in 2d graphics apps like Photoshop.
  • Selection masking now uses Blender face and vertex masking.
  • Lots of tweaks and fixes :smiley: