Go to: Synopsis. Return value. Related. Flags. Python examples.
scaleConstraint(
[target...] [object]
, [maintainOffset=boolean], [name=string], [offset=[float, float, float]], [remove=boolean], [skip=string], [targetList=boolean], [weight=float], [weightAliasList=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
scaleConstraint is undoable, queryable, and editable.
Constrain an object's scale to the scale of the target object or
to the average scale of a number of targets.
A scaleConstraint takes as input one or more "target" DAG
transform nodes to which to scale the single "constraint
object" DAG transform node. The scaleConstraint scales the
constrained object at the weighted geometric mean of the
world space target scale factors.
string[] | Name of the created constraint node |
In query mode, return type is based on queried flag.
aimConstraint, geometryConstraint, normalConstraint, orientConstraint, parentConstraint, pointConstraint, poleVectorConstraint, tangentConstraint
maintainOffset, name, offset, remove, skip, targetList, weight, weightAliasList
Long name (short name) |
Argument types |
Properties |
name(n)
|
string
|
|
|
Sets the name of the constraint node to the specified
name. Default name is constrainedObjectName_constraintType
|
|
weight(w)
|
float
|
|
|
Sets the weight value for the specified target(s).
If not given at creation time, the default value of 1.0 is used.
|
|
remove(rm)
|
boolean
|
|
|
removes the listed target(s) from the constraint.
|
|
targetList(tl)
|
boolean
|
|
|
Return the list of target objects.
|
|
weightAliasList(wal)
|
boolean
|
|
|
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
|
|
offset(o)
|
[float, float, float]
|
|
|
Sets or queries the value of the offset. Default is 1,1,1.
|
|
maintainOffset(mo)
|
boolean
|
|
|
The offset necessary to preserve the constrained
object's initial scale will be calculated and used as the
offset.
|
|
skip(sk)
|
string
|
|
|
Specify the axis to be skipped. Valid values are "x", "y", "z" and "none". During creation, "none" is the default. This flag is multi-use.
|
|
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.
|
import maya.cmds as cmds
# Scale cube1 at the scale of cone1.
cmds.scaleConstraint( 'cone1', 'cube1' )
# Uses the average of the scale of cone1 and surf2.
cmds.scaleConstraint( 'cone1', 'surf2', 'cube2', w=.1 )
# Sets the weight for cone1's effect on cube2 to 10.
cmds.scaleConstraint( 'cone1', 'cube2', e=True, w=10.0 )
# Removes surf2 from cube2's scaleConstraint
cmds.scaleConstraint( 'surf2', 'cube2', e=True, rm=True )
# Adds surf3 to cube2's scaleConstraint with the default weight
cmds.scaleConstraint( 'surf3', 'cube2' )
# Constrain the x and z scale of sph2 to sph1
cmds.scaleConstraint( 'sph1', 'sph2', skip="y" )