On this page | |
Since | 18.0 |
Solaris constraints ¶
Currently, USD does not support constraints. Parametric constraints are probably antithetical to USD’s design mission of being descriptive, immutable, and idempotent.
As a layer above USD, that generates USD, the LOP network can compute dynamic constraints, and “bake” the results as time samples when it writes the USD to disk.
Notes and tips ¶
-
You cannot use a nested point instance as a source (the thing constrained to the path).
-
You can use a nested point instance as a path.
-
By default, geometry imported from SOPs (for example, through SOP Import or SOP Create) has point attributes imported into USD. So you can set up attributes (for example, an up vector attribute) in SOPs and use them in this node.
-
In VEX snippets, you can use
@
variable names containing colons (:
). This makes it easier to automatically bind certain USD attribute names (for examplei@primvars:foo
). (These names are not normally legal in names in VEX source code. The node automatically encodes these kinds of names when used in a snippet.)
Parameters ¶
Source ¶
Type
Whether the source (the thing constrained to follow a path) is a regular primitive, or a point instance. You cannot use a nested point instance as a source.
Source Instances
When Source ▸ Type is “Point Intance”, the point instance to use, using /‹path›[‹instance_index›]
syntax (for example, /geometry/instancer[1]
).
Path ¶
Target Source
Where to get the path curve to follow, either the first input or the second input.
Type
Whether the path is a regular primitive, or a point instance. (You can use a nested point instance as a target.)
Constraint Options ¶
Import Time
Specify the frame at which the source and/or target geometry are imported into the embedded sopnet to build the constraints. The default “$FF” expression forces the constraint LOP to be time dependent, which is needed when operating on a non time-dependent network that has time samples driving the source or target primitives. However, for better performance with a non time-dependent network with no time samples, it is recommended to use a static value instead.
Maintain Local Offset
When this is off (the default), the source object snaps onto the path it follows. When this is on, the object maintains the same relative distance between itself and the path as it follows the shape of the path.
Parametrization
How to map the Position value onto the path.
Normalized Distance
Make 0
the start of the curve and 1
the end of the curve, with fractional values in between are divided by the arc length of the curve.
Normalized Knots
Make 0
the start of the curve and 1
the end of curve, where fractional values in between are divided by the distances between knots/edit points.
For example, if a polyline has 5 points (two ends and three interior corners), the distance at each successive point would be 0.0
, 0.25
, 0.5
, 0.75
, and 1.0
.
Distance from Start
Use the Position as an arc-length distance (in world units) from the start of the curve.
Distance from End
Use the Position as an arc-length distance (in world units) from the end of the curve.
Distance Point Attribute
Get the “distance” value at each point in the curve from a primvar. The primvar must be a vector3
, but only the first (X) component is used. The X values should monotonically increase along the curve or the result will be very weird.
Distance Attribute
When Parameterization is “Distance point attribute”, the name of the primvar containing the distance value (not including the primvar:
prefix). The primvar must be a vector3
, but only the first (X) component is used.
Position
Where to position the source object along the path. To animate the source object along the path, this should be an expression based on the current frame ($F
) or time ($T
).
For example, if Parameterizaiton is “Normalized distance”, you might set this to $F/100
.
Use Snippet
Set the position using a VEX snippet. The snippet should write the position value to the pos
variable. You can use the variables typically available to an Attribute Wrangle SOP. @ptnum
is the index of the current prim being constrained. You can use npoints(0)
to get the total number of prims being constrained. You can use @Frame
and @Time
to make the snippet time-dependent.
The initial value of pos
(at the start of the snippet) is the evaluated value of the Position parameter. So you can use an expression in that parameter to compute a “base” value, and modify it using the snippet.
Orientation ¶
Look At Mode
How to compute the direction the source object points along.
None
Don’t rotate the source object to look at anything.
Along Path
Point along the path curve’s tangent direction. This is usually what you want, so it looks like the object is following the curve.
Direction Attribute from Path
Use a vector3f
primvar on the curve to specify the look at vector at each point.
From Primitive: Rotate the source prim to point at a specific prim.
Look At Source
When Look at mode is “from primitive”, where to get the primitive to look at (the first or second input).
Look At Xform
When Look at mode is “from primitive”, the scene graph path of the prim to look at. (This does not support looking at a point instance.)
Direction Attribute
When Look at mode is “Direction attribute from path”, the name of a vector3f
primvar (minus the primvar:
prefix) to use as the look at direction.
Look Up Mode
How to compute the up vector.
Up Vector Attribute from Path
Use vector3f
primvar on the curve to specify the up vector at each point.
Along Path
Use the path tangent as the Up vector.
X Axis
Use the world +X direction as the up vector.
Y Axis
Use the world +Y direction as the up vector.
Z Axis
Use the world +Z direction as the up vector.
From Primitive
Rotate the source prim so its up vector points at a specific prim as it moves along the curve.
Custom
Use the vector in the Up vector parameter.
Up Vector Source
When Look up mode is “from primitive”, where to get the primitive to point the up vector at (the first or second input).
Up Vector Xform
When Look at mode is “from primitive”, the scene graph path of the prim to point the up vector at. (This does not support point instances.)
Look At Axis
Which axis on the source object to match to the look at vector. You can use this to compensate for the orientation the source object was created in. This can’t be the same as the Look up axis.
Look Up Axis
Which axis on the source object to match to the up vector. You can use this to compensate for the orientation the source object was created in. This can’t be the same as the Look at axis.
Up Attribute
When Look up mode is “Up attribute from path”, the name of a vector3f
primvar (minus the primvar:
prefix) to use as the look up vector.
Roll
Roll angle (in degrees) around the look at direction. You can use this, for example, to animate “banking” as the source object goes around curves.
Use Snippet
Set the roll using a VEX snippet. The snippet should write the roll degrees to the roll
variable. You can use the variables typically available to an Attribute Wrangle SOP. @ptnum
is the index of the current prim being constrained. You can use npoints(0)
to get the total number of prims being constrained. You can use @Frame
and @Time
to make the snippet time-dependent.
The initial value of roll
(at the start of the snippet) is the evaluated value of the Roll parameter. So you can use an expression in that parameter to compute a “base” value, and modify it using the snippet.
Examples ¶
FollowPathConstraint Example for Follow Path Constraint
This example contains a number of various uses for the Follow Path Constraint LOP.
See also |