ジャンプ先: 概要. 戻り値. キーワード. 関連. フラグ. Python 例.
copySkinWeights([destinationSkin=string], [influenceAssociation=string], [mirrorInverse=boolean], [mirrorMode=string], [noBlendWeight=boolean], [noMirror=boolean], [normalize=boolean], [sampleSpace=uint], [selectedComponents=boolean], [smooth=boolean], [sourceSkin=string], [surfaceAssociation=string], [uvSpace=[string, string]])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
copySkinWeights は、取り消し可能、照会可能、および編集可能です。
skinCluster ウェイトを XYZ 軸の 1 軸の反対側にコピーまたはミラーするコマンドです。このコマンドを使用して、サーフェスから別のサーフェスへ、または同じサーフェス内で、ウェイトをミラーすることができます。
なし
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
skinCluster, duplicate, mirror
skinCluster, skinPercent
destinationSkin, influenceAssociation, mirrorInverse, mirrorMode, noBlendWeight, noMirror, normalize, sampleSpace, selectedComponents, smooth, sourceSkin, surfaceAssociation, uvSpace
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。
|
import maya.cmds as cmds
# Create plane and a skeleton. Bind the skin.
#
cmds.file( f=True,new=True )
cmds.polyPlane( ch=1, w=10, h=10, sx=5, sy=5, ax=(0,1,0) )
cmds.select( d=True )
cmds.joint( p=(0, 0, -6) )
cmds.joint( p=(0, 0, -4) )
cmds.joint( 'joint1', e=True, zso=True, oj='xyz')
cmds.joint( p=(2, 0, -4) )
cmds.joint( 'joint2', e=True, zso=True, oj='xyz')
cmds.joint( p=(5, 0, -3) )
cmds.joint( 'joint3', e=True, zso=True, oj='xyz')
cmds.select( 'joint2', r=True )
cmds.joint( p=(-2, 0, -4) )
cmds.joint( 'joint4', e=True, zso=True, oj='xyz')
cmds.joint( p=(-5, 0, -3) )
cmds.joint( 'joint5', e=True, zso=True, oj='xyz')
cmds.select( 'joint2', r=True )
cmds.joint( p=(0, 0, 3) )
cmds.joint( 'joint6', e=True, zso=True, oj='xyz')
cmds.joint( p=(5, 0, 5) )
cmds.joint( 'joint7', e=True, zso=True, oj='xyz')
cmds.select( 'joint7', r=True )
cmds.joint( p=(-5, 0, 5) )
cmds.joint( 'joint8', e=True, zso=True, oj='xyz')
cmds.select( 'pPlane1', 'joint1', r=True )
maya.mel.eval('createSkinCluster "-mi 5 -dr 4"' )
# Modify some weights on the -x side of the character
#
cmds.skinPercent( 'skinCluster1', 'pPlane1.vtx[30]', tv=('joint2',0.200000) )
cmds.skinPercent( 'skinCluster1', 'pPlane1.vtx[31]', tv=('joint2',0.200000) )
cmds.skinPercent( 'skinCluster1', 'pPlane1.vtx[24]', tv=('joint5',0.550000) )
cmds.skinPercent( 'skinCluster1', 'pPlane1.vtx[25]', tv=('joint5',0.550000) )
# Mirror the skin weights to the other side of the character
# Mirror inverse is chosen since we want to go from -x to +x, not +x to -x.
#
cmds.copySkinWeights( ss='skinCluster1', ds='skinCluster1', mirrorMode='YZ', mirrorInverse=True )
# Now create a second plane and bind it as skin
#
cmds.polyPlane( ch=1, w=10, h=10, sx=5, sy=5, ax=(0,1,0) )
cmds.select( 'pPlane2', r='joint1' )
maya.mel.eval('createSkinCluster "-mi 5 -dr 4"' )
# Copy the skin weights from the first plane onto the new plane.
# The -noMirror flag is used since we want to copy directly, not mirror.
#
cmds.copySkinWeights( ss='skinCluster1', ds='skinCluster2', noMirror=True )