first commit

This commit is contained in:
lethanhsonvsp
2025-11-17 15:16:36 +07:00
commit a40d0921eb
17012 changed files with 2652386 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
# Blend Constraint
![Example](../images/constraint_blend/blend_constraint.gif)
A blend constraint allows the constrained GameObject to blend between GameObject Source A Position
and GameObject Source B Position as well as blending between GameObject Source A Rotation
and GameObject Source B Rotation.
![Component](../images/constraint_blend/blend_constraint_component.png)
|Properties|Description|
|---|---|
|Weight|The overall weight of the constraint. If set to 0, the constraint has no influence on the Constrained Object. When set to 1, it applies full influence with the current settings. Intermediate values are interpolated linearly.|
|Constrained Object|The GameObject affected by the Source Objects.|
|Source A|The first source GameObject that influences the position and rotation of the Constrained Object.|
|Source B|The second source GameObject that influences the position and rotation of the Constrained Object.|
|Maintain Offset|Specifies whether to maintain the initial offset between the Constrained Object and the Source Objects. You can retain any combination of either Position and/or Rotation offset.|
|Blend A | B Position|If enabled, the constrained GameObject's position blends between those of Source A and Source B by the specified amount. As with the constraint's overall weight, intermediate values are interpolated linearly.|
|Blend A | B Rotation|If enabled, the constrained GameObject's rotation blends between those of Source A and Source B by the specified amount. As with the constraint's overall weight, intermediate values are interpolated linearly.|

View File

@@ -0,0 +1,24 @@
# ChainIK Constraint
![Example](../images/constraint_chainik/chainik.gif)
The Chain IK constraint allows you to invert the control of a hierarchy of GameObjects, so the end of the chain can reach a target position.
By defining Root and Tip GameObjects, the Chain IK constraint can find and constrain all GameObjects in between.
This constraint implements the FABRIK solver (Forward and Backward Reaching Inverse Kinematic).
More details can be found [here](http://www.andreasaristidou.com/FABRIK.html).
![Component](../images/constraint_chainik/chainik_component.png)
|Properties|Description|
|---|---|
|Weight|The overall weight of the constraint. If set to 0, the constraint has no influence on the chain elements. When set to 1, it applies full influence with the current settings. Intermediate values are interpolated linearly.|
|Root|The root GameObject of the chain hierarchy.|
|Tip|The final GameObject of the chain hierarchy. It must be a descendant of the Root GameObject.|
|Target|The GameObject that specifies the desired target transform for the chain's Tip.|
|Maintain Target Offset|Specifies whether to maintain the initial offset between the Tip and the Target. You can retain any combination of either Position and/or Rotation offset.|
|Chain Rotation Weight|The weight of rotations applied throughout the chain. If set to 1, the chain will fully reach for its target goal. As with the constraint's overall weight, intermediate values are interpolated linearly.|
|Tip Rotation Weight|The weight of the rotation applied to the Tip. If set to 1, the Tip aligns its rotation to the specified Target. As with the constraint's overall weight, intermediate values are interpolated linearly.|
|Max Iterations|The maximum number of solver iterations to perform to try to make the Tip reach the Target within the specified Tolerance threshold.|
|Tolerance|Distance tolerance between the Target and Tip GameObjects. The solver will finish its computation if the distance is less than this value at any point, even if Max Iterations has not been reached.|

View File

@@ -0,0 +1,17 @@
# Damped Transform
![Example](../images/constraint_damped_transform/damped_transform.gif)
The damped transform constraint allows damping the position and rotation transform values from the source GameObject to the constrained GameObject.
The Maintain Aim option forces the constrained object to always aim at the source object.
![Component](../images/constraint_damped_transform/damped_transform_component.png)
|Properties|Description|
|---|---|
|Weight|The overall weight of the constraint. If set to 0, the constraint has no influence on the Constrained Object. When set to 1, it applies full influence with the current settings. Intermediate values are interpolated linearly.|
|Constrained Object|The GameObject affected by the Source GameObjects.|
|Source|The GameObject that influences the Constrained Object's transform.|
|Damp Position|The weight of positional damping to apply to the Constrained Object. If set to 0, the Constrained Object follows the Source object's position with no damping. If set to 1, the Constrained Object's position is fully damped. As with the constraint's overall weight, intermediate values are interpolated linearly.|
|Damp Rotation|The weight of rotational damping to apply to the Constrained Object. If set to 0, the Constrained Object follows the Source object's rotation with no damping. If set to 1, the Constrained Object's rotation is fully damped. As with the constraint's overall weight, intermediate values are interpolated linearly.|
|Maintain Aim|Specifies whether to maintain the initial rotation offset between the Constrained Object and the Source Object.|

View File

@@ -0,0 +1,41 @@
# Multi-Aim Constraint
![Example](../images/constraint_multi_aim/multi_aim.gif)
A Multi-Aim Constraint rotates a Constrained Object to face a target position specified by one or more Source Objects.
It is typically used to make a GameObject look at objects of interest, such as nearby interactable props or the position of the cursor.
You can specify the aim direction by selecting which Aim Axis to use on the Constrained Object (X, -X, Y, -Y, Z, -Z).
You can optionally specify World Up parameters to help the Constrained Object maintain stable roll orientation.
_Note that this constraint's handling of multiple targets is different from that of most third-party 3D animation software.
Specifically, it calculates an aim rotation to each target, and then produces a weighted sum of all these rotations.
This approach allows you to easily blend in or out the effects of individual targets, since their weight values are not normalized prior to calculation.
To replicate the behavior of other 3D animation software, you should use a single Source Object that is constrained to multiple targets via a [MultiPositionConstraint](./MultiPositionConstraint.md)._
![Component](../images/constraint_multi_aim/multi_aim_component.png)
|Properties|Description|
|---|---|
|Weight|The overall weight of the constraint. If set to 0, the constraint has no influence on the Constrained Object. When set to 1, it applies full influence with the current settings. Intermediate values are interpolated linearly.|
|Constrained Object|The GameObject affected by the Source Objects.|
|Aim Axis|Specifies the local aim axis of the Constrained Object to use in order to orient its forward direction to the Source Objects.|
|Up Axis|Specifies the local up axis of the Constrained Object to use in order to orient its upward direction (i.e., roll orientation).|
|World Up Type|Specifies which mode to use to stabilize the upward direction (i.e., roll orientation) of the Constrained Object.|
|World Up Axis|A vector in some reference frame that is used to stabilize the upward direction of the Constrained Object. This value is used when World Up Type is either Vector or Object Rotation Up. In those cases, the reference frame is either the world or another object, respectively.
|World Up Object|A GameObject used as a reference frame for World Up Axis. This value is used when World Up Type is either Object Up or Object Rotation Up.|
|Source Objects|The list of GameObjects that influence the Constrained Object's orientation, and the amount of weight they contribute to the final pose. The constraint calculates rotation toward each target to produce a weighted sum. _The order of Source Objects does not affect the result._|
|Maintain Rotation Offset|Specifies whether to maintain the initial rotation offset between the Constrained Object and the Source Objects.|
|Offset|Specifies an additional local space rotation offset to apply to the Constrained Object, after it has been rotated toward its target.|
|Constrained Axes|Specifies the axes to which the constraint can apply rotation.|
|Min Limit|Clamps the minimum rotation that may be applied about any of the constrained axes of rotation.|
|Max Limit|Clamps the maximum rotation that may be applied about any of the constrained axes of rotation.|
World Up Type can have the following values:
|Values|Description|
|---|---|
|None|Do not use a World Up vector.|
|Scene Up|The Y-axis of the scene.|
|Object Up|The Y-axis of the GameObject specified by World Up Object.|
|Object Up Rotation|The axis specified by World Up Vector, in the space of the GameObject specified by World Up Object.|
|Vector|The World Up Vector.|

View File

@@ -0,0 +1,23 @@
# Multi-Parent Constraint
![Example](../images/constraint_multi_parent/multi_parent.gif)
A Multi-Parent Constraint moves and rotates a GameObject as if it is the child of another GameObject in the Hierarchy window.
Because using this constraint does not actually change the GameObject hierarchy, it offers some advantages:
- It does not affect scale.
- The Constrained Object can have multiple Source Objects (i.e., parents).
- The Constrained Object does not have to be a child of any of the Source Objects.
- You can vary the effect of the constraint by specifying an overall weight, as well as individual weights for each of the Source Objects.
- You can still apply normal animation to the Constrained Object's children as normal.
![Component](../images/constraint_multi_parent/multi_parent_component.png)
|Properties|Description|
|---|---|
|Weight|The overall weight of the constraint. If set to 0, the constraint has no influence on the Constrained Object. When set to 1, it applies full influence with the current settings. Intermediate values are interpolated linearly.|
|Constrained Object|The GameObject affected by the Source Objects.|
|Source Objects|The list of GameObjects that influence the Constrained Object's position and orientation, and the amount of weight they contribute to the final pose. The constraint applies linearly interpolated, weighted translation and rotation toward each target. _The order of Source Objects does not affect the result._|
|Maintain Offset|Specifies whether to maintain the initial offset between the Constrained Object and the Source Objects. You can retain any combination of either Position and/or Rotation offset.|
|Constrained Position Axes|Specifies the axes to which the constraint can apply translation.|
|Constrained Rotation Axes|Specifies the axes to which the constraint can apply rotation.|

View File

@@ -0,0 +1,16 @@
# Multi-Position Constraint
![Example](../images/constraint_multi_position/multi_position.gif)
A Multi-Position Constraint component moves a Constrained Object to follow its Source Objects.
![Component](../images/constraint_multi_position/multi_position_component.png)
|Properties|Description|
|---|---|
|Weight|The overall weight of the constraint. If set to 0, the constraint has no influence on the Constrained Object. When set to 1, it applies full influence with the current settings. Intermediate values are interpolated linearly.|
|Constrained Object|The GameObject affected by the Source Objects.|
|Constrained Axes|Specifies the axes to which the constraint can apply translation.|
|Source Objects|The list of GameObjects that influence the Constrained Object's position, and the amount of weight they contribute to the final pose. The constraint calculates translation toward each target to produce a weighted sum. _The order of Source Objects does not affect the result._|
|Maintain Position Offset|Specifies whether to maintain the initial position offset between the Constrained Object and the Source Objects.|
|Offset|Specifies an additional local space translation offset to apply to the Constrained Object, after it has been moved toward its target.|

View File

@@ -0,0 +1,16 @@
# Multi-Referential Constraint
![Example](../images/constraint_multi_referential/multi_ref.gif)
The Multi-Referential Constraint allows you to configure a group of GameObjects to have dynamic parent-child-like behavior.
The movement of the Driving object influences all of the other Reference Objects as if it were their parent.
Use this constraint to simulate dynamic parenting changes without modifying your hierarchy.
For example, you could configure a character's hand to sometimes control the motion of a prop, and the prop to sometimes control the motion of the hand.
![Component](../images/constraint_multi_referential/multi_ref_component.png)
|Properties|Description|
|---|---|
|Weight|The overall weight of the constraint. If set to 0, the constraint has no influence on the Reference Objects. When set to 1, it applies full influence with the current settings. Intermediate values are interpolated linearly.|
|Driving|An object from the list of Referenced Objects, whose motion drives that of all other Referenced Objects.|
|Referenced Objects|A list of GameObjects to be driven by the specified Driving object.|

View File

@@ -0,0 +1,17 @@
# Multi-Rotation Constraint
![Example](../images/constraint_multi_rotation/multi_rotation.gif)
A Multi-Rotation Constraint component rotates a Constrained Object to match the rotation of its Source Objects.
The constraint applies rotation about the shortest path to each target.
![Example](../images/constraint_multi_rotation/multi_rotation_component.png)
|Properties|Description|
|---|---|
|Weight|The overall weight of the constraint. If set to 0, the constraint has no influence on the Constrained Object. When set to 1, it applies full influence with the current settings. Intermediate values are interpolated linearly.|
|Constrained Object|The GameObject affected by the Source Objects.|
|Constrained Axes|Specifies the axes to which the constraint can apply rotation.|
|Source Objects|The list of GameObjects that influence the Constrained Object's orientation, and the amount of weight they contribute to the final pose. The constraint calculates rotation toward each target to produce a weighted sum. _The order of Source Objects does not affect the result._|
|Maintain Rotation Offset|Specifies whether to maintain the initial rotation offset between the Constrained Object and the Source Objects.|
|Offset|Specifies an additional local space rotation offset to apply to the Constrained Object, after it has been rotated toward its target.|

View File

@@ -0,0 +1,28 @@
# Override Transform
![Example](../images/constraint_override_transform/override_transform.gif)
An Override Transform constraint allows you to override the Constrained Object's transform with a value coming from an Override Source, or from manually specified values.
![Example](../images/constraint_override_transform/override_transform_component.png)
|Properties|Description|
|---|---|
|Weight|The overall weight of the constraint. If set to 0, the constraint has no influence on the Constrained Object. When set to 1, it applies full influence with the current settings. Intermediate values are interpolated linearly.|
|Constrained Object|The GameObject affected by the Override source.|
|Override Source|The GameObject that influences the Constrained Object's transform. If specified, Override Position and Override Rotation fields are ignored.|
|Override Position|A specific position value to apply to the Constrained Object. This value is ignored if an Override Source is specified.|
|Override Rotation|A specific rotation value to apply to the Constrained Object. This value is ignored if an Override Source is specified.|
|Space|Specifies how the Override Source's local transform values (or manual Override Position and Rotation) should be applied to Constrained Object.|
|Position Weight|The weight of the position influence. A weight of 1 causes the constrained GameObject to be fully influenced by its Override source.|
|Rotation Weight|The weight of the rotation influence. A weight of 1 causes the constrained GameObject to be fully influenced by its Override source.|
Space can have the following values:
|Values|Description|
|---|---|
|World|The displacement of the Override Source's local transform values _replace_ the Constrained Object's global transform values.|
|Local|The displacement of the Override Source's local transform values _replace_ the Constrained Object's local transform values.|
|Pivot|The displacement of the Override Source's local transform values are _added to_ The Constrained Object's local transform values.|
_In each case, the initial position of the Override Source GameObject at the time the constraint is created, is treated as the point of reference for calculating its displacement._

View File

@@ -0,0 +1,17 @@
# TwistChain Constraint
![Example](../images/constraint_twistchain/twistchain.gif)
The Twist Chain constraint allows you to control world rotations on both ends of a GameObject chain hierarchy.
The constraint calculates interpolated rotations for intermediate transforms between a Root and Tip to create a smooth animated hierarchy.
![Component](../images/constraint_twistchain/twistchain_component.png)
|Properties|Description|
|---|---|
|Weight|The overall weight of the constraint. If set to 0, the constraint has no influence on the chain elements. When set to 1, it applies full influence with the current settings. Intermediate values are interpolated linearly.|
|Root|The root GameObject of the chain hierarchy.|
|Tip|The final GameObject of the chain hierarchy. It must be a descendant of the Root GameObject.|
|Root Target|The GameObject that specifies the desired target rotation for the chain's Root.|
|Tip Target|The GameObject that specifies the desired target rotation for the chain's Tip.|
|Curve|A curve with a normalized domain and range, specifying how the twist rotation should be distributed down the length of the chain.|

View File

@@ -0,0 +1,15 @@
# Twist Correction
![Example](../images/constraint_twist_correction/twist_correction.gif)
The Twist Correction constraint redistributes a percentage of a Source's rotation to one or more Twist Nodes in order to correct the twist deformation of a body part that rotates on multiple axes.
Common use cases are shoulders, wrists, and upper legs.
![Component](../images/constraint_twist_correction/twist_correction_component.png)
|Properties|Description|
|---|---|
|Weight|The overall weight of the constraint. If set to 0, the constraint has no influence on the Twist Nodes. When set to 1, it applies full influence with the current settings. Intermediate values are interpolated linearly.|
|Source|The GameObject that influences the Twist Nodes to rotate around a specific Twist Axis.|
|Twist Axis|Specifies the axis on the Source object from which the rotation is extracted and then redistributed to the Twist Nodes.|
|Twist Nodes|The list of GameObjects that will be influenced by the Source GameObject, and the cumulative percentage of the Source's twist rotation they should inherit. They are generally expected to all be leaf nodes in the hierarchy (i.e., they have a common parent and no children), and to have their twist axes oriented the same as the Source object in their initial pose.|

View File

@@ -0,0 +1,31 @@
# Two Bone IK
![Example](../images/constraint_two_bone_ik/two_bone_ik.gif)
The Two Bone IK constraint allows you to invert the control of a simple hierarchy of two GameObjects, so the Tip of a limb can reach a Target position.
An additional Hint GameObject allows you to specify the direction the limb should be oriented when it bends.
![Component](../images/constraint_two_bone_ik/two_bone_ik_component.png)
|Properties|Description|
|---|---|
|Weight|The overall weight of the constraint. If set to 0, the constraint has no influence on the limb elements. When set to 1, it applies full influence with the current settings. Intermediate values are interpolated linearly.|
|Root|The root GameObject of the limb hierarchy.|
|Mid|The middle GameObject of the limb hierarchy. It must be a child of the Root GameObject.|
|Tip|The final GameObject of the limb hierarchy. It must be a child of the Mid GameObject.|
|Target|Source GameObject that specifies the desired position of the Tip.|
|Hint|Optional Source GameObject, whose position is used to specify the direction the limb should be oriented when it bends.|
|Maintain Target Offset|Specifies whether to maintain the initial offset between the Tip and the Target. You can retain any combination of either Position and/or Rotation offset.|
|Target Position Weight|The weight to apply for calculating the desired position when reaching for the Target. If set to 1, the Root and Mid objects will extend as far as necessary to try to reach the specified Target position. As with the constraint's overall weight, intermediate values are interpolated linearly.|
|Target Rotation Weight|The weight of the rotation applied to the Tip. If set to 1, the Tip aligns it rotation to the specified Target. As with the constraint's overall weight, intermediate values are interpolated linearly.|
|Hint Weight|The amount of influence the Hint has on the configuration of the hierarchy. When set to 1, the Hint fully influences the hierarchy configuration. If no Hint GameObject is specified, the hint weight is ignored.|
## Auto Setup from Tip Transform
The component's context menu available from its header in the Inspector provides a "Auto Setup from Tip Transform" option.
This menu command will automatically create and assign both a Target and Hint GameObject in your Rig's hierarchy.
To use this option:
1. Add a Two Bone IK Constraint to a GameObject in your Rig hierarchy.
2. Assign the Tip GameObject.
3. Select "Auto Setup from Tip Transform" from the component's context menu.