XGen User Tips

The following section contains tips you can use in your XGen workflows.

UV Compensation

Sometimes when you use attribute compensation the faces in the model do not align properly. For example, you can set Tilt V=1 (OffU when used in an expression) and all of your primitives will not point in the same direction. This misalignment is due XGen using intrinsic parameterization of the model, which is derived from the CV winding order.

You can prepare the model so its intrinsic uvs will seem randomly ordered from face to face. You can also compensate for this in most case with a few expressions:

To compensate for misaligned faces:

  1. Enter the following three expressions as global expressions (see Expressions) :
    float upOrDown:   (abs(dot(norm($dPdv),[0,1,0]))>0.6 || abs(dot(norm($dPdu),[0,1,0]))>0.6)? 1 : 0
    float flipY:      (abs(dot(norm($dPdu),[0,1,0]))>0.6)? 90 : 0
    float flipZ:      (abs(dot(norm($dPdu),[0,0,1]))>0.6)? 90 : 0
    
  2. Enter the following in the Twist Attribute field:
    twist: upOrDown() ? flipY() :flipZ()
    

Rotate to Camera

To make primitives only around the normal rotate to face the camera, do the following:

To make primitives rotate to face the camera:

  1. In the Primitives tab, for Card attributes enter:
    length: 0.3
    width:  1.0
    offV:   1.0
    aboutN: $eye=norm($cam-$P);$ang=acosd(dot( $eye,[0,0,1])); $axis=cross([0,0,1],$eye); dot($axis,$N)>0 ? $ang : -$ang
    
  2. In the Spline attributes, enter:
    length:   0.3
    width:    1.0
    bendV[0]: 1.0
    aboutN:   $eye=norm($cam-$P);$ang=acosd(dot( $eye,[0,0,1])); $axis=cross([0,0,1],$eye); dot($axis,$N)>0 ? $ang : -$ang
    

Grooming Grass

When grooming large grassy areas, set Control using to Attribute to control noise at each segment of the primitive. Create an attribute-driven Description without the need to create guides, which also sets the default expressions so that they will not need guides.