// 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
//
//  Creation Date:	May 15, 1997
//
//
//  Procedure Name:
//		AEbrushTemplate
//
//  Description:
//		Creates the attribute editor controls for the brush Node
//
//  Input Value:
//		nodeName 
//
//  Output Value:
//		None
// 

//
//  Procedure Name:
//	AEassignBrushTextureCB
//

global proc int AEassignBrushTextureCB( string $fileAttribute,
                                 string $fileName,
                                 string $fileType )
{
	setAttr $fileAttribute -type "string" $fileName;

	string $currentDir = `workspace -q -dir`;
    retainWorkingDirectory ($currentDir);

	return true;
}

//
//  Procedure Name:
//	AEbrushTextureBrowser
//

global proc AEbrushTextureBrowser( string $cmd )
{
    string  $workspace = `workspace -q -fn`;
    setWorkingDirectory $workspace "image" "sourceImages";
	
	fileBrowser ($cmd, "Open", "image", 100);
}

//
//  Procedure Name:
//	AEbrushTextureNameNew 
//

global proc AEbrushTextureNameNew (string $fileAttribute)
{
	setUITemplate -pst attributeEditorTemplate;
	rowLayout -nc 3 textureNameLayout;
		text -l "Image Name";
		textField textureNameField;
			symbolButton -image "navButtonBrowse.xpm" browser;
	setParent ..;
	setUITemplate -ppt;
	
    AEbrushTextureNameReplace $fileAttribute;
}

//
//  Procedure Name:
//	AEbrushTextureNameReplace
//

global proc AEbrushTextureNameReplace (string $fileAttribute)
{
	connectControl -fileName textureNameField $fileAttribute;

    string $command = "AEassignBrushTextureCB "+" "+$fileAttribute;

    button -e -c
		("AEbrushTextureBrowser \"" + $command + "\"" ) browser;
}


global proc AEbrushCustomColor1New(string $label, int $idx, string $attrName1)
{
	global string $gAEbrushControls[];
	$gAEbrushControls[$idx] = `attrColorSliderGrp
		-l $label
		-sb false
		-at $attrName1
		customColorSlider`;
}
global proc AEbrushCustomColor1Replace(string $label, int $idx, string $attrName1)
{
	global string $gAEbrushControls[];
	attrColorSliderGrp
		-edit
		-at $attrName1
		-l $label
	$gAEbrushControls[$idx];
}
global proc checkBrushUseFrameExtension ( string $nodeName ) 
{
	string $nodeAttr = $nodeName + ".useFrameExtension";
	int $value = `getAttr $nodeAttr`;
	
	if ( $value == 1 ) {
		editorTemplate -dimControl $nodeName "frameExtension" false;
	} else {
		editorTemplate -dimControl $nodeName "frameExtension" true;
	}
}

//
//  Procedure Name:
//	AEbrushTemplate
//
global proc AEbrushTemplate ( string $nodeName )
{
	editorTemplate -beginNoOptimize;
	
	editorTemplate -beginScrollLayout;

		editorTemplate -addControl "brushType" "checkType";
		editorTemplate -addControl "globalScale";
		editorTemplate -beginLayout "Channels" -collapse 1;
			editorTemplate -addControl "depth" "checkDepth";
			editorTemplate -addControl "modifyDepth";
			editorTemplate -addControl "modifyColor";
			editorTemplate -addControl "modifyAlpha";
		editorTemplate -endLayout;
		editorTemplate -beginLayout "Brush Profile" -collapse 1;
			editorTemplate -addControl "brushWidth";
			editorTemplate -addControl "softness";
			editorTemplate -addControl "flatness1";
			editorTemplate -addControl "flatness2";
			editorTemplate -addControl "stampDensity";
			editorTemplate -addSeparator;
			editorTemplate -addControl "occlusionWidthScale";
			editorTemplate -addControl "edgeClip" "checkEdgeClip";
			editorTemplate -addControl "edgeClipDepth";
			editorTemplate -beginLayout "Screenspace Width Control" -collapse 1;
				editorTemplate -addControl "screenspaceWidth" "checkScreenspaceWidth";
				editorTemplate -addControl "distanceScaling";
				editorTemplate -addControl "minPixelWidth";
				editorTemplate -addControl "maxPixelWidth";
			editorTemplate -endLayout;
		editorTemplate -endLayout;
		editorTemplate -beginLayout "Twist" -collapse 1;			
			editorTemplate -addControl "forwardTwist";
			editorTemplate -addControl "twist";
			editorTemplate -addControl "twistRate";
			editorTemplate -addControl "twistRand";
		editorTemplate -endLayout;					
		editorTemplate -beginLayout "Thin Line Multi Streaks" -collapse 1;
			editorTemplate -addControl "multiStreaks";
			editorTemplate -addControl "multiStreakSpread1";
			editorTemplate -addControl "multiStreakSpread2";
			editorTemplate -label "Diffuse Random" -addControl "multiStreakDiffuseRand";
			editorTemplate -label "Specular Random" -addControl "multiStreakSpecularRand";
			editorTemplate -label "Light All Streaks" -addControl "multiStreakLightAll";
		editorTemplate -endLayout;

		editorTemplate -beginLayout "Mesh" -collapse 1;
			editorTemplate -addControl "tubeSections";
			editorTemplate -addControl "subSegments";
			editorTemplate -addControl "singleSided";
			editorTemplate -addControl "perPixelLighting";
			editorTemplate -addControl "endCaps";
			editorTemplate -addControl "hardEdges";
			editorTemplate -beginLayout "Thorns on Mesh" -collapse 1;
				editorTemplate -addControl "branchThorns" "checkThorns";
				editorTemplate -addControl "twigThorns" "checkThorns";
				editorTemplate -addControl "leafThorns" "checkThorns";
				editorTemplate -addControl "flowerThorns";
				editorTemplate -addControl "thornDensity";
				editorTemplate -addControl "thornElevation";
				editorTemplate -addControl "thornLength";
				editorTemplate -addControl "thornBaseWidth";
				editorTemplate -addControl "thornTipWidth";
				editorTemplate -addControl "thornSpecular";
				editorTemplate -addControl "thornBaseColor";
				editorTemplate -addControl "thornTipColor";
			editorTemplate -endLayout;
			editorTemplate -beginLayout "Mesh Environment Reflections" -collapse 1;
				editorTemplate -addControl "branchReflectivity";
				editorTemplate -addControl "leafReflectivity";
				editorTemplate -addControl "flowerReflectivity";
				AEaddRampControl "environment";
				AEaddRampControl "reflectionRolloff";
			editorTemplate -endLayout;
		editorTemplate -endLayout;


		editorTemplate -beginLayout "Shading" -collapse 1;
			editorTemplate -suppress "color1";
			editorTemplate -callCustom
				"AEbrushCustomColor1New \"Color1\" 1"
				"AEbrushCustomColor1Replace \"Color1\" 1"
				"color1";
			editorTemplate -suppress "incandescence1";
			editorTemplate -callCustom
				"AEbrushCustomColor1New \"Incandescence1\" 2"
				"AEbrushCustomColor1Replace \"Incandescence1\" 2"
				"incandescence1";
			editorTemplate -suppress "transparency1";
			editorTemplate -callCustom
				"AEbrushCustomColor1New \"Transparency1\" 3"
				"AEbrushCustomColor1Replace \"Transparency1\" 3"
				"transparency1";
			editorTemplate -addControl "blurIntensity" "checkType";
			editorTemplate -addControl "edgeAntialias";
			editorTemplate -beginLayout "    Tube Shading" -collapse 1;
				editorTemplate -suppress "color2";
				editorTemplate -callCustom
					"AEbrushCustomColor1New \"Color2\" 4"
					"AEbrushCustomColor1Replace \"Color2\" 4"
					"color2";
				editorTemplate -suppress "incandescence2";
				editorTemplate -callCustom
					"AEbrushCustomColor1New \"Incandescence2\" 5"
					"AEbrushCustomColor1Replace \"Incandescence2\" 5"
					"incandescence2";
				editorTemplate -suppress "transparency2";
				editorTemplate -callCustom
					"AEbrushCustomColor1New \"Transparency2\" 6"
					"AEbrushCustomColor1Replace \"Transparency2\" 6"
					"transparency2";
				editorTemplate -addControl "hueRand";
				editorTemplate -addControl "satRand";
				editorTemplate -addControl "valRand";
				editorTemplate -addControl "brightnessRand";
				editorTemplate -addControl "rootFade";
				editorTemplate -addControl "tipFade";
			editorTemplate -endLayout;
		editorTemplate -endLayout;


		editorTemplate -beginLayout "Texturing" -collapse 1;
			
			editorTemplate -addControl "mapColor" "checkMapping";
			editorTemplate -addControl "texColorScale";
			editorTemplate -addControl "texColorOffset";
			editorTemplate -addSeparator;
			editorTemplate -addControl "mapOpacity" "checkMapping";
			editorTemplate -addControl "texOpacityScale";
			editorTemplate -addControl "texOpacityOffset";
			editorTemplate -addSeparator;
			editorTemplate -addControl "mapDisplacement" "checkMapping";
			editorTemplate -addControl "displacementScale";
			editorTemplate -addControl "displacementOffset";
			editorTemplate -addControl "bumpIntensity";
			editorTemplate -addControl "bumpBlur";
			editorTemplate -addControl -label "Use Luminance" "luminanceIsDisplacement";
			editorTemplate -addSeparator;
			editorTemplate -addControl "textureType" "checkMapping";
			editorTemplate -addControl "mapMethod";
			editorTemplate -addControl "texUniformity";
			editorTemplate -suppress "texColor1";
			editorTemplate -callCustom
				"AEbrushCustomColor1New \"Tex Color1\" 7"
				"AEbrushCustomColor1Replace \"Tex Color1\" 7"
				"texColor1";
			editorTemplate -suppress "texColor2";
			editorTemplate -callCustom
				"AEbrushCustomColor1New \"Tex Color2\" 8"
				"AEbrushCustomColor1Replace \"Tex Color2\" 8"
				"texColor2";
			editorTemplate -addControl "texAlpha1";
			editorTemplate -addControl "texAlpha2";
				editorTemplate -addControl "repeatU";
			editorTemplate -addControl "repeatV";
			editorTemplate -addControl "offsetU";
			editorTemplate -addControl "offsetV";
			editorTemplate -addControl "blurMult";
			editorTemplate -addControl "smear";
			editorTemplate -addControl "smearU";
			editorTemplate -addControl "smearV";
			editorTemplate -addSeparator;
			editorTemplate -suppress "imageName";
			editorTemplate -callCustom "AEbrushTextureNameNew" 
					"AEbrushTextureNameReplace" 
					"imageName";
			editorTemplate -addControl "useFrameExtension" "checkBrushUseFrameExtension";
			editorTemplate -addControl "frameExtension";	
			editorTemplate -addControl "fringeRemoval";
			editorTemplate -addSeparator;
			editorTemplate -addControl "fractalAmplitude";
			editorTemplate -addControl "fractalRatio";
			editorTemplate -addControl "fractalThreshold";
			
		editorTemplate -endLayout;

	
		editorTemplate -beginLayout "Illumination" -collapse 1;
		
			editorTemplate -addControl "illuminated" "checkIllumination";
			editorTemplate -addControl "realLights" "checkIllumination";
			editorTemplate -addControl "lightingBasedWidth" "checkIllumination";
			editorTemplate -addControl "lightDirection";
			editorTemplate -addSeparator;
			editorTemplate -addControl "translucence";
			editorTemplate -addSeparator;
			editorTemplate -addControl "specular";
			editorTemplate -addControl "specularPower";
			editorTemplate -suppress "specularColor";
			editorTemplate -callCustom
				"AEbrushCustomColor1New \"Specular Color\" 9"
				"AEbrushCustomColor1Replace \"Specular Color\" 9"
				"specularColor";
		
		editorTemplate -endLayout;

		editorTemplate -beginLayout "Shadow Effects" -collapse 1;
		
			editorTemplate -addControl "fakeShadow" "checkFakeShadow";
			editorTemplate -addControl "shadowDiffusion";
			editorTemplate -addControl "shadowOffset";
			editorTemplate -label "Shadow Transp." -addControl "shadowTransparency";
			editorTemplate -addSeparator;
			editorTemplate -addControl "backShadow";
			editorTemplate -addControl "centerShadow";
			editorTemplate -addSeparator;
			editorTemplate -addControl "depthShadowType";
			editorTemplate -addControl "depthShadow";
			editorTemplate -addControl "depthShadowDepth";
			editorTemplate -addSeparator;
			editorTemplate -addControl "castShadows";
		
		editorTemplate -endLayout;

		editorTemplate -beginLayout "Glow" -collapse 1;
			editorTemplate -addControl "glow";
			editorTemplate -suppress "glowColor";
			editorTemplate -callCustom
				"AEbrushCustomColor1New \"Glow Color\" 10"
				"AEbrushCustomColor1Replace \"Glow Color\" 10"
				"glowColor";

			editorTemplate -addControl "glowSpread";
			editorTemplate -addSeparator;
			editorTemplate -addControl "shaderGlow";
		editorTemplate -endLayout;

		editorTemplate -beginLayout "Tubes" -collapse 1;
			editorTemplate -addControl "tubes" "checkTubes";
			editorTemplate -addControl "tubeCompletion";
		
			editorTemplate -beginLayout "    Creation" -collapse 1;
				editorTemplate -addControl "tubesPerStep";
				editorTemplate -addControl "tubeRand";
				editorTemplate -addControl "startTubes";
				editorTemplate -addControl "segments";
				editorTemplate -addSeparator;
				editorTemplate -addControl "lengthMin";
				editorTemplate -addControl "lengthMax";
				editorTemplate -addSeparator;
				editorTemplate -addControl "tubeWidth1";
				editorTemplate -addControl "tubeWidth2";
				editorTemplate -addControl "widthRand";
				editorTemplate -addControl "widthBias";
				editorTemplate -addSeparator;
				editorTemplate -addControl "segmentLengthBias";
				editorTemplate -addControl "segmentWidthBias";
				editorTemplate -addSeparator;
				AEaddRampControl "widthScale";
				editorTemplate -addSeparator;
				editorTemplate -addControl "tubeDirection";
				editorTemplate -addControl "elevationMin";
				editorTemplate -addControl "elevationMax";
				editorTemplate -addControl "azimuthMin";
				editorTemplate -addControl "azimuthMax";
				editorTemplate -addSeparator;
				editorTemplate -addControl "simplifyMethod";
			editorTemplate -endLayout;
		
			editorTemplate -beginLayout "    Growth" -collapse 1;
					editorTemplate -addControl "branches" "checkBranches";
					editorTemplate -addControl "twigs" "checkTwigs";
					editorTemplate -addControl "leaves" "checkLeaves";
					editorTemplate -addControl "flowers" "checkFlowers";
					editorTemplate -addControl "buds" "checkBuds";
				editorTemplate -beginLayout "        Branches" -collapse 1;
			
					editorTemplate -addControl "startBranches";
					editorTemplate -addControl "numBranches";
					editorTemplate -addControl "splitMaxDepth";
					editorTemplate -addControl "branchDropout";
					editorTemplate -addControl "splitRand";
					editorTemplate -addControl "splitAngle";
					editorTemplate -addControl "splitTwist";
					editorTemplate -addControl "splitSizeDecay";			
					editorTemplate -addControl "splitBias";
					editorTemplate -addControl "minSize";
					editorTemplate -addControl "middleBranch";
			
				editorTemplate -endLayout;
				editorTemplate -beginLayout "        Twigs" -collapse 1;
			
					editorTemplate -addControl "twigsInCluster";
					editorTemplate -addControl "numTwigClusters";
					editorTemplate -addControl "twigDropout";
					editorTemplate -addSeparator;
					editorTemplate -addControl "twigLength";
					editorTemplate -addControl "twigBaseWidth";
					editorTemplate -addControl "twigTipWidth";
					editorTemplate -addControl "twigStart";
					editorTemplate -addControl "twigAngle1";
					editorTemplate -addControl "twigAngle2";
					editorTemplate -addControl "twigTwist";
					editorTemplate -addControl "twigStiffness";
					editorTemplate -addControl "branchAfterTwigs";
					AEaddRampControl "twigLengthScale";
			
				editorTemplate -endLayout;
	
				editorTemplate -beginLayout "        Leaves" -collapse 1;
			
					editorTemplate -addControl "leavesInCluster";
					editorTemplate -addControl "numLeafClusters";
					editorTemplate -addControl "leafDropout";
					editorTemplate -addControl "leafLocation";
					editorTemplate -addSeparator;
					editorTemplate -addControl "leafLength";
					editorTemplate -addControl "leafBaseWidth";
					editorTemplate -addControl "leafTipWidth";
					AEaddRampControl "leafWidthScale";
					editorTemplate -addControl "leafStart";
					editorTemplate -addControl "leafAngle1";
					editorTemplate -addControl "leafAngle2";
					editorTemplate -addControl "leafTwist";
					editorTemplate -addControl "leafForwardTwist";
					editorTemplate -addControl "leafBend";
					AEaddRampControl "leafCurl";
					editorTemplate -addControl "leafTwirl";
					editorTemplate -addControl "leafSegments";
					editorTemplate -addControl "leafFlatness";
					editorTemplate -addControl "leafSizeDecay";
					editorTemplate -addControl "leafStiffness";
					editorTemplate -addControl "leafTranslucence";
					editorTemplate -addControl "leafSpecular";
					editorTemplate -addSeparator;
					editorTemplate -suppress "leafColor1";
					editorTemplate -callCustom
						"AEbrushCustomColor1New \"Leaf Color1\" 11"
						"AEbrushCustomColor1Replace \"Leaf Color1\" 11"
						"leafColor1";
					editorTemplate -suppress "leafColor2";
					editorTemplate -callCustom
						"AEbrushCustomColor1New \"Leaf Color2\" 12"
						"AEbrushCustomColor1Replace \"Leaf Color2\" 12"
						"leafColor2";
					editorTemplate -addControl "leafHueRand";
					editorTemplate -addControl "leafSatRand";
					editorTemplate -addControl "leafValRand";
					editorTemplate -addSeparator;
					editorTemplate -addControl "leafUseBranchTex" "checkLeafUseBranchTex";
					editorTemplate -suppress "leafImage";
					editorTemplate -callCustom "AEbrushTextureNameNew" 
						"AEbrushTextureNameReplace" 
						"leafImage";
					editorTemplate -addSeparator;
					editorTemplate -addControl "terminalLeaf";
				
				editorTemplate -endLayout;
				editorTemplate -beginLayout "        Flowers" -collapse 1;
				
					editorTemplate -addControl "petalsInFlower";
					editorTemplate -addControl "numFlowers";
					editorTemplate -addControl "petalDropout";
					editorTemplate -addControl "flowerLocation";
					editorTemplate -addSeparator;
					editorTemplate -addControl "petalLength";
					editorTemplate -addControl "petalBaseWidth";
					editorTemplate -addControl "petalTipWidth";
					AEaddRampControl "petalWidthScale";
					editorTemplate -addControl "flowerStart";
					editorTemplate -addControl "flowerAngle1";
					editorTemplate -addControl "flowerAngle2";
					editorTemplate -addControl "flowerTwist";
					editorTemplate -addControl "petalForwardTwist";
					editorTemplate -addControl "petalBend";
					AEaddRampControl "petalCurl";
					editorTemplate -addControl "petalTwirl";
					editorTemplate -addControl "petalSegments";
					editorTemplate -addControl "petalFlatness";
					editorTemplate -addControl "flowerSizeDecay";
					editorTemplate -addControl "flowerStiffness";
					editorTemplate -addSeparator;
					editorTemplate -addControl "flowerTranslucence";
					editorTemplate -addControl "flowerSpecular";
					editorTemplate -suppress "petalColor1";
					editorTemplate -callCustom
						"AEbrushCustomColor1New \"Petal Color1\" 13"
						"AEbrushCustomColor1Replace \"Petal Color1\" 13"
						"petalColor1";
					editorTemplate -suppress "petalColor2";
					editorTemplate -callCustom
						"AEbrushCustomColor1New \"Petal Color2\" 14"
						"AEbrushCustomColor1Replace \"Petal Color2\" 14"
						"petalColor2";
					editorTemplate -addControl "flowerHueRand";	
					editorTemplate -addControl "flowerSatRand";				
					editorTemplate -addControl "flowerValRand";
					editorTemplate -addSeparator;
					editorTemplate -addControl "flowerUseBranchTex" "checkFlowerUseBranchTex";
					editorTemplate -suppress "flowerImage";
					editorTemplate -callCustom "AEbrushTextureNameNew" 
						"AEbrushTextureNameReplace" 
						"flowerImage";
					
				editorTemplate -endLayout;
				editorTemplate -beginLayout "        Buds" -collapse 1;
					
					editorTemplate -addControl "budSize";

					editorTemplate -suppress "budColor";
					editorTemplate -callCustom
						"AEbrushCustomColor1New \"Bud Color\" 15"
						"AEbrushCustomColor1Replace \"Bud Color\" 15"
						"budColor";
					
				editorTemplate -endLayout;
			editorTemplate -endLayout;
			editorTemplate -beginLayout "    Behavior" -collapse 1;
				editorTemplate -beginLayout "        Displacement" -collapse 1;
				
					editorTemplate -addControl "displacementDelay";
					editorTemplate -addSeparator;
					editorTemplate -addControl "noise";
					editorTemplate -addControl "noiseFrequency";
					editorTemplate -addControl "noiseOffset";
					editorTemplate -addSeparator;
					editorTemplate -addControl "wiggle";
					editorTemplate -addControl "wiggleFrequency";
					editorTemplate -addControl "wiggleOffset";
					editorTemplate -addSeparator;
					editorTemplate -addControl "curl";
					editorTemplate -addControl "curlFrequency";
					editorTemplate -addControl "curlOffset";
					
				editorTemplate -endLayout;
				editorTemplate -beginLayout "        Forces" -collapse 1;			
					
					editorTemplate -addControl "pathFollow";
					editorTemplate -addControl "pathAttract";
					editorTemplate -addSeparator;
					editorTemplate -addControl "curveFollow";
					editorTemplate -addControl "curveAttract";
					editorTemplate -addControl "curveMaxDist";
					editorTemplate -addSeparator;
					editorTemplate -addControl "random";
					editorTemplate -addSeparator;
					editorTemplate -addControl "uniformForce";
					editorTemplate -addSeparator;
					editorTemplate -addControl "gravity";
					editorTemplate -addSeparator;
					editorTemplate -addControl "deflection" "checkDeflection";
					editorTemplate -addControl "deflectionMin";
					editorTemplate -addControl "deflectionMax";
					editorTemplate -addSeparator;
					editorTemplate -addControl "momentum";
					editorTemplate -addSeparator;
					editorTemplate -addControl "lengthFlex";
					
				editorTemplate -endLayout;
				editorTemplate -beginLayout "        Turbulence" -collapse 1;			
				
					editorTemplate -addControl "turbulenceType" "checkTurbulence";
					editorTemplate -label "Interpolation" -addControl "turbulenceInterpolation";
					editorTemplate -addControl "turbulence";
					editorTemplate -label "Frequency" -addControl "turbulenceFrequency";
					editorTemplate -addControl "turbulenceSpeed";
					editorTemplate -addControl "turbulenceOffset";
					
				editorTemplate -endLayout;
				editorTemplate -beginLayout "        Spiral" -collapse 1;			
					
					editorTemplate -addControl "spiralMin";
					editorTemplate -addControl "spiralMax";
					editorTemplate -addControl "spiralDecay";
					
				editorTemplate -endLayout;
				editorTemplate -beginLayout "        Bend" -collapse 1;			
					
					editorTemplate -addControl "bend";
					editorTemplate -addControl "bendBias";
					
				editorTemplate -endLayout;					
			editorTemplate -endLayout;
			editorTemplate -beginLayout "    Length Mappings" -collapse 1;			
				
				editorTemplate -addControl "colorLengthMap";
				editorTemplate -addControl "transpLengthMap";
				editorTemplate -addControl "incandLengthMap";
				editorTemplate -addControl "widthLengthMap";
				editorTemplate -addControl "splitLengthMap";

			editorTemplate -endLayout;
			editorTemplate -beginLayout "    User MEL Scripts" -collapse 1;
				editorTemplate -addControl "creationScript";
				editorTemplate -addControl "runtimeScript";
			editorTemplate -endLayout;
		editorTemplate -endLayout;
		editorTemplate -beginLayout "Gaps" -collapse 1;			
									
			editorTemplate -addControl "gapSize";
			editorTemplate -addControl "gapSpacing";
			editorTemplate -addControl "gapRand";
			
		editorTemplate -endLayout;
		editorTemplate -beginLayout "Flow Animation" -collapse 1;			
			editorTemplate -addControl "flowSpeed";
			editorTemplate -addControl "textureFlow";
			editorTemplate -addControl "strokeTime";
			editorTemplate -addControl "timeClip" "checkTimeClip";
			editorTemplate -label "Start Time (seconds)" -addControl "startTime";
			editorTemplate -label "End Time (seconds)" -addControl "endTime";
			editorTemplate -addControl "time";
		editorTemplate -endLayout;

		// include/call base class/node attributes
		AEdependNodeTemplate $nodeName;

	editorTemplate -addExtraControls;
	editorTemplate -endScrollLayout;
	
	editorTemplate -endNoOptimize;
}

// Dimming Code

global proc checkMapping(string $node)
{
	global string $gAEbrushControls[];
	int $val1 = `getAttr ($node+".mapColor")`;
	int $val2 = `getAttr ($node+".mapOpacity")`;
	int $val3 = `getAttr ($node+".mapDisplacement")`;
	int $ttype = `getAttr ($node+".textureType")`;
	float $color1[3] = `getAttr ($node+".color1")`;
	int $bType = `getAttr ($node+".brushType")`;
	int $illum = `getAttr ($node+".illuminated")`;
	$val3 = $val3 && ($bType == 5); //displacement only if meshtype
	int $val = 1;
	if ( $val1 + $val2 + $val3 > 0 ){
		$val = 0;
	}

	if ($val1) {
		// We are mapping color, so check that color1 is not 0 to insure the effect
		// of mapping appears.
		if ($color1[0] == 0 && $color1[1] == 0 && $color1[2] == 0) {
			// We might want to check to see if the values are attached, but it is unlikely,
			// so, we do not.
			setAttr ($node+".color1") 1 1 1;
		}
	}
	
	editorTemplate -dimControl $node "displacementScale" (!$val3);
	editorTemplate -dimControl $node "displacementOffset" (!$val3);
	editorTemplate -dimControl $node "bumpIntensity" (!$val3 || !$illum);
	editorTemplate -dimControl $node "bumpBlur" (!$val3 || !$illum);
	editorTemplate -dimControl $node "luminanceIsDisplacement" (!$val3);

	editorTemplate -dimControl $node "textureType" $val;
//	editorTemplate -dimControl $node "texColor1" $val;
//	editorTemplate -dimControl $node "texColor2" $val;

	//	Bug fix #117048.  The dangers of using global strings...
	//
	//	The global string values are not reset to null when the corresponding
	//	controls are deleted.  To fix this, simply ensure the control exists
	//	before editting it.  27jul99 - bwk
	//
	if (`attrColorSliderGrp -exists $gAEbrushControls[7]`) {
		attrColorSliderGrp -edit -en ($val1) $gAEbrushControls[7];
	}
	if (`attrColorSliderGrp -exists $gAEbrushControls[8]`) {
		attrColorSliderGrp -edit -en ($val1) $gAEbrushControls[8];
	}
	
	editorTemplate -dimControl $node "texColorScale" (!$val1);
	editorTemplate -dimControl $node "texColorOffset" (!$val1);
	editorTemplate -dimControl $node "texOpacityScale" (!$val2);
	editorTemplate -dimControl $node "texOpacityOffset" (!$val2);
	editorTemplate -dimControl $node "texAlpha1" (!($val2 || $val3));
	editorTemplate -dimControl $node "texAlpha2" (!($val2 || $val3));
	editorTemplate -dimControl $node "mapMethod" ($val || ($bType > 3));
	editorTemplate -dimControl $node "texUniformity" $val;	
	editorTemplate -dimControl $node "repeatU" $val;
	editorTemplate -dimControl $node "repeatV" $val;
	editorTemplate -dimControl $node "offsetU" $val;
	editorTemplate -dimControl $node "offsetV" $val;
	editorTemplate -dimControl $node "blurMult" $val;
	editorTemplate -dimControl $node "smear" $val;
	editorTemplate -dimControl $node "smearU" $val;
	editorTemplate -dimControl $node "smearV" $val;
	editorTemplate -dimControl $node "imageName" ($val || $ttype != 4);
	editorTemplate -dimControl $node "fringeRemoval" ($val || $ttype != 4);
	editorTemplate -dimControl $node "fractalAmplitude" ($val || $ttype != 3);
	editorTemplate -dimControl $node "fractalRatio" ($val || $ttype != 3);
	editorTemplate -dimControl $node "fractalThreshold" ($val || $ttype != 3);
}
	


global proc checkIllumination( string $node )
{
	global string $gAEbrushControls[];
	int $val = `getAttr ($node+".illuminated")`;
	int $diffuse = $val;
	if( !$diffuse  ){
		float $lb = `getAttr ($node+".lightingBasedWidth")`;
		if( $lb > 0.001 || $lb < -0.001) {
			$diffuse = true;
		}
	}
	int $val2 = `getAttr ($node+".realLights")`;
	int $tOn = `getAttr ($node+".tubes")`;
	int $bType = `getAttr ($node+".brushType")`;
	
	editorTemplate -dimControl $node "realLights" (!$diffuse);
	editorTemplate -dimControl $node "lightDirection" (!$diffuse || $val2);
	editorTemplate -dimControl $node "translucence" (!$val);
	editorTemplate -dimControl $node "specular" (!$val);
	editorTemplate -dimControl $node "specularPower" (!$val);
//	editorTemplate -dimControl $node "specularColor" (!$val);

	//	Bug fix #117048.  The dangers of using global strings...
	//
	//	The global string values are not reset to null when the corresponding
	//	controls are deleted.  To fix this, simply ensure the control exists
	//	before editting it.  27jul99 - bwk
	//
	if (`attrColorSliderGrp -exists $gAEbrushControls[9]`) {
		attrColorSliderGrp -edit -en $val $gAEbrushControls[9];
	}
	
	editorTemplate -dimControl $node "leafTranslucence" (!$val || !$tOn);
	editorTemplate -dimControl $node "flowerTranslucence" (!$val || !$tOn);
	editorTemplate -dimControl $node "leafSpecular" (!$val || !$tOn);
	editorTemplate -dimControl $node "flowerSpecular" (!$val || !$tOn);

	int $dim =($bType !=4) || (!$val);
	editorTemplate -dimControl $node "multiStreakSpecularRand" $dim;
	editorTemplate -dimControl $node "multiStreakLightAll" $dim;

	// if brush is not mesh, or not illuminated, perPixelLighting is dimmed
	int $isMesh = ($bType == 5);
	editorTemplate -dimControl $node "perPixelLighting" (!$isMesh || !$val);
}


global proc checkFakeShadow( string $node )
{
	int $val = `getAttr ($node+".fakeShadow")`;
	int $bType = `getAttr ($node+".brushType")`;
	int $dim = ($val == 0) || ($bType > 3);
	editorTemplate -dimControl $node "shadowDiffusion" $dim;
	editorTemplate -dimControl $node "shadowTransparency" $dim;
	editorTemplate -dimControl $node "shadowOffset" ($val != 1);
}


global proc checkBranches ( string $node )
{
	int $tOn = `getAttr ($node+".tubes")`;
	int $bOn = `getAttr ($node+".branches")`;
	int $dim = !$tOn || !$bOn;
	
	editorTemplate -dimControl $node "branches" (!$tOn);
	editorTemplate -dimControl $node "startBranches" $dim;
	editorTemplate -dimControl $node "numBranches" $dim;
	editorTemplate -dimControl $node "splitMaxDepth" $dim;
	editorTemplate -dimControl $node "branchDropout" $dim;
	editorTemplate -dimControl $node "splitRand" $dim;
	editorTemplate -dimControl $node "splitAngle" $dim;
	editorTemplate -dimControl $node "splitTwist" $dim;
	editorTemplate -dimControl $node "splitSizeDecay" $dim;			
	editorTemplate -dimControl $node "splitBias" $dim;
	editorTemplate -dimControl $node "splitTwist" $dim;
	editorTemplate -dimControl $node "minSize" $dim;
	editorTemplate -dimControl $node "middleBranch" $dim;
}
	

global proc checkTwigs ( string $node )
{
	int $tOn = `getAttr ($node+".tubes")`;
	int $bOn = `getAttr ($node+".twigs")`;
	int $dim = !$tOn || !$bOn;
	int $bType = `getAttr ($node+".brushType")`;
	int $isMesh = ($bType == 5);

	editorTemplate -dimControl $node "twigs" (!$tOn);
	editorTemplate -dimControl $node "twigsInCluster" $dim;
	editorTemplate -dimControl $node "numTwigClusters" $dim;
	editorTemplate -dimControl $node "twigDropout" $dim;
	editorTemplate -dimControl $node "twigLength" $dim;
	editorTemplate -dimControl $node "twigBaseWidth" $dim;
	editorTemplate -dimControl $node "twigTipWidth" $dim;
	editorTemplate -dimControl $node "twigStart" $dim;
	editorTemplate -dimControl $node "twigAngle1" $dim;
	editorTemplate -dimControl $node "twigAngle2" $dim;
	editorTemplate -dimControl $node "twigTwist" $dim;
	editorTemplate -dimControl $node "twigStiffness" $dim;
	editorTemplate -dimControl $node "twigThorns" ($dim || !$isMesh);
	editorTemplate -dimControl $node "branchAfterTwigs" $dim;
	editorTemplate -dimControl $node "twigLengthScale" $dim;
	editorTemplate -dimControl $node "twigLengthScale_Interp" $dim;
}

global proc checkLeafUseBranchTex ( string $node )
{
	global string $gAEbrushControls[];
	int $tOn = `getAttr ($node+".tubes")`;
	int $lOn = `getAttr ($node+".leaves")`;
	int $uOn = `getAttr ($node+".leafUseBranchTex")`;
	int $dim = !$tOn || !$lOn || $uOn;
	editorTemplate -dimControl $node "leafImage" $dim;
}

global proc checkLeaves ( string $node )
{
	global string $gAEbrushControls[];
	int $tOn = `getAttr ($node+".tubes")`;
	int $lOn = `getAttr ($node+".leaves")`;
	int $iOn = `getAttr ($node+".illuminated")`;
	int $dim = !$tOn || !$lOn;
	int $bType = `getAttr ($node+".brushType")`;
	int $isMesh = ($bType == 5);
	editorTemplate -dimControl $node "leaves" (!$tOn);
	editorTemplate -dimControl $node "leavesInCluster" $dim;
	editorTemplate -dimControl $node "numLeafClusters" $dim;
	editorTemplate -dimControl $node "leafDropout" $dim;
	editorTemplate -dimControl $node "leafLength" $dim;
	editorTemplate -dimControl $node "leafBaseWidth" $dim;
	editorTemplate -dimControl $node "leafTipWidth" $dim;
	editorTemplate -dimControl $node "leafStart" $dim;
	editorTemplate -dimControl $node "leafAngle1" $dim;
	editorTemplate -dimControl $node "leafAngle2" $dim;
	editorTemplate -dimControl $node "leafTwist" $dim;
	editorTemplate -dimControl $node "leafSegments" $dim;
	editorTemplate -dimControl $node "leafFlatness" $dim;
	editorTemplate -dimControl $node "leafSizeDecay" $dim;
	editorTemplate -dimControl $node "leafTranslucence" ($dim || !$iOn);
	editorTemplate -dimControl $node "terminalLeaf" $dim;
	editorTemplate -dimControl $node "leafWidthScale" $dim;
	editorTemplate -dimControl $node "leafWidthScale_Interp" $dim;
	editorTemplate -dimControl $node "leafBend" $dim;
	editorTemplate -dimControl $node "leafCurl" $dim;
	editorTemplate -dimControl $node "leafCurl_Interp" $dim;
	editorTemplate -dimControl $node "leafTwirl" $dim;
	editorTemplate -dimControl $node "leafStiffness" $dim;
	editorTemplate -dimControl $node "leafSpecular" ($dim || (!$iOn));
	editorTemplate -dimControl $node "leafThorns" ($dim || (!$isMesh));
	editorTemplate -dimControl $node "leafReflectivity" ($dim || (!$isMesh));
//	editorTemplate -dimControl $node "leafColor1" $dim;
//	editorTemplate -dimControl $node "leafColor2" $dim;

	//	Bug fix #117048.  The dangers of using global strings...
	//
	//	The global string values are not reset to null when the corresponding
	//	controls are deleted.  To fix this, simply ensure the control exists
	//	before editting it.  27jul99 - bwk
	//
	if (`attrColorSliderGrp -exists $gAEbrushControls[11]`) {
		attrColorSliderGrp -edit -en (!$dim) $gAEbrushControls[11];
	}
	if (`attrColorSliderGrp -exists $gAEbrushControls[12]`) {
		attrColorSliderGrp -edit -en (!$dim) $gAEbrushControls[12];
	}
	
	editorTemplate -dimControl $node "leafHueRand" $dim;
	editorTemplate -dimControl $node "leafSatRand" $dim;
	editorTemplate -dimControl $node "leafValRand" $dim;
	editorTemplate -dimControl $node "leafUseBranchTex" $dim;
	checkLeafUseBranchTex( $node );
}


global proc checkType ( string $node )
{
	//	Temporary Maya 2.5 fix for bug #117249.  Ensure the object exists to 
	//	prevent error message from being printed.
	//	09aug99 - bwk
	//
	if (!`objExists $node`) return;
	int $bType = `getAttr ($node+".brushType")`;
	int $illum = `getAttr ($node+".illuminated")`;
	int $leaves = `getAttr ($node+".leaves")`;
	int $flowers = `getAttr ($node+".flowers")`;
	int $tubes = `getAttr ($node+".tubes")`;
	$leaves = $leaves && $tubes;
	$flowers = $flowers && $tubes;
	editorTemplate -dimControl $node "blurIntensity" (!($bType == 2));
	int $isThinLine = ($bType == 4);
	int $isMesh = ($bType == 5);
	editorTemplate -dimControl $node "stampDensity" ($bType > 3);
	editorTemplate -dimControl $node "edgeAntialias" ($bType > 3);
	editorTemplate -dimControl $node "occlusionWidthScale" ($bType > 3);
	checkThorns( $node );
	checkFakeShadow( $node );
	checkMapping( $node );
	int $dim = !$isThinLine;
	editorTemplate -dimControl $node "multiStreaks" $dim;
	editorTemplate -dimControl $node "multiStreakSpread1" $dim;
	editorTemplate -dimControl $node "multiStreakSpread2" ($dim || !$tubes);
	editorTemplate -dimControl $node "multiStreakDiffuseRand" $dim;
	editorTemplate -dimControl $node "multiStreakSpecularRand" ($dim || (!$illum));
	editorTemplate -dimControl $node "multiStreakLightAll" ($dim || (!$illum));
	$dim = $isThinLine;
	editorTemplate -dimControl $node "flatness1" $dim;
	editorTemplate -dimControl $node "flatness2" ($dim || !$tubes);
	editorTemplate -dimControl $node "softness" $dim;
	$dim = !$isMesh;
	editorTemplate -dimControl $node "environment" $dim;
	editorTemplate -dimControl $node "environment_Interp" $dim;
	editorTemplate -dimControl $node "reflectionRolloff" $dim;
	editorTemplate -dimControl $node "reflectionRolloff_Interp" $dim;
	editorTemplate -dimControl $node "branchReflectivity" $dim;
	editorTemplate -dimControl $node "leafReflectivity" ($dim || (!$leaves));
	editorTemplate -dimControl $node "flowerReflectivity" ($dim || (!$flowers));
	editorTemplate -dimControl $node "singleSided" $dim;
	editorTemplate -dimControl $node "perPixelLighting" ($dim || (!$illum));


	
}

global proc checkThorns( string $node )
{
	int $bType = `getAttr ($node+".brushType")`;
	int $flowers = `getAttr ($node+".flowers")`;
	int $leaves = `getAttr ($node+".leaves")`;
	int $twigs = `getAttr ($node+".twigs")`;
	int $tubes = `getAttr ($node+".tubes")`;
	$leaves = $leaves && $tubes;
	$flowers = $flowers && $tubes;
	$twigs = $twigs && $tubes;
	int $isMesh = ($bType == 5);
	int $dim = !$isMesh;
	editorTemplate -dimControl $node "branchThorns" $dim;
	editorTemplate -dimControl $node "twigThorns" ($dim || !$twigs);
	editorTemplate -dimControl $node "leafThorns" ($dim || !$leaves);
	editorTemplate -dimControl $node "flowerThorns" ($dim || !$flowers);
	if( !$dim ){
		int $isThorn = (`getAttr ($node+".branchThorns")`
					|| `getAttr ($node+".twigThorns")`
					|| `getAttr ($node+".leafThorns")`
					|| `getAttr ($node+".flowerThorns")`);
		$dim = $dim || (!$isThorn);
	}

	editorTemplate -dimControl $node "thornDensity" $dim;
	editorTemplate -dimControl $node "thornElevation" $dim;
	editorTemplate -dimControl $node "thornLength" $dim;
	editorTemplate -dimControl $node "thornBaseWidth" $dim;
	editorTemplate -dimControl $node "thornTipWidth" $dim;
	editorTemplate -dimControl $node "thornSpecular" $dim;
	editorTemplate -dimControl $node "thornBaseColor" $dim;
	editorTemplate -dimControl $node "thornTipColor" $dim;
}


global proc checkDepth ( string $node )
{
	int $dOn = `getAttr ($node+".depth")`;
	editorTemplate -dimControl $node "modifyDepth" (!$dOn);
}

global proc checkFlowerUseBranchTex ( string $node )
{
	global string $gAEbrushControls[];
	int $tOn = `getAttr ($node+".tubes")`;
	int $lOn = `getAttr ($node+".flowers")`;
	int $uOn = `getAttr ($node+".flowerUseBranchTex")`;
	int $dim = !$tOn || !$lOn || $uOn;
	editorTemplate -dimControl $node "flowerImage" $dim;
}

global proc checkFlowers ( string $node )
{
	global string $gAEbrushControls[];
	int $tOn = `getAttr ($node+".tubes")`;
	int $fOn = `getAttr ($node+".flowers")`;
	int $iOn = `getAttr ($node+".illuminated")`;
	int $dim = !$tOn || !$fOn;
	int $bType = `getAttr ($node+".brushType")`;
	int $isMesh = ($bType == 5);

	editorTemplate -dimControl $node "flowers" (!$tOn);
	editorTemplate -dimControl $node "petalsInFlower" $dim;
	editorTemplate -dimControl $node "numFlowers" $dim;
	editorTemplate -dimControl $node "petalDropout" $dim;
	editorTemplate -dimControl $node "petalLength" $dim;
	editorTemplate -dimControl $node "petalBaseWidth" $dim;
	editorTemplate -dimControl $node "petalTipWidth" $dim;
	editorTemplate -dimControl $node "flowerStart" $dim;
	editorTemplate -dimControl $node "flowerAngle1" $dim;
	editorTemplate -dimControl $node "flowerAngle2" $dim;
	editorTemplate -dimControl $node "flowerTwist" $dim;
	editorTemplate -dimControl $node "petalSegments" $dim;
	editorTemplate -dimControl $node "petalFlatness" $dim;
	editorTemplate -dimControl $node "flowerSizeDecay" $dim;
	editorTemplate -dimControl $node "flowerTranslucence" ($dim || !$iOn);
	editorTemplate -dimControl $node "flowerSpecular" ($dim || !$iOn);
	editorTemplate -dimControl $node "flowerThorns" ($dim || !$isMesh);
	editorTemplate -dimControl $node "flowerReflectivity" ($dim || (!$isMesh));
	editorTemplate -dimControl $node "petalWidthScale" $dim;
	editorTemplate -dimControl $node "petalWidthScale_Interp" $dim;
	editorTemplate -dimControl $node "petalBend" $dim;
	editorTemplate -dimControl $node "petalCurl" $dim;
	editorTemplate -dimControl $node "petalCurl_Interp" $dim;
	editorTemplate -dimControl $node "petalTwirl" $dim;
	editorTemplate -dimControl $node "flowerStiffness" $dim;
//	editorTemplate -dimControl $node "petalColor1" $dim;
//	editorTemplate -dimControl $node "petalColor2" $dim;

	//	Bug fix #117048.  The dangers of using global strings...
	//
	//	The global string values are not reset to null when the corresponding
	//	controls are deleted.  To fix this, simply ensure the control exists
	//	before editting it.  27jul99 - bwk
	//
	if (`attrColorSliderGrp -exists $gAEbrushControls[13]`) {
		attrColorSliderGrp -edit -en (!$dim) $gAEbrushControls[13];
	}
	if (`attrColorSliderGrp -exists $gAEbrushControls[14]`) {
		attrColorSliderGrp -edit -en (!$dim) $gAEbrushControls[14];
	}
	
	editorTemplate -dimControl $node "flowerHueRand" $dim;
	editorTemplate -dimControl $node "flowerSatRand" $dim;					
	editorTemplate -dimControl $node "flowerValRand" $dim;
	editorTemplate -dimControl $node "flowerUseBranchTex" $dim;
	checkFlowerUseBranchTex( $node );
}



global proc checkBuds ( string $node )
{
	global string $gAEbrushControls[];
	int $tOn = `getAttr ($node+".tubes")`;
	int $bOn = `getAttr ($node+".buds")`;
	int $dim = !$tOn || !$bOn;
	
	editorTemplate -dimControl $node "buds" (!$tOn);
	editorTemplate -dimControl $node "budSize" $dim;
//	editorTemplate -dimControl $node "budColor" $dim;

	//	Bug fix #117048.  The dangers of using global strings...
	//
	//	The global string values are not reset to null when the corresponding
	//	controls are deleted.  To fix this, simply ensure the control exists
	//	before editting it.  27jul99 - bwk
	//
	if (`attrColorSliderGrp -exists $gAEbrushControls[15]`) {
		attrColorSliderGrp -edit -en (!$dim) $gAEbrushControls[15];
	}
}


global proc checkDeflection ( string $node )
{
	int $tOn = `getAttr ($node+".tubes")`;
	int $dOn = `getAttr ($node+".deflection")`;
	int $dim = !$tOn || !$dOn;
	editorTemplate -dimControl $node "deflection" (!$tOn);
	editorTemplate -dimControl $node "deflectionMin" $dim;
	editorTemplate -dimControl $node "deflectionMax" $dim;
}


global proc checkTurbulence ( string $node )
{
	int $tOn = `getAttr ($node+".tubes")`;
	int $ttOn = `getAttr ($node+".turbulenceType")`;
	int $dim = !$tOn || ($ttOn == 0);
	
	editorTemplate -dimControl $node "turbulenceType" (!$tOn);
	editorTemplate -dimControl $node "turbulenceInterpolation" $dim;
	editorTemplate -dimControl $node "turbulence" $dim;
	editorTemplate -dimControl $node "turbulenceFrequency" $dim;
	editorTemplate -dimControl $node "turbulenceSpeed" $dim;
	editorTemplate -dimControl $node "turbulenceOffset" $dim;
}


global proc checkTimeClip ( string $node )
{
	int $tOn = `getAttr ($node+".timeClip")`;
	int $dim = !$tOn;
	editorTemplate -dimControl $node "startTime" $dim;
	editorTemplate -dimControl $node "endTime" $dim;
}

global proc checkScreenspaceWidth ( string $node )
{
	int $sOn = `getAttr ($node+".screenspaceWidth")`;
	int $dim = !$sOn;
	editorTemplate -dimControl $node "distanceScaling" $dim;
	editorTemplate -dimControl $node "minPixelWidth" $dim;
	editorTemplate -dimControl $node "maxPixelWidth" $dim;
}
	
global proc checkEdgeClip ( string $node )
{
	int $sOn = `getAttr ($node+".edgeClip")`;
	editorTemplate -dimControl $node "edgeClipDepth" (!$sOn);
}

global proc checkTubes ( string $node )
{
	global string $gAEbrushControls[];
	int $tOn = `getAttr ($node+".tubes")`;
	int $tOff = !$tOn;

	int $bType = `getAttr ($node+".brushType")`;
	int $isThinLine = ($bType == 4);
	
	editorTemplate -dimControl $node "tubeCompletion" $tOff;
	editorTemplate -dimControl $node "simplifyMethod" $tOff;
	editorTemplate -dimControl $node "tubesPerStep" $tOff;
	editorTemplate -dimControl $node "startTubes" $tOff;
	editorTemplate -dimControl $node "lengthMin" $tOff;
	editorTemplate -dimControl $node "lengthMax" $tOff;
	editorTemplate -dimControl $node "tubeWidth1" $tOff;
	editorTemplate -dimControl $node "tubeWidth2" $tOff;
	editorTemplate -dimControl $node "widthRand" $tOff;
	editorTemplate -dimControl $node "widthBias" $tOff;
	editorTemplate -dimControl $node "segments" $tOff;
	editorTemplate -dimControl $node "segmentLengthBias" $tOff;
	editorTemplate -dimControl $node "segmentWidthBias" $tOff;
	editorTemplate -dimControl $node "tubeDirection" $tOff;
	editorTemplate -dimControl $node "tubeRand" $tOff;
	editorTemplate -dimControl $node "elevationMin" $tOff;
	editorTemplate -dimControl $node "elevationMax" $tOff;
	editorTemplate -dimControl $node "azimuthMin" $tOff;
	editorTemplate -dimControl $node "azimuthMax" $tOff;


//	editorTemplate -dimControl $node "color2" $tOff;
//	editorTemplate -dimControl $node "incandescence2" $tOff;
//	editorTemplate -dimControl $node "transparency2" $tOff;

	//	Bug fix #117048.  The dangers of using global strings...
	//
	//	The global string values are not reset to null when the corresponding
	//	controls are deleted.  To fix this, simply ensure the control exists
	//	before editting it.  27jul99 - bwk
	//
	if (`attrColorSliderGrp -exists $gAEbrushControls[4]`) {
		attrColorSliderGrp -edit -en $tOn $gAEbrushControls[4];
	}
	if (`attrColorSliderGrp -exists $gAEbrushControls[5]`) {
		attrColorSliderGrp -edit -en $tOn $gAEbrushControls[5];
	}
	if (`attrColorSliderGrp -exists $gAEbrushControls[6]`) {
		attrColorSliderGrp -edit -en $tOn $gAEbrushControls[6];
	}

	editorTemplate -dimControl $node "flatness2" ($tOff || $isThinLine);
	editorTemplate -dimControl $node "brightnessRand" $tOff;
	editorTemplate -dimControl $node "rootFade" $tOff;
	editorTemplate -dimControl $node "tipFade" $tOff;
	editorTemplate -dimControl $node "hueRand" $tOff;
	editorTemplate -dimControl $node "satRand" $tOff;
	editorTemplate -dimControl $node "valRand" $tOff;
	
	checkBranches( $node );
	checkTwigs( $node );
	checkLeaves( $node );
	checkFlowers( $node );
	checkBuds( $node );
	
	editorTemplate -dimControl $node "displacementDelay" $tOff;
	editorTemplate -dimControl $node "noise" $tOff;
	editorTemplate -dimControl $node "noiseFrequency" $tOff;
	editorTemplate -dimControl $node "noiseOffset" $tOff;
	editorTemplate -dimControl $node "wiggle" $tOff;
	editorTemplate -dimControl $node "wiggleFrequency" $tOff;
	editorTemplate -dimControl $node "wiggleOffset" $tOff;
	editorTemplate -dimControl $node "curl" $tOff;
	editorTemplate -dimControl $node "curlFrequency" $tOff;
	editorTemplate -dimControl $node "curlOffset" $tOff;
					
	editorTemplate -dimControl $node "pathFollow" $tOff;
	editorTemplate -dimControl $node "pathAttract" $tOff;
	editorTemplate -dimControl $node "curveFollow" $tOff;
	editorTemplate -dimControl $node "curveAttract" $tOff;
	editorTemplate -dimControl $node "curveMaxDist" $tOff;
	editorTemplate -dimControl $node "random" $tOff;
	editorTemplate -dimControl $node "uniformForce" $tOff;
	editorTemplate -dimControl $node "gravity" $tOff;

	editorTemplate -dimControl $node "twistRand" $tOff;

	checkDeflection( $node );

	editorTemplate -dimControl $node "momentum" $tOff;
	editorTemplate -dimControl $node "lengthFlex" $tOff;
	
	checkTurbulence( $node );
	
	editorTemplate -dimControl $node "spiralMin" $tOff;
	editorTemplate -dimControl $node "spiralMax" $tOff;
	editorTemplate -dimControl $node "spiralDecay" $tOff;
					
	checkTimeClip( $node );
		
	editorTemplate -dimControl $node "colorLengthMap" $tOff;
	editorTemplate -dimControl $node "transpLengthMap" $tOff;
	editorTemplate -dimControl $node "incandLengthMap" $tOff;
	editorTemplate -dimControl $node "widthLengthMap" $tOff;
	editorTemplate -dimControl $node "splitLengthMap" $tOff;

	editorTemplate -dimControl $node "creationScript" $tOff;
	editorTemplate -dimControl $node "runtimeScript" $tOff;

	editorTemplate -dimControl $node "multiStreakSpread2" ($tOff || !$isThinLine);

}
		
