Follow Path Constraint 跟随路径约束

The Follow Path constraint moves an object along a curve and, if enabled, adjusts its rotation to align with the curve's direction. This constraint is commonly used for:

  • Animating objects along a predefined path, such as vehicles on a track or a camera following a scene.

  • Simulating mechanical systems like conveyor belts or bicycle chains.

  • Controlling motion smoothly without keyframing each movement manually.

Tip

The Follow Path constraint works well in combination with the Locked Track Constraint. For example, when animating a camera along a path, a Locked Track constraint can help control its roll angle by locking it to a secondary target.

跟随路径 vs. 钳制到

While both constraints move objects along a curve, Follow Path is time-based (movement is determined by the current frame), whereas the Clamp To Constraint sets an object's position based on a location property.

物体空间解算

Note, the object's position and rotation are evaluated in World Space:

  • Position Offset: The object's location acts as an offset from its normal position on the curve. For example, an object with a location of (1.0, 1.0, 0.0) will be displaced by one unit along the X and Y axes from its default path position. To place the object exactly on the curve, reset its location with Alt-G.

  • Scale Influence: The object's offset is affected by the curve's scale. If the curve has a scale of (2.0, 1.0, 1.0), the same (1.0, 1.0, 0.0) offset will be doubled along the X-axis but remain unchanged along Y.

  • Rotation Alignment: When Follow Curve is enabled, the object's rotation follows the curve's direction. To ensure correct alignment, the object's axis should be properly oriented before applying the constraint. Resetting rotation with Alt-R may help.

控制沿路径的移动

The object's motion along the curve can be controlled in different ways:

  1. Path Animation Timing: The movement is determined by the curve's Path Animation settings in the object properties. The Frames value defines the duration, and the constraint's Offset shifts the start frame.

  2. Custom Animation via F-Curves: For precise control, an Evaluation Time F-Curve can be added in the Graph Editor to control movement dynamically.

  3. Stationary Object on the Path: If an object should remain fixed at a point on the curve, a flat Speed F-Curve can be used, where the curve's value determines the position along the path.

选项

../../../_images/animation_constraints_relationship_follow-path_panel.png

Follow Path 跟随路径面板。

目标

数据 ID 用于选择约束的目标,该目标 必须 是一个曲线对象,当它没有目标时就没有功能(红色状态)。参见 常见的约束属性 以获得更多信息。

偏移

Offsets the object's position along the curve in frames (relative to the animation settings).

前进轴

物体的轴必须与路径的前进方向对齐(即在所有者位置与曲线相切)。如果激活了 “跟随曲线” 选项,则会受到影响。

向上轴

物体的轴线必须(尽可能的)与世界 Z 轴对齐。事实上,这个选项激活,自身的行为与 锁定追踪约束 共用一些属性,路径为 "轴",世界 Z 轴为 "磁铁"。如果激活了 跟随曲线 选项,则会受到影响。

Fixed Position 固定位置

Locks the object to a specific position along the curve, regardless of animation.

曲线半径

Scales the object based on the curve's radius. See Curve Editing.

跟随曲线

如果这个选项没有被激活,主人的旋转就不会被曲线修改;否则,就会根据前进轴和上升轴受到影响。

Animate Path 动画路径

Automatically creates an F-Curve to control the object's motion along the path.

Keyframing Evaluation Time

To animate movement along a path manually, keyframe the curve's Evaluation Time:

  1. 选择曲线,然后转到曲线属性中的 路径动画 面板。

  2. 在首帧(如第 1 帧)将 估算时刻 设置为起始值(例如 1)。

  3. 右键点击 估算时刻 并选择 插入关键帧

  4. 移动到末帧(如第 100 帧),将 估算时刻 设置为结束值(例如 100)。

  5. 插入另一个关键帧。

这样就可以完全控制物体沿曲线的移动。

影响

控制约束对对象的影响百分比。有关详细信息,请参阅 通用约束属性

例子