This tutorial is a beginners guide to using splines with XGen and MtoA. It shows you how to create the hairs for a jumping spider model using a combination of XGen Splines and Maya's Paint Effects and deformation tools with Arnold's render curves. We will also cover ways to shape and deform the curves to create a more realistic result. Finally, we will shade and light the spider model itself to achieve a believable 'electron microscope' photographic look.
- Start off by loading the spider model. It consists of separated polygon models on which we can apply hair splines.
We will create different descriptions for each body part. Let's start with the legs.
- Select the leg geometry and go to Generate> Create Description. The Create XGen Description window will appear. Choose Groomable splines and click on Create.
- To get the viewport to update the XGen description automatically, enable 'Update Preview Automatically'. That way, any changes that are made to the description will display in realtime in Maya's viewport, and you won't need to continually update the preview (eye icon) after every change.
- To increase the number of hairs, we must increase the Density value. Go to the Grooming tab and under Settings, increase the Density value to 80.
We can use XGen's brush-based grooming tools to style the hairs on the legs.
We will start by bending the curves downwards along the shape of the leg.
- Go to the Grooming tab and select the Bend brush. In the viewport move the mouse over the leg. You should see that the cursor has changed to the brush tool. Click and drag the brush along the leg from the top to the bottom. You should see that the hairs bend as you brush along them.
- The hairs look too uniform. We can break them up by adding some noise to them. Select the Noise brush and repeatedly brush along the hairs.
- Once you have finished grooming the curves, select the leg description and assign a Standard Surface shader to it. We want to use a Standard Surface rather than a Standard Hair because we want a shader that has no specularity to achieve an 'electron microscope' look to the render.
- To add the same leg description to the other legs, select the other leg meshes and go to Descriptions>Bind Patches>Add Selected Faces.
We can duplicate the leg description and use it for the body.
- Select the leg To and go to Descriptions>Duplicate Description...
- Repeat the above step that we used to add the leg geometry to the description. Select the body geometry and go to Descriptions>Bind Patches>Add Selected Faces.
In order to quickly add some variation to the body description, we can add a modifier to it. Go to the Modifiers tab and Add new Modifier.
- Choose the Noise icon and click OK.
- Increase the Frequency and Magnitude to get the desired amount of noise. In this case of Frequency of 4 and a Magnitude of 1.3 was used.
We will use a Paint Effects brush for the head and then convert it to curves. This will give us more choice of tools once we have converted it to curves. This will then give us more control when it comes to 'shaping' the individual hair curves.
- Start off selecting the head geometry and go to Paint Effects>Make Paintable. This will allow us to paint our Paint Effects strokes directly onto the surface of the head.
- Open the Content Browser. Select the Paint Effects tab and select the furBunny.mel brush under the hair folder.
Select the 'furBunny' stroke in the Hair folder
- Paint a stroke across the head as indicated in the image below.
Currently, the stroke is intersecting the eye geometry. We want the stroke to appear to wrap around the eyeball. We can try to achieve this using a Paint Effects Modifier.
- Select the furbunny Paint Effects stroke and select Paint Effects>Create Modifier. Scale the modifier so that it is the same size as the eyeball and position it in the same place. Increase the Force value. The example below uses a value of two.
The 'Paint Effects Modifier' is not giving us quite the effect that we want and looks a little bit too random. We can instead use a sculpt deformer to deform the shape. However, we will have to convert the Paint Effects stroke to curves first and delete the Paint Effects Modifier.
- Select the furbunny stroke and go to Modify>Convert>Paint Effects to Curves.
- Select the curves and go to Create Deformers>Sculpt Deformer (set to 'Project' mode).
- Paint another stroke on the top of the head. Select it and increase the Global Scale to 6 to increase the size of the stroke as per the image below.
Paint Effects stroke - Global Scale 6
To pull the curves back so that they don't overlap the other side (we want to duplicate them across later), we can use a Lattice Deformer.
- Select the end curves and select Create Deformers>Lattice. With the lattice selected, go into component mode (F8), select the end cv's of the lattice and move them back so that they don't overlay the center of the head. Additionally, you can use this lattice to shape the curves even further.
Use a Lattice Deformer to shape the curves
- Once you are happy with how the curves are looking. Group them together and duplicate them across to the other side of the head in the -Z direction.
Duplicate curves to the other side of the head (-Z direction).
At the moment the curves are looking very symmetrical because we have simply duplicated one group of curves to the other side. One way to reduce the symmetry is to add some noise variation to the curves. The sculpt deformer has an option to deform the curves using a texture map.
- Select the right side group of curves and go to Deform> Sculpt.
- Add a noise texture to the Texture attribute of the Sculpt Deformer. To view the texture in the viewport, you must enable hardware texturing - Shading>Hardware Texturing.
- Select the curves and create a set for them Create>Sets>Set
- Open the set in the attribute editor. Under Arnold, select Add. The 'Add Override Attribute' window should appear. Add the following attributes to the set.
- Ai Curve Shader
- Ai Curve Width
- Ai Mode
- Ai Render Curve
Add Override Attributes to Set
- Connect an Ai Hair shader to the Ai Curve Shader attribute.
- Increase the Ai Curve Width to 0.02, depending on how thick you want the curves to look.
- Change the Ai Mode to thick. This will give the curves a round tube profile.
- Select Ai Render Curve for the curves to render.
The spider's body has a 'rim shader' assigned to it which gives the impression that the spider is photographed through an electron microscope. A sampler info node is connected to a ramp texture which is assigned to the Diffuse attribute of a Standard Surface shader.
Node editor showing body shader of Spider
The scene is lit simply with a large Ai Area light set to 'quad' that represents a large photographic soft box. Increase the samples to 3 for final rendering.
Thanks to Pedro Fernando Gómez for his assistance with XGen.