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.
Tips and notes ¶
-
By default, geometry imported from SOPs (for example, through
SOP Import LOP or
SOP Create LOP) 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.
-
The constraint LOP nodes work by converting USD geometry into SOPs, then applying constraint CHOP nodes to the SOP geometry, then applying changes back onto the USD primitives as overrides. Because of this, the nodes sometimes use SOP terminology (for example, “point group” and “primitive group”), even though they work with USD data. Future versions of Houdini may change this to be clearer.
-
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 ¶
Sampling Behavior
Cooking this node can generate many USD time samples, rather than just a single time sample at the current time. This can be equivalent to having a Cache LOP following this node, but it will evaluate much faster, and does not cache data from any other nodes. This allows animated data to be authored to USD without introducing a node time dependency which would then cause all following nodes to also be time dependent. This can vastly improve playback performance of some LOP Networks.
In all sampling modes, if a parameter on this node does not vary with time, and does not rely on other time sampled data from the stage, only a single default value will be generated in USD for the corresponding attribute. USD time samples are only generated for parameters that may vary over time.
Sample Current Frame
A single time sample will be generated for the current time.
Sample Frame Range If Input Is Not Time Dependent
If the input to this node is time dependent, this node behaves as if it is in Sample Current Frame mode. Otherwise it behaves as if it is in Sample Frame Range mode.
Sample Frame Range
The Start/End/Inc parameter is used to generate multiple times at which this node’s parameters are evaluated, and a USD time sample is created for each attribute at each one of these times.
Start/End/Inc
When the Sampling behavior is Sample Frame Range, this parameter controls the number and spacing of base time samples to be generated by this node. The default values of this parameter are @fstart
, @fend
, and @finc
. These values correspond to the start, end, and step size of the global Houdini animation settings when interacting with Houdini. When using a ROP node to generate a range of frames, these values correspond to the start, end, and increment values specified on the ROP node being executed. This default ensures that a USD file written to disk will contain time samples for exactly the frame range requested by the ROP (regardless of the Houdini animation settings).
Subframe Sampling
For each primary sample generated by this node, these parameters can cause additional samples to be generated around that primary sample time. This is most often used to ensure that accurate data exists at exactly the camera shutter open and close times, as well as at the primary sample time.
Shutter
Controls the method used to specify the shutter open and close times relative to the primary sample times.
Specify Manually
The Shutter Open/Close parameter values provide exact offset values relative to the primary sample time.
Use Camera Prim
The Camera Prim parameter provides the scene graph path of a camera primitive from which the shutter open and close times are extracted to provide the offset values relative to the primary time sample.
Shutter Open/Close
When Shutter is set to Specify Manually, these two offset values are added to the primary sample time to indicate the shutter open and close times. The open time should be less than or equal to zero, and the close time should be greater than or equal to zero.
Camera Prim
When Shutter is set to Use Camera Prim, this is the scene graph path of a camera prim on the input node’s stage. The shutter open and close attribute values are read from this primitive.
Samples
The number of subframe samples to create for each primary sample. These samples are evenly distributed between the shutter open and close times. Note that such an even distribution may or may not create a sample at exactly the primary sample time.
Always Include Frame Sample
When turned on, forces a sample to be created at exactly the primary sample time. If the Samples value, together with the shutter open and close times, already place a sample at the primary sample time, turning on this option has no effect. Otherwise, this option causes an addition sample to be added. This means that the actual number of samples per primary sample may in fact be one more than the number specified in the Samples parameter.
Type
Whether the source (the thing constrained to the surface) is a regular primitive, or a point instance. You cannot use a nested point instance as a source.
Source
When Source Type is Primitive, the scene graph path to the prim to use.
Source Instances
When Source Type is Point Instancer, the point instance to use, using /‹path›[‹instance_index›]
syntax (for example, /geometry/instancer[1]
).
Target Source
Where to get the surface to stick to, either the node’s First Input or the Second Input.
Type
Whether the surface is a regular primitive, or a point instance.
Target
When Target Type is Primitive, the scene graph path to the prim to use.
Target Instance
When Target Type is Point Instancer, the point instance to use, using /‹path›[‹instance_index›]
syntax (for example, /geometry/instancer[1]
).
Hide Target
When Target Source is First Input and Type is Primitive, whether to hide set the path’s visibility to “hidden”.
Import Time
Specify the frame at which the source and/or target geometry are imported into the embedded SOP network 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 surface. When this is on, the object maintains the same relative distance between itself and the surface as it follows the shape of the surface.
Mode
How to map a position parameter onto the surface.
UV (Sticky)
Look up the coordinates in the UV parameter on the surface using the texture coordinates from a primvar (specified in the UV Attribute parameter).
Primitive + UV
Treat the coordinates in the UV parameter as intrinsic local UV coordinates on a specific polygon face, where the first two components are U and V coordinates, and the third component (W) is the index of the polygon face. This does not require an attribute containing texture coordinates.
Point Group
Place the source object at the surface point closest to the centroid of the points in a certain geometry subset.
Primitive Group
Place the source object at the surface point closest to the centroid of the polygon faces in a certain geometry subset.
Closest Distance
Places the source object at the surface point closes to the world space position in the Position parameter.
UV Attribute
When Mode is UV (Sticky), the name of a primvar containing texture coordinates. For geometry imported from SOPs, this may be uv
, however in USD it is usually called st
. The texture coordinates must be non-overlapping.
UV
When Mode is UV (Sticky), the texture coordinate at which to place the source object.
Group
When Mode is Point Group or Primitive Group, the name of a geometry subset to find the closest surface point to.
Position Attribute
When Mode is Closest Distance, the name of a primvar containing point positions. For geometry imported from SOPs, this may be P
, but in USD this is usually the positions
attribute.
Position
When Mode is Closest Distance, the world space position to find the closest surface point to.
Use Snippet
When Mode is UV (Sticky), Primitive + UV, or Closest Distance, you can set the position/UV using a VEX snippet. @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.
Look At Mode
How to orient the source object.
None
Don’t rotate the source object.
U Direction
Use the surface’s U direction as the Look At direction. This works best with NURBS surfaces.
V Direction
Use the surface’s V direction as the Look At direction. This works best with NURBS surfaces.
Direction Attribute from Geometry
Use the value of a vector primvar on the surface as the Look At vector.
From Primitive
Rotate the source object to always point at a certain 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 Geometry, the name of a vector primvar (without the primvar:
prefix) on the surface to use as the look at vector.
Look Up Mode
How to compute the up vector.
Up Vector Attribute from Geometry
Use vector3f
primvar on the surface to specify the up vector at each point.
U Direction
Use the surface’s U direction as the up vector. This works best with NURBS surfaces.
V Direction
Use the surface’s V direction as the up vector. This works best with NURBS surfaces.
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 Attribute from Geometry 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 Up 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 Vector Attribute from Geometry, the name of a vector3f
primvar (minus the primvar:
prefix) on the surface to use as the look up vector.
Roll
Roll angle (in degrees) around the look at direction.
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 ¶
SurfaceConstraint Example for Surface Constraint
This example demonstrates various uses of the Surface Constraint LOP.
See also |