pymel.core.general.transformLimits

transformLimits(*args, **kwargs)

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.

Flags:
Long name (short name) Argument Types Properties
enableRotationX (erx) bool, bool ../../../_images/query.gif
 
enable/disable the lower and upper x-rotation limitsWhen queried, it returns boolean boolean
enableRotationY (ery) bool, bool ../../../_images/query.gif
 
enable/disable the lower and upper y-rotation limitsWhen queried, it returns boolean boolean
enableRotationZ (erz) bool, bool ../../../_images/query.gif
 
enable/disable the lower and upper z-rotation limitsWhen queried, it returns boolean boolean
enableScaleX (esx) bool, bool ../../../_images/query.gif
 
enable/disable the lower and upper x-scale limitsWhen queried, it returns boolean boolean
enableScaleY (esy) bool, bool ../../../_images/query.gif
 
enable/disable the lower and upper y-scale limitsWhen queried, it returns boolean boolean
enableScaleZ (esz) bool, bool ../../../_images/query.gif
 

enable/disable the lower and upper z-scale limitsWhen queried, it returns boolean booleanFlag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

enableTranslationX (etx) bool, bool ../../../_images/query.gif
 
enable/disable the ower and upper x-translation limitsWhen queried, it returns boolean boolean
enableTranslationY (ety) bool, bool ../../../_images/query.gif
 
enable/disable the lower and upper y-translation limitsWhen queried, it returns boolean boolean
enableTranslationZ (etz) bool, bool ../../../_images/query.gif
 
enable/disable the lower and upper z-translation limitsWhen queried, it returns boolean boolean
remove (rm) bool ../../../_images/create.gif
 
turn all the limits off and reset them to their default values
rotationX (rx) float, float ../../../_images/query.gif
 
set the lower and upper x-rotation limitsWhen queried, it returns angle angle
rotationY (ry) float, float ../../../_images/query.gif
 
set the lower and upper y-rotation limitsWhen queried, it returns angle angle
rotationZ (rz) float, float ../../../_images/query.gif
 
set the lower and upper z-rotation limitsWhen queried, it returns angle angle
scaleX (sx) float, float ../../../_images/query.gif
 
set the lower and upper x-scale limitsWhen queried, it returns float float
scaleY (sy) float, float ../../../_images/query.gif
 
set the lower and upper y-scale limitsWhen queried, it returns float float
scaleZ (sz) float, float ../../../_images/query.gif
 
set the lower and upper z-scale limitsWhen queried, it returns float float
translationX (tx) float, float ../../../_images/query.gif
 
set the lower and upper x-translation limitsWhen queried, it returns linear linear
translationY (ty) float, float ../../../_images/query.gif
 
set the lower and upper y-translation limitsWhen queried, it returns linear linear
translationZ (tz) float, float ../../../_images/query.gif
 
set the lower and upper z-translation limitsWhen queried, it returns linear linear

Derived from mel command maya.cmds.transformLimits

Example:

import pymel.core as pm

import maya.cmds as cmds

# 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 ) )

Previous topic

pymel.core.general.transformCompare

Next topic

pymel.core.general.ungroup

Core

Core Modules

Other Modules

This Page