unreal.RigDynamicsSolverSettings

class unreal.RigDynamicsSolverSettings(simulation_space: RigDynamicsSimulationSpace = Ellipsis, space_bone: RigElementKey = Ellipsis, gravity: Vector = Ellipsis, max_time_step: float = 0.0, max_num_steps: int = 0, num_iterations: int = 0, num_constraint_sub_iterations: int = 0, read_bone_orientations: bool = False, read_bone_positions: bool = False, reset_from_position: bool = False, position_threshold_for_reset: float = 0.0, reset_from_kinematic_speed: bool = False, kinematic_speed_threshold_for_reset: float = 0.0, reset_from_evaluation_interval: bool = False, evaluation_interval_threshold_for_reset: float = 0.0)

Bases: StructBase

Configuration/settings for the dynamics solver

C++ Source:

  • Plugin: ControlRigDynamics

  • Module: ControlRigDynamics

  • File: RigDynamicsData.h

Editor Properties: (see get_editor_property/set_editor_property)

  • evaluation_interval_threshold_for_reset (float): [Read-Write] If the time between successive solver evaluations (measured via the rig’s absolute time) exceeds this value AND is also greater than the frame’s delta time, the pose and velocities of all objects in the simulation are reset. This detects cases where evaluation was genuinely skipped - e.g. the rig stopped being ticked, or the editor was paused, without triggering just because the frame’s delta time was rather large.

  • gravity (Vector): [Read-Write] Gravity in world space. This can be scaled by each particle.

  • kinematic_speed_threshold_for_reset (float): [Read-Write] If any kinematic object in the simulation exceeds this speed, we will reset the pose and velocities of all objects in the simulation. This is to detect problems - for example if the target animation has teleports/jumps etc.

  • max_num_steps (int32): [Read-Write] The maximum number of steps that the update can be divided into. If MaxNumSteps * MaxTimeStep is less than the update time, the simulation will run “slow”.

  • max_time_step (float): [Read-Write] The maximum timestep of any step.

  • num_constraint_sub_iterations (int32): [Read-Write] The number of constraint (distance and collision) sub-iterations. Along-chain constraints will be one-way on the last iteration, so if this is 1 (which is often enough), particles in a chain will never be able to affect their parents. Increasing will result in more realistic behavior that comes with a performance cost.

  • num_iterations (int32): [Read-Write] This is the total number of iterations, including iterating over the particle targets. This can normally be 1, unless you want to track targets with very accurate spring behavior.

  • position_threshold_for_reset (float): [Read-Write] If any object in the simulation exceeds this distance from the simulation origin, we will reset the pose and velocity of all objects in the simulation. This is to detect problems/explosions.

  • read_bone_orientations (bool): [Read-Write] If true, then the read-back from the solver is done by rotating bones to match the directions between particles. If there is no branching, then this will result in the final bones matching the simulated particles (depending on the skeletal bone constraints being fulfilled). However, when there is branching, there can be some deviation.

  • read_bone_positions (bool): [Read-Write] If true the bone positions (translation) will be updated based on the particles. This will introduce stretching etc in the skeleton that is not there in the original animation, but it should result in better matching of the simulation and the bone positions.

  • reset_from_evaluation_interval (bool): [Read-Write]

  • reset_from_kinematic_speed (bool): [Read-Write]

  • reset_from_position (bool): [Read-Write]

  • simulation_space (RigDynamicsSimulationSpace): [Read-Write]

  • space_bone (RigElementKey): [Read-Write] The bone to use for the simulation space (only relevant if SimulationSpace is set to SpaceBone)

property evaluation_interval_threshold_for_reset: float

[Read-Only] If the time between successive solver evaluations (measured via the rig’s absolute time) exceeds this value AND is also greater than the frame’s delta time, the pose and velocities of all objects in the simulation are reset. This detects cases where evaluation was genuinely skipped - e.g. the rig stopped being ticked, or the editor was paused, without triggering just because the frame’s delta time was rather large.

Type:

(float)

property gravity: Vector

[Read-Only] Gravity in world space. This can be scaled by each particle.

Type:

(Vector)

property kinematic_speed_threshold_for_reset: float

[Read-Only] If any kinematic object in the simulation exceeds this speed, we will reset the pose and velocities of all objects in the simulation. This is to detect problems - for example if the target animation has teleports/jumps etc.

Type:

(float)

property max_num_steps: int

[Read-Only] The maximum number of steps that the update can be divided into. If MaxNumSteps * MaxTimeStep is less than the update time, the simulation will run “slow”.

Type:

(int32)

property max_time_step: float

[Read-Only] The maximum timestep of any step.

Type:

(float)

property num_constraint_sub_iterations: int

[Read-Only] The number of constraint (distance and collision) sub-iterations. Along-chain constraints will be one-way on the last iteration, so if this is 1 (which is often enough), particles in a chain will never be able to affect their parents. Increasing will result in more realistic behavior that comes with a performance cost.

Type:

(int32)

property num_iterations: int

[Read-Only] This is the total number of iterations, including iterating over the particle targets. This can normally be 1, unless you want to track targets with very accurate spring behavior.

Type:

(int32)

property position_threshold_for_reset: float

[Read-Only] If any object in the simulation exceeds this distance from the simulation origin, we will reset the pose and velocity of all objects in the simulation. This is to detect problems/explosions.

Type:

(float)

property read_bone_orientations: bool

[Read-Only] If true, then the read-back from the solver is done by rotating bones to match the directions between particles. If there is no branching, then this will result in the final bones matching the simulated particles (depending on the skeletal bone constraints being fulfilled). However, when there is branching, there can be some deviation.

Type:

(bool)

property read_bone_positions: bool

[Read-Only] If true the bone positions (translation) will be updated based on the particles. This will introduce stretching etc in the skeleton that is not there in the original animation, but it should result in better matching of the simulation and the bone positions.

Type:

(bool)

property reset_from_evaluation_interval: bool

[Read-Only]

Type:

(bool)

property reset_from_kinematic_speed: bool

[Read-Only]

Type:

(bool)

property reset_from_position: bool

[Read-Only]

Type:

(bool)

property simulation_space: RigDynamicsSimulationSpace

[Read-Only]

Type:

(RigDynamicsSimulationSpace)

property space_bone: RigElementKey

[Read-Only] The bone to use for the simulation space (only relevant if SimulationSpace is set to SpaceBone)

Type:

(RigElementKey)