Constraint Operators

bpy.ops.constraint.add_target()

Add a target to the constraint

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

File:

startup/bl_operators/constraint.py:26

bpy.ops.constraint.apply(*, constraint='', owner='OBJECT', report=False)

Apply constraint and remove from the stack

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

  • report (bool) – Report, Create a notification after the operation (optional)

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.childof_clear_inverse(*, constraint='', owner='OBJECT')

Clear inverse correction for Child Of constraint

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.childof_set_inverse(*, constraint='', owner='OBJECT')

Set inverse correction for Child Of constraint

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.copy(*, constraint='', owner='OBJECT', report=False)

Duplicate constraint at the same position in the stack

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

  • report (bool) – Report, Create a notification after the operation (optional)

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.copy_to_selected(*, constraint='', owner='OBJECT')

Copy constraint to other selected objects/bones

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.delete(*, constraint='', owner='OBJECT', report=False)

Remove constraint from constraint stack

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

  • report (bool) – Report, Create a notification after the operation (optional)

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.disable_keep_transform()

Set the influence of this constraint to zero while trying to maintain the object’s transformation. Other active constraints can still influence the final transformation

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

File:

startup/bl_operators/constraint.py:86

bpy.ops.constraint.followpath_path_animate(*, constraint='', owner='OBJECT', frame_start=1, length=100)

Add default animation for path used by constraint if it isn’t animated already

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

  • frame_start (int) – Start Frame, First frame of path animation (in [-1048574, 1048574], optional)

  • length (int) – Length, Number of frames that path animation should take (in [0, 1048574], optional)

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.limitdistance_reset(*, constraint='', owner='OBJECT')

Reset limiting distance for Limit Distance Constraint

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.move_down(*, constraint='', owner='OBJECT')

Move constraint down in constraint stack

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.move_to_index(*, constraint='', owner='OBJECT', index=0)

Change the constraint’s position in the list so it evaluates after the set number of others

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

  • index (int) – Index, The index to move the constraint to (in [0, inf], optional)

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.move_up(*, constraint='', owner='OBJECT')

Move constraint up in constraint stack

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.normalize_target_weights()

Normalize weights of all target bones

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

File:

startup/bl_operators/constraint.py:61

bpy.ops.constraint.objectsolver_clear_inverse(*, constraint='', owner='OBJECT')

Clear inverse correction for Object Solver constraint

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.objectsolver_set_inverse(*, constraint='', owner='OBJECT')

Set inverse correction for Object Solver constraint

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

bpy.ops.constraint.remove_target(*, index=0)

Remove the target from the constraint

Parameters:

index (int) – index, (in [-inf, inf], optional)

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]

File:

startup/bl_operators/constraint.py:44

bpy.ops.constraint.stretchto_reset(*, constraint='', owner='OBJECT')

Reset original length of bone for Stretch To Constraint

Parameters:
  • constraint (str) – Constraint, Name of the constraint to edit (optional, never None)

  • owner (Literal['OBJECT', 'BONE']) –

    Owner, The owner of this constraint (optional)

    • OBJECT Object – Edit a constraint on the active object.

    • BONE Bone – Edit a constraint on the active bone.

Returns:

Result of the operator call.

Return type:

set[Literal[Operator Return Items]]