Go to: Synopsis. Return value. MEL examples.

Synopsis

createHairCurveNode(
string $hsys,
string $surface,
float $u, float $v,
int $numCvs,
int $doOut,
int $doStart,
int $doRest,
int $isPassive,
string $startCurve,
float $length,
int $endHairSystemIndex[],
string $hsysGroup,
string $hsysOutHairGroup,
int $simulationType )

This is a low level mel routine that sets up a hair follicle and manages all the attachments. It is used by the "Create Hair" menu as well as "make selected curves dynamic". It is useful if one wishes to custom script creation of hairs or dynamic curves. Any strings passed into this routine should be the names of existing shape nodes of the type required by the arguments. In The argument $hsys requires a valid hairSystem node, however the other stringscan be set to "" and the hairsystem node will either not implement that node or create one. The argument $endHairSystemIndex is a simple 1 element int array that is used to keep track of the index we connect to between calls, so that it is faster when looping over large numbers of hairs. Initialize the first element of this array to zero, and if you are creating follicles in a loop then keep this initialization outside of the loop. For examples of the usage of this call look at createHair.mel.

Return value

None

Arguments

Variable Name Variable Type Description
$hys string name of the hair system node
$surface string surface or mesh to attach the follicle to (set to "" if there is no surface)
$u float $v uv coordinates on the surface to attach the follicle to (if no surface 0,0 is OK)
$numCvs int number of cvs to create for the hair curve ( if a start curve is passed in it will override this value )
$doOut int if true then create output curves for the follice
$doStart int if true then create a start curve for the follicle
$doRest int if true then create a rest curve for the follicle
$isPassive int if true then make the follicle passive
$startCurve string name of a curve to use for the start position(if "" then a curve will be created)
$length float length of hair curve to create (ignored if a start curve is specified)
$endHairSystemIndex int[] this keeps track between calls of the index of the last hair created
$hsysGroup string an existing group to parent the follices under (for no grouping set to "")
$hsysOutHairGroup string an existing group to parent the output hair curves under (for no grouping set to "")
$simulationType int 1 = dynamic, 2 = static

MEL examples

        sphere;
        string $hsys = `createNode hairSystem`;
        connectAttr time1.outTime ($hsys + ".currentTime");
        int $ind[1];
        $ind[0] = 0;
        int $i;
        for( $i = 0; $i < 10; $i++ ){
                float $v = 0;
                float $u = $i/10.0;
                string $newHair = createHairCurveNode( $hsys, "nurbsSphereShape1", $u,$v,10, true, true, false, false, "", 3.0, $ind, "","",1);
        }