Module Constraint :: Class Constraints

Class Constraints

source code

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.
source code
int
__len__()
Returns the number of constraints in the constraint stack.
source code
Constraint
append(type)
Appends a new constraint to the end of the constraint stack.
source code
 
remove(con)
Remove a constraint from this objects constraint sequence.
source code
None
moveUp(con)
Moves the constraint up in the object's constraint stack.
source code
None
moveDown(con)
Moves the constraint down in the object's constraint stack.
source code
Method Details

__getitem__(index)
(Indexing operator)

source code 
This operator returns one of the constraints in the stack.
Returns: Constraint
an Constraint object
Raises:
  • KeyError - index was out of range

__len__()
(Length operator)

source code 
Returns the number of constraints in the constraint stack.
Returns: int
number of Constraints

append(type)

source code 
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)

source code 
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)

source code 
Moves the constraint up in the object's constraint stack.
Parameters:
  • con (Constraint) - a constraint from this sequence to remove.
Returns: None

moveDown(con)

source code 
Moves the constraint down in the object's constraint stack.
Parameters:
  • con (Constraint) - a constraint from this sequence to remove.
Returns: None