Go to: Synopsis. Return value. Related.
Flags. Python
examples.
bindSkin( [objects] , [byClosestPoint=boolean], [byPartition=boolean], [colorJoints=boolean], [delete=boolean], [doNotDescend=boolean], [enable=boolean], [name=string], [partition=string], [toAll=boolean], [toSelectedBones=boolean],
[toSkeleton=boolean],
[unbind=boolean], [unbindKeepHistory=boolean],
[unlock=boolean])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
bindSkin is undoable, queryable, and editable.
This command binds the currently selected objects to the currently
selected skeletons. Shapes which can be bound are: meshes, nurbs
curves, nurbs surfaces, lattices, subdivision surfaces, and API
shapes. Multiple shapes and multiple skeletons can be bound at once
by selecting them or specifying them on the command line. Selection
order is not important.The skin is bound using the so-called
"rigid" bind, in which the components are rigidly attached to the
closest bone in the skeleton. Flexors can later be added to the
skeleton to smooth out the skinning around joints.The skin(s) can
be bound either to the entire skeleton hierarchy of the selected
joint(s), or to only the selected joints. The entire hierarchy is
the default. The -tsb/-toSelectedBones flag allows binding to only
the selected bones.This command can also be used to detach the skin
from the skeleton. Detaching the skin is useful in a variety of
situations, such as: inserting additional bones, deleting bones,
changing the bind position of the skeleton or skin, or simply
getting rid of the skinning nodes altogether. The options to use
when detaching the skin depend on how much of the skinning info you
want to get rid of. Namely: (1) -delete or -unbind: remove all
skinning nodes, (2) -unbindKeepHistory: remove the skinning sets,
but keep the weights, (3) -disable: disable the skinning but keep
the skinning sets and the weights.
In query mode, return type is based on queried flag.
blendShape, boneLattice, copyFlexor, copySkinWeights, dagPose, flexor,
skinCluster, skinPercent, wire,
wrinkle
byClosestPoint, byPartition, colorJoints, delete, doNotDescend, enable, name, partition, toAll,
toSelectedBones, toSkeleton, unbind,
unbindKeepHistory, unlock
Long name (short name) |
Argument types |
Properties |
toSkeleton(ts) |
boolean |
|
|
objects will be bound to the selected skeletons. The
toSkeleton, toAll and toSelectedBones flags are mutually exclusive.
The toSkeleton flag is the default. |
|
toSelectedBones(tsb) |
boolean |
|
|
objects will be bound to the selected bones only. |
|
toAll(ta) |
boolean |
|
|
objects will be bound to the entire selected skeletons. Even
bones with zero influence will be bound, whereas the toSkeleton
will only bind non-zero influences. |
|
byClosestPoint(bcp) |
boolean |
|
|
bind each point in the object to the segment closest to the
point. The byClosestPoint and byPartition flags are mutually
exclusive. The byClosestPoint flag is the default. |
|
byPartition(bp) |
boolean |
|
|
bind each group in the partition to the segment closest to the
group's centroid. A partition must be specified with the
-p/-partition flag |
|
partition(p) |
string |
|
|
Specify a partition to bind by. This is only valid when used
with the -bp/-byPartition flag. |
|
unbind(ub) |
boolean |
|
|
unbind the selected objects. They will no longer move with the
skeleton. Any bindSkin history that is no longer used will be
deleted. |
|
unbindKeepHistory(ubk) |
boolean |
|
|
unbind the selected objects. They will no longer move with the
skeleton. However, existing weights on the skin will be kept for
use the next time the skin is bound. This option is appropriate if
you want to modify the skeleton without losing the weighting
information on the skin. |
|
unlock(ul) |
boolean |
|
|
unlock the selected objects. Since bindSkin will no longer give
normal results if bound objects are moved away from the skeleton,
bindSkin locks translate, rotate and scale. This command unlocks
the selected objects translate, rotate and scale. |
|
delete(d) |
boolean |
|
|
Detach the skin on the selected skeletons and remove all bind-
related construction history. |
|
enable(en) |
boolean |
|
|
Enable or disable a bind that has been disabled on the selected
skeletons. To enable the bind on selected bones only, select the
bones and use the -tsb flag with the -en flag. This flag is used
when you want to temporarily disable the bind without losing the
set information or the weight information of the skinning, for
example if you want to modify the bindPose. |
|
doNotDescend(dnd) |
boolean |
|
|
Do not descend to shapes that are parented below the selected
object(s). Bind only the selected objects. |
|
colorJoints(cj) |
boolean |
|
|
In bind mode, this flag assigns colors to the joints based on
the colors assigned to the joint's skin set. In delete and unlock
mode, this flag removes the colors from joints that are no longer
bound as skin. In disable and unbindKeepHistory mode, this flag
does nothing. |
|
name(n) |
string |
|
|
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
# Create a joint chain and a polygonal plane.
cmds.select(d=True)
cmds.joint(p=(-3.0, 0.0,-12.0))
cmds.joint(p=(-3.0, 0.0, -5.0))
cmds.joint(p=(1.0, 0.0, 5.5))
cmds.joint(p=(6.0, 0.0, 10.0))
cmds.polyPlane(w=20.0,h=20.0,sx=25,sy=25)
cmds.select('joint1',add=True)
# to bind the selected objects to the selected skeleton
#
cmds.bindSkin()
# to bind nurbsSphere1 and pPlane1 to the skeleton containing joint2
#
cmds.bindSkin( 'nurbsSphere1', 'joint2', 'pPlane1' )
# to bind the selected partition to the selected skeleton
#
cmds.bindSkin( bp=True )
# to bind the selected objects to the selected bones only,
# not the entire skeleton
#
cmds.bindSkin( tsb=True )
# to detach the selected objects and delete any unused
# bindSkin history
#
cmds.bindSkin( unbind=True )
# to detach pPlane1 and delete any unused
# bindSkin history
#
cmds.bindSkin( 'pPlane1', unbind=True )
# to detach the selected objects and keep the history
#
cmds.bindSkin( unbindKeepHistory=True )
# To disable the skin on the selected skeletons. This gives
# the effect of detaching the skin without removing the
# bindSkin groups on the object. You can then modify the joint
# positioning, and enable the binding, keeping your original
# groups.
#
cmds.bindSkin( enable=False )
# to enable skin on a skeleton which has been disabled
#
cmds.bindSkin( enable=True )