# Align SOP

## Summary

The Align SOP aligns a group of primitives to each other or to an auxiliary input, by translating or rotating each primitive along any pivot point.

Left and Right Primitives - The notions of "left" and "right" which follow depend on context. If an auxiliary input is used, it is always the right primitive and the primary input geometry are all left primitives. If only one input is used, then for each pair being aligned, there is a left and a right primitive. This means that relative to neighbouring primitives, one primitive can be both left and right.

## Parameters

Group - A subset of primitives to align (accepts patterns, as described in Pattern Matching in the Scripting Guide). If blank, it aligns the entire input.

Align - Can optionally align subgroups of n primitives or every nth primitive in a cyclical manner.

Example: Assume there are six primitives numbered for 0 - 5, and N = 2. Then:

a)
b)

N `/inc` - Determines the number of primitives to be either grouped or skipped.

## Parameters - Align Page

Bias `/bias` - Determines which primitive remains unaffected: 0 Left, 1 Right.

Left UV `/leftuv1 /leftuv2` - Pivot Location for each "left" primitive.

Right UV `/rightuv1 /rightuv2` - Pivot location for each "right" primitive.

Right UV End `/rightuvend1 /rightuvend2` - If an auxiliary input is used, this location specifies an end point for the alignment. Left primitives are then distributed uniformly between the Right UV and the Right UV End.

Individual Alignment - Causes each primitive of the input to be aligned. If unchecked, only the first primitive is aligned and all others are placed relative to it, preserving the spatial layout of the left primitives.

Translate - When enabled, translates primitives during alignment by translating the left UV position to the right UV position.

Rotate - When enabled, rotates primitives during alignment by aligning the left UV tangents (at the left UV position) to the right UV tangents (at the right UV position).

## Parameters - Transform Page

Translate / Rotate Order - Sets the overall transform and rotation order for the transformations. The transform and rotation order determines the order in which transformations take place. Depending on the order, you can achieve different results using the exact same values.

Translate / Rotation / Scale / Pivot `/tx-y-z /rx-y-z /sx-y-z` - Allows you to perform a post-alignment transformation. Specify the amount of translation / rotation / scaling about the local `xyz` axes.

## Uses / Works in Relation With

This SOP works with all primitive types.

## Inputs / Geometry Types

Align Source - Any geometry type. Treated as left/right primitive pairs or left primitives if an auxiliary source is used.

Auxiliary Source - Any geometry type consisting of a single primitive treated as the "right" primitive.