Module Constraint :: Class Constraints
[frames] | no frames]

Class Constraints

The Constraints object

This object provides access to sequence of constraints for a particular object. They can be accessed from Object.constraints. or PoseBone.constraints.

Instance Methods
Constraint
__getitem__(index)
This operator returns one of the constraints in the stack.
int
__len__()
Returns the number of constraints in the constraint stack.
Constraint
append(type)
Appends a new constraint to the end of the constraint stack.
 
remove(con)
Remove a constraint from this objects constraint sequence.
None
moveUp(con)
Moves the constraint up in the object's constraint stack.
None
moveDown(con)
Moves the constraint down in the object's constraint stack.
Method Details

__getitem__(index)
(Indexing operator)

 

This operator returns one of the constraints in the stack.

Parameters:
  • index (int)
Returns: Constraint
an Constraint object
Raises:
  • KeyError - index was out of range

__len__()
(Length operator)

 

Returns the number of constraints in the constraint stack.

Returns: int
number of Constraints

append(type)

 

Appends a new constraint to the end of the constraint stack.

Parameters:
  • type (int constant) - a constant specifying the type of constraint to create. as from Type
Returns: Constraint
the new Constraint

remove(con)

 

Remove a constraint from this objects constraint sequence.

Parameters:
  • con (Constraint) - a constraint from this sequence to remove.

Note: Accessing attributes of the constraint after it is removed will throw an exception.

moveUp(con)

 

Moves the constraint up in the object's constraint stack.

Parameters:
  • con (Constraint) - a constraint from this sequence to remove.
Returns: None

moveDown(con)

 

Moves the constraint down in the object's constraint stack.

Parameters:
  • con (Constraint) - a constraint from this sequence to remove.
Returns: None