Go to: Synopsis. Return value. Flags. Python examples.

Synopsis

transformLimits( [object] , [enableRotationX=[boolean, boolean]], [enableRotationY=[boolean, boolean]], [enableRotationZ=[boolean, boolean]], [enableScaleX=[boolean, boolean]], [enableScaleY=[boolean, boolean]], [enableScaleZ=[boolean, boolean]], [enableTranslationX=[boolean, boolean]], [enableTranslationY=[boolean, boolean]], [enableTranslationZ=[boolean, boolean]], [remove=boolean], [rotationX=[angle, angle]], [rotationY=[angle, angle]], [rotationZ=[angle, angle]], [scaleX=[float, float]], [scaleY=[float, float]], [scaleZ=[float, float]], [translationX=[linear, linear]], [translationY=[linear, linear]], [translationZ=[linear, linear]])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

transformLimits is undoable, queryable, and editable.

The transformLimits command allows us to set, edit, or query the limits of the transformation that can be applied to objects.

We can also turn any limits off which may have been previously set. When an object is first created, all the transformation limits are off by default.

Transformation limits allow us to control how much an object can be transformed. This is most useful for joints, although it can be used any place we would like to limit the movement of an object.

Default values are:
( -1, 1) for translation, ( -1, 1) for scaling, and (-45,45) for rotation.

Return value

None

In query mode, return type is based on queried flag.

Flags

enableRotationX, enableRotationY, enableRotationZ, enableScaleX, enableScaleY, enableScaleZ, enableTranslationX, enableTranslationY, enableTranslationZ, remove, rotationX, rotationY, rotationZ, scaleX, scaleY, scaleZ, translationX, translationY, translationZ
Long name (short name) Argument types Properties
enableRotationX(erx) [boolean, boolean] query
enable/disable the lower and upper x-rotation limits
When queried, it returns boolean boolean
enableRotationY(ery) [boolean, boolean] query
enable/disable the lower and upper y-rotation limits
When queried, it returns boolean boolean
enableRotationZ(erz) [boolean, boolean] query
enable/disable the lower and upper z-rotation limits
When queried, it returns boolean boolean
enableScaleX(esx) [boolean, boolean] query
enable/disable the lower and upper x-scale limits
When queried, it returns boolean boolean
enableScaleY(esy) [boolean, boolean] query
enable/disable the lower and upper y-scale limits
When queried, it returns boolean boolean
enableScaleZ(esz) [boolean, boolean] query
enable/disable the lower and upper z-scale limits
When queried, it returns boolean boolean
enableTranslationX(etx) [boolean, boolean] query
enable/disable the ower and upper x-translation limits
When queried, it returns boolean boolean
enableTranslationY(ety) [boolean, boolean] query
enable/disable the lower and upper y-translation limits
When queried, it returns boolean boolean
enableTranslationZ(etz) [boolean, boolean] query
enable/disable the lower and upper z-translation limits
When queried, it returns boolean boolean
remove(rm) boolean create
turn all the limits off and reset them to their default values
rotationX(rx) [angle, angle] query
set the lower and upper x-rotation limits
When queried, it returns angle angle
rotationY(ry) [angle, angle] query
set the lower and upper y-rotation limits
When queried, it returns angle angle
rotationZ(rz) [angle, angle] query
set the lower and upper z-rotation limits
When queried, it returns angle angle
scaleX(sx) [float, float] query
set the lower and upper x-scale limits
When queried, it returns float float
scaleY(sy) [float, float] query
set the lower and upper y-scale limits
When queried, it returns float float
scaleZ(sz) [float, float] query
set the lower and upper z-scale limits
When queried, it returns float float
translationX(tx) [linear, linear] query
set the lower and upper x-translation limits
When queried, it returns linear linear
translationY(ty) [linear, linear] query
set the lower and upper y-translation limits
When queried, it returns linear linear
translationZ(tz) [linear, linear] query
set the lower and upper z-translation limits
When queried, it returns linear linear

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Create an object, e.g.
cmds.cone()

# 1. To set the limits for the translation of the cone to within
# a unit volume centered at the origin
cmds.transformLimits( tx=(-1, 1), ty=(-1, 1), tz=(-1, 1) )

# 2. To disable the lower limits
cmds.transformLimits( etx=(False, True), ety=(False, True), etz=(False, True ) )