// 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
//
//  Creation Date: 1998
//
//  Procedure Name:
//	AEstrokeTemplate
//
//  Description Name;
//	Creates the attribute editor controls for the stroke Node
//
//  Input Value:
//	nodeName 
//
//  Output Value:
//	None
// 

global string $positionStrokeName = "";

global proc positionStrokeReplace( string $nodeName )
{
	global string $positionStrokeName;
	radioButtonGrp -e 
		-onCommand1 ("setAttr "+$nodeName+" 1")
		-onCommand2 ("setAttr "+$nodeName+" 0")
		$positionStrokeName;

	if (`getAttr $nodeName`) {
		radioButtonGrp -e -select 1 $positionStrokeName;
	} else {
		radioButtonGrp -e -select 2 $positionStrokeName;
	}
}

global proc positionStrokeNew( string $nodeName )
{
	global string $positionStrokeName;
	if ($positionStrokeName == "" || !`radioButtonGrp -exists $positionStrokeName`) {
		$positionStrokeName = `radioButtonGrp
			-numberOfRadioButtons 2
			-label "Position Stroke"
			-labelArray2 "in 3D" "on View Plane"
			-columnWidth3 135 100 130
			positionStrokeButons`;
	}
	positionStrokeReplace( $nodeName );
}

//
//  Procedure Name:
//	AEbrushTemplate
//
global proc AEstrokeTemplate ( string $nodeName )
{
	editorTemplate -beginScrollLayout;

		editorTemplate -suppress "perspective";
		// What the heck are these things? APP 09mar00
		editorTemplate -suppress "useObjectColor";
		editorTemplate -suppress "objectColor";
		editorTemplate -suppress "drawOverride";
		editorTemplate -suppress "brush";
		editorTemplate -suppress "curveMode";
		editorTemplate -suppress "leafCurveMode";
		editorTemplate -suppress "flowerCurveMode";

		editorTemplate -callCustom "positionStrokeNew" "positionStrokeReplace" "perspective";
		editorTemplate -addControl -label "Display Quality" "displayPercent";
		editorTemplate -addControl "drawAsMesh";
		editorTemplate -addControl "sampleDensity";
		editorTemplate -addControl "seed";
		editorTemplate -addControl "drawOrder";
		editorTemplate -addControl "surfaceOffset";
		editorTemplate -addControl "smoothing";
		editorTemplate -addControl "motionBlurred";
		editorTemplate -interruptOptimize;
		editorTemplate -addControl "primaryVisibility";

		// Stroke Render
		// 
		editorTemplate -beginLayout "End Bounds" -collapse 1;
			editorTemplate -addControl "minClip";
			editorTemplate -addControl "maxClip";
		editorTemplate -endLayout;
		editorTemplate -beginLayout "Normal Direction" -collapse 1;
			editorTemplate -addControl "useNormal";
			editorTemplate -addControl "normal";
		editorTemplate -endLayout;
		editorTemplate -beginLayout "Pressure Mappings" -collapse 1;
			AEaddRampControl "pressureScale";
			editorTemplate -addControl "pressureMap1";
			editorTemplate -addControl "pressureMin1";
			editorTemplate -addControl "pressureMax1";
			editorTemplate -addSeparator;
			editorTemplate -addControl "pressureMap2";
			editorTemplate -addControl "pressureMin2";
			editorTemplate -addControl "pressureMax2";
			editorTemplate -addSeparator;
			editorTemplate -addControl "pressureMap3";
			editorTemplate -addControl "pressureMin3";
			editorTemplate -addControl "pressureMax3";
			editorTemplate -addControl "pressure";
		editorTemplate -endLayout;
		editorTemplate -beginLayout "Input Curves" -collapse 1;
			editorTemplate -addControl "pathCurve";
			editorTemplate -addControl "controlCurve";
		editorTemplate -endLayout;
		editorTemplate -beginLayout "Mesh Output" -collapse 1;
			editorTemplate -addControl -label "Color Per Vertex" "meshVertexColorMode";
			editorTemplate -addControl -label "Hard Edges" "meshHardEdges";
			editorTemplate -addControl -label "Output Quads" "meshQuadOutput";
			editorTemplate -addControl -label "Poly Limit" "meshPolyLimit";
			editorTemplate -addControl "cameraPoint";
			editorTemplate -beginLayout "Mesh Vertex Details" -collapse 1;
				editorTemplate -addControl -label "Main Vertex Buffer" "mainVertBufSize";
				editorTemplate -addControl -label "Leaf Vertex Buffer" "leafVertBufSize";
				editorTemplate -addControl -label "Flower Vertex Buffer" "flowerVertBufSize";
			editorTemplate -endLayout;
		editorTemplate -endLayout;
		editorTemplate -beginLayout "Nurbs Output" -collapse 1;
			editorTemplate -addControl "degree";
			editorTemplate -addControl "curveAlign";
		editorTemplate -endLayout;

		// include/call base class/node attributes
		AEshapeTemplate $nodeName;

	editorTemplate -addExtraControls;
	editorTemplate -endScrollLayout;

}
