KineFX (Procedural) Weights
KineFXのWeightをVEXで設定したい
Bone Deform SOPでSkeltonの変形に合わせてメッシュを変形させる
@boneCapture という謎のAttributeが必要になるが普通には作れないので
(Capture Attribute UnpackでVEXで触れる形にバラす)
VEXで弄る
Capture Attribute Packでデフォーマ系が認識できる形に戻す
Capture Attribute Packに必要そうなAttrib (スケルトン側)
Unpackに頼らずscratchでPack用のAttrib群を作る
以下を変形されるメッシュ側に作る
まとめると最低限 Pointに2つ + Detailに2つで良さそう?
Point
f[]@boneCapture_data: ボーン毎の自らに対するウェイト (1.0, 0.0, 0.0, ...)
i[]@boneCapture_index: 上に対応するボーンのインデックス(@ptnum?) (0, 1, 2, ...)
Detail
s[]@boneCapture_pCaptPath
名前の配列 ("point1", "point2", ...)
f[][]@boneCapture_pCaptData
float配列の配列
ボーン数と対応
配列内の各float配列は規定の20個
That attribute is always 20 values. The first 16 are a transform matrix describing the rest transform at the time of capture. The other four are the top, bottom, x radius, and z radius of the capture capsule in that order. Technical details are in the HDK doc (@toadstorm)
code:.cpp
{1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0,
1.0, 1.0, 1.0, 1.0 };
これがボーン数分並ぶ
配列内配列のような特殊floatなので事前にAttribute Createで作っておく
https://scrapbox.io/files/681c4068aec8143a95c443b5.png
Optionalかも
f@pCaptFrame: 0でOK?
s@pCaptSkelRoot: なければ空欄でもOK?
参考
Smooth SOPは@boneCaptureに使える