O'Reilly logo

Blender 2.49 Scripting by Michel J. Anders

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming with constraints

Blender has many constraints that you may apply to an object. Some of them are quite like drivers, in the sense that they do not restrict a motion of an object but copy some parameters such as rotation or location. From a developer's point of view, each Blender Object has a constraints attribute that is a sequence of constraint objects. This sequence can be appended and items from this sequence can be deleted. It is also possible to alter the order of the items.

Method

Action

Example

append(type)

Appends a new constraint to an object and returns the constraint

ob.constraints.append( Constraint.Type.TRACKTO)

remove(constraint)

Removes a constraint from an object

ob.constraints.remove( ob.constraints[0]) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required