// Copyright (C) 1997-2004 Alias Systems Corp.
// 
// The information in this file is provided for the exclusive use of the
// licensees of Alias.  Such users have the right to use, modify,
// and incorporate this code into other products for purposes authorized
// by the Alias license agreement, without fee.
// 
// ALIAS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
// INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
// EVENT SHALL ALIAS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
// CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.

// Alias Script File
// MODIFY THIS AT YOUR OWN RISK
//
// makeTubeOn
//
// This function turns tubes on for the current template brush,
// and sets the tube generation parameters such that there is 
// little change in appearance. A single tube is created that
// exactly follows the brush path and has the same width as
// the brush.
//<doc>
//<name makeTubeOn>
//<owner "Alias Unsupported">
//
//<synopsis>
//	makeTubeOn ()
//
//<returns>
//  None.
//
//<description>
// This function turns tubes on for the current template brush,
// and sets the tube generation parameters such that there is 
// little change in appearance. A single tube is created that
// exactly follows the brush path and has the same width as
// the brush.
//
//<flags>
//	None.
//<examples>
//  makeTubeOn;
//
//</doc>

global proc
makeTubeOn()
{
	string $brush = getDefaultBrush();
	setAttr ($brush + ".tubes") 1;	
	setAttr ($brush + ".startTubes") 1;	
	setAttr ($brush + ".tubesPerStep") 0;	
	setAttr ($brush + ".segments") 500;	
	setAttr ($brush + ".elevationMin") 0;	
	setAttr ($brush + ".elevationMax") 0;	
	setAttr ($brush + ".azimuthMin") 0;	
	setAttr ($brush + ".azimuthMax") 0;	
	setAttr ($brush + ".tubeCompletion") 0;	
	setAttr ($brush + ".branches") 0;	
	setAttr ($brush + ".twigs") 0;	
	setAttr ($brush + ".leaves") 0;	
	setAttr ($brush + ".flowers") 0;	
	setAttr ($brush + ".pathFollow") 1.0;	
	setAttr ($brush + ".pathAttract") 0.0;	
	setAttr ($brush + ".random") 0.0;	
	setAttr ($brush + ".gravity") 0.0;	
	setAttr ($brush + ".lengthFlex") 1.0;	
	if( getAttr( $brush + ".mapMethod" ) > 1 )
	{
		float $uRep = getAttr( $brush + ".repeatU" );
		setAttr  ($brush + ".repeatU") ($uRep * 100);
	}
	float $colr[] = getAttr( $brush + ".color1" );
	setAttr  ($brush + ".color2") $colr[0] $colr[1] $colr[2];
	$colr = getAttr( $brush + ".incandescence1" );
	setAttr  ($brush + ".incandescence2") $colr[0] $colr[1] $colr[2];
	$colr = getAttr( $brush + ".transparency1" );
	setAttr  ($brush + ".transparency2") $colr[0] $colr[1] $colr[2];

	float $flatness = getAttr( $brush + ".flatness1" );
	setAttr  ($brush + ".flatness2") $flatness;
	float $wid = getAttr( $brush + ".brushWidth" );
	setAttr  ($brush + ".tubeWidth1") $wid;
	setAttr  ($brush + ".tubeWidth2") $wid;
}

