pymel.core.general.xformConstraint

xformConstraint(*args, **kwargs)

This command allows you to change the transform constraint used by the transform tools during component transforms. In query mode, return type is based on queried flag.

Flags:

Long Name / Short Name Argument Types Properties
alongNormal / n int ../../../_images/query.gif ../../../_images/edit.gif
  When set the transform constraint will first be applied along the vertex normals of the components being transformed. When queried, returns the current state of this option.
live / l bool ../../../_images/query.gif
  Query-only flag that can be used to check whether the current live surface will be used as a transform constraint.
type / t unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Set the type of transform constraint to use. When queried, returns the current transform constraint as a string. none - no constraintsurface - constrain components to their surfaceedge - constrain components to surface edgesFlag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.xformConstraint

Example:

::

import pymel.core as pm

# Return the current transform constraint pm.xformConstraint(query=True, type=True) # Result: u’none’ #

# Constrain moving components to the surface pm.symmetricModelling(type=”surface”)