unreal.ConstraintsScriptingLibrary

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

Bases: BlueprintFunctionLibrary

This is a set of helper functions to access various parts of the Sequencer and Control Rig API via Python and Blueprints.

C++ Source:

  • Module: Constraints

  • File: ConstraintsScripting.h

classmethod add_constraint(world, parent_handle, child_handle, constraint, maintain_offset) bool

Add Constraint to the system using the incoming parent and child handles with the specified type.

Parameters:
Returns:

return If constraint added correctly

Return type:

bool

classmethod create_from_type(world, type) TickableTransformConstraint

Create Constraint based on the specified type.

Parameters:
Returns:

return The constraint object

Return type:

TickableTransformConstraint

classmethod create_transformable_component_handle(world, scene_component, socket_name) TransformableComponentHandle

Create the transformable handle that deals with getting and setting transforms on this scene component

Parameters:
  • world (World) –

  • scene_component (SceneComponent) – World to create the constraint

  • socket_name (Name) – Optional name of the socket to get the transform

Returns:

returns the handle for this scene component

Return type:

TransformableComponentHandle

classmethod create_transformable_handle(world, object, attachment_name='None') TransformableHandle

Create the transformable handle that deals with getting and setting transforms on this object

Parameters:
  • world (World) –

  • object (Object) – World to create the constraint

  • attachment_name (Name) – Optional name of the attachment to get the transform. Not that this can represent a scene component’s socket name or a control rig control for example.

Returns:

returns the handle for this scene component

Return type:

TransformableHandle

classmethod get_constraints_array(world) Array[TickableConstraint]

Get a copy of the constraints in the current world

Parameters:

world (World) – World we are in

Returns:

Copy of the constraints in the level

Return type:

Array[TickableConstraint]

classmethod get_manager(world) ConstraintsManager

Get the manager of the constraints. This object contains delegates to listen to for when constraints are added,deleted, and is also the outer used when creating custom transformable handles, for example this is used to create control rig transformable handles Note this function will create the mananager and it’s actor if one doesn’t exist.

Parameters:

world (World) –

Returns:

Returns the mananger

Return type:

ConstraintsManager

classmethod remove_constraint(world, index) bool

Remove constraint at specified index

Parameters:
  • world (World) – World to remove the constraint

  • index (int32) – Index to remove from

Returns:

return If constraint removed correctly

Return type:

bool

classmethod remove_this_constraint(world, tickable_constraint) bool

Remove specified constraint

Parameters:
  • world (World) – World to remove the constraint

  • tickable_constraint (TickableConstraint) – Constraint to remove

Returns:

return If constraint removed correctly

Return type:

bool