GenerateUVSetByContourStretching

詳細

入力ポリゴンの輪郭に固定された「サーフェイス」上に入力ポリゴンの輪郭をストレッチして、新しいテクスチャ座標のセットを作成します。輪郭ストレッチ処理を正常に実行するためには、ポリゴン入力に適切な輪郭が必要です。

スクリプト構文

oReturn = GenerateUVSetByContourStretching( InputObjs, PropertyName, [ContourStretchingMethod], [MaintainAspect], [CornerPoints] );

戻り値

2 つの XSICollection オブジェクトを含む XSICollection オブジェクトを戻します。 1 番目は、作成されたプロパティのリストです。 2 番目は、作成されたオペレータのリストです。

パラメータ

パラメータ タイプ 説明
InputObjs 文字列 ポリゴンの UV テクスチャ座標の輪郭ストレッチ オペレータを適用する、入力ポリゴンのリスト

デフォルト値: 選択されたオブジェクト

PropertyName 文字列 テクスチャ座標の名前の候補
ContourStretchingMethod siTxtContourStretchingMethod ポリゴン クラスタの輪郭のストレッチ方法

デフォルト値: siContourStretchingWalkingOnMesh

MaintainAspect Boolean アスペクト比を保持するかどうかを決定

デフォルト値: False

CornerPoints 文字列 入力ポリゴンの輪郭上でコーナーを形成する、入力ポイントのオプション リスト。 各入力は、0 から N 個のポイントを持ちますが、はじめの 4 つのポイントのみがコーナーの定義に使用されます。 入力コーナーが入力ポリゴンの輪郭の一部でない場合には、無視されます。

デフォルト値: 空。コーナーは内部で自動的に算出されます。

VBScript の例

Dim l_CreatedObjects

NewScene

'This example will create a texture space by contour stretching the contour of 

'set of input polygons.

CreatePrim "Sphere", "MeshSurface"

ActivateRaycastPolySelTool

SelectGeometryComponents "sphere.poly[3,4,11,12,19,20,27,28]"

CreateCluster

'Translate a point and notice that the texture follows the deformation

Translate "sphere.pnt[20]", 0.15, 4.8, -0.48, siRelative, siView, siObj, siXYZ

'Stretch the polygons - Method is by spatial distance, Default for MaintainAspect = FALSE, Pass-in corners.

set l_CreatedObjects = GenerateUVSetByContourStretching( "sphere.polymsh.cls.Polygon", "Texture_Projection", siContourStretchingSpatialDistance, , "sphere.pnt[4,6,32,34]" )

' What was created

logmessage "Created Properties: " & l_CreatedObjects(0)

logmessage "Created Operators:" & l_CreatedObjects(1)

'Use the generated texture space.

ActivateObjectSelTool

ApplyShader , , , , siLetLocalMaterialsOverlap

SIApplyShaderToCnxPoint "Image", "sphere.Material.Phong.diffuse"

SetInstanceDataValue , "sphere.Material.Phong.Image.tspace_id", "Texture_Projection"

SetDisplayMode "Camera", "textured"

関連項目

ModifyUVSetByContourStretching