/* This is a textured primitive plugin created by Kevinaz and Llyr Carter */ #plugin("object", "mesh", "K_Hair"); #button(24, 24, 2, 0x0000000000, 0x0000000000, 0x0000000038, 0x0000000038, 0x0000202038, 0x0000202038, 0x0000202038, 0x0000202038, 0x0000202038, 0x0000202038, 0x0000202038, 0x00003fe038, 0x0000202038, 0x0000202038, 0x0000202038, 0x0000202038, 0x0000202038, 0x0000202038, 0x0000000038, 0x0000000038, 0x0000000010, 0x0000000000, 0x0000000000, 0x0000000000); #parameter("x_scale",float,1.0,0.0,100.0,scale,scale_x); #parameter("y_scale",float,1.0,0.0,100.0,scale,scale_y); #parameter("z_scale",float,1.0,0.0,100.0,scale,scale_z); #parameter("Create texture",int,1,0,1); #parameter("Create material",int,1,0,1); #parameter("Set texture",int,1,0,1); #parameter("Apply material",int,1,0,1); #return($returnShape); point3 $currentPoint; float $x_scale, $y_scale, $z_scale; int $createTexture; int $createMaterial; int $setTexture; int $applyMaterial; $x_scale = parameter("x_scale"); $y_scale = parameter("y_scale"); $z_scale = parameter("z_scale"); $createTexture = parameter("Create texture"); $createMaterial = parameter("Create material"); $setTexture = parameter("Set texture"); $applyMaterial = parameter("Apply material"); shape $returnShape; $returnShape.Open(); object $curObject; $curObject = project.curObject; material $currentMaterial; int $matIndex; int $matIndexList[0]; string $matList[0]; int $matCounter; texture $curTexture; $matIndex = 0; $currentMaterial = $curObject.LookupMaterial("K_Hair"); if($currentMaterial == NULL && $createMaterial) { $currentMaterial = $curObject.NewMaterial("K_Hair"); $currentMaterial.Ka = 0.700000; $currentMaterial.Kd = 0.700000; $currentMaterial.Ks = 0.200000; $currentMaterial.Ke = 0.000000; $currentMaterial.alpha = 1.000000; $currentMaterial.roughness = 32.000000; $currentMaterial.brilliance = 1.000000; $currentMaterial.LockAmbiantDiffuse = 1; $currentMaterial.Marked = 0; $currentMaterial.ambient = (0.000000,0.000000,0.000000); $currentMaterial.diffuse = (0.000000,0.000000,0.000000); $currentMaterial.specular = (0.000000,0.000000,0.000000); $currentMaterial.emissive = (0.000000,0.000000,0.000000); $currentMaterial.SetBlendMode(TEXTURE_SPECULAR,0); $currentMaterial.SetAlphaMode(TEXTURE_SPECULAR,0); $currentMaterial.SetBlendMode(TEXTURE_TRANSPARENCY,0); $currentMaterial.SetAlphaMode(TEXTURE_TRANSPARENCY,0); $currentMaterial.SetBlendMode(TEXTURE_BUMPMAP,0); $currentMaterial.SetAlphaMode(TEXTURE_BUMPMAP,0); } if($currentMaterial != NULL) $curTexture = $currentMaterial.GetTexture(TEXTURE_SPECULAR); if($curTexture == NULL || $currentMaterial == NULL) { $curTexture = project.LookupTexture("K_Hair_Texture"); if($curTexture != NULL && $currentMaterial != NULL && $setTexture) { $currentMaterial.SetTexture(TEXTURE_SPECULAR,$curTexture); } } if($curTexture == NULL && $createTexture) { $curTexture = project.NewTexture("K_Hair_Texture"); $curTexture.InvertImage = 0; $curTexture.SetFileName(project.GetDirectory(DIRECTORY_SCRIPT) + "\\K_Hair_Texture.gif"); } if($currentMaterial != NULL) $curTexture = $currentMaterial.GetTexture(TEXTURE_TRANSPARENCY); if($curTexture == NULL || $currentMaterial == NULL) { $curTexture = project.LookupTexture("K_Hair_Texture"); if($curTexture != NULL && $currentMaterial != NULL && $setTexture) { $currentMaterial.SetTexture(TEXTURE_TRANSPARENCY,$curTexture); } } if($currentMaterial != NULL) $curTexture = $currentMaterial.GetTexture(TEXTURE_BUMPMAP); if($curTexture == NULL || $currentMaterial == NULL) { $curTexture = project.LookupTexture("K_Hair_Texture"); if($curTexture != NULL && $currentMaterial != NULL && $setTexture) { $currentMaterial.SetTexture(TEXTURE_BUMPMAP,$curTexture); } } if($currentMaterial != NULL && $applyMaterial) { $matIndex = $returnShape.AddMaterial($currentMaterial); $matIndexList.push($matIndex); $matList.push($currentMaterial.name); } $currentPoint.x = -3.758300 * $x_scale; $currentPoint.y = -63.597000 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = -4.188300 * $x_scale; $currentPoint.y = -54.071999 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = -4.188300 * $x_scale; $currentPoint.y = -40.554001 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = -4.188300 * $x_scale; $currentPoint.y = -27.035999 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = -4.188300 * $x_scale; $currentPoint.y = -13.518000 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = -4.188300 * $x_scale; $currentPoint.y = 0.000000 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = -4.188300 * $x_scale; $currentPoint.y = 13.518000 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = -4.188300 * $x_scale; $currentPoint.y = 27.035999 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = -4.188300 * $x_scale; $currentPoint.y = 40.554001 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = -4.188300 * $x_scale; $currentPoint.y = 54.071999 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = -4.188300 * $x_scale; $currentPoint.y = 67.589996 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 3.984100 * $x_scale; $currentPoint.y = -63.597000 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 4.188300 * $x_scale; $currentPoint.y = -54.071999 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 4.188300 * $x_scale; $currentPoint.y = -40.554001 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 4.188300 * $x_scale; $currentPoint.y = -27.035999 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 4.188300 * $x_scale; $currentPoint.y = -13.518000 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 4.188300 * $x_scale; $currentPoint.y = 0.000000 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 4.188300 * $x_scale; $currentPoint.y = 13.518000 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 4.188300 * $x_scale; $currentPoint.y = 27.035999 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 4.188300 * $x_scale; $currentPoint.y = 40.554001 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 4.188300 * $x_scale; $currentPoint.y = 54.071999 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 4.188300 * $x_scale; $currentPoint.y = 67.589996 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = -2.031600 * $x_scale; $currentPoint.y = -67.589996 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 2.257400 * $x_scale; $currentPoint.y = -67.589996 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = -3.186900 * $x_scale; $currentPoint.y = -65.949997 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 3.341500 * $x_scale; $currentPoint.y = -65.949997 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $currentPoint.x = 0.000000 * $x_scale; $currentPoint.y = -68.042000 * $y_scale; $currentPoint.z = 6.094000 * $z_scale; $returnShape.AddPoint($currentPoint); $returnShape.OpenFace($matIndex,FACE_HAS_TEXCOORDS); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.103000))); $returnShape.VertexN(1); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.202660))); $returnShape.VertexN(2); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.202660))); $returnShape.VertexN(13); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.103000))); $returnShape.VertexN(12); $returnShape.CloseFace(); $returnShape.OpenFace($matIndex,FACE_HAS_TEXCOORDS); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.202660))); $returnShape.VertexN(2); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.302330))); $returnShape.VertexN(3); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.302330))); $returnShape.VertexN(14); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.202660))); $returnShape.VertexN(13); $returnShape.CloseFace(); $returnShape.OpenFace($matIndex,FACE_HAS_TEXCOORDS); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.302330))); $returnShape.VertexN(3); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.402000))); $returnShape.VertexN(4); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.402000))); $returnShape.VertexN(15); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.302330))); $returnShape.VertexN(14); $returnShape.CloseFace(); $returnShape.OpenFace($matIndex,FACE_HAS_TEXCOORDS); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.402000))); $returnShape.VertexN(4); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.501660))); $returnShape.VertexN(5); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.501660))); $returnShape.VertexN(16); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.402000))); $returnShape.VertexN(15); $returnShape.CloseFace(); $returnShape.OpenFace($matIndex,FACE_HAS_TEXCOORDS); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.501660))); $returnShape.VertexN(5); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.601330))); $returnShape.VertexN(6); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.601330))); $returnShape.VertexN(17); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.501660))); $returnShape.VertexN(16); $returnShape.CloseFace(); $returnShape.OpenFace($matIndex,FACE_HAS_TEXCOORDS); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.601330))); $returnShape.VertexN(6); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.701000))); $returnShape.VertexN(7); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.701000))); $returnShape.VertexN(18); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.601330))); $returnShape.VertexN(17); $returnShape.CloseFace(); $returnShape.OpenFace($matIndex,FACE_HAS_TEXCOORDS); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.701000))); $returnShape.VertexN(7); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.800670))); $returnShape.VertexN(8); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.800670))); $returnShape.VertexN(19); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.701000))); $returnShape.VertexN(18); $returnShape.CloseFace(); $returnShape.OpenFace($matIndex,FACE_HAS_TEXCOORDS); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.800670))); $returnShape.VertexN(8); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.900330))); $returnShape.VertexN(9); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.900330))); $returnShape.VertexN(20); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.800670))); $returnShape.VertexN(19); $returnShape.CloseFace(); $returnShape.OpenFace($matIndex,FACE_HAS_TEXCOORDS); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.900330))); $returnShape.VertexN(9); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,1.000000))); $returnShape.VertexN(10); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,1.000000))); $returnShape.VertexN(21); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.900330))); $returnShape.VertexN(20); $returnShape.CloseFace(); $returnShape.OpenFace($matIndex,FACE_HAS_TEXCOORDS); $returnShape.TexCoordN($returnShape.AddTexCoord((0.119550,0.015420))); $returnShape.VertexN(24); $returnShape.TexCoordN($returnShape.AddTexCoord((0.051330,0.032770))); $returnShape.VertexN(0); $returnShape.TexCoordN($returnShape.AddTexCoord((0.000000,0.103000))); $returnShape.VertexN(1); $returnShape.TexCoordN($returnShape.AddTexCoord((1.000000,0.103000))); $returnShape.VertexN(12); $returnShape.TexCoordN($returnShape.AddTexCoord((0.975610,0.032770))); $returnShape.VertexN(11); $returnShape.TexCoordN($returnShape.AddTexCoord((0.898910,0.015420))); $returnShape.VertexN(25); $returnShape.CloseFace(); $returnShape.OpenFace($matIndex,FACE_HAS_TEXCOORDS); $returnShape.TexCoordN($returnShape.AddTexCoord((0.500000,0.000000))); $returnShape.VertexN(26); $returnShape.TexCoordN($returnShape.AddTexCoord((0.257470,0.003330))); $returnShape.VertexN(22); $returnShape.TexCoordN($returnShape.AddTexCoord((0.119550,0.015420))); $returnShape.VertexN(24); $returnShape.TexCoordN($returnShape.AddTexCoord((0.898910,0.015420))); $returnShape.VertexN(25); $returnShape.TexCoordN($returnShape.AddTexCoord((0.769480,0.003330))); $returnShape.VertexN(23); $returnShape.CloseFace(); $returnShape.Close();