unreal.PhysicsAsset

class unreal.PhysicsAsset(outer: Object | None = None, name: Name | str = 'None')

Bases: Object

PhysicsAsset contains a set of rigid bodies and constraints that make up a single ragdoll. The asset is not limited to human ragdolls, and can be used for any physical simulation using bodies and constraints. A SkeletalMesh has a single PhysicsAsset, which allows for easily turning ragdoll physics on or off for many SkeletalMeshComponents The asset can be configured inside the Physics Asset Editor. see: https://docs.unrealengine.com/InteractiveExperiences/Physics/PhysicsAssetEditor see: USkeletalMesh

C++ Source:

  • Module: Engine

  • File: PhysicsAsset.h

Editor Properties: (see get_editor_property/set_editor_property)

  • asset_user_data (Array[AssetUserData]): [Read-Write]

  • constraint_profiles (Array[Name]): [Read-Write]

  • not_for_dedicated_server (bool): [Read-Write] If true, we skip instancing bodies for this PhysicsAsset on dedicated servers

  • physical_animation_profiles (Array[Name]): [Read-Write]

  • solver_iterations (SolverIterations): [Read-Only] Old solver settings shown for reference. These will be removed at some point. When you open an old asset you should see that the settings were transferred to “SolverSettings” above. You should usually see: SolverSettings.PositionIterations = OldSettings.SolverIterations * OldSetting.JointIterations; SolverSettings.VelocityIterations = 1; SolverSettings.ProjectionIterations = 1;

  • solver_settings (PhysicsAssetSolverSettings): [Read-Write] Solver settings when the asset is used with a RigidBody Anim Node (RBAN).

  • solver_type (PhysicsAssetSolverType): [Read-Write] Solver type used in physics asset editor. This can be used to make what you see in the asset editor more closely resembles what you see in game (though there will be differences owing to framerate variation etc). If your asset will primarily be used as a ragdoll select “World”, but if it will be used in the AnimGraph select “RBAN”.

  • thumbnail_info (ThumbnailInfo): [Read-Only] Information for thumbnail rendering

add_asset_user_data_of_class(user_data_class) bool

Creates and adds an instance of the provided AssetUserData class to the target asset.

Parameters:

user_data_class (type(Class)) – UAssetUserData sub class to create

Returns:

Whether or not an instance of InUserDataClass was succesfully added

Return type:

bool

get_asset_user_data_of_class(user_data_class) AssetUserData

Returns an instance of the provided AssetUserData class if it’s contained in the target asset.

Parameters:

user_data_class (type(Class)) – UAssetUserData sub class to get

Returns:

The instance of the UAssetUserData class contained, or null if it doesn’t exist

Return type:

AssetUserData

get_constraint_by_bone_names(bone1_name, bone2_name) ConstraintInstanceAccessor

Gets a constraint by its joint name

Parameters:
  • bone1_name (Name) – name of the first bone in the joint

  • bone2_name (Name) – name of the second bone in the joint

Returns:

ConstraintInstance accessor to the constraint data

Return type:

ConstraintInstanceAccessor

get_constraint_by_name(constraint_name) ConstraintInstanceAccessor

Gets a constraint by its joint name

Parameters:

constraint_name (Name) – name of the constraint

Returns:

ConstraintInstance accessor to the constraint data

Return type:

ConstraintInstanceAccessor

get_constraints(includes_terminated) Array[ConstraintInstanceAccessor]

Gets all constraints

Parameters:

includes_terminated (bool)

Returns:

out_constraints (Array[ConstraintInstanceAccessor]): returned list of constraints matching the parameters

Return type:

Array[ConstraintInstanceAccessor]

has_asset_user_data_of_class(user_data_class) bool

Checks whether or not an instance of the provided AssetUserData class is contained.

Parameters:

user_data_class (type(Class)) – UAssetUserData sub class to check for

Returns:

Whether or not an instance of InUserDataClass was found

Return type:

bool