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 componentasset_user_data_editor_only
(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_control_profile_asset
(PhysicsControlProfileAsset): [Read-Write] Public property dataphysics_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 visualizationwarn_about_invalid_names
(bool): [Read-Write] Warn if an an invalid control or body modifier name is used. This can happen quite easily since they’re only referenced through names, which are likely auto-generated. However, it may happen for valid reasons, in which case you’ll want to disable this.
- 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, body_modifier_data) 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”
body_modifier_data (PhysicsControlModifierData) – The initial properties of the modifier
- Return type:
- create_body_modifiers_from_limb_bones(limb_bones, body_modifier_data) -> (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
body_modifier_data (PhysicsControlModifierData) – The initial properties of the modifier
- 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, body_modifier_data) 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”
body_modifier_data (PhysicsControlModifierData) – The initial properties of the modifier
- Return type:
- create_control(parent_mesh_component, parent_bone_name, child_mesh_component, child_bone_name, control_data, control_target, set, name_prefix='') 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
set (Name) – Which set to include the control in (optional). Note that it automatically gets added to the set “All”
name_prefix (str) – Optional string that is prefixed to the control that is created.
- Returns:
The name of the new control
- Return type:
- create_controls_and_body_modifiers_from_control_profile_asset(skeletal_mesh_component, world_component, world_bone_name) None ¶
This uses the control profile asset (that should have already been set) to create controls and body modifiers It is also possible to specify a mesh component to use for the “world” object - so that the world controls can be made to work in the space of another object (or a bone if that is a skeletal mesh component)
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
world_component (MeshComponent) –
world_bone_name (Name) –
- create_controls_and_body_modifiers_from_limb_bones(skeletal_mesh_component, limb_setup_data, world_space_control_data, parent_space_control_data, body_modifier_data, world_component=None, world_bone_name="None") -> (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”. It is also possible to specify a mesh component to use for the “world” object - so that the world controls can be made to work in the space of another object (or a bone if that is a skeletal mesh component)
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
limb_setup_data (Array[PhysicsControlLimbSetupData]) –
world_space_control_data (PhysicsControlData) –
parent_space_control_data (PhysicsControlData) –
body_modifier_data (PhysicsControlModifierData) –
world_component (MeshComponent) –
world_bone_name (Name) –
- 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, world_component=None, world_bone_name="None", name_prefix="") -> (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
world_component (MeshComponent) – Optional component to use as the parent object for any “world-space” controls that are created. Will be ignored if the controls being created are not world-space.
world_bone_name (Name) – Additional bone name to identify the world object if the WorldComponent is actually a skeletal mesh component.
name_prefix (str) – Optional string that is prefixed to each control that is created.
- 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 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, set) 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
set (Name) – Which set to include the control in (optional). Note that it automatically gets added to the set “All”
- 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 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 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, set) 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
set (Name) – Which set to include the control in (optional). Note that it automatically gets added to the set “All”
- Returns:
An array of the controls that have been created
- Return type:
- create_named_body_modifier(name, mesh_component, bone_name, set, body_modifier_data) 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”
body_modifier_data (PhysicsControlModifierData) – The initial properties of the modifier
- Return type:
- create_named_control(name, parent_mesh_component, parent_bone_name, child_mesh_component, child_bone_name, control_data, control_target, set) 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
set (Name) – Which set to include the control in (optional). Note that it automatically gets added to the set “All”
- 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_exists(name) bool ¶
Indicates if a body modifier with the name exists (doesn’t produce a warning if it doesn’t)
- 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_cached_bone_angular_velocities(skeletal_mesh_component, bone_names) Array[Vector] ¶
Gets the angular velocities of the requested bones that will be used as targets (in world space). Target velocities for bones that are not found will be set to zero. Note that these targets will have been calculated and cached at the start of the Physics Control Component, so if using the built in tick, may be too old to be useful. If you manually update the component then you can access these target velocities prior to applying your own targets.
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
- Return type:
- get_cached_bone_angular_velocity(skeletal_mesh_component, bone_name) Vector ¶
Gets the angular velocity of the requested bone that will be used as a target (in world space). Target velocities for bones that are not found will be set to zero. Note that these targets will have been calculated and cached at the start of the Physics Control Component update, so if using the built in tick, may be too old to be useful. If you manually update the component then you can access these target velocities prior to applying your own targets.
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
bone_name (Name) –
- Return type:
- get_cached_bone_orientation(skeletal_mesh_component, bone_name) Rotator ¶
Gets the orientation of the requested bone that will be used as a target (in world space). Targets for bones that are not found will be set to Identity. Note that these targets will have been calculated and cached at the start of the Physics Control Component, so if using the built in tick, may be too old to be useful. If you manually update the component then you can access these target transforms prior to applying your own targets.
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
bone_name (Name) –
- Return type:
- get_cached_bone_orientations(skeletal_mesh_component, bone_names) Array[Rotator] ¶
Gets the orientations of the requested bones that will be used as targets (in world space). Targets for bones that are not found will be set to identity. Note that these targets will have been calculated and cached at the start of the Physics Control Component, so if using the built in tick, may be too old to be useful. If you manually update the component then you can access these target transforms prior to applying your own targets.
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
- Return type:
- get_cached_bone_position(skeletal_mesh_component, bone_name) Vector ¶
Gets the position of the requested bone that will be used as a target (in world space). Targets for bones that are not found will be set to zero. Note that these targets will have been calculated and cached at the start of the Physics Control Component, so if using the built in tick, may be too old to be useful. If you manually update the component then you can access these target transforms prior to applying your own targets.
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
bone_name (Name) –
- Return type:
- get_cached_bone_positions(skeletal_mesh_component, bone_names) Array[Vector] ¶
Gets the positions of the requested bones that will be used as targets (in world space). Targets for bones that are not found will be set to zero. Note that these targets will have been calculated and cached at the start of the Physics Control Component, so if using the built in tick, may be too old to be useful. If you manually update the component then you can access these target transforms prior to applying your own targets.
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
- Return type:
- get_cached_bone_transform(skeletal_mesh_component, bone_name) Transform ¶
Gets the transforms of the requested bone that will be used as a target (in world space). Targets for bones that are not found will be set to Identity. Note that these targets will have been calculated and cached at the start of the Physics Control Component, so if using the built in tick, may be too old to be useful. If you manually update the component then you can access these target transforms prior to applying your own targets.
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
bone_name (Name) –
- Return type:
- get_cached_bone_transforms(skeletal_mesh_component, bone_names) Array[Transform] ¶
Gets the transforms of the requested bones that will be used as targets (in world space). Targets for bones that are not found will be set to Identity. Note that these targets will have been calculated and cached at the start of the Physics Control Component, so if using the built in tick, may be too old to be useful. If you manually update the component then you can access these target transforms prior to applying your own targets.
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
- Return type:
- get_cached_bone_velocities(skeletal_mesh_component, bone_names) Array[Vector] ¶
Gets the linear velocities of the requested bones that will be used as targets (in world space). Target velocities for bones that are not found will be set to zero. Note that these targets will have been calculated and cached at the start of the Physics Control Component, so if using the built in tick, may be too old to be useful. If you manually update the component then you can access these target velocities prior to applying your own targets.
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
- Return type:
- get_cached_bone_velocity(skeletal_mesh_component, bone_name) Vector ¶
Gets the linear velocity of the requested bone that will be used as a target (in world space). Target velocities for bones that are not found will be set to zero. Note that these targets will have been calculated and cached at the start of the Physics Control Component, so if using the built in tick, may be too old to be useful. If you manually update the component then you can access these target velocities prior to applying your own targets.
- Parameters:
skeletal_mesh_component (SkeletalMeshComponent) –
bone_name (Name) –
- Return type:
- 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_exists(name) bool ¶
Indicates if a control with the name exists (doesn’t produce a warning if it doesn’t)
- 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)
- invoke_control_profile(profile_name) None ¶
Looks up the profile which should exist in the registered control profile asset, and invokes it.
- Parameters:
profile_name (Name) –
- make_body_modifier(mesh_component: MeshComponent, bone_name: Name, set: Name, body_modifier_data: PhysicsControlModifierData) Name ¶
deprecated: ‘make_body_modifier’ was renamed to ‘create_body_modifier’.
- make_body_modifiers_from_limb_bones(limb_bones: None, body_modifier_data: PhysicsControlModifierData) 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, body_modifier_data: PhysicsControlModifierData) 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, set: Name, name_prefix: str = '') Name ¶
deprecated: ‘make_control’ was renamed to ‘create_control’.
- make_controls_from_limb_bones(limb_bones: None, control_type: PhysicsControlType, control_data: PhysicsControlData, world_component: MeshComponent = Ellipsis, world_bone_name: Name = 'None', name_prefix: str = '') 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, set: Name) 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, set: Name) 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, body_modifier_data: PhysicsControlModifierData) 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, set: Name) 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)
- property physics_control_profile_asset: PhysicsControlProfileAsset¶
[Read-Write] Public property data
- Type:
- reset_body_modifier_to_cached_bone_transform(name, behavior=ResetToCachedTargetBehavior.RESET_IMMEDIATELY) bool ¶
This flags the body associated with the modifier to set (using teleport) its position and velocity to the cached animation target. This will only affect skeletal mesh component bodies.
- Parameters:
name (Name) – The name of the body modifier to use to identify the body to reset.
behavior (ResetToCachedTargetBehavior) – When the reset should happen.
- Returns:
true if the body modifier is found (even if no cached target is found), and false otherwise.
- Return type:
- reset_body_modifiers_in_set_to_cached_bone_transforms(set_name, behavior=ResetToCachedTargetBehavior.RESET_IMMEDIATELY) None ¶
Calls ResetBodyModifierToCachedTarget for each of the body modifiers in the set
- Parameters:
set_name (Name) –
behavior (ResetToCachedTargetBehavior) –
- reset_body_modifiers_to_cached_bone_transforms(names, behavior=ResetToCachedTargetBehavior.RESET_IMMEDIATELY) None ¶
Calls ResetBodyModifierToCachedTarget for each of the body modifiers
- Parameters:
behavior (ResetToCachedTargetBehavior) –
- 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) 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_data(name, modifier_data) bool ¶
Modifies an existing Body Modifier Data
- Parameters:
name (Name) – The name of the modifier to update.
modifier_data (PhysicsControlModifierData) – The new data
- Returns:
true if the modifier was found and modified, false if not
- Return type:
- set_body_modifier_datas(names, modifier_data) None ¶
Modifies existing Body Modifier Data
- Parameters:
names (Array[Name]) – The names of the modifiers to update. Note that if you have these in a FPhysicsControlNameArray then it can be split.
modifier_data (PhysicsControlModifierData) – The new data
- set_body_modifier_datas_in_set(set, modifier_data) None ¶
Modifies existing Body Modifier Data
- Parameters:
set (Name) – The set of modifiers to update. Standard sets will include “All” and things like “ArmLeft”, depending on how body modifiers have been created.
modifier_data (PhysicsControlModifierData) – The new data
- 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_physics_blend_weight(name, physics_blend_weight=1.000000) bool ¶
Sets the physics blend weight for a body modifier
- set_body_modifier_sparse_data(name, modifier_data) bool ¶
Modifies an existing Body Modifier Data
- Parameters:
name (Name) – The name of the modifier to update.
modifier_data (PhysicsControlModifierSparseData) – The new data
- Returns:
true if the modifier was found and modified, false if not
- Return type:
- set_body_modifier_sparse_datas(names, modifier_data) None ¶
Modifies existing Body Modifier Data
- Parameters:
names (Array[Name]) – The names of the modifiers to update. Note that if you have these in a FPhysicsControlNameArray then it can be split.
modifier_data (PhysicsControlModifierSparseData) – The new data
- set_body_modifier_sparse_datas_in_set(set, modifier_data) None ¶
Modifies existing Body Modifier Data
- Parameters:
set (Name) – The set of modifiers to update. Standard sets will include “All” and things like “ArmLeft”, depending on how body modifiers have been created.
modifier_data (PhysicsControlModifierSparseData) – The new data
- set_body_modifier_update_kinematic_from_simulation(name, update_kinematic_from_simulation) bool ¶
Sets whether a body modifier should update kinematics from the simulation results
- Parameters:
name (Name) – The name of the body modifier to access.
update_kinematic_from_simulation (bool) – Whether the body should be updated from the simulation when it is kinematic, or whether it should track the kinematic target directly. This will be most likely useful when using async physics, in order to make kinematic parts behave the same as dynamic ones.
- 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_physics_blend_weight(set, physics_blend_weight=1.000000) None ¶
Sets the physics blend weight for body modifiers
- Parameters:
- set_body_modifiers_in_set_update_kinematic_from_simulation(set, update_kinematic_from_simulation) None ¶
Sets whether body modifiers should update kinematics from the simulation results
- 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.
update_kinematic_from_simulation (bool) – Whether the body should be updated from the simulation when it is kinematic, or whether it should track the kinematic target directly. This will be most likely useful when using async physics, in order to make kinematic parts behave the same as dynamic ones.
- 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_physics_blend_weight(names, physics_blend_weight=1.000000) None ¶
Sets the physics blend weight for body modifiers
- set_body_modifiers_update_kinematic_from_simulation(names, update_kinematic_from_simulation) None ¶
Sets whether body modifiers should update kinematics from the simulation results
- 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.
update_kinematic_from_simulation (bool) – Whether the body should be updated from the simulation when it is kinematic, or whether it should track the kinematic target directly. This will be most likely useful when using async physics, in order to make kinematic parts behave the same as dynamic ones.
- 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_cached_bone_data(skeletal_mesh_component, bone_name, tm, velocity, angular_velocity) bool ¶
This allows the caller to override the target that will have been calculated and cached at the start of the Physics Control Component update. This is unlikely to be useful when using the built in tick, but if you are manually updating the component then you may wish to call this after UpdateTargetCaches but before UpdateControls.
- 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) 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 update.
control_data (PhysicsControlData) – The new control data
- Returns:
true if the control was found and modified, false if not
- Return type:
- set_control_datas(names, control_data) 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 update. Note that if you have these in a FPhysicsControlNameArray then it can be split.
control_data (PhysicsControlData) – The new control data
- set_control_datas_in_set(set, control_data) 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 update. 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
- 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_parent(name, parent_mesh_component, parent_bone_name) bool ¶
Updates the parent object part of a control. Note that this won’t change the name of the control (which may subsequently be misleading), or any set it is included in, etc.
- Parameters:
name (Name) –
parent_mesh_component (MeshComponent) –
parent_bone_name (Name) –
- Return type:
- set_control_parents(names, parent_mesh_component, parent_bone_name) None ¶
Updates the parent object part of controls. Note that this won’t change the name of the controls (which may subsequently be misleading), or any set they are included in, etc.
- Parameters:
parent_mesh_component (MeshComponent) –
parent_bone_name (Name) –
- set_control_parents_in_set(set, parent_mesh_component, parent_bone_name) None ¶
Set Control Parents in Set
- Parameters:
set (Name) –
parent_mesh_component (MeshComponent) –
parent_bone_name (Name) –
- set_control_point(name, position) bool ¶
Sets the point at which controls will “push” the child object.
- set_control_sparse_data(name, control_data) 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 update.
control_data (PhysicsControlSparseData) – The new control data
- Returns:
true if the control was found and modified, false if not
- Return type:
- set_control_sparse_datas(names, control_data) 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 update. Note that if you have these in a FPhysicsControlNameArray then it can be split.
control_data (PhysicsControlSparseData) – The new control data
- set_control_sparse_datas_in_set(set, control_data) 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 update. Standard sets will include “All”, “WorldSpace”, “ParentSpace” and things like “WorldSpace-ArmLeft”, depending on how controls have been created.
control_data (PhysicsControlSparseData) – The new control data
- set_control_sparse_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 (PhysicsControlSparseMultiplier) –
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_sparse_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 (PhysicsControlSparseMultiplier) – The new control multiplier
enable_control (bool) – Enables the controls if currently disabled
- set_control_sparse_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 (PhysicsControlSparseMultiplier) – The new control multiplier
enable_control (bool) – Enables the controls if currently disabled
- 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_orientations(names, orientation, angular_velocity_delta_time, enable_control=True, apply_control_point_to_target=False) None ¶
Calls SetControlTargetOrientation for each of the control names
- set_control_target_orientations_from_array(names, orientations, velocity_delta_time, enable_control=True, apply_control_point_to_target=False) bool ¶
Calls SetControlTargetPosition for each element of the control names and positions. These array should match in size.
- set_control_target_orientations_in_set(set_name, orientation, angular_velocity_delta_time, enable_control=True, apply_control_point_to_target=False) None ¶
Calls SetControlTargetOrientation for each of the controls in the set
- 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_target_positions(names, position, velocity_delta_time, enable_control=True, apply_control_point_to_target=False) None ¶
Calls SetControlTargetPosition for each of the control names
- set_control_target_positions_and_orientations(names, position, orientation, velocity_delta_time, enable_control=True, apply_control_point_to_target=False) None ¶
Calls SetControlTargetPositionAndOrientation for each of the control names
- set_control_target_positions_and_orientations_from_array(names, positions, orientations, velocity_delta_time, enable_control=True, apply_control_point_to_target=False) bool ¶
Calls SetControlTargetPositionAndOrientation for each element of the control names, positions and orientations. These array should match in size.
- set_control_target_positions_and_orientations_in_set(set_name, position, orientation, velocity_delta_time, enable_control=True, apply_control_point_to_target=False) None ¶
Calls SetControlTargetPositionAndOrientation for each control in the set
- set_control_target_positions_from_array(names, positions, velocity_delta_time, enable_control=True, apply_control_point_to_target=False) bool ¶
Calls SetControlTargetPosition for each element of the control names and positions. These array should match in size.
- set_control_target_positions_in_set(set_name, position, velocity_delta_time, enable_control=True, apply_control_point_to_target=False) None ¶
Calls SetControlTargetPosition for each of the controls in the set
- 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)
- update_controls(delta_time) None ¶
Allows manual ticking so that your code can run in between updating the target caches and updating the controls and body modifiers. This allows you to read the targets coming from animation and use those values to create your own controls etc.
To use this function, you should disable ticking of the Physics Control Component, and ensure that the relevant Skeletal Mesh Component (if being used) has ticked, using a tick prerequisite. Then explicitly call (in order) UpdateTargetCaches and UpdateControls as you process your tick.
- Parameters:
delta_time (float) –
- update_target_caches(delta_time) None ¶
Allows manual ticking so that your code can run in between updating the target caches and updating the controls. This allows you to read the targets coming from animation and use those values to create your own controls etc.
To use this function, you should disable ticking of the Physics Control Component, and ensure that the relevant Skeletal Mesh Component (if being used) has ticked, using a tick prerequisite. Then explicitly call (in order) UpdateTargetCaches and UpdateControls as you process your tick.
- Parameters:
delta_time (float) –
- property velocity_prediction_time: float¶
[Read-Write] The time used when “predicting” the target position/orientation. Zero will disable the visualization of this.
- Type:
(float)
- property visualization_size_scale: float¶
[Read-Write] Size of the gizmos etc used during visualization
- Type:
(float)
- property warn_about_invalid_names: bool¶
[Read-Write] Warn if an an invalid control or body modifier name is used. This can happen quite easily since they’re only referenced through names, which are likely auto-generated. However, it may happen for valid reasons, in which case you’ll want to disable this.
- Type:
(bool)