unreal.RigUnit_HierarchyInstantiateFromPhysicsAsset

class unreal.RigUnit_HierarchyInstantiateFromPhysicsAsset(execute_pin: RigVMExecutePin = [], physics_solver_component_key: RigComponentKey = Ellipsis, use_automatic_solver: bool = False, physics_asset: PhysicsAsset = Ellipsis, constraint_profile_name: Name = 'None', bones_to_use: None = [], enable_joints: bool = False, enable_drives: bool = False, add_sim_space_control: bool = False, add_parent_space_control: bool = False, make_helper_bodies: bool = False, sim_space_control_data: PhysicsControlData = Ellipsis, parent_space_control_data: PhysicsControlData = Ellipsis, physics_body_component_keys: None = [], physics_joint_component_keys: None = [], sim_space_control_component_keys: None = [], parent_space_control_component_keys: None = [])

Bases: RigUnit_PhysicsBaseMutable

Creates multiple physics components based on the supplied physics asset. Note that the resulting simulation bodies may not precisely match the physics asset. Note: This node only runs during the construction event (before physics instantiation, after which this data is frozen).

C++ Source:

  • Plugin: ControlRigPhysics

  • Module: ControlRigPhysics

  • File: RigPhysicsExecution.h

Editor Properties: (see get_editor_property/set_editor_property)

  • add_parent_space_control (bool): [Read-Write] Whether to create a parent-space control for each body that was created. Note that if this is set to true, then it will be created for the root-most body in the physics asset too. This is often not needed, so make sure it isn’t enabled if you don’t want it to be.

  • add_sim_space_control (bool): [Read-Write] Whether to create a simulation-space control for each body that was created

  • bones_to_use (Array[RigElementKey]): [Read-Write] If this is empty, then all bodies in the physics asset that match a bone in the hierarchy will be created. Otherwise only bodies that relate to the specified bones will be created.

  • constraint_profile_name (Name): [Read-Write] Name of the constraint profile to use. If empty (or invalid), the default profile will be used

  • enable_drives (bool): [Read-Write] Whether to enable the drives authored in the physics asset. Note that if you are creating parent space controls, you may not want the drives

  • enable_joints (bool): [Read-Write] Whether to enable the joints authored in the physics asset. Note that you can’t have drives without joints.

  • execute_pin (RigVMExecutePin): [Read-Write] This property is used to chain multiple mutable units together

  • make_helper_bodies (bool): [Read-Write] If true, and BonesToUse/BoneMask is being used to create a subset of the physics asset, then helper bodies will be created when needed: Kinematic bodies on bones that are connected by a physics joint to those in BonesToUse/BoneMask. This is used so that (a) instantiating individual chains can be done without explicitly including the parent (in the physics joint sense) body, and (b) entire physics assets can be made from multiple calls to instantiate individual chains.

  • parent_space_control_component_keys (Array[RigComponentKey]): [Read-Write] The parent-space Physics Control component keys that were created

  • parent_space_control_data (PhysicsControlData): [Read-Write] Data for the parent space control

  • physics_asset (PhysicsAsset): [Read-Write] The Physics Asset to instantiate from

  • physics_body_component_keys (Array[RigComponentKey]): [Read-Write] The Physics Body component keys that were created

  • physics_joint_component_keys (Array[RigComponentKey]): [Read-Write] The Physics Joint component keys that were created

  • physics_solver_component_key (RigComponentKey): [Read-Write] Note that setting the solver component, if known, has the benefit of avoiding the need to search for an automatic solver.

  • sim_space_control_component_keys (Array[RigComponentKey]): [Read-Write] The simulation-space Physics Control component keys that were created

  • sim_space_control_data (PhysicsControlData): [Read-Write] Data for the simulation space control

  • use_automatic_solver (bool): [Read-Write] If true (and the physics solver is not explicitly set), then this component will be added to any physics solver that exists above it in the hierarchy, if that solver allows automatically adding physics components.

property add_parent_space_control: bool

[Read-Write] Whether to create a parent-space control for each body that was created. Note that if this is set to true, then it will be created for the root-most body in the physics asset too. This is often not needed, so make sure it isn’t enabled if you don’t want it to be.

Type:

(bool)

property add_sim_space_control: bool

[Read-Write] Whether to create a simulation-space control for each body that was created

Type:

(bool)

property bones_to_use: None

[Read-Write] If this is empty, then all bodies in the physics asset that match a bone in the hierarchy will be created. Otherwise only bodies that relate to the specified bones will be created.

Type:

(Array[RigElementKey])

property constraint_profile_name: Name

[Read-Write] Name of the constraint profile to use. If empty (or invalid), the default profile will be used

Type:

(Name)

property enable_drives: bool

[Read-Write] Whether to enable the drives authored in the physics asset. Note that if you are creating parent space controls, you may not want the drives

Type:

(bool)

property enable_joints: bool

[Read-Write] Whether to enable the joints authored in the physics asset. Note that you can’t have drives without joints.

Type:

(bool)

property make_helper_bodies: bool

[Read-Write] If true, and BonesToUse/BoneMask is being used to create a subset of the physics asset, then helper bodies will be created when needed: Kinematic bodies on bones that are connected by a physics joint to those in BonesToUse/BoneMask. This is used so that (a) instantiating individual chains can be done without explicitly including the parent (in the physics joint sense) body, and (b) entire physics assets can be made from multiple calls to instantiate individual chains.

Type:

(bool)

property parent_space_control_component_keys: None

[Read-Only] The parent-space Physics Control component keys that were created

Type:

(Array[RigComponentKey])

property parent_space_control_data: PhysicsControlData

[Read-Write] Data for the parent space control

Type:

(PhysicsControlData)

property physics_asset: PhysicsAsset

[Read-Write] The Physics Asset to instantiate from

Type:

(PhysicsAsset)

property physics_body_component_keys: None

[Read-Only] The Physics Body component keys that were created

Type:

(Array[RigComponentKey])

property physics_joint_component_keys: None

[Read-Only] The Physics Joint component keys that were created

Type:

(Array[RigComponentKey])

property physics_solver_component_key: RigComponentKey

[Read-Write] Note that setting the solver component, if known, has the benefit of avoiding the need to search for an automatic solver.

Type:

(RigComponentKey)

property sim_space_control_component_keys: None

[Read-Only] The simulation-space Physics Control component keys that were created

Type:

(Array[RigComponentKey])

property sim_space_control_data: PhysicsControlData

[Read-Write] Data for the simulation space control

Type:

(PhysicsControlData)

property use_automatic_solver: bool

[Read-Write] If true (and the physics solver is not explicitly set), then this component will be added to any physics solver that exists above it in the hierarchy, if that solver allows automatically adding physics components.

Type:

(bool)