ApplyHairResampleOp

Introduced

v3.5

Categories

operator

Description

Applies a uniform resample operation to a hair object. This makes all segments uniform in length, and ensures the hair is ready to be manipulated or styled with the standard hair constraints active. Hair must be resampled whenever hair is non-uniform (for example, when it has been edited in "stretchy" mode) and when constrained editing operations need to be applied, such as adding dynamics or scaling the hair.

Scripting Syntax

oReturn = ApplyHairResampleOp( InputObjs );

Return Value

Returns the full path of the hair operator.

Parameters

Parameter Type Description
InputObjs Selection list Specifies the hair object to be resampled

Examples

VBScript Example

' 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.