unreal.IKRigController

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

Bases: Object

A singleton (per-asset) class used to make modifications to a UIKRigDefinition asset

All modifications to an IKRigDefinition must go through this controller.

Editors can subscribe to the callbacks on this controller to be notified of changes that require reinitialization of a running IK Rig processor instance. The API here is split into public/scripting sections which are accessible from Blueprint/Python and sections that are only relevant to editors in C++.

C++ Source:

  • Plugin: IKRig

  • Module: IKRigEditor

  • File: IKRigController.h

add_bone_setting(bone_name, solver_index) bool

Add settings to the given Bone/Solver. Does nothing if Bone already has settings in this Solver.

Parameters:
  • bone_name (Name) –

  • solver_index (int32) –

Return type:

bool

add_new_goal(goal_name, bone_name) Name

Add a new Goal associated with the given Bone. GoalName must be unique. Bones can have multiple Goals (rare).

Parameters:
  • goal_name (Name) –

  • bone_name (Name) –

Return type:

Name

add_retarget_chain(chain_name, start_bone_name, end_bone_name, goal_name) Name

Add a new chain with the given Chain and Bone names. Returns newly created chain name (uniquified). Note: only the ChainName is required here, all else can be set later.

Parameters:
  • chain_name (Name) –

  • start_bone_name (Name) –

  • end_bone_name (Name) –

  • goal_name (Name) –

Return type:

Name

add_solver(solver_class) int32

Add a new solver of the given type to the bottom of the stack. Returns the stack index.

Parameters:

solver_class (type(Class)) –

Return type:

int32

apply_auto_fbik() bool

Analyse the skeleton to see if it matches a known template and automatically generates a full body IK setup Returns true if a matching skeletal template was found and the FBIK setup for it was applied.

Return type:

bool

apply_auto_generated_retarget_definition() bool

Analyse the skeleton to see if it matches a known template and automatically generates all retarget chains and sets the retarget root Returns true if a matching skeletal template was found and the retarget definition for it was applied.

Return type:

bool

connect_goal_to_solver(goal_name, solver_index) bool

Connect the given Goal to the given Solver. This creates an “Effector” with settings specific to this Solver.

Parameters:
  • goal_name (Name) –

  • solver_index (int32) –

Return type:

bool

disconnect_goal_from_solver(goal_to_remove, solver_index) bool

Disconnect the given Goal from the given Solver. This removes the Effector that associates the Goal with the Solver.

Parameters:
  • goal_to_remove (Name) –

  • solver_index (int32) –

Return type:

bool

get_all_goals() Array[IKRigEffectorGoal]

Get access to the list of Goals.

Return type:

Array[IKRigEffectorGoal]

get_bone_excluded(bone_name) bool

Returns true if the given Bone is excluded, false otherwise.

Parameters:

bone_name (Name) –

Return type:

bool

get_bone_for_goal(goal_name) Name

The the Bone associated with the given Goal.

Parameters:

goal_name (Name) –

Return type:

Name

get_bone_settings(bone_name, solver_index) Object

Get the generic (Solver-specific) Bone settings UObject for this Bone in the given Solver.

Parameters:
  • bone_name (Name) –

  • solver_index (int32) –

Return type:

Object

classmethod get_controller(ik_rig_definition) IKRigController

Use this to get the controller for the given IKRig

Parameters:

ik_rig_definition (IKRigDefinition) –

Return type:

IKRigController

get_end_bone(solver_index) Name

Get the name of the end bone on a given solver. (not all solvers require extra end bones, checks CanSetEndBone() first)

Parameters:

solver_index (int32) –

Return type:

Name

get_goal(goal_name) IKRigEffectorGoal

Get read-write access to the Goal with the given name.

Parameters:

goal_name (Name) –

Return type:

IKRigEffectorGoal

get_goal_name_for_bone(bone_name) Name

Get the Goal associated with the given Bone (may be NAME_None)

Parameters:

bone_name (Name) –

Return type:

Name

get_goal_settings_for_solver(goal_name, solver_index) Object

Get the UObject for the settings associated with the given Goal in the given Solver. Solvers can define their own per-Goal settings depending on their needs. These are termed “Effectors”.

Parameters:
  • goal_name (Name) –

  • solver_index (int32) –

Return type:

Object

get_index_of_solver(solver) int32

Get access to the given solver.

Parameters:

solver (IKRigSolver) –

Return type:

int32

get_num_solvers() int32

Get the number of solvers in the stack.

Return type:

int32

get_ref_pose_transform_of_bone(bone_name) Transform

Get the global-space retarget pose transform of the given Bone.

Parameters:

bone_name (Name) –

Return type:

Transform

get_retarget_chain_end_bone(chain_name) Name

Get the Start Bone name for the given Chain.

Parameters:

chain_name (Name) –

Return type:

Name

get_retarget_chain_goal(chain_name) Name

Get the Goal name for the given Chain.

Parameters:

chain_name (Name) –

Return type:

Name

get_retarget_chain_start_bone(chain_name) Name

Get the End Bone name for the given Chain.

Parameters:

chain_name (Name) –

Return type:

Name

get_retarget_chains() Array[BoneChain]

Get read-only access to the list of Chains.

Return type:

Array[BoneChain]

get_retarget_root() Name

Get the name of the Root Bone of the retargeting (can only be one).

Return type:

Name

get_root_bone(solver_index) Name

Get the name of the root bone on a given solver. (not all solvers support root bones, checks CanSetRootBone() first)

Parameters:

solver_index (int32) –

Return type:

Name

get_skeletal_mesh() SkeletalMesh

Get the skeletal mesh this asset is initialized with

Return type:

SkeletalMesh

get_solver_at_index(index) IKRigSolver

Get access to the given solver.

Parameters:

index (int32) –

Return type:

IKRigSolver

get_solver_enabled(solver_index) bool

Get enabled status of the given solver.

Parameters:

solver_index (int32) –

Return type:

bool

is_goal_connected_to_any_solver(goal_name) bool

Returns true if the given Goal is connected to ANY solver. False otherwise.

Parameters:

goal_name (Name) –

Return type:

bool

is_goal_connected_to_solver(goal_name, solver_index) bool

Returns true if the given Goal is connected to the given Solver. False otherwise.

Parameters:
  • goal_name (Name) –

  • solver_index (int32) –

Return type:

bool

is_skeletal_mesh_compatible(skeletal_mesh_to_check) bool

Returns true if the provided skeletal mesh could be used with this IK Rig.

Parameters:

skeletal_mesh_to_check (SkeletalMesh) –

Return type:

bool

move_solver_in_stack(solver_to_move_index, target_solver_index) bool

Move the solver at the given index to the target index.

Parameters:
  • solver_to_move_index (int32) –

  • target_solver_index (int32) –

Return type:

bool

remove_bone_setting(bone_name, solver_index) bool

Remove settings for the given Bone/Solver. Does nothing if Bone doesn’t have setting in this Solver.

Parameters:
  • bone_name (Name) –

  • solver_index (int32) –

Return type:

bool

remove_goal(goal_name) bool

Remove the Goal by name.

Parameters:

goal_name (Name) –

Return type:

bool

remove_retarget_chain(chain_name) bool

Remove a Chain with the given name. Returns true if a Chain was removed.

Parameters:

chain_name (Name) –

Return type:

bool

remove_solver(solver_index) bool

Remove the solver at the given stack index.

Parameters:

solver_index (int32) –

Return type:

bool

rename_goal(old_name, potential_new_name) Name

Rename a Goal. Returns new name, which may be different after being sanitized. Returns NAME_None if this fails.

Parameters:
  • old_name (Name) –

  • potential_new_name (Name) –

Return type:

Name

rename_retarget_chain(chain_name, new_chain_name) Name

Renamed the given Chain. Returns the new name (same as old if unsuccessful).

Parameters:
  • chain_name (Name) –

  • new_chain_name (Name) –

Return type:

Name

set_bone_excluded(bone_name, exclude) bool

Include/exclude a bone from all the solvers. All bones are included by default.

Parameters:
  • bone_name (Name) –

  • exclude (bool) –

Return type:

bool

set_end_bone(end_bone_name, solver_index) bool

Set the end bone on a given solver. (not all solvers require extra end bones, checks CanSetEndBone() first)

Parameters:
  • end_bone_name (Name) –

  • solver_index (int32) –

Return type:

bool

set_goal_bone(goal_name, new_bone_name) bool

The the Bone that the given Goal should be parented to / associated with.

Parameters:
  • goal_name (Name) –

  • new_bone_name (Name) –

Return type:

bool

set_retarget_chain_end_bone(chain_name, end_bone_name) bool

Set the End Bone for the given Chain. Returns true if operation was successful.

Parameters:
  • chain_name (Name) –

  • end_bone_name (Name) –

Return type:

bool

set_retarget_chain_goal(chain_name, goal_name) bool

Set the Goal for the given Chain. Returns true if operation was successful.

Parameters:
  • chain_name (Name) –

  • goal_name (Name) –

Return type:

bool

set_retarget_chain_start_bone(chain_name, start_bone_name) bool

Set the Start Bone for the given Chain. Returns true if operation was successful.

Parameters:
  • chain_name (Name) –

  • start_bone_name (Name) –

Return type:

bool

set_retarget_root(root_bone_name) bool

Set the Root Bone of the retargeting (can only be one).

Parameters:

root_bone_name (Name) –

Return type:

bool

set_root_bone(root_bone_name, solver_index) bool

Set the root bone on a given solver. (not all solvers support root bones, checks CanSetRootBone() first)

Parameters:
  • root_bone_name (Name) –

  • solver_index (int32) –

Return type:

bool

set_skeletal_mesh(skeletal_mesh) bool

Sets the preview mesh to use. Loads the hierarchy into the asset’s IKRigSkeleton. Returns true if the mesh was able to be set. False if it was incompatible for any reason.

Parameters:

skeletal_mesh (SkeletalMesh) –

Return type:

bool

set_solver_enabled(solver_index, is_enabled) bool

Set enabled/disabled status of the given solver.

Parameters:
  • solver_index (int32) –

  • is_enabled (bool) –

Return type:

bool