A while back I posted a script called djPFXUVs that could be used to quickly re-layout uv's for paintFX leafs to help with the task of building and assigning more interesting textures. Today I thought I'd share an updated version of that script, which as you can see here, even has a UI.
Support for multiple uv sets
A new feature is the option to choose a source and optional target UV set, where the target can be either the source, any other existing set or a new one. This means textures for various material attributes do not need to be sharing the same uv's. You could use one uv set for diffuse color and another for reflectivity, and thus create even more variations amongst leave textures.
New Grass Layout Mode
Grass Layout Mode does not create a tiled layout like the leaf modes. Instead each shell (ie each blade of grass) is scaled to the specified blade width and then randomly positioned along the U-axis in the primary uv quadrant. Here is an example showing before...
The nice thing about the way the original paintFX uvs are layed out is the way the tallest blades use the full V-axis while shorter blades use relatively less. djPFXUVs maintains this height relationship, so after grass layout with blade width = 0.5 we get something like this...
In the above image I just selected a few shells to give a clearer picture of what is happening. With thousands of blades of grass distributed randomly, all you'd see would just be a mass of lines.
Here is a snapshot of the hypershade showing a simple example of how you could take advantage of this new uv layout.
colorMain is a rampTexture set to "U Ramp". Because blade of grass is randomly distributed somewhere in the U-axis, each blade will be textured with a narrow strip of this ramp and the gradation seen in this snapshot will be barely noticeable on a single blade. This ramp therefore can be thought of as a kind of probability distribution. The narrow brown strip to the right of the ramp means approximately 10% of the grass blades will get that brown color, the rest will be various shades of green.
colorBase is a rampTexture set to "V Ramp". I am using this to create a variation along the length of the grass. My grass will be browner near the base.
colorBaseMask is a rampTexture with some noise added.
I combine colorBase over colorMain using colorBaseMask in a layeredTexture (colorLayers) and the result is used as the color in a phong material. This is just a simple example. Nothing fancy. If you wanted photoreal grass you would need to make a bit more effort, but I think this example helps illustrate the idea behind grass layout mode.
Here is a quick render
You can find djPFXUVs on my downloads page. This is a python script. To use it you'll need to put djPFXUVs.py somewhere in you scripts path, then run the following:
import djPFXUVs djPFXUVs.layoutUI()