unreal.PhysicsControlComponent
¶
- class unreal.PhysicsControlComponent(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
SceneComponent
This is the main Physics Control Component class which manages Controls and Body Modifiers associated with one or more static or skeletal meshes. You can add this as a component to an actor containing a mesh and then use it to create, configure and destroy Controls/Body Modifiers:
Controls are used to control one physics body relative to another (or the world). These controls are done through physical spring/damper drives.
Body Modifiers are used to update the most important physical properties of physics bodies such as whether they are simulated vs kinematic, or whether they experience gravity.
Note that Controls and Body Modifiers are given names (which are predictable). These names can then be stored (perhaps in arrays) to make it easy to quickly change multiple Controls/Body Modifiers.
C++ Source:
Plugin: PhysicsControl
Module: PhysicsControl
File: PhysicsControlComponent.h
Editor Properties: (see get_editor_property/set_editor_property)
absolute_location
(bool): [Read-Write] If RelativeLocation should be considered relative to the world, rather than the parentabsolute_rotation
(bool): [Read-Write] If RelativeRotation should be considered relative to the world, rather than the parentabsolute_scale
(bool): [Read-Write] If RelativeScale3D should be considered relative to the world, rather than the parentasset_user_data
(Array[AssetUserData]): [Read-Write] Array of user data stored with the componentauto_activate
(bool): [Read-Write] Whether the component is activated at creation or must be explicitly activated.can_ever_affect_navigation
(bool): [Read-Write] Whether this component can potentially influence navigationcomponent_tags
(Array[Name]): [Read-Write] Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.debug_body_modifier_detail_filter
(str): [Read-Write] Display detailed info for body modifiers containing this string (if non-empty) when this component is selecteddebug_control_detail_filter
(str): [Read-Write] Display detailed info for controls containing this string (if non-empty) when this component is selecteddetail_mode
(DetailMode): [Read-Write] If detail mode is >= system detail mode, primitive won’t be rendered.editable_when_inherited
(bool): [Read-Write] True if this component can be modified when it was inherited from a parent actor classhidden_in_game
(bool): [Read-Write] Whether to hide the primitive in game, if the primitive is Visible.is_editor_only
(bool): [Read-Write] If true, the component will be excluded from non-editor buildsmax_num_controls_or_modifiers_per_name
(int32): [Read-Write] Upper limit on the number of controls or modifiers that will be created using the same name (which will get a numerical postfix). When this limit is reached a warning will be issued and the control or modifier won’t be created. This is to avoid problems if controls or modifiers are being created dynamically, and can generally be a “moderately large” number, depending on how many controls or modifiers you expect to create.mobility
(ComponentMobility): [Read-Write] How often this component is allowed to move, used to make various optimizations. Only safe to set in constructor.on_component_activated
(ActorComponentActivatedSignature): [Read-Write] Called when the component has been activated, with parameter indicating if it was from a reseton_component_deactivated
(ActorComponentDeactivateSignature): [Read-Write] Called when the component has been deactivatedphysics_volume_changed_delegate
(PhysicsVolumeChanged): [Read-Write] Delegate that will be called when PhysicsVolume has been changed *primary_component_tick
(ActorComponentTickFunction): [Read-Write] Main tick function for the Componentrelative_location
(Vector): [Read-Write] Location of the component relative to its parentrelative_rotation
(Rotator): [Read-Write] Rotation of the component relative to its parentrelative_scale3d
(Vector): [Read-Write] Non-uniform scaling of the component relative to its parent. Note that scaling is always applied in local space (no shearing etc)replicate_using_registered_sub_object_list
(bool): [Read-Write] When true the replication system will only replicate the registered subobjects list When false the replication system will instead call the virtual ReplicateSubObjects() function where the subobjects need to be manually replicated.replicates
(bool): [Read-Write] Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!should_update_physics_volume
(bool): [Read-Write] Whether or not the cached PhysicsVolume this component overlaps should be updated when the component is moved. see: GetPhysicsVolume()show_debug_body_modifier_list
(bool): [Read-Write] Display all the body modifiers and their basic properties when this component is selectedshow_debug_control_list
(bool): [Read-Write] Display all the controls and their basic properties when this component is selectedshow_debug_visualization
(bool): [Read-Write] Visualize the controls when this component is selectedteleport_distance_threshold
(float): [Read-Write] If the component moves by more than this distance then it is treated as a teleport, which prevents velocities being used for a frame. It is also used as the threshold for teleporting when moving kinematic objects. Zero or negative disables.teleport_rotation_threshold
(float): [Read-Write] If the component rotates by more than this angle (in degrees) then it is treated as a teleport, which prevents velocities being used for a frame. It is also used as the threshold for teleporting when moving kinematic objects. Zero or negative disables.use_attach_parent_bound
(bool): [Read-Write] If true, this component uses its parents bounds when attached. This can be a significant optimization with many components attached together.velocity_prediction_time
(float): [Read-Write] The time used when “predicting” the target position/orientation. Zero will disable the visualization of this.visible
(bool): [Read-Write] Whether to completely draw the primitive; if false, the primitive is not drawn, does not cast a shadow.visualization_size_scale
(float): [Read-Write] Size of the gizmos etc used during visualization
- add_body_modifier_to_set(body_modifier, set) PhysicsControlNames ¶
Adds a BodyModifier to a Set. This will add a new set if necessary. For example, you might make a set of body modifiers called “Feet” by calling this twice, passing in the left and right foot body modifiers.
- Parameters:
- Returns:
new_set (PhysicsControlNames):
- Return type:
- add_body_modifiers_to_set(body_modifiers, set) PhysicsControlNames ¶
Adds BodyModifiers to a Set. This will add a new set if necessary. For example, you might make a set of Arm body modifiers by calling this twice, passing in the left and right arm body modifiers.
- Parameters:
- Returns:
new_set (PhysicsControlNames):
- Return type:
- add_control_to_set(control, set) PhysicsControlNames ¶
Adds a Control to a Set. This will add a new set if necessary. For example, you might make a set of Controls called “ParentSpace_Feet” by calling this twice, passing in the left and right foot ParentSpace controls.
- Parameters:
- Returns:
new_set (PhysicsControlNames):
- Return type:
- add_controls_to_set(controls, set) PhysicsControlNames ¶
Adds Controls to a Set. This will add a new set if necessary. For example, you might make a set of ParentSpace Arm controls by calling this twice, passing in the left and right arm ParentSpace controls.
- Parameters:
- Returns:
new_set (PhysicsControlNames):
- Return type:
- create_body_modifier(mesh_component, bone_name, set, movement_type=PhysicsMovementType.SIMULATED, collision_type=CollisionEnabled.QUERY_AND_PHYSICS, gravity_multiplier=1.000000, use_skeletal_animation=True) Name ¶
Creates a new body modifier for mesh components
- Parameters:
mesh_component (MeshComponent) – The Mesh Component used as a target for the modifier
bone_name (Name) – The bone name, if a skeletal mesh is used
set (Name) – Which set to include the body modifier in (optional). Note that it automatically gets added to the set “All”
movement_type (PhysicsMovementType) – Whether to enable/disable simulation on the body
collision_type (CollisionEnabled) – Collision type to set on the body
gravity_multiplier (float) – The amount of gravity to apply when simulating
use_skeletal_animation (bool) – Whether the kinematic target is specified in the frame of the skeletal animation, rather than world space. Only relevant if the body is part of a skeletal mesh.
- Return type:
- create_body_modifiers_from_limb_bones(limb_bones, movement_type=PhysicsMovementType.SIMULATED, collision_type=CollisionEnabled.QUERY_AND_PHYSICS, gravity_multiplier=1.000000, use_skeletal_animation=True) -> (Map[Name, PhysicsControlNames], all_body_modifiers=PhysicsControlNames)¶
Creates a collection of controls controlling a skeletal mesh, grouped together in limbs
- Parameters:
limb_bones (Map[Name, PhysicsControlLimbBones]) – A map relating the limbs and the bones that they contain. Typically create this using GetLimbBonesFromSkeletalMesh
movement_type (PhysicsMovementType) – Whether to enable/disable simulation on the body
collision_type (CollisionEnabled) – Collision type to set on the body
gravity_multiplier (float) – The amount of gravity to apply when simulating
use_skeletal_animation (bool) – Whether the kinematic target is specified in the frame of the skeletal animation, rather than world space. Only relevant if the body is part of a skeletal mesh.
- Returns:
A map containing the modifiers for each limb
all_body_modifiers (PhysicsControlNames):
- Return type:
- create_body_modifiers_from_skeletal_mesh_below(skeletal_mesh_component, bone_name, include_self, set, movement_type=PhysicsMovementType.SIMULATED, collision_type=CollisionEnabled.QUERY_AND_PHYSICS, gravity_multiplier=1.000000, use_skeletal_animation=True) Array[Name] ¶
Creates new body modifiers for skeletal mesh components
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) – The skeletal mesh which will have body modifiers
bone_name (Name) – The bone name below which modifiers should be created
include_self (bool) – Whether or not to include BoneName when creating modifiers
set (Name) – Which set to include the body modifier in (optional). Note that it automatically gets added to the set “All”
movement_type (PhysicsMovementType) – Whether to enable/disable simulation on the body
collision_type (CollisionEnabled) – Collision type to set on the body
gravity_multiplier (float) – The amount of gravity to apply when simulating
use_skeletal_animation (bool) – Whether the kinematic target is specified in the frame of the skeletal animation, rather than world space. Only relevant if the body is part of a skeletal mesh.
- Return type:
- create_control(parent_mesh_component, parent_bone_name, child_mesh_component, child_bone_name, control_data, control_target, control_settings, set, enabled=True) Name ¶
Creates a new control for mesh components
- Parameters:
parent_mesh_component (MeshComponent) –
parent_bone_name (Name) –
child_mesh_component (MeshComponent) –
child_bone_name (Name) –
control_data (PhysicsControlData) – Describes the initial strength etc of the new control
control_target (PhysicsControlTarget) – Describes the initial target for the new control
control_settings (PhysicsControlSettings) – General settings for the control
set (Name) – Which set to include the control in (optional). Note that it automatically gets added to the set “All”
enabled (bool) – If true then the control will be enabled immediately. If false you will need to call SetControlEnabled(true) in order to activate it.
- Returns:
The name of the new control
- Return type:
- create_controls_and_body_modifiers_from_limb_bones(skeletal_mesh_component, limb_setup_data, world_space_control_data, world_space_control_settings, enable_world_space_controls, parent_space_control_data, parent_space_control_settings, enable_parent_space_controls, physics_movement_type=PhysicsMovementType.STATIC, gravity_multiplier=1.000000) -> (all_world_space_controls=PhysicsControlNames, limb_world_space_controls=Map[Name, PhysicsControlNames], all_parent_space_controls=PhysicsControlNames, limb_parent_space_controls=Map[Name, PhysicsControlNames], all_body_modifiers=PhysicsControlNames, limb_body_modifiers=Map[Name, PhysicsControlNames])¶
Creates a collections of controls and body modifiers for a character, based on the description passed in. This makes: - World-space controls - Parent-space controls - Body modifiers for all the body parts. In addition, they get added to sets, so they can be referenced later. Each control is added to three sets: - “All” - “ControlType - i.e. “WorldSpace” or “ParentSpace”, each of which will end up containing all controls of that type - “ControlType_LimbName” - e.g. “WorldSpace_ArmLeft” or “ParentSpace_Head” Each body modifier is added to “All” and a set named after the limb - e.g. “Spine” or “LegRight”.
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
limb_setup_data (Array[PhysicsControlLimbSetupData]) –
world_space_control_data (PhysicsControlData) –
world_space_control_settings (PhysicsControlSettings) –
enable_world_space_controls (bool) –
parent_space_control_data (PhysicsControlData) –
parent_space_control_settings (PhysicsControlSettings) –
enable_parent_space_controls (bool) –
physics_movement_type (PhysicsMovementType) –
gravity_multiplier (float) –
- Returns:
all_world_space_controls (PhysicsControlNames):
limb_world_space_controls (Map[Name, PhysicsControlNames]):
all_parent_space_controls (PhysicsControlNames):
limb_parent_space_controls (Map[Name, PhysicsControlNames]):
all_body_modifiers (PhysicsControlNames):
limb_body_modifiers (Map[Name, PhysicsControlNames]):
- Return type:
tuple
- create_controls_from_limb_bones(limb_bones, control_type, control_data, control_settings, enabled=True) -> (Map[Name, PhysicsControlNames], all_controls=PhysicsControlNames)¶
Creates a collection of controls controlling a skeletal mesh, grouped together in limbs
- Parameters:
limb_bones (Map[Name, PhysicsControlLimbBones]) – A map relating the limbs and the bones that they contain. Typically create this using GetLimbBonesFromSkeletalMesh
control_type (PhysicsControlType) – What type of control to create. This determines what the parent will be for each control
control_data (PhysicsControlData) – Describes the initial strength etc of the new control
control_settings (PhysicsControlSettings) – General settings for the control
enabled (bool) – If true then the control will be enabled immediately. If false you will need to call SetControlEnabled(true) in order to enable it.
- Returns:
A map containing the controls for each limb
all_controls (PhysicsControlNames): A single container for all the controls that have been created
- Return type:
- create_controls_from_limb_bones_and_constraint_profile(limb_bones, constraint_profile, enabled=True) -> (Map[Name, PhysicsControlNames], all_controls=PhysicsControlNames)¶
Creates a collection of ParentSpace controls controlling a skeletal mesh, grouped together in limbs, initializing them with a constraint profile
- Parameters:
limb_bones (Map[Name, PhysicsControlLimbBones]) – A map relating the limbs and the bones that they contain. Typically create this using GetLimbBonesFromSkeletalMesh
constraint_profile (Name) – The constraint profile to use for initializing the control strength and damping (etc) parameters. Note that the controls will all be created in “ parent space” - i.e. with each part controlled relative to its parent. The strength and damping will be taken from the values that the relevant joint in the physics asset would have given the constraint profile (or the default profile if it can’t be found) - though they will not match exactly if the linear drive and different x/y/z values, or if the angular drive was using twist/swing instead of slerp. Note also that the joint constraints do not use the animation velocity as a target, so when creating controls in this way the control settings will set the skeletal animation velocity multiplier to zero.
enabled (bool) – If true then the control will be enabled immediately. If false you will need to call SetControlEnabled(true) in order to enable it.
- Returns:
A map containing the controls for each limb
all_controls (PhysicsControlNames): A single container for all the controls that have been created
- Return type:
- create_controls_from_skeletal_mesh(skeletal_mesh_component, bone_names, control_type, control_data, control_settings, set, enabled=True) Array[Name] ¶
Creates a collection of controls controlling a skeletal mesh
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) – The skeletal mesh which will have controls
bone_names (Array[Name]) – The names of bones for which controls should be created. Each bone will be the child in a control
control_type (PhysicsControlType) – What type of control to create. This determines what the parent will be for each control
control_data (PhysicsControlData) – Describes the initial strength etc of the new control
control_settings (PhysicsControlSettings) – General settings for the control
set (Name) – Which set to include the control in (optional). Note that it automatically gets added to the set “All”
enabled (bool) – If true then the control will be enabled immediately. If false you will need to call SetControlEnabled(true) in order to enable it.
- Returns:
An array of the controls that have been created
- Return type:
- create_controls_from_skeletal_mesh_and_constraint_profile(skeletal_mesh_component, bone_names, constraint_profile, set, enabled=True) Array[Name] ¶
Creates a collection of ParentSpace controls controlling a skeletal mesh, initializing them with a constraint profile
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) – The skeletal mesh which will have controls
bone_names (Array[Name]) – The names of bones for which controls should be created. Each bone will be the child in a control
constraint_profile (Name) – The constraint profile to use for initializing the control strength and damping (etc) parameters. Note that the controls will all be created in “ parent space” - i.e. with each part controlled relative to its parent. The strength and damping will be taken from the values that the relevant joint in the physics asset would have given the constraint profile (or the default profile if it can’t be found) - though they will not match exactly if the linear drive and different x/y/z values, or if the angular drive was using twist/swing instead of slerp. Note also that the joint constraints do not use the animation velocity as a target, so when creating controls in this way the control settings will set the skeletal animation velocity multiplier to zero.
set (Name) – Which set to include the control in (optional). Note that it automatically gets added to the set “All”
enabled (bool) – If true then the control will be enabled immediately. If false you will need to call SetControlEnabled(true) in order to enable it.
- Returns:
An array of the controls that have been created
- Return type:
- create_controls_from_skeletal_mesh_and_constraint_profile_below(skeletal_mesh_component, bone_name, include_self, constraint_profile, set, enabled=True) Array[Name] ¶
Creates a collection of ParentSpace controls controlling a skeletal mesh, initializing them with a constraint profile
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) – The skeletal mesh which will have controls
bone_name (Name) – The name of the bone below which controls should be created. Each bone will be the child in a control
include_self (bool) – Whether or not to include BoneName when creating controls
constraint_profile (Name) – The constraint profile to use for initializing the control strength and damping (etc) parameters. Note that the controls will all be created in “ parent space” - i.e. with each part controlled relative to its parent. The strength and damping will be taken from the values that the relevant joint in the physics asset would have given the constraint profile (or the default profile if it can’t be found) - though they will not match exactly if the linear drive and different x/y/z values, or if the angular drive was using twist/swing instead of slerp. Note also that the joint constraints do not use the animation velocity as a target, so when creating controls in this way the control settings will set the skeletal animation velocity multiplier to zero.
set (Name) – Which set to include the control in (optional). Note that it automatically gets added to the set “All”
enabled (bool) – If true then the control will be enabled immediately. If false you will need to call SetControlEnabled(true) in order to enable it.
- Returns:
An array of the controls that have been created
- Return type:
- create_controls_from_skeletal_mesh_below(skeletal_mesh_component, bone_name, include_self, control_type, control_data, control_settings, set, enabled=True) Array[Name] ¶
Creates a collection of controls controlling a skeletal mesh
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) – The skeletal mesh which will have controls
bone_name (Name) – The name of the bone below which controls should be created. Each bone will be the child in a control
include_self (bool) – Whether or not to include BoneName when creating controls
control_type (PhysicsControlType) – What type of control to create. This determines what the parent will be for each control
control_data (PhysicsControlData) – Describes the initial strength etc of the new control
control_settings (PhysicsControlSettings) – General settings for the control
set (Name) – Which set to include the control in (optional). Note that it automatically gets added to the set “All”
enabled (bool) – If true then the control will be enabled immediately. If false you will need to call SetControlEnabled(true) in order to enable it.
- Returns:
An array of the controls that have been created
- Return type:
- create_named_body_modifier(name, mesh_component, bone_name, set, movement_type=PhysicsMovementType.SIMULATED, collision_type=CollisionEnabled.QUERY_AND_PHYSICS, gravity_multiplier=1.000000, use_skeletal_animation=True) bool ¶
Creates a new body modifier for mesh components
- Parameters:
name (Name) –
mesh_component (MeshComponent) – The Mesh Component used as a target for the modifier
bone_name (Name) – The bone name, if a skeletal mesh is used
set (Name) – Which set to include the body modifier in (optional). Note that it automatically gets added to the set “All”
movement_type (PhysicsMovementType) – Whether to enable/disable simulation on the body
collision_type (CollisionEnabled) – Collision type to set on the body
gravity_multiplier (float) – The amount of gravity to apply when simulating
use_skeletal_animation (bool) – Whether the kinematic target is specified in the frame of the skeletal animation, rather than world space. Only relevant if the body is part of a skeletal mesh.
- Return type:
- create_named_control(name, parent_mesh_component, parent_bone_name, child_mesh_component, child_bone_name, control_data, control_target, control_settings, set, enabled=True) bool ¶
Creates a new control for mesh components
- Parameters:
name (Name) –
parent_mesh_component (MeshComponent) –
parent_bone_name (Name) –
child_mesh_component (MeshComponent) –
child_bone_name (Name) –
control_data (PhysicsControlData) – Describes the initial strength etc of the new control
control_target (PhysicsControlTarget) – Describes the initial target for the new control
control_settings (PhysicsControlSettings) – General settings for the control
set (Name) – Which set to include the control in (optional). Note that it automatically gets added to the set “All”
enabled (bool) – If true then the control will be enabled immediately. If false you will need to call SetControlEnabled(true) in order to enable it.
- Returns:
True if a new control was created, false if a control of the specified name already exists
- Return type:
- property debug_body_modifier_detail_filter: str¶
[Read-Write] Display detailed info for body modifiers containing this string (if non-empty) when this component is selected
- Type:
(str)
- property debug_control_detail_filter: str¶
[Read-Write] Display detailed info for controls containing this string (if non-empty) when this component is selected
- Type:
(str)
- destroy_all_body_modifiers(names: None) None ¶
deprecated: ‘destroy_all_body_modifiers’ was renamed to ‘destroy_body_modifiers’.
- destroy_all_controls(names: None) None ¶
deprecated: ‘destroy_all_controls’ was renamed to ‘destroy_controls’.
- destroy_body_modifiers_in_set(set) None ¶
Destroys BodyModifiers
- Parameters:
set (Name) – The set of body modifiers to destroy. Standard sets will include “All” and things like “ArmLeft”, depending on how body modifiers have been created.
- destroy_controls_in_set(set) None ¶
Destroys all controls in a set
- Parameters:
set (Name) – The set of controls to use to destroy. Standard sets will include “All”, “WorldSpace”, “ParentSpace” and things like “WorldSpace-ArmLeft”, depending on how controls have been created.
- get_all_body_modifier_names() Array[Name] ¶
Returns a reference to all the body modifier names that have been created.
- get_all_control_names() Array[Name] ¶
Returns a reference to all the control names that have been created.
- get_body_modifier_names_in_set(set) Array[Name] ¶
Returns a reference to all the body modifier names that have been created and are in the specified set, which could be a limb, or a subsequently created set. Standard sets will include “All” and things like “ArmLeft”, depending on how body modifiers have been created.
- get_control_data(name) PhysicsControlData or None ¶
- Parameters:
name (Name) – The name of the control to access.
- Returns:
Returns true if the control was found, false if not
control_data (PhysicsControlData):
- Return type:
PhysicsControlData or None
- get_control_multiplier(name) PhysicsControlMultiplier or None ¶
- Parameters:
name (Name) – The name of the control to access.
- Returns:
Returns true if the control was found, false if not
control_multiplier (PhysicsControlMultiplier):
- Return type:
PhysicsControlMultiplier or None
- get_control_names_in_set(set) Array[Name] ¶
Returns a reference to all the control names that have been created and are in the specified set, which could be a limb, or a subsequently created set. Standard sets will include “All”, “WorldSpace”, “ParentSpace” and things like “WorldSpace-ArmLeft”, depending on how controls have been created.
- get_control_target(name) PhysicsControlTarget or None ¶
- Parameters:
name (Name) – The name of the control to access.
- Returns:
Returns true if the control was found, false if not
control_target (PhysicsControlTarget):
- Return type:
PhysicsControlTarget or None
- get_limb_bones_from_skeletal_mesh(skeletal_mesh_component, limb_setup_data) Map[Name, PhysicsControlLimbBones] ¶
Calculates which bones belong to which limb in a skeletal mesh
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) – The skeletal mesh which will be analyzed
limb_setup_data (Array[PhysicsControlLimbSetupData]) – This needs to be filled in with the list of limbs to “discover”. Note that the limbs should be listed starting at the “leaf” (i.e. outer) parts of the skeleton first, typically finishing with the spine. In addition, the spine limb is typically specified using the first spine bone, but flagging it to include its parent (normally the pelvis).
- Returns:
A map of limb names to bones
- Return type:
- get_sets_containing_body_modifier(control) Array[Name] ¶
Returns the names of all sets containing the body modifier (may be empty - e.g. if it doesn’t exist)
- get_sets_containing_control(control) Array[Name] ¶
Returns the names of all sets containing the control (may be empty - e.g. if it doesn’t exist)
- make_body_modifier(mesh_component: MeshComponent, bone_name: Name, set: Name, movement_type: PhysicsMovementType = Ellipsis, collision_type: CollisionEnabled = Ellipsis, gravity_multiplier: float = 1.0, use_skeletal_animation: bool = True) Name ¶
deprecated: ‘make_body_modifier’ was renamed to ‘create_body_modifier’.
- make_body_modifiers_from_limb_bones(limb_bones: None, movement_type: PhysicsMovementType = Ellipsis, collision_type: CollisionEnabled = Ellipsis, gravity_multiplier: float = 1.0, use_skeletal_animation: bool = True) Tuple[None, PhysicsControlNames] ¶
deprecated: ‘make_body_modifiers_from_limb_bones’ was renamed to ‘create_body_modifiers_from_limb_bones’.
- make_body_modifiers_from_skeletal_mesh_below(skeletal_mesh_component: SkeletalMeshComponent, bone_name: Name, include_self: bool, set: Name, movement_type: PhysicsMovementType = Ellipsis, collision_type: CollisionEnabled = Ellipsis, gravity_multiplier: float = 1.0, use_skeletal_animation: bool = True) None ¶
deprecated: ‘make_body_modifiers_from_skeletal_mesh_below’ was renamed to ‘create_body_modifiers_from_skeletal_mesh_below’.
- make_control(parent_mesh_component: MeshComponent, parent_bone_name: Name, child_mesh_component: MeshComponent, child_bone_name: Name, control_data: PhysicsControlData, control_target: PhysicsControlTarget, control_settings: PhysicsControlSettings, set: Name, enabled: bool = True) Name ¶
deprecated: ‘make_control’ was renamed to ‘create_control’.
- make_controls_from_limb_bones(limb_bones: None, control_type: PhysicsControlType, control_data: PhysicsControlData, control_settings: PhysicsControlSettings, enabled: bool = True) Tuple[None, PhysicsControlNames] ¶
deprecated: ‘make_controls_from_limb_bones’ was renamed to ‘create_controls_from_limb_bones’.
- make_controls_from_limb_bones_and_constraint_profile(limb_bones: None, constraint_profile: Name, enabled: bool = True) Tuple[None, PhysicsControlNames] ¶
deprecated: ‘make_controls_from_limb_bones_and_constraint_profile’ was renamed to ‘create_controls_from_limb_bones_and_constraint_profile’.
- make_controls_from_skeletal_mesh(skeletal_mesh_component: SkeletalMeshComponent, bone_names: None, control_type: PhysicsControlType, control_data: PhysicsControlData, control_settings: PhysicsControlSettings, set: Name, enabled: bool = True) None ¶
deprecated: ‘make_controls_from_skeletal_mesh’ was renamed to ‘create_controls_from_skeletal_mesh’.
- make_controls_from_skeletal_mesh_and_constraint_profile(skeletal_mesh_component: SkeletalMeshComponent, bone_names: None, constraint_profile: Name, set: Name, enabled: bool = True) None ¶
deprecated: ‘make_controls_from_skeletal_mesh_and_constraint_profile’ was renamed to ‘create_controls_from_skeletal_mesh_and_constraint_profile’.
- make_controls_from_skeletal_mesh_and_constraint_profile_below(skeletal_mesh_component: SkeletalMeshComponent, bone_name: Name, include_self: bool, constraint_profile: Name, set: Name, enabled: bool = True) None ¶
deprecated: ‘make_controls_from_skeletal_mesh_and_constraint_profile_below’ was renamed to ‘create_controls_from_skeletal_mesh_and_constraint_profile_below’.
- make_controls_from_skeletal_mesh_below(skeletal_mesh_component: SkeletalMeshComponent, bone_name: Name, include_self: bool, control_type: PhysicsControlType, control_data: PhysicsControlData, control_settings: PhysicsControlSettings, set: Name, enabled: bool = True) None ¶
deprecated: ‘make_controls_from_skeletal_mesh_below’ was renamed to ‘create_controls_from_skeletal_mesh_below’.
- make_named_body_modifier(name: Name, mesh_component: MeshComponent, bone_name: Name, set: Name, movement_type: PhysicsMovementType = Ellipsis, collision_type: CollisionEnabled = Ellipsis, gravity_multiplier: float = 1.0, use_skeletal_animation: bool = True) bool ¶
deprecated: ‘make_named_body_modifier’ was renamed to ‘create_named_body_modifier’.
- make_named_control(name: Name, parent_mesh_component: MeshComponent, parent_bone_name: Name, child_mesh_component: MeshComponent, child_bone_name: Name, control_data: PhysicsControlData, control_target: PhysicsControlTarget, control_settings: PhysicsControlSettings, set: Name, enabled: bool = True) bool ¶
deprecated: ‘make_named_control’ was renamed to ‘create_named_control’.
- property max_num_controls_or_modifiers_per_name: int¶
[Read-Write] Upper limit on the number of controls or modifiers that will be created using the same name (which will get a numerical postfix). When this limit is reached a warning will be issued and the control or modifier won’t be created. This is to avoid problems if controls or modifiers are being created dynamically, and can generally be a “moderately large” number, depending on how many controls or modifiers you expect to create.
- Type:
(int32)
- set_all_body_modifier_gravity_multipliers(names: None, gravity_multiplier: float = 1.0) None ¶
deprecated: ‘set_all_body_modifier_gravity_multipliers’ was renamed to ‘set_body_modifiers_gravity_multiplier’.
- set_all_body_modifier_movement_type(names: None, movement_type: PhysicsMovementType = Ellipsis) None ¶
deprecated: ‘set_all_body_modifier_movement_type’ was renamed to ‘set_body_modifiers_movement_type’.
- set_all_body_modifiers_collision_type(names: None, collision_type: CollisionEnabled = Ellipsis) None ¶
deprecated: ‘set_all_body_modifiers_collision_type’ was renamed to ‘set_body_modifiers_collision_type’.
- set_all_body_modifiers_gravity_multiplier(names: None, gravity_multiplier: float = 1.0) None ¶
deprecated: ‘set_all_body_modifiers_gravity_multiplier’ was renamed to ‘set_body_modifiers_gravity_multiplier’.
- set_all_body_modifiers_movement_type(names: None, movement_type: PhysicsMovementType = Ellipsis) None ¶
deprecated: ‘set_all_body_modifiers_movement_type’ was renamed to ‘set_body_modifiers_movement_type’.
- set_all_body_modifiers_use_skeletal_animation(names: None, use_skeletal_animation: bool) None ¶
deprecated: ‘set_all_body_modifiers_use_skeletal_animation’ was renamed to ‘set_body_modifiers_use_skeletal_animation’.
- set_all_control_datas(names: None, control_data: PhysicsControlData, enable_control: bool = True) None ¶
deprecated: ‘set_all_control_datas’ was renamed to ‘set_control_datas’.
- set_all_control_targets(names: None, control_target: PhysicsControlTarget, enable_control: bool = True) None ¶
deprecated: ‘set_all_control_targets’ was renamed to ‘set_control_targets’.
- set_all_controls_enabled(names: None, enable: bool = True) None ¶
deprecated: ‘set_all_controls_enabled’ was renamed to ‘set_controls_enabled’.
- set_all_controls_in_set_use_skeletal_animation(set: Name, use_skeletal_animation: bool = True, skeletal_animation_velocity_multiplier: float = 1.0) None ¶
deprecated: ‘set_all_controls_in_set_use_skeletal_animation’ was renamed to ‘set_controls_in_set_use_skeletal_animation’.
- set_all_controls_use_skeletal_animation(names: None, use_skeletal_animation: bool = True, skeletal_animation_velocity_multiplier: float = 1.0) None ¶
deprecated: ‘set_all_controls_use_skeletal_animation’ was renamed to ‘set_controls_use_skeletal_animation’.
- set_body_modifier_collision_type(name, collision_type=CollisionEnabled.QUERY_AND_PHYSICS) bool ¶
Sets the collision type for a body modifier
- Parameters:
name (Name) – The name of the body modifier to access.
collision_type (CollisionEnabled) – Collision type to set on the body
- Returns:
true if the body modifier was found, false if not
- Return type:
- set_body_modifier_gravity_multiplier(name, gravity_multiplier=1.000000) bool ¶
Sets the gravity multiplier for a body modifier
- set_body_modifier_kinematic_target(name, kinematic_target_position, kinematic_target_orienation, make_kinematic) bool ¶
Sets the kinematic target transform for a body modifier.
- Parameters:
name (Name) – The name of the body modifier to access.
kinematic_target_position (Vector) – The position to use as the kinematic target of the associated body, if it is kinematic
kinematic_target_orienation (Rotator) –
make_kinematic (bool) – If set then the body will be made kinematic. If not set, then it won’t be changed.
- Returns:
true if the body modifier was found, false if not
- Return type:
- set_body_modifier_movement_type(name, movement_type=PhysicsMovementType.SIMULATED) bool ¶
Sets the movement type for a body modifier
- Parameters:
name (Name) – The name of the body modifier to access.
movement_type (PhysicsMovementType) – Whether to enable/disable simulation on the body
- Returns:
true if the body modifier was found, false if not
- Return type:
- set_body_modifier_use_skeletal_animation(name, use_skeletal_animation) bool ¶
Sets whether a body modifier should use skeletal animation for its kinematic targets
- Parameters:
- Returns:
true if the body modifier was found, false if not
- Return type:
- set_body_modifiers_collision_type(names, collision_type=CollisionEnabled.QUERY_AND_PHYSICS) None ¶
Sets the collision type for body modifiers
- Parameters:
names (Array[Name]) – The names of the body modifiers to access. Note that if you have these in a FPhysicsControlNameArray then it can be split.
collision_type (CollisionEnabled) – Collision type to set on the bodies
- set_body_modifiers_gravity_multiplier(names, gravity_multiplier=1.000000) None ¶
Sets the gravity multiplier for body modifiers
- set_body_modifiers_in_set_collision_type(set, collision_type=CollisionEnabled.QUERY_AND_PHYSICS) None ¶
Sets the collision type for body modifiers
- Parameters:
set (Name) – The set of body modifiers to modify. Standard sets will include “All” and things like “ArmLeft”, depending on how body modifiers have been created.
collision_type (CollisionEnabled) – Collision type to set on the bodies
- set_body_modifiers_in_set_gravity_multiplier(set, gravity_multiplier=1.000000) None ¶
Sets the gravity multiplier for body modifiers
- set_body_modifiers_in_set_movement_type(set, movement_type=PhysicsMovementType.SIMULATED) None ¶
Sets the movement type for body modifiers
- Parameters:
set (Name) – The set of body modifiers to modify. Standard sets will include “All” and things like “ArmLeft”, depending on how body modifiers have been created.
movement_type (PhysicsMovementType) – Whether to enable/disable simulation on the bodies
- set_body_modifiers_in_set_use_skeletal_animation(set, use_skeletal_animation) None ¶
Sets whether body modifiers should use skeletal animation for their kinematic targets
- Parameters:
set (Name) – The set of body modifiers to modify. Standard sets will include “All” and things like “ArmLeft”, depending on how body modifiers have been created.
use_skeletal_animation (bool) – Whether the kinematic target is specified in the frame of the skeletal animation, rather than world space. Only relevant if the body is part of a skeletal mesh.
- set_body_modifiers_movement_type(names, movement_type=PhysicsMovementType.SIMULATED) None ¶
Sets the movement type for body modifiers
- Parameters:
names (Array[Name]) – The names of the body modifiers to access. Note that if you have these in a FPhysicsControlNameArray then it can be split.
movement_type (PhysicsMovementType) – Whether to enable/disable simulation on the bodies
- set_body_modifiers_use_skeletal_animation(names, use_skeletal_animation) None ¶
Sets whether body modifiers should use skeletal animation for their kinematic targets
- Parameters:
names (Array[Name]) – The names of the body modifiers to access. Note that if you have these in a FPhysicsControlNameArray then it can be split.
use_skeletal_animation (bool) – Whether the kinematic target is specified in the frame of the skeletal animation, rather than world space. Only relevant if the body is part of a skeletal mesh.
- set_control_angular_data(name, strength=1.000000, damping_ratio=1.000000, extra_damping=0.000000, max_torque=0.000000, enable_control=True) bool ¶
Modifies an existing control’s angular data - i.e. the strengths etc of the control driving towards the target
- Parameters:
name (Name) – The name of the control to modify.
strength (float) – The strength used to drive angular motion
damping_ratio (float) – The amount of damping associated with the angular strength. 1 Results in critically damped motion
extra_damping (float) – The amount of additional angular damping
max_torque (float) – The maximum torque used to drive the angular motion. Zero indicates no limit.
enable_control (bool) – Enables the control if it is currently disabled
- Returns:
true if the control was found and modified, false if not
- Return type:
- set_control_data(name, control_data, enable_control=True) bool ¶
Modifies an existing control data - i.e. the strengths etc of the control driving towards the target
- Parameters:
name (Name) – The name of the control to modify.
control_data (PhysicsControlData) – The new control data
enable_control (bool) – Enables the control if it is currently disabled
- Returns:
true if the control was found and modified, false if not
- Return type:
- set_control_datas(names, control_data, enable_control=True) None ¶
Modifies existing control data - i.e. the strengths etc of the controls driving towards the targets
- Parameters:
names (Array[Name]) – The names of the controls to modify. Note that if you have these in a FPhysicsControlNameArray then it can be split.
control_data (PhysicsControlData) – The new control data
enable_control (bool) – Enables the control if it is currently disabled
- set_control_datas_in_set(set, control_data, enable_control=True) None ¶
Modifies existing control data - i.e. the strengths etc of the controls driving towards the targets
- Parameters:
set (Name) – The set of controls to modify. Standard sets will include “All”, “WorldSpace”, “ParentSpace” and things like “WorldSpace-ArmLeft”, depending on how controls have been created.
control_data (PhysicsControlData) – The new control data
enable_control (bool) – Enables the controls if currently disabled
- set_control_linear_data(name, strength=1.000000, damping_ratio=1.000000, extra_damping=0.000000, max_force=0.000000, enable_control=True) bool ¶
Modifies an existing control’s linear data - i.e. the strengths etc of the control driving towards the target
- Parameters:
name (Name) – The name of the control to modify.
strength (float) – The strength used to drive linear motion
damping_ratio (float) – The amount of damping associated with the linear strength. 1 Results in critically damped motion
extra_damping (float) – The amount of additional linear damping
max_force (float) – The maximum force used to drive the linear motion. Zero indicates no limit.
enable_control (bool) – Enables the control if it is currently disabled
- Returns:
true if the control was found and modified, false if not
- Return type:
- set_control_multiplier(name, control_multiplier, enable_control=True) bool ¶
Modifies an existing control data using the multipliers
- Parameters:
name (Name) – The name of the control to modify.
control_multiplier (PhysicsControlMultiplier) –
enable_control (bool) – Enables the control if it is currently disabled
- Returns:
true if the control was found and modified, false if not
- Return type:
- set_control_multipliers(names, control_multiplier, enable_control=True) None ¶
Modifies existing control data using the multipliers
- Parameters:
names (Array[Name]) – The names of the controls to modify. Note that if you have these in a FPhysicsControlNameArray then it can be split.
control_multiplier (PhysicsControlMultiplier) – The new control multiplier
enable_control (bool) – Enables the controls if currently disabled
- set_control_multipliers_in_set(set, control_multiplier, enable_control=True) None ¶
Modifies existing control data using the multipliers
- Parameters:
set (Name) – The set of controls to modify. Standard sets will include “All”, “WorldSpace”, “ParentSpace” and things like “WorldSpace-ArmLeft”, depending on how controls have been created.
control_multiplier (PhysicsControlMultiplier) – The new control multiplier
enable_control (bool) – Enables the controls if currently disabled
- set_control_point(name, position) bool ¶
Sets the point at which controls will “push” the child object.
- set_control_target(name, control_target, enable_control=True) bool ¶
Modifies an existing control target - i.e. what it is driving towards, relative to the parent object
- Parameters:
name (Name) – The name of the control to modify.
control_target (PhysicsControlTarget) – The new target for the control
enable_control (bool) – Enables the control if it is currently disabled
- Returns:
true if the control was found and modified, false if not
- Return type:
- set_control_target_orientation(name, orientation, angular_velocity_delta_time, enable_control=True, apply_control_point_to_target=False) bool ¶
Modifies an existing control target - i.e. what it is driving towards, relative to the parent object
- Parameters:
name (Name) – The name of the control to modify.
orientation (Rotator) – The new orientation target for the control
angular_velocity_delta_time (float) – If non-zero, the target angular velocity will be calculated using the current target position. If zero, the target velocity will be set to zero.
enable_control (bool) – Enables the control if it is currently disabled
apply_control_point_to_target (bool) – If true, then the target position/orientation is treated as a “virtual” object, where the system attempts to move the object to match the pose of this “virtual” object that has been placed at the target transform. Use this when you want to specify the target transform for the object as a whole. If false, then the target transform is used as is, and the system drives the control point towards this transform.
- Returns:
true if the control was found and modified, false if not
- Return type:
- set_control_target_poses(name, parent_position, parent_orientation, child_position, child_orientation, velocity_delta_time, enable_control=True) bool ¶
Calculates and sets an existing control target. This takes the “virtual” position/orientation of the parent and child and calculates the relative control. Note that this will set bApplyControlPointToTarget to true.
- Parameters:
name (Name) – The name of the control to modify.
parent_position (Vector) – The virtual/target parent position
parent_orientation (Rotator) – The virtual/target parent orientation
child_position (Vector) – The virtual/target child position
child_orientation (Rotator) – The virtual/target child orientation
velocity_delta_time (float) – If non-zero, the target velocity will be calculated using the current target position. If zero, the target velocity will be set to zero.
enable_control (bool) – Enables the control if it is currently disabled
- Returns:
Returns true if the control was found and modified, false if not
- Return type:
- set_control_target_position(name, position, velocity_delta_time, enable_control=True, apply_control_point_to_target=False) bool ¶
Modifies an existing control target - i.e. what it is driving towards, relative to the parent object
- Parameters:
name (Name) – The name of the control to modify.
position (Vector) – The new position target for the control
velocity_delta_time (float) – If non-zero, the target velocity will be calculated using the current target position. If zero, the target velocity will be set to zero.
enable_control (bool) – Enables the control if it is currently disabled
apply_control_point_to_target (bool) – If true, then the target position/orientation is treated as a “virtual” object, where the system attempts to move the object to match the pose of this “virtual” object that has been placed at the target transform. Use this when you want to specify the target transform for the object as a whole. If false, then the target transform is used as is, and the system drives the control point towards this transform.
- Returns:
true if the control was found and modified, false if not
- Return type:
- set_control_target_position_and_orientation(name, position, orientation, velocity_delta_time, enable_control=True, apply_control_point_to_target=False) bool ¶
Modifies an existing control target - i.e. what it is driving towards, relative to the parent object
- Parameters:
name (Name) – The name of the control to modify.
position (Vector) – The new position target for the control
orientation (Rotator) – The new orientation target for the control
velocity_delta_time (float) – If non-zero, the target velocity will be calculated using the current target position. If zero, the target velocity will be set to zero.
enable_control (bool) – Enables the control if it is currently disabled
apply_control_point_to_target (bool) – If true, then the target position/orientation is treated as a “virtual” object, where the system attempts to move the object to match the pose of this “virtual” object that has been placed at the target transform. Use this when you want to specify the target transform for the object as a whole. If false, then the target transform is used as is, and the system drives the control point towards this transform.
- Returns:
Returns true if the control was found and modified, false if not
- Return type:
- set_control_targets(names, control_target, enable_control=True) None ¶
Modifies existing control targets - i.e. what they are driving towards, relative to the parent objects
- Parameters:
names (Array[Name]) – The names of the controls to modify. Note that if you have these in a FPhysicsControlNameArray then it can be split.
control_target (PhysicsControlTarget) – The new target for the controls
enable_control (bool) – Enables the controls if currently disabled
- set_control_targets_in_set(set, control_target, enable_control=True) None ¶
Modifies existing control targets - i.e. what they are driving towards, relative to the parent objects
- Parameters:
set (Name) – The set of controls to modify. Standard sets will include “All”, “WorldSpace”, “ParentSpace” and things like “WorldSpace-ArmLeft”, depending on how controls have been created.
control_target (PhysicsControlTarget) – The new target for the controls
enable_control (bool) – Enables the controls if currently disabled
- set_control_use_skeletal_animation(name, use_skeletal_animation=True, skeletal_animation_velocity_multiplier=1.000000) bool ¶
Sets whether or not the control should use skeletal animation for the targets
- Parameters:
name (Name) – The name of the control to modify.
use_skeletal_animation (bool) – If true then the targets will be a combination of the skeletal animation (if there is any) and the control target that has been set
skeletal_animation_velocity_multiplier (float) – If skeletal animation is being used, then this determines the amount of velocity extracted from the animation that is used as targets for the controls
- Returns:
true if the control was found and modified, false if not
- Return type:
- set_controls_in_set_use_skeletal_animation(set, use_skeletal_animation=True, skeletal_animation_velocity_multiplier=1.000000) None ¶
Sets whether or not the controls should use skeletal animation for the targets
- Parameters:
set (Name) – The set of controls to modify. Standard sets will include “All”, “WorldSpace”, “ParentSpace” and things like “WorldSpace-ArmLeft”, depending on how controls have been created.
use_skeletal_animation (bool) – If true then the targets will be a combination of the skeletal animation (if there is any) and the control target that has been set
skeletal_animation_velocity_multiplier (float) – If skeletal animation is being used, then this determines the amount of velocity extracted from the animation that is used as targets for the controls
- set_controls_use_skeletal_animation(names, use_skeletal_animation=True, skeletal_animation_velocity_multiplier=1.000000) None ¶
Sets whether or not the controls should use skeletal animation for the targets
- Parameters:
names (Array[Name]) – The names of the controls to modify. Note that if you have these in a FPhysicsControlNameArray then it can be split.
use_skeletal_animation (bool) – If true then the targets will be a combination of the skeletal animation (if there is any) and the control target that has been set
skeletal_animation_velocity_multiplier (float) – If skeletal animation is being used, then this determines the amount of velocity extracted from the animation that is used as targets for the controls
- property show_debug_body_modifier_list: bool¶
[Read-Write] Display all the body modifiers and their basic properties when this component is selected
- Type:
(bool)
- property show_debug_control_list: bool¶
[Read-Write] Display all the controls and their basic properties when this component is selected
- Type:
(bool)
- property show_debug_visualization: bool¶
[Read-Write] Visualize the controls when this component is selected
- Type:
(bool)
- property teleport_distance_threshold: float¶
[Read-Write] If the component moves by more than this distance then it is treated as a teleport, which prevents velocities being used for a frame. It is also used as the threshold for teleporting when moving kinematic objects. Zero or negative disables.
- Type:
(float)
- property teleport_rotation_threshold: float¶
[Read-Write] If the component rotates by more than this angle (in degrees) then it is treated as a teleport, which prevents velocities being used for a frame. It is also used as the threshold for teleporting when moving kinematic objects. Zero or negative disables.
- Type:
(float)