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. In query mode, return type is based on queried flag.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
enableRotationX (erx) | bool, bool | ||
|
|||
enableRotationY (ery) | bool, bool | ||
|
|||
enableRotationZ (erz) | bool, bool | ||
|
|||
enableScaleX (esx) | bool, bool | ||
|
|||
enableScaleY (esy) | bool, bool | ||
|
|||
enableScaleZ (esz) | bool, bool | ||
|
|||
enableTranslationX (etx) | bool, bool | ||
|
|||
enableTranslationY (ety) | bool, bool | ||
|
|||
enableTranslationZ (etz) | bool, bool | ||
|
|||
remove (rm) | bool | ||
|
|||
rotationX (rx) | float, float | ||
|
|||
rotationY (ry) | float, float | ||
|
|||
rotationZ (rz) | float, float | ||
|
|||
scaleX (sx) | float, float | ||
|
|||
scaleY (sy) | float, float | ||
|
|||
scaleZ (sz) | float, float | ||
|
|||
translationX (tx) | float, float | ||
|
|||
translationY (ty) | float, float | ||
|
|||
translationZ (tz) | float, float | ||
|
Derived from mel command maya.cmds.transformLimits
Example:
import pymel.core as pm
# Create an object, e.g.
pm.cone()
# Result: [nt.Transform(u'nurbsCone1'), nt.MakeNurbCone(u'makeNurbCone1')] #
# 1. To set the limits for the translation of the cone to within
# a unit volume centered at the origin
pm.transformLimits( tx=(-1, 1), ty=(-1, 1), tz=(-1, 1) )
# 2. To disable the lower limits
pm.transformLimits( etx=(False, True), ety=(False, True), etz=(False, True ) )