unreal.RigUnit_SpringInterpV2

class unreal.RigUnit_SpringInterpV2(target: float = 0.0, strength: float = 0.0, critical_damping: float = 0.0, force: float = 0.0, use_current_input: bool = False, current: float = 0.0, target_velocity_amount: float = 0.0, initialize_from_target: bool = False, result: float = 0.0, velocity: float = 0.0)

Bases: RigVMFunction_SimBase

Uses a simple spring model to interpolate a float from Current to Target.

C++ Source:

  • Plugin: ControlRig

  • Module: ControlRig

  • File: RigUnit_SpringInterp.h

Editor Properties: (see get_editor_property/set_editor_property)

  • critical_damping (float): [Read-Write] The amount of damping in the spring. Set it smaller than 1 to make the spring oscillate before stabilizing on the target. Set it equal to 1 to reach the target without overshooting. Set it higher than one to make the spring take longer to reach the target.

  • current (float): [Read-Write] Current position of the spring.

  • force (float): [Read-Write] Extra force to apply (since the mass is 1, this is also the acceleration).

  • initialize_from_target (bool): [Read-Only] If true, then the initial value will be taken from the target value, and not from the current value.

  • result (float): [Read-Write] New position of the spring after delta time.

  • strength (float): [Read-Write] The spring strength determines how hard it will pull towards the target. The value is the frequency at which it will oscillate when there is no damping.

  • target (float): [Read-Write] Rest/target position of the spring.

  • target_velocity_amount (float): [Read-Write] The amount that the velocity should be passed through to the spring. A value of 1 will result in more responsive output, but if the input is noisy or has step changes, these discontinuities will be passed through to the output much more than if a smaller value such as 0 is used.

  • use_current_input (bool): [Read-Only] If true, then the Current input will be used to initialize the state, and is required to be a variable that holds the current state. If false then the Target value will be used to initialize the state and the Current input will be ignored/unnecessary as a state will be maintained by this node.

  • velocity (float): [Read-Write] Velocity

property critical_damping: float

[Read-Write] The amount of damping in the spring. Set it smaller than 1 to make the spring oscillate before stabilizing on the target. Set it equal to 1 to reach the target without overshooting. Set it higher than one to make the spring take longer to reach the target.

Type:

(float)

property current: float

[Read-Write] Current position of the spring.

Type:

(float)

property force: float

[Read-Write] Extra force to apply (since the mass is 1, this is also the acceleration).

Type:

(float)

property initialize_from_target: bool

[Read-Only] If true, then the initial value will be taken from the target value, and not from the current value.

Type:

(bool)

property result: float

[Read-Only] New position of the spring after delta time.

Type:

(float)

property strength: float

[Read-Write] The spring strength determines how hard it will pull towards the target. The value is the frequency at which it will oscillate when there is no damping.

Type:

(float)

property target: float

[Read-Write] Rest/target position of the spring.

Type:

(float)

property target_velocity_amount: float

[Read-Write] The amount that the velocity should be passed through to the spring. A value of 1 will result in more responsive output, but if the input is noisy or has step changes, these discontinuities will be passed through to the output much more than if a smaller value such as 0 is used.

Type:

(float)

property use_current_input: bool

[Read-Only] If true, then the Current input will be used to initialize the state, and is required to be a variable that holds the current state. If false then the Target value will be used to initialize the state and the Current input will be ignored/unnecessary as a state will be maintained by this node.

Type:

(bool)

property velocity: float

[Read-Only] Velocity

Type:

(float)