LockEnvelopeDeformerWeights

導入

v5.0

カテゴリ

オペレータ デフォメーション

詳細

指定デフォーマのエンベロープの修正を禁止します。

エンベロープ デフォーメーションのエフェクトはウェイト マッピングにより制御されます。 これらのエンベロープ ウェイトは、ペイントやスムージングなどのさまざまな編集ツールで修正できます。 このコマンドは、直接的な操作または(正規化などの)間接的な操作によりデフォーマのウェイトが修正されないようにします。

スクリプト構文

oReturn = LockEnvelopeDeformerWeights( PropObj, Deformers, [Locked] );

戻り値

ロックを適用する新しいXSICollectionを含むOperatorを戻します。

パラメータ

パラメータ タイプ 詳細
PropObj 文字列 ウェイトをロックするエンベロープ ウェイト プロパティ。
Deformers デフォーマオブジェクトのXSICollection(以下の例を参照) ロックされるデフォーマのリスト。
Locked ブール これらのデフォーマはロックしてください(それ以外の場合はロック解除されます)。

デフォルト値: True

VBScript の例

'
'       This example illustrates how you can control the normalization process
'       when setting envelope weights by using weight locking. Normalization
'       automatically enforces that the sum of the weights for a given point
'       is always maintained to 100% when modifying weights numerically,
'       by painting or through any of the other weight editing commands.
'
' We start with a simple cylinder enveloped to a 6 bone chain
NewScene , false
set oCyl = CreatePrim( "Cylinder", "MeshSurface" )
SetValue "cylinder.cylinder.height", 10
SetValue "cylinder.polymsh.geom.subdivv", 20
SetValue "cylinder.polymsh.geom.subdivu", 16
Create2DSkeleton 1.97818728045807E-02, 5.04656031338284, 0, 0.81105678498785, 3.66123003127775, 0, 0, 0, 0, 4
AppendBone "eff", 0.890184276206176, 1.91967196234563, 0
AppendBone "eff", 0.969311767424504, 0.257275623819517, 0
AppendBone "eff", 1.00887551303367, -1.76134850153362, 0
AppendBone "eff", 0.969311767424504, -3.18625964884171, 0
AppendBone "eff", 1.97818728045807E-02, -4.96739858297683, 0
SelectObj "cylinder", , True
ApplyFlexEnv "cylinder;bone,bone1,bone2,bone3,bone4,bone5,eff", False, 0
' Say that for a given set of points you want to set the
' envelope weight assignment so that the points are weighted
' 50% to "bone1", 25% to "bone" and 25% to "bone2"
' You can first set the weight for these points to 50% to "bone1"
SIModifyFlexEnvWght "cylinder.polymsh.cls.EnvelopWeightCls.Envelope_Weights", "bone1", _
        "cylinder.pnt[18,19,41,42,64,65,87,88,110,111,133,134,156,157,179,180,202,203,225,226,248,249,271,272,294,295,317,318,340,341,363,364]", 0, 50
' Get the list of deformers to use as input to the LockEnvelopeDeformerWeights command
set oDefs = CreateObject( "XSI.Collection" )
oDefs.SetAsText "bone1" 
' Tip - Alternatively, you could use "oDefs.Add oCyl.Envelopes(0).Deformers(0)" to populate the Deformers collection
' Now to avoid that normalization affects the new 50%
' assignment, we can lock the weights for deformer "bone1" as follows:
LockEnvelopeDeformerWeights "cylinder.polymsh.cls.EnvelopWeightCls.Envelope_Weights", oDefs, True
' Now we can assign the two other bones to 25% without having normaliztion
' affect the "bone1" values.
SIModifyFlexEnvWght "cylinder.polymsh.cls.EnvelopWeightCls.Envelope_Weights", "bone", _ 
        "cylinder.pnt[18,19,41,42,64,65,87,88,110,111,133,134,156,157,179,180,202,203,225,226,248,249,271,272,294,295,317,318,340,341,363,364]", 0, 25
SIModifyFlexEnvWght "cylinder.polymsh.cls.EnvelopWeightCls.Envelope_Weights", "bone2", _ 
        "cylinder.pnt[18,19,41,42,64,65,87,88,110,111,133,134,156,157,179,180,202,203,225,226,248,249,271,272,294,295,317,318,340,341,363,364]", 0, 25
' Now once we're done we can unlock the weights for that
' deformer in the same way:
LockEnvelopeDeformerWeights "cylinder.polymsh.cls.EnvelopWeightCls.Envelope_Weights", oDefs, False
' We could have also simply cleared all weight locks as follows:
ClearEnvelopeWeightLocks "cylinder.polymsh.cls.EnvelopWeightCls.Envelope_Weights"
' Now weights don't need to be locked on a per deformer basis.
' One could have locked individual point/deformer weight pairs as follows:
LockEnvelopeWeights "cylinder.polymsh.cls.EnvelopWeightCls.Envelope_Weights", Array(41, 42, 64, 65), Array(1, 1, 2, 2), True
' This last command locks the weight for points 41 and 42 for deformer 1 (the
' second deformer since indices start at zero) and points 64 and 65 for deformer 2.

関連項目

SIApplyFlexEnv LockEnvelopeWeights LockEnvelopePointWeights ClearEnvelopeWeightLocks SIModifyFlexEnvWght Envelope