Module Constraint
[frames | no frames]

Module Constraint

The Blender.Constraint submodule

New:

This module provides access to the Constraint Data in Blender.

Examples:
 from Blender import *

 ob = Object.Get('Cube')
 if len(ob.constraints) > 0:
   const = ob.constraints[0]
   if const.type == Constraint.Type.FLOOR:
     offs = const[Constrint.Settings.OFFSET]
Or to print all the constraints attached to each bone in a pose:
 from Blender import *
 
 ob = Object.Get('Armature')
 pose = ob.getPose()
 for bonename in pose.bones.keys():
   bone = pose.bones[bonename]
   for const in bone.constraints:
     print bone.name,'=>',const

Classes
Constraint This object provides access to a constraint for a particular object accessed from Constraints.
Constraints This object provides access to sequence of constraints for a particular object.

Variable Summary
readonly dictionary Settings: Constant dict used for changing constraint settings.
readonly dictionary Type: Constant Constraint dict used by Constraints.append() and for comparison with Constraint.type.

Variable Details

Settings

Constant dict used for changing constraint settings.
  • Used for all constraints
    • TARGET (Object)
    • BONE (string): name of Bone subtarget (for armature targets) (Note: not used by Stretch To (STRETCHTO))
  • Used by IK Solver (IKSOLVER) constraint:
    • TOLERANCE (float): clamped to [0.0001:1.0]
    • ITERATIONS (int): clamped to [1,10000]
    • CHAINLEN (int): clamped to [0,255]
    • POSWEIGHT (float): clamped to [0.01,1.0]
    • ROTWEIGHT (float): clamped to [0.01,1.0]
    • ROTATE (bool)
    • USETIP (bool)
  • Used by Action (ACTION) constraint:
    • ACTION (Action Object)
    • LOCAL (bool)
    • START (int): clamped to [1,maxframe]
    • END (int): clamped to [1,maxframe]
    • MIN (float): clamped to [-180.0,180.0]
    • MAX (float): clamped to [-180.0,180.0]
    • KEYON (int): values are XROT, YROT, ZROT
  • Used by Track To (TRACKTO) constraint:
    • TRACK (int): values are TRACKX, TRACKY, TRACKZ, TRACKNEGX, TRACKNEGY, TRACKNEGZ
    • UP (int): values are UPX, UPY, UPZ
  • Used by Stretch To (STRETCHTO) constraint:
    • RESTLENGTH (float): clamped to [0.0:100.0]
    • VOLVARIATION (float): clamped to [0.0:100.0]
    • VOLUMEMODE (int): values are VOLUMEXZ, VOLUMEX, VOLUMEZ, VOLUMENONE
    • PLANE (int): values are PLANEX, PLANEZ
  • Used by Follow Path (FOLLOWPATH) constraint:
    • FOLLOW (bool)
    • OFFSET (float): clamped to [-maxframe:maxframe]
    • FORWARD (int): values are TRACKX, TRACKY, TRACKZ, TRACKNEGX, TRACKNEGY, TRACKNEGZ
    • UP (int): values are UPX, UPY, UPZ
  • Used by Lock Track (FOLLOWPATH) constraint:
    • TRACK (int): values are TRACKX, TRACKY, TRACKZ, TRACKNEGX, TRACKNEGY, TRACKNEGZ
    • LOCK (int): values are LOCKX, LOCKY, LOCKZ
  • Used by Floor (FLOOR) constraint:
    • MINMAX (int): values are MINX, MINY, MINZ, MAXX, MAXY, MAXZ
    • OFFSET (float): clamped to [-100.0,100.0]
    • STICKY (bool)
  • Used by Copy Location (COPYLOC) and Copy Rotation (COPYROT)
    • COPY (bitfield): any combination of COPYX, COPYY and COPYZ
    • LOCAL (bool): Only for constraints which Armature targets.
  • Used by Copy Size (COPYSIZE) constraint:
    • COPY (bitfield): any combination of COPYX, COPYY and COPYZ
Type:
readonly dictionary

Type

Constant Constraint dict used by Constraints.append() and for comparison with Constraint.type. Values are TRACKTO, IKSOLVER, FOLLOWPATH, COPYROT, COPYLOC, COPYSIZE, ACTION, LOCKTRACK, STRETCHTO, FLOOR, NULL
Type:
readonly dictionary

Generated by Epydoc 2.1 on Thu Jul 13 16:50:05 2006 http://epydoc.sf.net