LinkDeform

カテゴリ

アニメーション シェイプ アニメーション

詳細

シェイプ アニメーションが 1 つまたは複数の指定したパラメータ(たとえば、シーン内のエレメントの位置と向き)によって動作するように、ポーズベースのデフォーメーションをセットアップします。 LinkDeformによってポーズベースのデフォメーションがセットアップされ、デフォームキーが作成されると(ApplyDeformKeyまたはSaveDeformKeyを使用)、選択したパラメータによってジオメトリのデフォメーションが決定されます。 結果として得られるデフォーメーションは、選択した N 個のパラメータによって定義される N 個の空間のシェイプ間をスムーズに補間します。

ポーズベースのデフォーメーション(マルチリンク パラメータに基づく)を使用すると、クラスタのシェイプを複数のパラメータに同時にリンクできます。 結果として得られるシェイプは、パラメータによって定義される空間内でスムーズに補間されます。 ポーズベースのデフォーメーションは、筋肉のシェイプをボーンの方向などのパラメータにリンクする場合に特に便利です。

スクリプト構文

oReturn = LinkDeform( [Cluster], [Parameter list], [LinkWithOri] );

戻り値

数値パラメータがシェイプとリンクしているオブジェクトを持つXSICollectionを含むISIVTCollectionを戻します。

パラメータ

パラメータ タイプ 詳細
Cluster 文字列 今後のデフォーメーションで考慮するクラスタ。

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

Parameter list 文字列 シェイプとリンクする数値パラメータのリスト

デフォルト値: Explorer で選択した値

LinkWithOri ブール True に設定すると、デフォーメーションが回転にリンクします。

デフォルト値: False

1. VBScript の例

' This example illustrates how to control the shape of an object (a sphere) based on two parameters
' its position in x and in z.
NewScene
' Here we create the geometry that will be deformed
CreatePrim "Sphere", "MeshSurface"
' We create the specific cluster that will be deformed
SelectGeometryComponents "sphere.pnt[4-6,11-13,18-20,25-27,32-34,39-41,46-48,53-55]"
CreateCluster
' We link the deformation of the new cluster to the position of the sphere in x and z
LinkDeform "sphere.polymsh.cls.Point", "sphere.kine.global.posz,sphere.kine.global.posx"
' Finally we model and save deform keys defining the relationship between the different
' sphere positions and the shape
Translate "Sphere", -10, 0, 0, siAbsolute, siParent, siObj, siX
ActivateVertexSelTool
Scale "sphere.polymsh.cls.Point", 0.267441860465116, 1, 1, siRelative, siLocal, siObj, siXYZ
SaveDeformKey "sphere.polymsh.cls.Point"
Translate "Sphere", 10, 0, 0, siAbsolute, siParent, siObj, siX
Scale "sphere.polymsh.cls.Point", 0.313953488372093, 1, 1, siRelative, siLocal, siObj, siXYZ
SaveDeformKey "sphere.polymsh.cls.Point"
Translate "Sphere", 0, 0, 10, siAbsolute, siParent, siObj, siZ
Scale "sphere.polymsh.cls.Point", 1, 1, 0.302325581395349, siRelative, siLocal, siObj, siXYZ
SaveDeformKey "sphere.polymsh.cls.Point"
Translate "Sphere", 0, 0, -10, siAbsolute, siParent, siObj, siZ
Scale "sphere.polymsh.cls.Point", 1, 1, 0.27906976744186, siRelative, siLocal, siObj, siXYZ
SaveDeformKey "sphere.polymsh.cls.Point"
' To see the result translate the sphere in the XZ plane. The multi-link interpolator will
' calculate a smooth blending between the deform keys over the space defined by the two parameters

2. VBScript の例

' 
' In this example, an animation is created (on Y axis) on
' a sphere. A cluster is created with some points of the 
' sphere, and the cluster is "linked" for deform with the
' local YPos parameter of the sphere. In this way, changes
' on YPos of the sphere will deform its shape. 
' Two deformations (i.e. moves) of the points of the cluster are
' performed in different frames, and each of the deformation acts
' as DeformKey.
' 
NewScene
CreatePrim "Sphere", "NurbsSurface", "MySphere"
' Create anim key of YPos of the sphere, at different frames
SetValue "PlayControl.Out", 40
SaveKey "MySphere.kine.local.posy", 1, -3.0
SaveKey "MySphere.kine.local.posy", 30, 3.0
SaveKey "MySphere.kine.local.posy", 40, 1.5
' Create a cluster in the sphere, and create a LinkDeform
SetSelFilter "Point"
AddToSelection "MySphere.pnt[(0,6),(7,6),(6,6),(5,6),(4,6),(3,6),(6,5),(1,6),(1,5),(2,6),(7,5),(0,5),(2,5),(5,4),(5,5),(4,5)]" 
CreateCluster 
LinkDeform "MySphere.surfmsh.cls.Point", "MySphere.kine.local.posy" 
' Create the first Deform key at frame 1, with translation of
' points of the cluster
SetValue "PlayControl.Current", 1
Translate "MySphere.pnt[(0,6)]", -1.74522900164809, 0.27627214396616, -0.027627214396616, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(0,5)]", -1.63879153625736, 7.95443183208384E-02, -7.95443183208383E-03, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(4,6)]", 2.5, 0.5, 0, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(4,5)]", 2.5, -0.3, 0, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(3,5)]", 2, -1.5, 0, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(1,5)]", -1.5, -0.4, 0, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(7,6)]", -1.2, 1.26649251503908, -0.2, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(5,6)]", 1.5, 1.53788376826177, -0.2, siRelative, siView, siObj, siXYZ
SelectObj "MySphere.surfmsh.cls.Point"
SaveDeformKey
' Create the second Deform key at frame 30, with translation of
' points of the cluster
SetValue "PlayControl.Current", 30
Translate "MySphere.pnt[(0,6)]", 6.0, -0.5, 0, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(0,5)]", 5.4, 0, 0, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(1,5)]", 4.0, 1.3, -0.13, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(4,5)]", -5.5, 0.12, 0, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(4,6)]", -6.0, -0.5, 0, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(5,4)]", -1.7, 0.5, 0, siRelative, siView, siObj, siXYZ
Translate "MySphere.pnt[(3,6)]", -2.0, 0, 0, siRelative, siView, siObj, siXYZ
SaveDeformKey "MySphere.surfmsh.cls.Point"
' Playback the animation
SetDisplayMode "Camera", "textured"
PlayForwardsFromStart

関連項目

SaveDeformKey ApplyDeformKey LinkDeformWithOri