Python for Constraints

Use vrConstraintService, as well as vrdConstraintNode, when working with constraints via Python.

We have added an example file, SimpleConstraint.vpb, that demonstrates how to use the following Python contraint functions. To access the example file, select File > Open Examples... > SimpleConstraint.vpb.

Python Constraints Video Captions: In VRED 2020, we have implemented the ability to create constraints using the scripting language Python. For working with the constraints, please use the Python documentation. Here you will find all important information on how to create and use the constraints. The simple constraint example shows different constraints and their effects.


The following objects and functions are supported:

Objects

These are the supported objects:

vrConstraintService

These are the vrConstraintService functions:

vrdConstraintNode

vrdConstraintNode (base class) is used for constraining the position or orientation of one object to another. Try imposing limits on objects and automating animated processes.

These are the vrdConstraintNode functions:

vrdPositionConstraintNode

vrdPositionConstraintNode makes an object move and follow the position of another object or the average position of several. Use this for matching the motion of objects with that of another.

Try using a position constraint to animate an object to follow a series of others.

These are the specific vrdPositionConstraintNode functions:

vrdOrientationConstraintNode

vrdOrientationConstraintNode is for an orient constraint. It matches the orientation of an object to one or more other objects. Use it for making several objects orient, simultaneously. For example, make a group of objects, such as the steering wheel, tires, and headlights, rotate in the same direction, at the same time. Animate the steering wheel, then constrain the tires and headlights to the animated steering wheel.

vrdAimConstraintNode

vrdAimConstraintNode is for an aim constraint, which constrain an object’s orientation and aims the object at other objects. Use it to aim a camera or light at an object or group of objects.

These are the specific vrdAimConstraintNode functions: