ApplyHairResampleOp

導入

v3.5

詳細

均等再サンプリング操作をヘア オブジェクトに適用します。 これにより、すべてのセグメントの長さが均一になり、ヘアが標準ヘア コンストレイントを有効にした状態で操作またはスタイル付けする準備が整います。 ヘアが均一でない場合(たとえば、「可変長」モードで編集されていた場合など)に、ダイナミクスを追加したり、ヘアのスケーリングを実行するといった拘束付き編集操作を適用したい場合には、必ずヘアの再サンプリングを実行する必要があります。

スクリプト構文

oReturn = ApplyHairResampleOp( InputObjs );

戻り値

ヘア オペレータの完全パスを戻します。

パラメータ

パラメータ タイプ 説明
InputObjs 選択リスト 再サンプリングするオブジェクトを指定します。

VBScript の例

' This example shows use of the ApplyHairResampleOp command.

NewScene , False

set oGrid = CreatePrim( "Grid", "MeshSurface" )

SetValue oGrid & ".polymsh.geom.subdivu", 1

SetValue oGrid & ".polymsh.geom.subdivv", 1

set oHair = ApplyHairOp( oGrid )

' Turn on "show points" mode in the camera view.

SetValue "Camera.camvis.compobjselvert", True

' Move some hair points in stretchy mode.

SetValue oHair & ".hair.AllowStretch", True

Translate oHair & ".pnt[(1,13)]", 5.7, 2.4, 0, siRelative, siView, siObj, siXYZ

Translate oHair & ".pnt[(1,12)]", 3.5, 2.8, 0, siRelative, siView, siObj, siXYZ

Translate oHair & ".pnt[(1,11)]", 1.9, 2.2, 0, siRelative, siView, siObj, siXYZ

Translate oHair & ".pnt[(3,11)]", -2.7, -0.5, 0, siRelative, siView, siObj, siXYZ

Translate oHair & ".pnt[(3,12)]", -3.2, 0, 0, siRelative, siView, siObj, siXYZ

msgbox "See how some hair segments are stretched now..."

' Now resample the hair uniformly and turn off stretchy mode.

ApplyHairResampleOp oHair

SetValue oHair & ".hair.AllowStretch", False

msgbox "And now they're all uniformly sampled..."

' Running the script should pop up the two message boxes, one before

' and the other after uniformly resampling the hair segments.