pymel.core.animation.bindSkin

bindSkin(*args, **kwargs)

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.

Flags:
Long name (short name) Argument Types Properties
byClosestPoint (bcp) bool ../../../_images/create.gif
 

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) bool ../../../_images/create.gif
 
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
colorJoints (cj) bool ../../../_images/create.gif
 

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.

delete (d) bool ../../../_images/create.gif
 
Detach the skin on the selected skeletons and remove all bind- related construction history.
doNotDescend (dnd) bool ../../../_images/create.gif
 
Do not descend to shapes that are parented below the selected object(s). Bind only the selected objects.
enable (en) bool ../../../_images/create.gif
 

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.

name (n) unicode ../../../_images/create.gif
 
This flag is obsolete.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.
partition (p) unicode ../../../_images/create.gif
 
Specify a partition to bind by. This is only valid when used with the -bp/-byPartition flag.
toAll (ta) bool ../../../_images/create.gif
 
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.
toSelectedBones (tsb) bool ../../../_images/create.gif
 
objects will be bound to the selected bones only.
toSkeleton (ts) bool ../../../_images/create.gif
 
objects will be bound to the selected skeletons. The toSkeleton, toAll and toSelectedBones flags are mutually exclusive. The toSkeleton flag is the default.
unbind (ub) bool ../../../_images/create.gif
 
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) bool ../../../_images/create.gif
 

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) bool ../../../_images/create.gif
 

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.

Derived from mel command maya.cmds.bindSkin

Example:

import pymel.core as pm

import maya.cmds as cmds

# Create a joint chain and a polygonal plane.
pm.select(d=True)
pm.joint(p=(-3.0, 0.0,-12.0))
# Result: nt.Joint(u'joint1') #
pm.joint(p=(-3.0, 0.0, -5.0))
# Result: nt.Joint(u'joint2') #
pm.joint(p=(1.0, 0.0, 5.5))
# Result: nt.Joint(u'joint3') #
pm.joint(p=(6.0, 0.0, 10.0))
# Result: nt.Joint(u'joint4') #
pm.polyPlane(w=20.0,h=20.0,sx=25,sy=25)
# Result: [nt.Transform(u'pPlane1'), nt.PolyPlane(u'polyPlane1')] #

pm.select('joint1',add=True)

# to bind the selected objects to the selected skeleton
#
pm.bindSkin()

# to bind nurbsSphere1 and pPlane1 to the skeleton containing joint2
#
pm.bindSkin( 'nurbsSphere1', 'joint2', 'pPlane1' )

# to bind the selected partition to the selected skeleton
#
pm.bindSkin( bp=True )

# to bind the selected objects to the selected bones only,
# not the entire skeleton
#
pm.bindSkin( tsb=True )

# to detach the selected objects and delete any unused
# bindSkin history
#
pm.bindSkin( unbind=True )

# to detach pPlane1 and delete any unused
# bindSkin history
#
pm.bindSkin( 'pPlane1', unbind=True )

# to detach the selected objects and keep the history
#
pm.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.
#
pm.bindSkin( enable=False )

# to enable skin on a skeleton which has been disabled
#
pm.bindSkin( enable=True )

Previous topic

pymel.core.animation.bakeSimulation

Next topic

pymel.core.animation.blendShape

Core

Core Modules

Other Modules

This Page