ApplyDeformKey

詳細

ポーズベースのデフォメーション キーを保存します。 シェイプ キーの保存、選択に加え、ポーズベースのデフォメーションを使用してシェイプ アニメーションを作成できます。 こうするには、1 つまたは複数のパラメータをリンクして選択したクラスタのデフォメーションを処理し、デフォーム キーを任意のポーズに設定します。

たとえば、シェイプ アニメーション処理されたオブジェクトのブレンドを、球の位置に応じて制御できます(球の位置によってシェイプ アニメーションを駆動)。 球が、特定のポーズ(小さな球で示されます)に関連付けられたデフォーム キーに近づくにつれ、ターゲット オブジェクトはその形に近づきます。球がデフォーム キーの間にあると、ターゲット オブジェクトはデフォーム キーの組み合わせ(補間)となります。

Tip:定義済みシェイプを使用してデフォーム キーを適用することができます。 デフォーム キーを選択して[デフォーム] > [シェイプ] > [デフォーム キーの適用]を実行し、現在のポーズでデフォーム キーを保存するオブジェクトに対し、デフォーム キーを適用します。

スクリプト構文

oReturn = ApplyDeformKey( [InputObj] );

戻り値

キーを戻します。

パラメータ

パラメータ タイプ 説明
InputObj 文字列 デフォームの設定に使用するクラスタ シェイプ キー

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

VBScript の例

'

' This example demonstrates how to use the ApplyDeformKey command to

' apply a shape deformation previously created

'

NewScene , false

' First get the old construction mode

iOldMode = GetValue( "Context.ConstructionMode" )

SetValue "Context.ConstructionMode", siConstructionModePrimaryShape

' Create the object to deform

CreatePrim "Sphere", "NurbsSurface"

' Select the points used for deformation and cluster them

CreateCluster "sphere.pnt[(5,4),(6,4),(7,4),(0,5),(1,5),(2,5),(3,5),(4,5),(5,5),(6,5),(7,5),(0,6),(1,6),(2,6),(3,6)]"

' Link the deformation of the cluster with the parameter sphere.kine.local.posx

LinkDeform "sphere.surfmsh.cls.Point", "sphere.kine.local.posx"

' Translate the sphere at X = -10

Translate "sphere", -10, 0, 0, siAbsolute

SaveDeformKey "sphere.surfmsh.cls.Point"

SetValue "sphere.surfmsh.cls.Point.PoseDeform1.Name", "SphereNormal"

' Deform the sphere at X = 0 and save the deformation

Translate "sphere", 0, 0, 0, siAbsolute

Scale "sphere.surfmsh.cls.Point", 1, 1, 2, siAbsolute, siParent, siObj, siZ

Scale "sphere.surfmsh.cls.Point", 2, 1, 1, siAbsolute, siParent, siObj, siX

SaveDeformKey "sphere.surfmsh.cls.Point"

SetValue "sphere.surfmsh.cls.Point.PoseDeform1.Name", "SphereFat"

' Translate the sphere at X = 10 and apply the deformation called SphereNormal

Translate "sphere", 10, 0, 0, siAbsolute

Refresh

ApplyDeformKey "sphere.surfmsh.cls.Point.SphereNormal"

' Pop up a Deform Control window. If you left click on the slider, 

' you will see the deformation of the sphere linked with the translation on the X axis

InspectObj "sphere.surfmsh.cls.Point.DeformControls"

' Restore the original construction mode

SetValue "Context.ConstructionMode", iOldMode

関連項目

LinkDeform SaveDeformKey