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
$hysstringname of the hair system node
$surfacestringsurface or mesh to attach the follicle to (set to "" if there is no surface)
$endHairSystemIndexint[]this keeps track between calls of the index of the last hair created
$hsysGroupstringan existing group to parent the follices under (for no grouping set to "")
$hsysOutHairGroupstringan existing group to parent the output hair curves under (for no grouping set to "")
$simulationTypeint1 = dynamic, 2 = static
$ufloat$v uv coordinates on the surface to attach the follicle to (if no surface 0,0 is OK)
$numCvsintnumber of cvs to create for the hair curve ( if a start curve is passed in it will override this value )
$doOutintif true then create output curves for the follice
$doStartintif true then create a start curve for the follicle
$doRestintif true then create a rest curve for the follicle
$isPassiveintif true then make the follicle passive
$startCurvestringname of a curve to use for the start position(if "" then a curve will be created)
$lengthfloatlength of hair curve to create (ignored if a start curve is specified)

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);
	}