Introduction To Xgen

Jesus FC
Lead Groom TD
Alejandro B
CG Lighting Artist

Before We Start.

We will be working using XGen for Maya.

This guide was created using the "Introduction to XGen" from Creature Garage!

It is extremely important to always remember to set the maya project before starting any XGen process, to always set the project before continuing with XGen work, this due to many files being created and set within the maya project. If the project is not set before starting anything, many issues will happen and many aspects won't even work.

Chapter 1- XGen Creation

To begin our journey as groomers, we'll always have to begin at the same spot, creating our XGen. Here we will learn to set the description, collection and to set a basic XGen in a selected mesh.

We are going to see how to create a guide description, for that you can select your model or a face selection where you want to grow your exit, a description or your hair, plus some extra faces, so we can have later on, space to create falloff and gradients

“So always try to select more than the side that you want to grow the hair, or if you want, you can select all the model and try to grow their hair and to create the map. But from some models, it's better to create it that way.”

In this tutorial we will not work with a separate geometry for the scalp. Using one method or the other will depend mostly on the needs of the production and workflow.

Don´t forget to set the project before starting with the XGen process.

Now, let's open the description tab, there you are going to be able to create a new XGen description, import a description, or import a preset. And here we are going to select and create new description.

Once we click on the “X on a box” to open the XGen description menu, we will create a new XGen description.

And now we can start by naming the “Description” and “Collection

The “Description” is a pattern for generating primitives such hari, rocks and more.

The “Collection” is the container of the project.

We are going to be working with “Splines” as this option gives us great options to customize and control the grooming process for hair, fur and more.

We want to have our primitives to be generated randomly across the surface, to have some randomness. 

And to control the “Splines” we will select the “Placing and shaping Guides”. So the groom follows the shapes we set.

And now we can create our XGen Description.

Once created, if we activate the wireframe we can see some “x” on the faces on the faces of the object .

Now we can start creating the guides for our groom, for that we are going to use the “add or move guides” tool in the XGen shelf.

Please remember that more than one guide is needed for the CGen preview to work, so the software has information for the interpolation of the hair, meaning how much hair such be between two guides.

After adding the guides, to preview the XGen on the mesh, we need to click on the preview icon located on the Description Menu of the XGen.

As you can see, the XGen shelf shares some tools with the XGen description menu.

NOTE: you can scale the guides to make the groom longer, relocate and remove as needed.

If you scale the guides and those remain thicc, that is an issue that we will learn how to solve later on.

To finish this chapter, here are some other methods on how to edit the guides.

Move Guides Tool.

Guide Control Points.

Copy/Paste Shape.

We invite you to play a little with those options.

You also have the Sculpt tool available in the XGgen shelf and the “Description Menu”.

And now we have learned the XGen basics, with this information we can create a very simple groom. But we want to learn about the basic attributes that can improve it. Next we will talk about “Width and Tapper

Chapter 2 - Width & Tapper

All hair has physical attributes as in real life. In this chapter we will learn how to set the width and tapper of your groom. Plus we will learn some tips and tricks, such as better viewport displaying and how to avoid certain issues.

We are going to be working for this tutorial and forward with a very basic and simple shape, a sphere.

We have created some simple guides for our XGen and the first thing that we are going to check is the “density” in the description menu, within the Primitives, Generator Attributes..

Density” controls the amount of hair created for the groom, meaning a low amount equals less hair and higher number equals much more hair.

Right now the tips of our groom are completely flat and even, so now we will work with the “taper”. Taper, meaning the reduction of the width at some point of the hair, normally used to make the tips smaller than the rest of the hair strand.

NOTE: Don´t take the taper slider or ramp to the maximum as too much taper will create noise in the tips when rendering.

You can create a taper using the width ramp, there you can select multiple points to change the width or, using the taper sliders.

“Taper Start Slider” controls where the spline width starts to taper. Taper Start ranges from 0.0 (the base) to 1.0 (the tip).

“Tilt N” will change the spread between the hair to the guides. The negative side will push the hair out and the positive side will pull the hair to the guides.

“Around N” rotates the primitive orientation around the surface normal. This vector is not affected by Bump, Tilt U and Tilt V. Very useful for grass ;)

Tips: Curly hair is thicker. Straight hair is thinner. For example, realistic hair is about 0.01, toon hair can be thicker, maybe as much as 0.1.

Next to the sliders there is an “Expression” icon, we can use an expression to set specific values or random ones, as we are going to do next.

We are going to add an expression here, for the first line, we are going to type: rand(0.01,0.02) That will set a random value between 0.01 and 0.02 for the width of our groom, creating different strands with random widths.

For this exercise we recommend 0.0075 to 0.02 as the rand values.

And with that, we can now bring the density up, to fill the area.

But now we’ll notice something is wrong, the hair looks like it’s breaking. And that is due to the CV count, as the spline has only 5 points at the moment. So we will increase, maybe to 80 or even 120.

TIP: to have a better preview we can change some settings on the viewport.

Here we are going to activate the “Smooth Wireframe” and “Multisampling Anti-Aliansing”, then up the sample amount to 16. Finally we can also enable the “Screen Space Ambient Occlusion”

IMPORTANT: Try to get the shape with the least amount of guides, as too many guides can create issues controlling and modifying the groom later on. Maps and modifiers can help us define most of our needs.

We can now say that we know how to work with our hair width and tapper attributes, we also learned how to improve the viewport quality for better previews. We used a simple description for extra detail.

Chapter 3 - Region/Guide/Density

Don´t forget to have already set the project before continuing with the XGen process. Also, for the Artisan Tools to work maps/mask , you need to have the Lambert 1 set as the material.

Note: Artisan Tools is just the paint and sculpting based interface and tools within maya.

Region Mask:

Let’s avoid interpolation (what a big word, we will define it later) and achieve better results, with more definition and easier control, maybe a cut here and there.

At the moment we have a lot of hair but no direction set, and to begin we are going to create a nice and crisp division where the hair starts to interpolate. For that we will create a mask for our groom, so that we can tell XGen where the division will exist. Note that the division is a result of the mask and the guides inside it, meaning the mask will force the groom inside it to follow the guides inside the mask and ignore guides outside the mask.

To avoid this interpolation we are going to open the Description Menu and go to the “Region Control” tab. Once there we are going to click on the paint brush for the “Region Map

That will flood the mesh with one color. What we want now is a different color. (NOTE: only use pure colors such as the ones recommended when clicking on the color tab) and for this example we will use the yellow suggested. We will paint with yellow now one area of the mesh.

Don’t worry if the hair hasn’t splitted yet, we still have to do some more steps.

Now that we have painted the mask, we will save the texture by clicking “save textures” at the end of the tool settings. That will create an .iff file within the source images - 3DPaintTextures and a .ptx file at the XGen folder. So next time you open this project everything loads properly. That is why it is so important to set the project before starting and continuing working.

TIP: you may want to play with the paint, straight lines tend to be too harsh so you could break up the mask edges, just as in the images that we showed before.

You can check the texture as well in the hypershade - textures tab.

Guide Control:

The first step into creating a nice style is to groom correctly. In this tutorial we will learn how to use guides, modify those to give direction and purpose.

Remember we said you can scale guides? Well, let's get back to it. With the scale tool you can make the guide longer or shorter, if the guide grows thicker as well, that is an issue. Closing XGen should update it and fix it. If not, there could be an error within the scene or model, so a new model and scene will be required and import the groom. Lastly, if nothing mentioned fixes the problem, then you will need to rework all from scratch.

Let’s talk about CV count again. The amount of points on the guide not only helps with the curvature of the spline, but also allows you to customize the shape a lot more. You change the amount of CV points at the “Description menu”.

There we can up the amount.

Note that more guides can be useful for complex shapes but can become harder to edit. So try to create a shape with a lower count and then refine with a higher one.

To edit the shape we can use several different methods. Using the Sculpt Guide Tool. (Chap.1)

We can select the guide and right-click to open various options.

The “Guide control points” allow you to move point by point past the guide.

The “Move Guides Tool” is similar to the “guide control”

And “Copy/Paste Guide Shape”, this option allows you to

Note: you can edit with the soft selection, but activate it after selecting the guide as it will not allow you to select it if the soft selection was already active.

When using the Sculpt tool or soft selection, you can increase or decrease the area of effect with the letter “b”, maintaining the key and moving the mouse will change the area.

Regarding the “Tool Settings” of the “Sculpt Guide Tool”:

Here you can lock or unlock the length of the guide, so you can change it with the sculpt tool or control points.

Also you can change the affected guides, to the current description, all descriptions and all collections.

Lastly, if you hit CTRL+Left Click, with the guide selected, you can reposition the guide on the mesh.

Knowing how to control a guide lets us create the main shapes of our groom, using the guide control points, sculpt guide tool or copy/paste shapes. Now that we know how to work with those, we will attack the density problem.

Density Mask:

The amount of hair, where it grows and how to set those parameters are the main dish in this subchapter. We will learn how to change densities via values and via a mask created inside Maya XGen.

Note: it is recommended for the density mask to start painting with absolute color, meaning, no falloff, and then blend the edges. And you can check the “only primitives in view” under “Preview/Output” to save resources if needed.

Take note, now we are going to explore a little of the “Primitives tab” and “Preview/Output” tab, on the XGen description.

At the Primitives Tab:

The “Density” slider will increase or decrease the amount of hair.

At the Preview/Output

The “Percent” will set how much of the actual hair we will see on the viewport. It doesn’t change the density for the render.

To create the mask we are going to the drop down menu at the density options and click on create mask.

Regarding the mask, the files are saved on the xgen folder - collections - “description name” - density mask.

Now we’ll have some options:

As a starting color White defines a 100% density, Black a 0%, Grey 50%.

We are not changing the resolution as it is not needed for the moment.

IMPORTANT: Remember to be on the Lambert1 for the painting to work.

For this example we will start with a black color, to save some time and then we will add a white spot at the top, to simulate the idea of a head. Remember to create gradient/falloff between the black and white color if you want to reduce the hair at the broders.

As you can see, there is no groom at the black areas and hair only grows at the white areas. With a falloff in the gray ones.

TIP: If you started with an undesired color, you can always change quite easily. Go to the “Tool Settings” for the paint brush, navigate to flood, then select the desired color and opacity.

Chapter 4 - Clump Modifiers

Points

Finally! Some order into this mess called “groom”. We will learn how to generate and set up point guides for the clump modifier, so that we can set “clumps” of hair.

To begin our process, let’s go to the XGen Description, Modifiers tab and click on the new modifiers icon.

NOTE: At the “Setup Maps” for the clump, you can actually click on the mesh to add the points. Also, CTRL+Click deletes Clumping points

Once we create the cumpling modifier, if we check the script editor we will see a warning saying that we have no clump guides. So let 's fix that.

Let’s go to the “Setup Maps” at the end of the Cumpling menu that was created with the modifier.

Once we open it, a new menu will pop up.

Within this menu we can set the amount/density of the clump points that are going to be created.

We can also create a mask or use the mask that we made for the density.

With the amount desired we can click on generate for the points to be created on an even distance in the mesh. You can always click on clear to erase and start over. Remember to save once you have completed your task.

We can also create clump points only on the base of the groom guides. Just click on the “Guide” option.

TIP: You can see each clump colored if you check the “Color Preview” at the end of the clump menu.

Regarding the “Maps” we will talk about those later on.

NOTE: At the “Setup Maps” for the clump, you can actually click on the mesh to add the points. Also, CTRL+Click deletes Clumping points

Mask & Clump Effect

Once we have a clump, we can customize via sliders and mask as well. We will learn about the masking options and sliders for clumps.

First, we create the mask map! Start color White, resolution same, name you set it up.

Then as in previous paints, we are taking the paint brush, full black no falloff and later we blend, be careful with the blend and were the lines ends, invading another region can pull hairs from an undesired area.

Now we can see what the mask actually does, white means 100% clump, black 0% clump.

One example as to what we can achieve with clump maps and guides is this:

Chunks of hair where the clumps open up, areas with a closer more defined clump.

If you want to remove the map and go back to the slider, just go to the drop down menu and click the last option.

You can also use the ramp to create some clumps effects. Just remember the side represents the root and the right side the tip of the hair.

Some examples are:

Lastly, let's talk about the “Clump Volumize” and it’s variance, just at the end of the menu.

Checking the box, tries to create some volume along the normal of the guide following its direction, to avoid the hair being too flat. But sometimes the result tends too flatten out the end. Try only using it on small clumps.

Clump variance” lets you vary the clumping effect on a per-primitive effect. This by bringing back the clump effect on the groom, you’ll see it as the groom clump ends at a point established and starts in reverse at that point. For example, “.5” makes the clump start from the middle.

Copy Effect & Cut Effect

The copy effect sets the blending effects between the neighbor Clumps. The cut effect is just as it sounds, it cuts the clump at the designated point in the curve.

The “copy”, in easy words, sets the blending of the clumping effect between neighboring clumps.

The ramp defines the amount to scale the copy at each point along the curve.

"Copy Variance", lets you vary the Copy on a per-primitive basis. Negative Copy Variance values decrease the effect, while positive values increase it.

Examples:

Now the “Cut” effect:

Sets the amount that each primitive in a clump is cut.

The Cut value is based on the length of the primitive. A value of 0.1 cuts the primitives by 10 percent of their length. This value can also be based on an expression (example: rand(0,20) this will make the value random between 0 to 20).

Cut effect with an expression: rand(0,20)

Noise Effect

Lets break up the clump a little, adding some “noise” will let us create more realistic grooms, as nothing is perfect. We can create very interesting flows of hair with these tools.

IMPORTANT: Have the correct/high CV count before working the Noise.

Maya Help Summary:

Noise

Sets the amount of noise effect added to each clump.

Noise Scale

Lets you scale the amount of noise effect applied at each point along the curve.

Noise Frequency

Sets the frequency of noise per clump.

Noise Correlation

Set the percentage of how much each clump's noise should correlate to its neighboring clumps.

No Noise
With Noise

Noise 1; Frequency 1

Noise 5; Frequency 0.2

Increasing the Noise correlation will make the noise of each clump similar. We can create more clumps for the description and create more interesting shapes, but we will check more of that in the last part of the Clump Modifiers

Frame Offset & Flatness Effect

We will not talk about the Frame Offset and Flatness Effect in this tutorial, but to give a little summary here's the maya help explanation about it:

Frame Offset: A per-clump value used to orient the following effects.

Flatness Effect: Set the amount to flatten clumps. Good for wet hair.

Offset & Curl Effect

Having some offset between the hair and guide gives us more options to customize. In this tutorial we will learn about the “offset and curl effects” mainly, we will talk a little about the “frame offset” and “flatness effect”.

The offset effect determines the offsett the clump to the guides based on the direction of the closer guide. The higher the number the bigger the distance.

The curl effect makes the groom/clumps curl around the guides. Just like curly hair for example.

And you can mix those two and create a curly haircut, just like the ones you see in those fancy comercial spots.

Here are some examples on that:

Offset

Curl

Offset & Curl

As in previous effects the scale option on all the effects change the strength of the effect at the specified position of the guide.

We’ve learned about two very important settings that could help us with curly hair for example.

Layering

Adding different modifiers and stacking those together lets us create more complex shapes with a lot of variance. We will experiment with that concept in this part. For example the image below, having multiple systems.

Up to this point we have already created one Clump Modifier and tweaked it. Now we have to create more clumps, edit those and get better, more interesting results.

NOTE: hierarchy, the first clump you create is the first modifier to be read, meaning the hierarchy has a priority, from first to last (from bottom to top).

Let's create a new clump, by clicking on the new modifier icon.

And now let's add another clumping system.

Now that we have the second clump, we can start tweaking, for example, click on the Setup Maps option we learned about before and add some clump guides there, in this case a density of “0.05”.

TIP: you can disable the “Color Preview” from the first Clumping system and activate in the new one, to see the effect the new map just created. Remember to hit save for the file to be written and saved

Right now we should be able to see something like this, our clumps being divided by half.

We now can change the clump effect to a “0.5”.

Noise effect, a value of 5, noise scale towards the first quarter and a frequency of “0.05

Before

After

Here’s an image of the values and modifiers.

Let’s go for the third Clump system now. Same process as before, new modifier - clumping. Again, we have to adjust another “Setup Maps” setting, with “0.5” density, and for the clum effect lets input a value of “0.6”.

Let’s go for the 4th clump, the final one! Again, “Setup maps” with a clumping guide density of 10 and up the primitives density of “80” (More Hair). With this system we just want to add the “middle shapes”. Same principle, edit the values and look for the most natural effect.

The main reason we are increasing the density of the groom now, is to avoid areas that has no hair or seem to be very empty. This happens due to the amount of clumps but it’s ok. Let’s remember that if we are talking about grooms, there are millions of hairs.

If we add another clump system, we might have some issues due to scale, so we are going to define the last parameters withins this last clump. We can tweak the Noise effect, Offset effect, Curl effect. Here’s an example on how those changes can alter the groom:

For the moment we are going to leave the 4th clumping modifiers (curl and offset) at 0. And we are going back to the first clumping system, to change the offset and curl there, this because the first is the one for the primary shapes and now that we have a nice and clear groom, we can alter the shape to make, for example, curly hair.

Finally, a groom worth noticing! Creating a nice groom requires work and we have made an interesting shape with some variations, but what if we would want to modify it for a deeper, more complex shape and look? Well, we move to modifiers.

Chapter 5 - Noise Modifiers

NOTE: For this tutorial we are going to work only with the first 3 clumping systems.

The Basics

Adding some noise to the whole groom, not just the clumps. Creating a little “controlled mess”. Realism is in the details and some noise can help us ground the effect.

First step, add a “Noise System” from the modifiers list. Just as we learned how to add the clump system, is just: New Modifier - Noise.

By default this is the result we get:

Before

After

Lots of break up within the strands

Now let’s define 3 different results: noise brings to the groom, “the stray noise”, “the fray noise”, “the fly aways”.

The stray noise: Hairs that separate a little from the clump.

The fray noise: Creates the damage of the hair

The fly aways: The hair that goes way off the clump

Now the options that we have.

As always, we can edit Noise effects via value, expression or maps. To give a better explanation of the options, let’s use the maya help guide. Never underestimate the amount of information that can be extracted from there.

Frequency:

Sets the frequency of the noise as cycles per-unit length of the primitive.

NOTE: This is why it was very important to have a high CV count when we started the noise back at the “Clump Modifiers - Noise Effect”. Having a low CV count now, won’t allow XGen to give nice crisp results, forcing us to rework most of the groom.

Magnitude:

Sets the maximum distance that CVs can be displaced by the effect to the Noise modifier.

Magnitude Scale:

Lets you scale the magnitude of the Noise effect at each point along the primitive.

NOTE: to make this easier to understand, the hair has a root and a tip. The curve represents that, the left side root, middle is the body of the hair and right the tip.

Correlation:

Sets the amount that the effect of the noise correlates between neighboring primitives.

Preserve Length:

Sets the percent (0 to 100) to blend the modified primitive length to the original groomed primitive length.

Here’s an example of what we can do with this modifier options:

Now that we have learned the basics, we will go deeper into each one and how to customize those with expressions!

Basic Strays

Who let the “Strays Out”. We, we, we did, let the hair be free! We have seen hairs that go in and out of their clumps. As nothing is perfect, we will introduce this imperfection to our groom.

To create stray hairs, we have to work with the description. Just like in the image below:

Here we are defining what percentage the “Stray()”  will affect. in this case 15%

Let’s add this “Stray” expression to the frequency by opening the expression editor for the frequency. Once there we will type: stray () ? 0.20 : 0

Let's define the values:

?” helps maya to understand that the following values will define the expression

0.20 means the frequency of the effect for the hairs under the stray description.

The “:” separates the values

0” is the frequency that will affect non stray hair, in this case no frequency means no effect.

If we change the “Stray()” value, we will change how many hairs will be affected.

Lets now do almost the same for the magnitude. Open up the expression editor for it and type stray() ? 2 : .02

Same idea:

The “2” defines the magnitude amount for stray hairs.

The “0.02” sets the magnitude for the non stray hairs.

Feel free to change the values to achieve the desired look.

Now we learned how to create those loose hair we all see! Feel free to experiment, as different settings can give you very interesting result.

Magnitude Stray Expression

As we did for the mask just before, we are going to create an expression to control the magnitude. This will help us to modify the magnitude of the noise in a more controlled fashion.

Remember, let’s click on the expression icon

For this we are going to input this information:

$min=0.0100;#0.00,0.20

$max=1.5750;#0.20,10.00

$seed=5;#0,10

$mag=rand($min,$max,$seed);

$strayMin=0.4550;#0.0,5.0

$strayMax=2.4000;#1.00,20.00

$strayNoise=rand($strayMin,$strayMax,8);

$noise=strays() ? $strayNoise : $mag; $fitMax=5.6850;#0.00,20.00

fit($noise, 0,1,0,$fitMax)

As we know, min and max values are determined by the amounts set from 0.00 to 0.20.

The seed from the randomization is set the same, between 0 to 10.

Mag is the magnitude, and it is defined by the three past values.

Stray minimum and maximum uses the same language, and are defined by the amounts set.

The noise set for the stray equals two random numbers defined by the $straymin, $straymax and 8.

Noise equals to the stray percentage defined by the $straynoise, $mag and $fitmax

Fit is defined by $noise, 0,1,0,$fitmax

With these sliders we can now work our magnitude way easier, with more options and super precise.

Min and Max, will set how weak and strong the magnitude is.

Seed helps randomize.

Stray Min and Max, change the scale of the stray.

Fit Max scales everything to “fit” inside the value selected. It can help to reduce or exaggerate the effect overall.

With this expression you now can control the amount of strays with a lot more control!

Fly Aways

Let's customize a lot more of our flyaways! Some rebel hairs here and there. Some hairs do not follow the path that the clumps have, those hairs tend to be lonely ones, but help to create a sense of reality.

Note: we will remove the expression from “magnitude expressions” just for the sake of order, but feel free to keep those.

We have two ways to create those.

Another description:

We can create a new description under the same collection, place some guides that kinda follow the direction of the first groom. This is if you want to control the fly aways for animation.

Then we can create an expression for the mask under the generator attributes and input the same expression as before:

$percentStray=5;#0,100

rand() < $percentStray/100.0 ? 1 : 0

Tailor the density, the width, up the CV count to the necessary amount. Play with the taper as well and width. Here’s an example:

We can and should add a Noise Modifier and break the groom to add another level of depth!

With Expressions:

We have our groom, several clumps and a noise modifier. Now we will add a second noise to our list (recommend to change the name to: fly aways). And remember to have a correct amount of CVs for the noise to work fine, you don’t have to go too crazy with the amount, try and error, find the value and then move forward.

For this we will put the same expression for the past mask:

$percentStray=5;#0,100

rand() < $percentStray/100.0 ? 1 : 0

Play with the mask percentage, depending on the scale number may vary, we will use “0.1”.

We will need a very high magnitude and very low frequency. That way very little hair will become fly aways.

We will change with the magnitude scale as well to have more control and preserve length of 60, so we keep a good length.

Here’s an example of the results:

Fly aways is super common in all grooms, in our hair, your pets hair, even in that old knitted sweater our grandma made. Knowing how to make those in CG will your groom that extra detail for a really good groom

Fray Noise (Hair Damage)

We have all suffered from damaged hair. It is a very common noise but quite dangerous! And yes, it mostly happens to the tip of the hair. Here we will learn how to break the flow of some hairs.

To begin with, let’s add another Noise system to our groom. And to the mask, let’s add our favorite expression so far:

$percentStray=5;#0,100

rand() < $percentStray/100.0 ? 1 : 0

(As you can see, this expression is quite useful, keep it at hand.)

This lets us mask our groom very easily.

IMPORTANT: CV count, should be high enough to achieve the desired look. But be careful as too much will be very expensive.

TIPS: Recommended CV count for human long hair, 60. For very long hair, 80.

We want to create a subtle effect that affects mainly the tips. For that we sill use a high frequency with a magnitude base magnitude. Most importantly the magnitude scale set for the tips to be most affected.

And here an image with all the modifiers all active at the same time (Stray mask was reduced to 8.5)

Strays, fly aways and fray altogether

Damaged hair is a problem in real life, so it is good that we now know how to replicate it within XGen, fray noise is what we call this and it makes an amazing tool!

Mask on Clumps

Let’s mask the clumps with the new knowledge that we have… and expressions! We worked with clump before and worked with painted mask, but now we might want to know how to work with maps mixed with expressions

For the moment we will turn off the noise modifiers so we can see the changes that will be done on the clump layer.

We are going to the last clump we made, “Clumping3” and as we did before, for the mask we are going to input the expression:

$percentStray=5;#0,100

rand() < $percentStray/100.0 ? 1 : 0

Now we can mask with a random mask the amount of clumping done to the groom. It’ll helps us to blend the clumps.

We can also input the same expression into the Noise Effect - Noise value. So we can control the amount of hairs that are going to be affected by the actual noise.

And with all the modifiers active:

Having a mask on your clumps allows you to set how strong a the is applied to your hair, if your mask has a noise pattern it can break the clump into smaller clumps for example!

Chapter 6 - Cut Modifier

Snip snip, a cut here and there. Let's help our tips and make nice cuts. Hair tends to have different lengths for many reasons, hair breaking, hairstyles in layers and more. For that the Cut modifier is very useful.

To begin with we will add a cut modifier to our groom! New modifier and select “Cut

We have the mask, where the cut will affect.

The amount, how much will be cutted. Using a random value from a min to a max. The calculation starts from the tip and cuts inwards.

Rebuild Type

Keep Param: affects the curves/strands of hair, cut the tips but it's going to remain the same structure of the actual hair

Reparam: It's going to cut the tips, but it's going to restructure all the other parts of the strands, realigin the CVs.

TIP: if you need to keep the same CV count, use Keep Param. If you don’t mind more CVs, Reparam might work better.

Now, try to guess… YES! Our favorite expression again. Let’s add it to the mask expression editor. So we can adjust it with a little randomization.

$percentStray=5;#0,100

rand() < $percentStray/100.0 ? 1 : 0

Now let's add another Cut, add the same expression to the mask, search for a value that works for us.

Here’s an example of what you can achieve

TIP: If you're working for fur or something like that on a creature, remember that a creature has a maximum length of hair and a minimum length of hair. And the hairs tend to fall completely from the follicles. So be aware of that. So see you on the next one.

The cut modifier is quite self explanatory, it cuts, but as in the example above, we can see how powerful it is. Having different lengths gives us another level of realism to the groom.

Chapter 7 - Expressions

Intro to Expression

Wait, didn't we use expressions before? Well now we’ll learn even more! In this tutorial we will work with some grass.

To begin with we will create a Groomable splines XGen description!

Now, let’s understand a little bit more about the Mask default expression.

The first number states the area of effect, meaning, 0 equals to no groom, 0.5 half density and 1 to full density. This means that we can control all information here with numbers.

If we want to achieve different lengths for random strands, we can achieve that with an expression.

We can open the expression editor for the length attribute on the primitive attributes. Right now we have the following expression:

map (‘$[DESC]/groom/length/’)

This means that XGen will look for a map, within our Maya project in the XGen folder - Collection - Description - Groom - Length

We have set this groom to simulate some grass, here are the values if you want to replicate to follow along.

We know that our grooming length is set to 2. And we have not painted any values, so now we will change the expression for the primitives length to 2

And after changing that, if we change the attribute again to 3, we will see that the actual length of the spline remains the same.

We can change the direction of the splines it follows.

Now, if we change the length of the splines in the grooming tab, it will not change.

We now need to add a random expression. Let’s go back to that menu and enter the expression:

rand(1.5,2.5)

1.5 is the minimum length

2.5 the maximum length.

Now we will be able to see different lengths for the groom.

Right now we understand what an expression is, but we still need to practice it more. This approach is good, but we can make a better and more complex expression in the next tutorial.

Declaring a variable

Now that we know about basic expressions, let's create complex ones and add a slider for easier control. Declaring a variable allows us to formulate expressions and give it a value defined by us. When we mix variables with another expression we can create a custom expression.

Let’s open the expression editor for the length of the primitives. We have a randomized value, but that won't be enough, we need more control.

For that we will add 2 more lines of code above the rand.

To declare a variable we need the “$” dollar sign, to declare names.

To end the variable we type a “;” semicolon

To set a minimum and maximum we type first a “#” hashtag. We separate the values by a “,”.

So we will type on the first line and in the process create our slider:

$min = 1; #0.00,10.00

$max = 1; #0.00,10.00

And now we replace on the rand expression:

rand($min,$max)

We end up with this:

$min = 1; #0.00,10.00

$max = 1; #0.00,10.00

rand($min,$max)

Now we can hit apply and “voilá” two new sliders appear! And with that we can define our values way more easily and correct faster. And we now have a nice randomized length.

Declaring a variable means we can create expressions as shown above, allowing us to, for example, to have a minimum and maximum lenght!

Maps + Expressions

We have now a lot of work done, let’s clean a bit, trim here and there. We will learn how to create an expression that will allow us to select a map, and edit it within the expressions in our expression editor with our expression maps.

TIP: Always keep a good and consistent naming convention!

Let’s remember that we took the length map expression out and created our own, so if we want to paint some length and then create a variable to randomize it, we will need to go back a bit.

Let’s open the “length” expression editor and replace all with this expression (we recommend to copy the expressions you have and save those on a notepad on you computer, so you can just paste those later on):

map (‘$[DESC]/groom/length/’)

Now we will paint some length on our own:

Then we can add the previous expressions with some extra lines of code and have our own expression to modify the painted length with our expressions! This can be quite helpful with scenarios, as it will give you an easy way to change the length and have many choices. You can also see this option as a way to increase the length with a little randomization to make it seem like time passed.

Right now we will reintroduce the randomized minimum and maximum, then we will declare that a randomized length will be established by our minimum and maximum.

Finally we will declare the last operation. The last operation is the last action that XGen will read and will apply that. So we will type:

$lengthmap*$randlength

This will create a map based on the multiplication of the length map and our rand length. We can also, instead of using a multiplication, divide, add, etc.

Rand Percentage

Let’s learn how to add random percentages to our expressions! So we can create complex expressions that only affect a percentage of our groom.

To begin with this part, we will add a randomized expression to the width of our primitives:

$randMin= 0.0050; #0.000,0.0010

$randMax= 0.0050; #0.000,0.0030

rand($randMin,$randMax)

If you feel there is not enough density, pump it up.

Now let’s create another Noise system and for our frequency set it to 0.2, for the magnitude 3 to create broken grass for example and then, open the expression editor for the noise mask, clean it and type:

$percentStray = 10; #0,100

rand() <  $percentStray/100 ? 1 : 0

NOTE: rand(), writing no values for the rand equals to having a 0 to 1 on it.

There we just declared that pur “percent stray” has a value between 0 and 100, for the moment 10.

We defined that “rand()” is lower than our “percent stray” divided by 100 on a 0 to 1 scale.

Therefore, we describe a code that will create a percentage of how many stray strands our mask will allow. (0=0% , 0.5=50% , 1=100%)

After this, we learned on how to declared a random value to our expressions, allowing us to create fast variable grooms!

Rand Percentage on Maps

Lately we’ve been talking about expressions and maps, that won’t change in this part. We will learn how to add a map to a randomized expression!

We are going to clear our mask description from our Noise 2 and just input a “1”, then hit apply. This to start working with a “clean canvas”.

Now, go to the drop down menu of the mask and click on “create new map”, let’s name it “mask_noise_stray”, with resolution of 30 (yes, we need more resolution than usual) and white color to start.

To work easier let’s turn off auto update the XGen preview and clear the XGen preview.

Now we are going to paint on the surface. Let’s remember black has no effect, white full effect and gray values are in-between. We will paint an area of no effect, some area with almost no effect and some blended areas.

IMPORTANT: Don’t forget to click on save texture on the “Tool Settings”.

Now, let’s click on load mask on the Noise modifier - mask options. So we are sure XGen will read it

Now we will add the expression we created in the previous part.

$percentStray = 10; #0,100

rand() <  $percentStray/100 ? 1 : 0

Let’s remember that percentStray is just a value, the actual texture of the stray line is the “rand”.

Having said that we can edit and add some code and declare that:

$randStray = rand() <  $percentStray/100 ? 1 : 0

$a+$randStray

This means that we add our painted map values with the values created on our expression map.

Now we have a slider “Percent Stray” that lets us edit the stray as a percentage.

We can change the operation, instead of an addition to multiply, divide or subtract. It depends on our needs.

Now we learned how to affect the maps with our Rand percentages! This gives us a lot of control and easy access to edit the groom!

Chapter 8 - Animation

Ready, set, GOOOOOOOO! We now have an XGen. We will set our groom for animation. Now, this part is not going to be as detailed as an expert in animation or VFX animator could explain it, but we will learn how to make all this work more than fine.

For this part we will use as an example the groom we create for “Layering Tutorial”.

Guides can be rigged and therefore can be animated, not all hair needs dynamics, sure you can use simulations, but it is not required. Having simulations can take a lot of time to calculate.

We need to understand that the Guides can be Curves!

IMPORTANT: only move forward if you have your final rig, if you reshape or change a guide while rigged, you will have to re-rig that guide. And that CV count matters.

First step, transform our Guides to Curves (Set the Delete option for the guides):

Let’s click on “Create Curves

Then, select the curves and click on “Curves to Guides”. Plot twist

Here we will check the option “Preserve Dynamic Link”, this will link the guides to the new curves, attaching them together. For example, if you edit a point of the curve, the guide will adjust.

To continue, for order we will hide our guides and hide all the curves except one.

First way to control a Curve: Point on Curve

On the “Deform” tab of maya, we will look for the “point on curve” option and click the option box.

Now select the curve and click on a point of the curve.

Adjust the weight to 1 and click apply, this will create a locator that can control 1 point of the curve.

Second way to control a Curve: Cluster

We can create a cluster for the control vertex of the curve, but it will not be as controllable for animation.

Third way to control a Curve: Joints / Rig

We will create a joint chain, be sure to have a root and for the joint to be at the root of the guide. just as in the example.

TIP: Hold the key “C” to snap to the curve.

After creating the chain, we will select the second joint (don’t select the first one) and now select the curve. Now click on bind skin on the “Skin” tab of Maya.

Now for us to control the curve without changing the length of the curve, we will select the second joint and the last joint and click on “Create IK Spline Handle” option box from the “Skeleton” tab of Maya.

For the settings, we will keep “root on curve”, “auto parent curve”, “Auto crate Curve”, “Auto Simplify curve”, "Number of spans 3".

And then, click on the second joint and last joint. That will create our Handle with a brand new curve..

Now we can create a “cluster” for our new curve. Let’s click on the sub select tool and we will see that our new curve has 4 points. Now we select a point and add a cluster, that for all the points.

IMPORTANT: Remember to have a nice and organized naming convention! Name all the clusters in order.

Now we will create a group for each cluster.

Then  we will create a curve for each cluster, we suggest a circle, for easier management, but feel free to use other forms if you know about rigging.

IMPORTANT: for all clusters, click on them and within the attributes enable “Relative”.

We will adjust our curves and then freeze transformation on all of them!

And now, we will start working with “Constrains”, so that the curves can control the clusters.

For our Curves and cluster, select the curve first, then the cluster and select the “Point Constrain” option box, enable “Maintain Offset” and apply, this for all the curves we created for the clusters.

Now, we also need a curve for our root, let’s create one and name it “MainCtrl”. We are going to select that curve, then the ClusterGRP and “Constrain Parent” with maintain “offset on”. Finally we have to the MainCtrl and the first joint and Parent Constrain those.

You should have something like this:

Let’s unhide the guides, and now you can test the rig, the curve should be controlling the guide as well. Meaning you can now move, key and therefore animate manually.

And that is it! We now have created a rig for our groom! We still need to bind the root to the mesh and we will have to paint out some weights. That’s for another moment, now we want to congratulate you for making it this far!

Conclusion

After all those chapters, we can proudly say that you know how to groom on XGen, you learned the basics on how to create a proper XGen, to edit it to your will and modify it to achieve the desired look. With maps, modifiers and descriptions you can make amazing grooms, you just have to practice and have good references!

Learning is not always easy but it will make you a better artist and we are very proud that you choose to learn with us, so for that, thank you! We invite you to keep learning with more tutorials on our site.

To continue your learning process we recommend the following videos:

Setting Maya for XGen:

This tutorial is there for you to customize your Maya settings for an optimal use with XGen! Patreon Exclusive

From 0 to Groom:

Learn to check your model for XGen usage, UV checking and the type of groom desired. Patreon Exclusive

XGen for production:

Here you will learn all about XGen in production cases, to be ready for that big feature groom! Patreon Exclusive

//Section Share-on 2