ジャンプ先: 概要. 戻り値. キーワード. 関連. フラグ. MEL 例.
bakeDeformer [-bakeRangeOfMotion] [-colorizeSkeleton boolean] [-customRangeOfMotion timerange] [-dstMeshName string] [-dstSkeletonName string] [-hierarchy boolean] [-influences string[]] [-maxInfluences int] [-pruneWeights float] [-smoothWeights int] [-srcMeshName string] [-srcSkeletonName string]
bakeDeformer は、取り消し可能、照会不可能、および編集不可能です。
デフォーマのセットによってメッシュ シェイプが決定されたリグ キャラクタを基に、bakeDeformer は観測されたデフォメーションに最も近いリニア ブレンド スキン ウェイトを計算します。そのために、可動域内でリグを移動することによってサンプルのテスト セットを生成します。結果のメッシュとポーズのペアは、スキニング ウェイトを計算して、制限された最適化を計算するために使用されます。bakeDeformer は、算出されたウェイトを自動的にバインドして目的のジオメトリに適用します。ソースと目的のメッシュ/スケルトンが同じ場合、このコマンドは、元のデフォメーションを skinCluster および計算されたウェイトで置き換えます。サンプルの使用方法については、次の例を参照してください。
bake, skinning, deformer
skinPercent
bakeRangeOfMotion, colorizeSkeleton, customRangeOfMotion, dstMeshName, dstSkeletonName, hierarchy, influences, maxInfluences, pruneWeights, smoothWeights, srcMeshName, srcSkeletonName
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
コマンド内でフラグを複数回使用できます。
|
proc string[] createJointsAndMesh(float $offset[])
{
string $root = `joint`;
joint; move -r 0 2 0;
joint; move -r 0 2 0;
joint; move -r 0 2 0;
joint; move -r 0 2 0;
joint; move -r 0 2 0;
string $meshes[] = `polyCube -sx 3 -sy 10 -sz 3 -h 10`;
move -r 0 5 0;
select -r $root $meshes;
move -r $offset[0] $offset[1] $offset[2];
select -cl;
return {$root, $meshes[0]};
}
proc bindMesh(string $object[])
{
string $rootJoint = $object[0];
string $mesh = $object[1];
select -r -hi $rootJoint;
select -add $mesh;
SmoothBindSkin;
select -cl;
}
proc randomizeJoints(string $object[])
{
string $rootJoint = $object[0];
select -r $rootJoint;
pickWalk -d down;
for ($i=0; $i<4; $i++)
{
float $rads[] = `sphrand 1.`;
rotate(
rad_to_deg($rads[0]),
rad_to_deg($rads[1]),
rad_to_deg($rads[2]));
pickWalk -d down;
}
}
proc matchRotations(string $src, string $dst)
{
select -r -hi $src;
string $srcChain[] = `ls -sl`;
select -r -hi $dst;
string $dstChain[] = `ls -sl`;
for ($i=0; $i<5; $i++)
{
select -r $dstChain[$i] $srcChain[$i];
MatchRotation;
}
}
{
// Create an empty scene
file -f -new;
// Create two joint chains/meshes
string $object1[] = createJointsAndMesh({0, 0, 0});
string $object2[] = createJointsAndMesh({5, 0, 0});
// Bind one of the joint chains to the mesh and rotate the weights
bindMesh($object1);
randomizeJoints($object1);
// Use bakeDeformer to learn and apply the linear blend skinning weights.
// Specify the source/destination skeletons and meshes and the number of maximum influences.
bakeDeformer
-ss $object1[0] -sm $object1[1]
-ds $object2[0] -dm $object2[1]
-mi 3;
// Match the rotations of the two chains to show the results are similar
matchRotations($object1[0], $object2[0]);
}