LimitEnvelopeDeformers

導入

v1.0

詳細

エンベロープ デフォーマの数を制限するオペレータを適用します。これは、特定の頂点に影響を与えます。 特定の整数の制限の場合、オペレータが最小数のウェイトを持つデフォーマを削除することによって、確実に制限が満たされるようにします。 続けて、残りのウェイトが正規化されます。 制限ではロックされたウェイトが尊重されます。つまり、最小限のウェイトが実際にはロックされている場合は、これらのウェイトは削除されません。 同様に、制限を適用した後の残りのウェイトのみがロックされている場合は、正規化は実行されません。

スクリプト構文

oReturn = LimitEnvelopeDeformers( PropObj, [SubComp], Limit );

戻り値

新しく作成された LimitEnvelopeDeformersOp オペレータを戻します。

パラメータ

パラメータ タイプ 説明
PropObj 文字列 変更するエンベロープ ウェイト プロパティ
SubComp 文字列 スムーズにするポイント/オブジェクト/クラスタのリスト

デフォルト値: 現在選択されている値

Limit Integer SubComp に含まれている特定の頂点に影響を与えることを許可されたデフォーマの最大数

JScript の例

NewScene(null, null);

// Create a cylinder to be deformed

CreatePrim("Cylinder", "MeshSurface", null, null);

SetValue("cylinder.polymsh.geom.subdivu", 20, null);

SetValue("cylinder.polymsh.geom.subdivv", 20, null);

SetValue("cylinder.cylinder.height", 12.264, null);

Create2DSkeleton(0, -6, 0.6, 0, -5.25, 0.525, -5.7, 0, 0, 4, null, null);

// Create a chain of bones to deform the cylinder with

AppendBone("eff", -0.16, -2.5, 0.25, null);

AppendBone("eff", -0.12, 0.6, 0, null);

AppendBone("eff", -0.12, 3.4, -0.34, null);

AppendBone("eff", -0.12, 5.7, -0.57, null);

AppendBone("eff", -0.12, 6.5, -0.65, null);

// Deform the cylinder

SelectObj("cylinder", null, true);

ApplyFlexEnv("cylinder;root,bone,bone1,bone2,bone3,bone4,bone5,bone6,bone7,bone8,bone9,eff", null, 2);

SelectObj("eff", null, true);

Translate(null, -4.8, -8.4, 0.84, siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0, null);

SelectObj("cylinder", null, true);

SetValue("cylinder.polymsh.cls.EnvelopWeightCls.Envelope_Weights.autoenvassign.defnbskelobj", 4, null);

// Open the weight editor to look at how the bones are assigned

OpenView("Weight Editor", null);

LockEnvelopeWeights("cylinder.polymsh.cls.EnvelopWeightCls.Envelope_Weights", Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), Array(4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4), null);

XSIUIToolkit.MsgBox("Note that in the Weight Editor each bone is affected by four deformers, and some of the weights of bone3 are locked.  A limit of 2 deformers will now be applied.");

// Limit to two the number of deformers that apply to a given vertex

LimitEnvelopeDeformers("cylinder.polymsh.cls.EnvelopWeightCls.Envelope_Weights", null, 2);

XSIUIToolkit.MsgBox("Only two deformers are permitted to affect a given vertex, and the weights have been normalized.  Note that the locked weights were not modified.");