A constraint which allows to connect one type of transform property (location, rotation, or scale) of the target object to the same or a different type of transform property in the owner object, within a given range of values (which might be different for each target and owner property). You can also switch between axes, and use the range values not as limits, but rather as “markers” to define a mapping between input (target) and output (owner) values.
Constraints are used to set up various relations between objects by affecting their position, rotation and scale. Can be used with the Object3D.constraints property.
target — constraint's target object.
See the base TargetConstraint class for common properties.
Which coordinate system to use. For example if you exported your scene through Verge3d for Blender/3ds Max, then this value should be 'Z_UP_RIGHT'
. More info in Verge3D Wiki. Default is 'Y_UP_RIGHT'
.
In Verge3D we use right-handed coordinate system with the Y axis pointing in the up direction, but Blender and 3ds Max uses right-handed coordinate system with Z axis pointing in the up direction (Verge3D Wiki). So, to correct the rotation for cameras and lights, set fixCameraLightRotation = true
. Default is false
.
A fromMax controls the upper bound independently for each axis (X, Y, and Z) of the input value range. Default is (0, 0, 0)
.
A fromMin controls the lower bound independently for each axis (X, Y, and Z) of the input value range. Default is (0, 0, 0)
.
The percentage of influence the constraint has on the object. Default is 1.0
(100%).
Used to check whether this or derived classes are transformation constraints. Default is true
.
The type of property to use as an input. Can be one of the 'POSITION'
, 'ROTATION'
, 'SCALE'
. Default is POSITION
.
The type of property to use as an output. Can be one of the 'POSITION'
, 'ROTATION'
, 'SCALE'
. Default is POSITION
.
An array of three elements - axis switches, they allow you to select which input axis will be mapped to the output X, Y and Z axes, respectively (by index). Each element in array can be one of the 'X'
, '-X'
, 'Y'
, '-Y'
, 'Z'
, '-Z'
. Default is ['X', 'Y', 'Z']
.
Specifies how the new transformation is combined with the existing transformation. Depends on mapTo:
'POSITION'
'ADD'
- The new values are added to the existing axis values.'REPLACE'
- The result of the constraint replaces the existing transformation.'ROTATION'
'ADD'
- The new values are added to the existing axis values.'AFTER'
- The new rotation is added after the existing rotation, as if it was applied to a child of the constraint owner.'BEFORE'
- The new rotation is added before the existing rotation, as if it was applied to a parent of the constraint owner.'REPLACE'
- The result of the constraint replaces the existing transformation.'SCALE'
'MULTIPLY'
- The new values are multiplied with the existing axis values.'REPLACE'
- The result of the constraint replaces the existing transformation.'REPLACE'
.
The space used to evaluate the owner of the constraint. Can be one of the v3d.ConstraintSpaceWorld
, v3d.ConstraintSpaceCustom
, v3d.ConstraintSpaceLocal
. Default is v3d.ConstraintSpaceWorld
.
The custom object whose space is used to evaluate the owner of the constraint. Works only when ownerSpace = v3d.ConstraintSpaceCustom
. Default is null
.
The space used to evaluate the target of the constraint. Can be one of the v3d.ConstraintSpaceWorld
, v3d.ConstraintSpaceCustom
, v3d.ConstraintSpaceLocal
. Default is v3d.ConstraintSpaceWorld
.
The custom object whose space is used to evaluate the target of the constraint. Works only when targetSpace = v3d.ConstraintSpaceCustom
. Default is null
.
Controls the upper bound independently for each axis (X, Y, and Z) of the output value range. Default is (0, 0, 0)
.
Controls the lower bound independently for each axis (X, Y, and Z) of the output value range. Default is (0, 0, 0)
.
The constraint's type. Equals to 'TransformationConstraint'
.
By default, fromMin and fromMax act as strict boundaries for an input value, any value outside these limits will be "clipped" to the nearest boundary. When useMotionExtrapolate is enabled, the behavior changes - they become "markers" instead of strict limits. This allows for a proportional (linear) mapping between the input value and its corresponding output value. Default is false
.
See the base TargetConstraint class for common methods.
For more info on how to obtain the source code of this module see this page.