pymel.core.animation.poleVectorConstraint

poleVectorConstraint(*args, **kwargs)

Constrains the poleVector of an ikRPsolve handle to point at a target object or at the average position of a number of targets. An poleVectorConstraint takes as input one or more “target” DAG transform nodes at which to aim pole vector for an IK handle using the rotate plane solver. The pole vector is adjust such that the in weighted average of the world space position target objects lies is the “rotate plane” of the handle.

Maya Bug Fix:
  • when queried, angle offsets would be returned in radians, not current angle unit
Modifications:
  • added new syntax for querying the weight of a target object, by passing the constraint first:

    aimConstraint( 'pCube1_aimConstraint1', q=1, weight ='pSphere1' )
    aimConstraint( 'pCube1_aimConstraint1', q=1, weight =['pSphere1', 'pCylinder1'] )
    aimConstraint( 'pCube1_aimConstraint1', q=1, weight =[] )
    
Flags:
Long name (short name) Argument Types Properties
layer (l) unicode ../../../_images/create.gif ../../../_images/edit.gif
 

Specify the name of the animation layer where the constraint should be added.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

name (n) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets the name of the constraint node to the specified name. Default name is constrainedObjectName_constraintType
remove (rm) bool ../../../_images/edit.gif
 
removes the listed target(s) from the constraint.
targetList (tl) bool ../../../_images/query.gif
 
Return the list of target objects.
weight (w) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets the weight value for the specified target(s). If not given at creation time, the default value of 1.0 is used.
weightAliasList (wal) bool ../../../_images/query.gif
 

Returns the names of the attributes that control the weight of the target objects. Aliases are returned in the same order as the targets are returned by the targetList flag

Derived from mel command maya.cmds.poleVectorConstraint

Example:

import pymel.core as pm

import maya.cmds as cmds

# aims the pole vector of handle1 at cone1.
pm.poleVectorConstraint( 'cone1', 'handle1' )

# uses the average of the position of cone1 and surf2.
pm.poleVectorConstraint( 'cone1', 'surf2', 'handle2', w=.1 )

# sets the weight for cone1's effect on handle2's poleVector to 10.
pm.poleVectorConstraint( 'cone1', 'handle2', e=True, w=10. )

# removes surf2 from handle2's poleVectorConstraint.
pm.poleVectorConstraint( 'surf2', 'handle2', e=True, rm=True )

# adds surf3 to handle2's poleVectorConstraint with the default weight.
pm.poleVectorConstraint( 'surf3', 'handle2' )

Previous topic

pymel.core.animation.pointOnPolyConstraint

Next topic

pymel.core.animation.pose

Core

Core Modules

Other Modules

This Page