global proc AEBranchTemplate( string $nodeName )
{
	editorTemplate -beginScrollLayout;
	
		// The all go into the collapsable "Parameters" section
		editorTemplate -beginLayout "Overall" -collapse false;

			// Add the default controls
			editorTemplate -addControl "pathSmooth" "XFUpdateObject ";
			editorTemplate -addControl "shapeSmooth";
			editorTemplate -addControl "growth";
			editorTemplate -addControl "growthInherit";
			editorTemplate -addControl "thicknessInherit";
			editorTemplate -addControl "nodeDensityInherit";
			editorTemplate -addControl "evaluation";					editorTemplate -addControl "uvBulgeToLength";
			
		editorTemplate -endLayout;
		
		editorTemplate -beginLayout "Multiplication" -collapse true;
		
			editorTemplate -beginNoOptimize;
		
			editorTemplate -addControl "updateMesh";
			editorTemplate -addControl "updateTesselatedMesh";
			editorTemplate -addControl "updateTextures";
			editorTemplate -addControl "updateMultipliedTransforms";
			
			editorTemplate -addControl "nodeNumber" "XFUpdateObject ";
			
			editorTemplate -addSeparator;
			
			editorTemplate -endNoOptimize;
				
			//Add the default controls for the Multiplication-Handling
			string $newFuncAttrib = "branchMultNewAttrib";
			string $replaceFuncAttrib = "branchMultReplaceAttrib";
			editorTemplate -callCustom $newFuncAttrib $replaceFuncAttrib "";
								
		editorTemplate -endLayout;

		editorTemplate -beginLayout "Standard Curve Parameters" -collapse false;
					
			//Add the default controls for the CurveParameters
			string $newFuncAttrib = "branchCurvNewAttrib";
			string $replaceFuncAttrib = "branchCurvReplaceAttrib";
			editorTemplate -callCustom $newFuncAttrib $replaceFuncAttrib "";
			
			editorTemplate -addControl "setNodeThickness";
			editorTemplate -addControl "setNodeGrowth";
			editorTemplate -addControl "setNodeDensity";
		
		editorTemplate -endLayout;
		
		/*editorTemplate -beginLayout "Extra Curve Parameters - not yet implemented" -collapse true;
							
			//Add the default controls for the ExtraCurveParameters
			//string $newFuncAttrib = "branchExtraNewAttrib";
			//string $replaceFuncAttrib = "branchExtraReplaceAttrib";
			//editorTemplate -callCustom $newFuncAttrib $replaceFuncAttrib "";
				
		editorTemplate -endLayout;*/
		
		editorTemplate -beginLayout "Family" -collapse false;
		
			//Add the default controls for the Family-Members-Handling
			string $newFuncAttrib = "branchFamilyNewAttrib";
			string $replaceFuncAttrib = "branchFamilyReplaceAttrib";
			editorTemplate -callCustom $newFuncAttrib $replaceFuncAttrib "";	
						
		editorTemplate -endLayout;
		
		editorTemplate -beginLayout "Pruning" -collapse false;
			
			//Add the default controls for the pruning-object
			string $newFuncAttrib = "branchPruneNewAttrib";
			string $replaceFuncAttrib = "branchPruneReplaceAttrib";
			editorTemplate -callCustom $newFuncAttrib $replaceFuncAttrib "";
						
			editorTemplate -addControl "pruneType";
			
		editorTemplate -endLayout;
		
		editorTemplate -beginLayout "Capping" -collapse false;
		
			editorTemplate -addControl "startCap";
			editorTemplate -addControl "endCap";
			
		editorTemplate -endLayout;
		
		editorTemplate -beginLayout "Deviation" -collapse false;
		
			editorTemplate -addControl "useDeviation";
			
			//Add the default controls for the deviation-curveParam
			string $newFuncAttrib = "branchDeviationNewAttrib";
			string $replaceFuncAttrib = "branchDeviationReplaceAttrib";
			editorTemplate -callCustom $newFuncAttrib $replaceFuncAttrib "";
			
		editorTemplate -endLayout;
		
		editorTemplate -beginLayout "Xfrog HD" -collapse true;
		
			editorTemplate -addControl "singleEvaluation";
				
			//Add the default controls for the Alternates-Handling
			string $newFuncAttrib = "branchAlternateNewAttrib";
			string $replaceFuncAttrib = "branchAlternateReplaceAttrib";
			editorTemplate -callCustom $newFuncAttrib $replaceFuncAttrib "alternateGrowth";	
								
		editorTemplate -endLayout;
		

		// Create an "Extras" section and also add controls for any
		// attributes we have not explicitly mentioned.
		editorTemplate -addExtraControls;
	editorTemplate -endScrollLayout;

	// Tell the attribute editor not to display the attributes we
	// don't care about.
	editorTemplate -suppress "caching";
	editorTemplate -suppress "nodeState";
}

global proc branchMultNewAttrib(string $attr)
{
	branchMultReplaceAttrib($attr);
}

global proc branchMultReplaceAttrib(string $attr)
{
	$type = `nodeType ($attr+"nodeNumber")`;
	int $end   = `size($attr)`-1;
	$node = `substring $attr 1 $end`;

	if(!`layout -exists ($type+"_multiplication_layout")`) columnLayout ($type+"_multiplication_layout");
	setParent ($type+"_multiplication_layout");
		
	if(!`layout -exists ($type+"_multiplication_preset_layout")`) rowLayout -nc 3 ($type+"_multiplication_preset_layout");
	if(!`text -exists ($type+"_multiplication_preset_text")`){
		setParent ($type+"_multiplication_preset_layout");
		text -label ("Node Preset") ($type+"_multiplication_preset_text");
	}
	if(!`optionMenu -exists ($type+"_multiplication_preset_menu")`){
		setParent ($type+"_multiplication_preset_layout");
		optionMenu ($type+"_multiplication_preset_menu");
			menuItem -data 1 -label "None";
			menuItem -data 2 -label "Perpendicular";
			menuItem -data 3 -label "Lateral";
			menuItem -data 4 -label "Altperpendicular";
			menuItem -data 5 -label "Altlateral";
			menuItem -data 6 -label "Pairperpendicular";
			menuItem -data 7 -label "Pairlateral";
	}
	optionMenu -e -select 1 ($type+"_multiplication_preset_menu");
	
	setParent ($type+"_multiplication_layout");
	if(!`layout -exists ($type+"_multiplication_nodeArrangement_layout")`) rowLayout -nc 3 ($type+"_multiplication_nodeArrangement_layout");
	if(!`text -exists ($type+"_multiplication_nodeArrangement_text")`){
		setParent ($type+"_multiplication_nodeArrangement_layout");
		text -label ("Node Arrangement") ($type+"_multiplication_nodeArrangement_text");
	}
	if(!`optionMenu -exists ($type+"_multiplication_nodeArrangement_menu")`){
		setParent ($type+"_multiplication_nodeArrangement_layout");
		optionMenu ($type+"_multiplication_nodeArrangement_menu");
			menuItem -data 1 -label "Ring";
			menuItem -data 2 -label "Pair Mirror";
	}
	optionMenu -e -select (`getAttr ($node+".nodeArrangement")`+1) ($type+"_multiplication_nodeArrangement_menu");
	
	setParent ($type+"_multiplication_layout");
	if(!`layout -exists ($type+"_multiplication_nodeMultiplicity_layout")`) rowLayout -nc 3 ($type+"_multiplication_nodeMultiplicity_layout"); //multiplication_nodeMultiplicity
	if(!`text -exists ($type+"_multiplication_nodeMultiplicity_text")`){
		setParent ($type+"_multiplication_nodeMultiplicity_layout");
		text -label ("Node Multiplicity") ($type+"_multiplication_nodeMultiplicity_text");
	}
	if(!`textField -exists ($type+"_multiplication_nodeMultiplicity_tf")`){
		setParent ($type+"_multiplication_nodeMultiplicity_layout");
		intField  -value 1 ($type+"_multiplication_nodeMultiplicity_tf");
	}
	intField  -e -value (`getAttr ($node+".nodeMultiplicity")`) ($type+"_multiplication_nodeMultiplicity_tf");
	if (`getAttr ($node+".nodeArrangement")`==0) intField  -e -enable true ($type+"_multiplication_nodeMultiplicity_tf");
	else intField -e -enable false ($type+"_multiplication_nodeMultiplicity_tf");
	
	setParent ($type+"_multiplication_layout");
	if(!`layout -exists ($type+"_multiplication_type_layout")`) rowLayout -nc 3 ($type+"_multiplication_type_layout");
	if(!`text -exists ($type+"_multiplication_type_text")`){
		setParent ($type+"_multiplication_type_layout");
		text -label ("Multiplication Type") ($type+"_multiplication_type_text");
	}
	if(!`optionMenu -exists ($type+"_multiplication_type_menu")`){
		setParent ($type+"_multiplication_type_layout");
		optionMenu ($type+"_multiplication_type_menu");
			menuItem -data 1 -label "Tesselated Mesh";
			menuItem -data 2 -label "Instance";
			menuItem -data 3 -label "Copy";
	}
	optionMenu -e -select (`getAttr ($node+".multiplyType")`+1) ($type+"_multiplication_type_menu");
		
	setParent ($type+"_multiplication_layout");
	if(!`separator -exists ($type+"_multiplication_separator2")`) 
	separator -h 10 -style "none" ($type+"_multiplication_separator2");
		
	if(!`layout -exists ($type+"_multiplication_button_layout")`) rowLayout -nc 3 ($type+"_multiplication_button_layout");
	if(!`text -exists ($type+"_multiplication_button_text")`){
		setParent ($type+"_multiplication_button_layout");
		text -label ("") ($type+"_multiplication_button_text");
	}
	if(!`button -exists ($type+"_multiplication_button")`){
			setParent ($type+"_multiplication_button_layout");
			button -l "Update" -h 20 ($type+"_multiplication_button");
	}
	
	setParent ($type+"_multiplication_layout");
	if(!`separator -exists ($type+"_multiplication_separator3")`) 
		separator -h 10 -style "none" ($type+"_multiplication_separator3");
		
	string $actionCommand;	
	$actionCommand = "setAttr "+$node+".nodePreset (`optionMenu -q -select "+$type+"_multiplication_preset_menu`-1); 				\n";
	$actionCommand += "setAttr "+$node+".nodeArrangement (`optionMenu -q -select "+$type+"_multiplication_nodeArrangement_menu`-1); 		\n";
	$actionCommand += "setAttr "+$node+".nodeMultiplicity (`intField  -q -value "+$type+"_multiplication_nodeMultiplicity_tf`); 			\n";
	$actionCommand += "setAttr "+$node+".multiplyType (`optionMenu -q -select "+$type+"_multiplication_type_menu`-1);		 		\n";
	$actionCommand += "optionMenu -e -select 1 "+$type+"_multiplication_preset_menu;								\n";
	$actionCommand += "XFUpdateObject "+$node+";													\n";
	
	$actionCommand += "getAttr \""+$node+".outChildParameters[0].ochildmaxInstances\";													";
	$actionCommand += "optionMenu -e -select (`getAttr (\""+$node+".multiplyType\")`+1) (\""+$type+"_multiplication_type_menu\");			\n";
	$actionCommand += "intField  -e -value (`getAttr (\""+$node+".nodeMultiplicity\")`) (\""+$type+"_multiplication_nodeMultiplicity_tf\");		\n";
	$actionCommand += "if (`getAttr (\""+$node+".nodeArrangement\")`==0) intField  -e -enable true (\""+$type+"_multiplication_nodeMultiplicity_tf\");	\n";
	$actionCommand += "else intField  -e -enable false (\""+$type+"_multiplication_nodeMultiplicity_tf\");						\n";
	$actionCommand += "optionMenu -e -select (`getAttr (\""+$node+".nodeArrangement\")`+1) (\""+$type+"_multiplication_nodeArrangement_menu\");	";

	button -e -command $actionCommand ($type+"_multiplication_button");		
}

global proc branchCurvNewAttrib(string $attr)
{
	branchCurvReplaceAttrib($attr);
}

global proc branchCurvReplaceAttrib(string $attr)
{
	$type = `nodeType ($attr+"thickness")`;
	int $end   = `size($attr)`-1;
	$node = `substring $attr 1 $end`;
	
	if(!`layout -exists ($type+"_curveParam_layout")`) columnLayout ($type+"_curveParam_layout");
	
	setParent ($type+"_curveParam_layout");
	if(!`layout -exists ($type+"_thickness_layout")`) rowLayout -nc 3 ($type+"_thickness_layout"); //thickness
	if(!`text -exists ($type+"_thickness_text")`){
		setParent ($type+"_thickness_layout");
		text -label ("Thickness") ($type+"_thickness_text");
	}
	if(!`textField -exists ($type+"_thickness_tf")`){
		setParent ($type+"_thickness_layout");
		textField  -ed 0 -tx "<no connection>" ($type+"_thickness_tf");
	}
	if(!`symbolButton -exists ($type+"_thickness_button")`){
			setParent ($type+"_thickness_layout");
			symbolButton -i "inArrow.xpm" -h 20 ($type+"_thickness_button");
	}
		
	setParent ($type+"_curveParam_layout");
	if(!`layout -exists ($type+"_nodeAngle_layout")`) rowLayout -nc 3 ($type+"_nodeAngle_layout"); //nodeAngle
	if(!`text -exists ($type+"_nodeAngle_text")`){
		setParent ($type+"_nodeAngle_layout");
		text -label ("Node Angle") ($type+"_nodeAngle_text");
	}
	if(!`textField -exists ($type+"_nodeAngle_tf")`){
		setParent ($type+"_nodeAngle_layout");
		textField  -ed 0 -tx "<no connection>" ($type+"_nodeAngle_tf");
	}
	if(!`symbolButton -exists ($type+"_nodeAngle_button")`){
			setParent ($type+"_nodeAngle_layout");
			symbolButton -i "inArrow.xpm" -h 20 ($type+"_nodeAngle_button");
	}
		
	setParent ($type+"_curveParam_layout");
	if(!`layout -exists ($type+"_nodeFlap_layout")`) rowLayout -nc 3 ($type+"_nodeFlap_layout"); //nodeFlap
	if(!`text -exists ($type+"_nodeFlap_text")`){
		setParent ($type+"_nodeFlap_layout");
		text -label ("Node Flap") ($type+"_nodeFlap_text");
	}
	if(!`textField -exists ($type+"_nodeFlap_tf")`){
		setParent ($type+"_nodeFlap_layout");
		textField  -ed 0 -tx "<no connection>" ($type+"_nodeFlap_tf");
	}
	if(!`symbolButton -exists ($type+"_nodeFlap_button")`){
			setParent ($type+"_nodeFlap_layout");
			symbolButton -i "inArrow.xpm" -h 20 ($type+"_nodeFlap_button");
	}
		
	setParent ($type+"_curveParam_layout");
	if(!`layout -exists ($type+"_nodeDistribution_layout")`) rowLayout -nc 3 ($type+"_nodeDistribution_layout"); //nodeDistribution
	if(!`text -exists ($type+"_nodeDistribution_text")`){
		setParent ($type+"_nodeDistribution_layout");
		text -label ("Node Distribution") ($type+"_nodeDistribution_text");
	}
	if(!`textField -exists ($type+"_nodeDistribution_tf")`){
		setParent ($type+"_nodeDistribution_layout");
		textField  -ed 0 -tx "<no connection>" ($type+"_nodeDistribution_tf");
	}
	if(!`symbolButton -exists ($type+"_nodeDistribution_button")`){
			setParent ($type+"_nodeDistribution_layout");
			symbolButton -i "inArrow.xpm" -h 20 ($type+"_nodeDistribution_button");
	}
		
	setParent ($type+"_curveParam_layout");
	if(!`layout -exists ($type+"_nodeScale_layout")`) rowLayout -nc 3 ($type+"_nodeScale_layout"); //nodeScale
	if(!`text -exists ($type+"_nodeScale_text")`){
		setParent ($type+"_nodeScale_layout");
		text -label ("Node Scale") ($type+"_nodeScale_text");
	}
	if(!`textField -exists ($type+"_nodeScale_tf")`){
		setParent ($type+"_nodeScale_layout");
		textField  -ed 0 -tx "<no connection>" ($type+"_nodeScale_tf");
	}
	if(!`symbolButton -exists ($type+"_nodeScale_button")`){
			setParent ($type+"_nodeScale_layout");
			symbolButton -i "inArrow.xpm" -h 20 ($type+"_nodeScale_button");
	}
		
	setParent ($type+"_curveParam_layout");
	if(!`layout -exists ($type+"_nodeScrew_layout")`) rowLayout -nc 3 ($type+"_nodeScrew_layout"); //nodeScrew
	if(!`text -exists ($type+"_nodeScrew_text")`){
		setParent ($type+"_nodeScrew_layout");
		text -label ("Node Screw") ($type+"_nodeScrew_text");
	}
	if(!`textField -exists ($type+"_nodeScrew_tf")`){
		setParent ($type+"_nodeScrew_layout");
		textField  -ed 0 -tx "<no connection>" ($type+"_nodeScrew_tf");
	}
	if(!`symbolButton -exists ($type+"_nodeScrew_button")`){
			setParent ($type+"_nodeScrew_layout");
			symbolButton -i "inArrow.xpm" -h 20 ($type+"_nodeScrew_button");
	}
		
	setParent ($type+"_curveParam_layout");
	if(!`layout -exists ($type+"_nodeGrowth_layout")`) rowLayout -nc 3 ($type+"_nodeGrowth_layout"); //nodeGrowth
	if(!`text -exists ($type+"_nodeGrowth_text")`){
		setParent ($type+"_nodeGrowth_layout");
		text -label ("Node Growth") ($type+"_nodeGrowth_text");
	}
	if(!`textField -exists ($type+"_nodeGrowth_tf")`){
		setParent ($type+"_nodeGrowth_layout");
		textField  -ed 0 -tx "<no connection>" ($type+"_nodeGrowth_tf");
	}
	if(!`symbolButton -exists ($type+"_nodeGrowth_button")`){
			setParent ($type+"_nodeGrowth_layout");
			symbolButton -i "inArrow.xpm" -h 20 ($type+"_nodeGrowth_button");
	}
		
	setParent ($type+"_curveParam_layout");
	if(!`layout -exists ($type+"_nodeDensity_layout")`) rowLayout -nc 3 ($type+"_nodeDensity_layout"); //nodeDensity
	if(!`text -exists ($type+"_nodeDensity_text")`){
		setParent ($type+"_nodeDensity_layout");
		text -label ("Node Density") ($type+"_nodeDensity_text");
	}
	if(!`textField -exists ($type+"_nodeDensity_tf")`){
		setParent ($type+"_nodeDensity_layout");
		textField  -ed 0 -tx "<no connection>" ($type+"_nodeDensity_tf");
	}
	if(!`symbolButton -exists ($type+"_nodeDensity_button")`){
			setParent ($type+"_nodeDensity_layout");
			symbolButton -i "inArrow.xpm" -h 20 ($type+"_nodeDensity_button");
	}
	
	
	string $params = `connectionInfo -sfd ($attr+"thickness")`;				//thickness
	if(`size($params)`!=0 && `nodeType $params`=="curveEmulation"){
		string $conInput[];
		tokenize($params, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_thickness_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_thickness_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_thickness_tf");
		$actionCommand  = "string $XFtempStringCurveEmulationName = `XFCreateCurveEmulation`; 								\n";
		$actionCommand += "string $XFtempStringCurveEmulationResult = `XFConnectCurveAttr $XFtempStringCurveEmulationName "+$node+" thickness`;		\n";
		$actionCommand += "textField -e -tx $XFtempStringCurveEmulationResult (\""+$type+"_thickness_tf\");						\n";
		$actionCommand += "symbolButton -e -i \"inArrow.xpm\" -h 20 -command (\"select \"+$XFtempStringCurveEmulationResult+\";\") "+$type+"_thickness_button;	\n";
		symbolButton -e -i "addy.xpm" -h 20 -command $actionCommand ($type+"_thickness_button");
	}
	$params = `connectionInfo -sfd ($attr+"nodeAngle")`;				//nodeAngle
	if(`size($params)`!=0 && `nodeType $params`=="curveEmulation"){
		string $conInput[];
		tokenize($params, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_nodeAngle_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_nodeAngle_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_nodeAngle_tf");
		$actionCommand  = "string $XFtempStringCurveEmulationName = `XFCreateCurveEmulation`; 								\n";
		$actionCommand += "string $XFtempStringCurveEmulationResult = `XFConnectCurveAttr $XFtempStringCurveEmulationName "+$node+" nodeAngle`;		\n";
		$actionCommand += "textField -e -tx $XFtempStringCurveEmulationResult (\""+$type+"_nodeAngle_tf\");						\n";
		$actionCommand += "symbolButton -e -i \"inArrow.xpm\" -h 20 -command (\"select \"+$XFtempStringCurveEmulationResult+\";\") "+$type+"_nodeAngle_button;	\n";
		symbolButton -e -i "addy.xpm" -h 20 -command $actionCommand ($type+"_nodeAngle_button");
	}
	$params = `connectionInfo -sfd ($attr+"nodeFlap")`;				//nodeFlap
	if(`size($params)`!=0 && `nodeType $params`=="curveEmulation"){
		string $conInput[];
		tokenize($params, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_nodeFlap_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_nodeFlap_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_nodeFlap_tf");
		$actionCommand  = "string $XFtempStringCurveEmulationName = `XFCreateCurveEmulation`; 								\n";
		$actionCommand += "string $XFtempStringCurveEmulationResult = `XFConnectCurveAttr $XFtempStringCurveEmulationName "+$node+" nodeFlap`;		\n";
		$actionCommand += "textField -e -tx $XFtempStringCurveEmulationResult (\""+$type+"_nodeFlap_tf\");						\n";
		$actionCommand += "symbolButton -e -i \"inArrow.xpm\" -h 20 -command (\"select \"+$XFtempStringCurveEmulationResult+\";\") "+$type+"_nodeFlap_button;	\n";
		symbolButton -e -i "addy.xpm" -h 20 -command $actionCommand ($type+"_nodeFlap_button");
	}
	$params = `connectionInfo -sfd ($attr+"nodeDistribution")`;				//nodeDistribution
	if(`size($params)`!=0 && `nodeType $params`=="curveEmulation"){
		string $conInput[];
		tokenize($params, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_nodeDistribution_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_nodeDistribution_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_nodeDistribution_tf");
		$actionCommand  = "string $XFtempStringCurveEmulationName = `XFCreateCurveEmulation`; 								\n";
		$actionCommand += "string $XFtempStringCurveEmulationResult = `XFConnectCurveAttr $XFtempStringCurveEmulationName "+$node+" nodeDistribution`;		\n";
		$actionCommand += "textField -e -tx $XFtempStringCurveEmulationResult (\""+$type+"_nodeDistribution_tf\");						\n";
		$actionCommand += "symbolButton -e -i \"inArrow.xpm\" -h 20 -command (\"select \"+$XFtempStringCurveEmulationResult+\";\") "+$type+"_nodeDistribution_button;	\n";
		symbolButton -e -i "addy.xpm" -h 20 -command $actionCommand ($type+"_nodeDistribution_button");
	}
	$params = `connectionInfo -sfd ($attr+"nodeScale")`;				//nodeScale
	if(`size($params)`!=0 && `nodeType $params`=="curveEmulation"){
		string $conInput[];
		tokenize($params, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_nodeScale_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_nodeScale_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_nodeScale_tf");
		$actionCommand  = "string $XFtempStringCurveEmulationName = `XFCreateCurveEmulation`; 								\n";
		$actionCommand += "string $XFtempStringCurveEmulationResult = `XFConnectCurveAttr $XFtempStringCurveEmulationName "+$node+" nodeScale`;		\n";
		$actionCommand += "textField -e -tx $XFtempStringCurveEmulationResult (\""+$type+"_nodeScale_tf\");						\n";
		$actionCommand += "symbolButton -e -i \"inArrow.xpm\" -h 20 -command (\"select \"+$XFtempStringCurveEmulationResult+\";\") "+$type+"_nodeScale_button;	\n";
		symbolButton -e -i "addy.xpm" -h 20 -command $actionCommand ($type+"_nodeScale_button");
	}
	$params = `connectionInfo -sfd ($attr+"nodeScrew")`;				//nodeScrew
	if(`size($params)`!=0 && `nodeType $params`=="curveEmulation"){
		string $conInput[];
		tokenize($params, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_nodeScrew_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_nodeScrew_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_nodeScrew_tf");
		$actionCommand  = "string $XFtempStringCurveEmulationName = `XFCreateCurveEmulation`; 								\n";
		$actionCommand += "string $XFtempStringCurveEmulationResult = `XFConnectCurveAttr $XFtempStringCurveEmulationName "+$node+" nodeScrew`;		\n";
		$actionCommand += "textField -e -tx $XFtempStringCurveEmulationResult (\""+$type+"_nodeScrew_tf\");						\n";
		$actionCommand += "symbolButton -e -i \"inArrow.xpm\" -h 20 -command (\"select \"+$XFtempStringCurveEmulationResult+\";\") "+$type+"_nodeScrew_button;	\n";
		symbolButton -e -i "addy.xpm" -h 20 -command $actionCommand ($type+"_nodeScrew_button");
	}
	$params = `connectionInfo -sfd ($attr+"nodeGrowth")`;				//nodeGrowth
	if(`size($params)`!=0 && `nodeType $params`=="curveEmulation"){
		string $conInput[];
		tokenize($params, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_nodeGrowth_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_nodeGrowth_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_nodeGrowth_tf");
		$actionCommand  = "string $XFtempStringCurveEmulationName = `XFCreateCurveEmulation`; 								\n";
		$actionCommand += "string $XFtempStringCurveEmulationResult = `XFConnectCurveAttr $XFtempStringCurveEmulationName "+$node+" nodeGrowth`;		\n";
		$actionCommand += "textField -e -tx $XFtempStringCurveEmulationResult (\""+$type+"_nodeGrowth_tf\");						\n";
		$actionCommand += "symbolButton -e -i \"inArrow.xpm\" -h 20 -command (\"select \"+$XFtempStringCurveEmulationResult+\";\") "+$type+"_nodeGrowth_button;	\n";
		symbolButton -e -i "addy.xpm" -h 20 -command $actionCommand ($type+"_nodeGrowth_button");
	}
	$params = `connectionInfo -sfd ($attr+"nodeDensity")`;				//nodeDensity
	if(`size($params)`!=0 && `nodeType $params`=="curveEmulation"){
		string $conInput[];
		tokenize($params, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_nodeDensity_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_nodeDensity_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_nodeDensity_tf");
		$actionCommand  = "string $XFtempStringCurveEmulationName = `XFCreateCurveEmulation`; 								\n";
		$actionCommand += "string $XFtempStringCurveEmulationResult = `XFConnectCurveAttr $XFtempStringCurveEmulationName "+$node+" nodeDensity`;		\n";
		$actionCommand += "textField -e -tx $XFtempStringCurveEmulationResult (\""+$type+"_nodeDensity_tf\");						\n";
		$actionCommand += "symbolButton -e -i \"inArrow.xpm\" -h 20 -command (\"select \"+$XFtempStringCurveEmulationResult+\";\") "+$type+"_nodeDensity_button;	\n";
		symbolButton -e -i "addy.xpm" -h 20 -command $actionCommand ($type+"_nodeDensity_button");
	}	
}

global proc branchFamilyNewAttrib(string $attr)
{
	branchFamilyReplaceAttrib($attr);
}

global proc branchFamilyReplaceAttrib(string $attr)
{
	$type = `nodeType ($attr+"inParameters")`;
	string $objectName[];
	tokenize($attr, ".", $objectName);

	if(!`layout -exists ($type+"_children_layout")`) columnLayout ($type+"_children_layout");

	setParent ($type+"_children_layout");
	if(!`layout -exists ($type+"_parent_layout")`) rowLayout -nc 3 ($type+"_parent_layout"); //parent
	if(!`text -exists ($type+"_parent_text")`){
		setParent ($type+"_parent_layout");
		text -label ("Parent") ($type+"_parent_text");
	}
	if(!`textField -exists ($type+"_parent_tf")`){
		setParent ($type+"_parent_layout");
		textField  -ed 0 -tx "<no connection>" ($type+"_parent_tf");
	}
	if(!`symbolButton -exists ($type+"_parent_button")`){
			setParent ($type+"_parent_layout");
			symbolButton -i "inArrow.xpm" -h 20 ($type+"_parent_button");
	}
	
	setParent ($type+"_children_layout");
	if(!`layout -exists ($type+"_pathC_layout_row1")`) rowLayout -nc 3 ($type+"_pathC_layout_row1"); //pathC
	if(!`text -exists ($type+"_pathC_text")`){
		setParent ($type+"_pathC_layout_row1");
		text -label ("Path Curve") ($type+"_pathC_text");
	}
	if(!`textField -exists ($type+"_pathC_tf")`){
		setParent ($type+"_pathC_layout_row1");
		textField  -ed 0 -tx "<no connection>" ($type+"_pathC_tf");
	}
	if(!`symbolButton -exists ($type+"_pathC_button")`){
		setParent ($type+"_pathC_layout_row1");
		symbolButton -i "addy.xpm" -h 20 ($type+"_pathC_button");
	}
	
	setParent ($type+"_children_layout");
	if(!`layout -exists ($type+"_shapeC_layout_row1")`) rowLayout -nc 3 ($type+"_shapeC_layout_row1"); //shapeC
	if(!`text -exists ($type+"_shapeC_text")`){
		setParent ($type+"_shapeC_layout_row1");
		text -label ("Shape Curve") ($type+"_shapeC_text");
	}
	if(!`textField -exists ($type+"_shapeC_tf")`){
		setParent ($type+"_shapeC_layout_row1");
		textField  -ed 0 -tx "<no connection>" ($type+"_shapeC_tf");
	}
	if(!`symbolButton -exists ($type+"_shapeC_button")`){
		setParent ($type+"_shapeC_layout_row1");
		symbolButton -i "addy.xpm" -h 20 ($type+"_shapeC_button");
	}
	
	setParent ($type+"_children_layout");
	if(!`layout -exists ($type+"_child_layout_row1")`) rowLayout -nc 3 ($type+"_child_layout_row1"); //child
	if(!`text -exists ($type+"_child_text")`){
		setParent ($type+"_child_layout_row1");
		text -label ("Child Object") ($type+"_child_text");
	}
	if(!`textField -exists ($type+"_child_tf")`){
		setParent ($type+"_child_layout_row1");
		textField  -ed 0 -tx "<no connection>" ($type+"_child_tf");
	}
	if(!`symbolButton -exists ($type+"_child_add_button")`){
		setParent ($type+"_child_layout_row1");
		symbolButton -i "addy.xpm" -h 20 ($type+"_child_add_button");
	}
	setParent ($type+"_children_layout");
	if(!`layout -exists ($type+"_child_layout_row2")`) rowLayout -nc 3 ($type+"_child_layout_row2");
	if(!`text -exists ($type+"_child_text2")`){
		setParent ($type+"_child_layout_row2");
		text -label ("Child Primitive") ($type+"_child_text2");
	}
	if(!`textField -exists ($type+"_child_prim_tf")`){
		setParent ($type+"_child_layout_row2");
		textField  -ed 0 -tx "<no connection>" ($type+"_child_prim_tf");
	}
	if(!`symbolButton -exists ($type+"_child_button")`){
		setParent ($type+"_child_layout_row2");
		symbolButton -i "outArrow.xpm" -h 20 ($type+"_child_button");
		if(`popupMenu -exists ($type+"_child_button_popup")`) deleteUI -menu ($type+"_child_button_popup");
		popupMenu -b 3 ($type+"_child_button_popup");
	}
	
	setParent ($type+"_children_layout");
	if(!`layout -exists ($type+"_shape_layout_row1")`) rowLayout -nc 3 ($type+"_shape_layout_row1"); //shape
	if(!`text -exists ($type+"_shape_text")`){
		setParent ($type+"_shape_layout_row1");
		text -label ("Shape Object") ($type+"_shape_text");
	}
	if(!`textField -exists ($type+"_shape_tf")`){
		setParent ($type+"_shape_layout_row1");
		textField  -ed 0 -tx "<no connection>" ($type+"_shape_tf");
	}
	if(!`symbolButton -exists ($type+"_shape_add_button")`){
		setParent ($type+"_shape_layout_row1");
		symbolButton -i "addy.xpm" -h 20 ($type+"_shape_add_button");
	}
	setParent ($type+"_children_layout");
	if(!`layout -exists ($type+"_shape_layout_row2")`) rowLayout -nc 3 ($type+"_shape_layout_row2");
	if(!`text -exists ($type+"_shape_text2")`){
		setParent ($type+"_shape_layout_row2");
		text -label ("ShapePrimitive") ($type+"_shape_text2");
	}
	if(!`textField -exists ($type+"_shape_prim_tf")`){
		setParent ($type+"_shape_layout_row2");
		textField  -ed 0 -tx "<no connection>" ($type+"_shape_prim_tf");
	}
	if(!`symbolButton -exists ($type+"_shape_button")`){
		setParent ($type+"_shape_layout_row2");
		symbolButton -i "outArrow.xpm" -h 20 ($type+"_shape_button");
		if(`popupMenu -exists ($type+"_shape_button_popup")`) deleteUI -menu ($type+"_shape_button_popup");
		popupMenu -b 3 ($type+"_shape_button_popup");
	}
	
	setParent ($type+"_children_layout");
	if(!`layout -exists ($type+"_head_layout_row1")`) rowLayout -nc 3 ($type+"_head_layout_row1"); //head
	if(!`text -exists ($type+"_head_text")`){
		setParent ($type+"_head_layout_row1");
		text -label ("Head Object") ($type+"_head_text");
	}
	if(!`textField -exists ($type+"_head_tf")`){
		setParent ($type+"_head_layout_row1");
		textField  -ed 0 -tx "<no connection>" ($type+"_head_tf");
	}
	if(!`symbolButton -exists ($type+"_head_add_button")`){
		setParent ($type+"_head_layout_row1");
		symbolButton -i "addy.xpm" -h 20 ($type+"_head_add_button");
	}
	setParent ($type+"_children_layout");
	if(!`layout -exists ($type+"_head_layout_row2")`) rowLayout -nc 3 ($type+"_head_layout_row2");
	if(!`text -exists ($type+"_head_text2")`){
		setParent ($type+"_head_layout_row2");
		text -label ("Head Primitive") ($type+"_head_text2");
	}
	if(!`textField -exists ($type+"_head_prim_tf")`){
		setParent ($type+"_head_layout_row2");
		textField  -ed 0 -tx "<no connection>" ($type+"_head_prim_tf");
	}
	if(!`symbolButton -exists ($type+"_head_button")`){
		setParent ($type+"_head_layout_row2");
		symbolButton -i "outArrow.xpm" -h 20 ($type+"_head_button");
		if(`popupMenu -exists ($type+"_head_button_popup")`) deleteUI -menu ($type+"_head_button_popup");
		popupMenu -b 3 ($type+"_head_button_popup");
	}
	
	string $pParams;
	string $pParamsData;
	if( catchQuiet ($pParams = `connectionInfo -sfd ($attr+"inPathCurves[0]")`)) $pParams="";		//curve
	if( catchQuiet ($pParamsData = `connectionInfo -sfd ($attr+"inPathCurvesData")`)) $pParamsData="";	//curveData

	if(`size($pParamsData)`!=0){
		string $conInput[];
		tokenize($pParamsData, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_pathC_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_pathC_button");
	} else if (`size($pParams)`!=0){
		string $conInput[];
		tokenize($pParams, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_pathC_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_pathC_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_pathC_tf");
		string $actionCommand 	=  "string $curveName = \"\";												\n";
		$actionCommand		+= "if(!catch($curveName = `XFConnectCurve 0`)){									\n";
		$actionCommand		+= "	textField -e -tx $curveName (\""+$type+"_pathC_tf\");								\n";
		$actionCommand		+= "	symbolButton -e -i \"inArrow.xpm\" -h 20 -command (\"select \"+$curveName+\";\") (\""+$type+"_pathC_button\");	\n";
		$actionCommand		+= "}															";
		symbolButton -e -i "addy.xpm" -h 20 -command $actionCommand ($type+"_pathC_button");
	}

	if( catchQuiet ($pParams = `connectionInfo -sfd ($attr+"inShapeCurves[0]")`)) $pParams="";		//curve
	if( catchQuiet ($pParamsData = `connectionInfo -sfd ($attr+"inShapeCurvesData")`)) $pParamsData="";	//curveData

	if(`size($pParamsData)`!=0){
		string $conInput[];
		tokenize($pParamsData, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_shapeC_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_shapeC_button");
	} else if (`size($pParams)`!=0){
		string $conInput[];
		tokenize($pParams, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_shapeC_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_shapeC_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_shapeC_tf");
		string $actionCommand 	=  "string $curveName = \"\";												\n";
		$actionCommand		+= "if(!catch($curveName = `XFConnectCurve 1`)){									\n";
		$actionCommand		+= "	textField -e -tx $curveName (\""+$type+"_shapeC_tf\");								\n";
		$actionCommand		+= "	symbolButton -e -i \"inArrow.xpm\" -h 20 -command (\"select \"+$curveName+\";\") (\""+$type+"_shapeC_button\");	\n";
		$actionCommand		+= "}															";
		symbolButton -e -i "addy.xpm" -h 20 -command $actionCommand ($type+"_shapeC_button");
	}
	
	
	if( catchQuiet ($pParams = `connectionInfo -sfd ($attr+"inParameters")`)) $pParams="";			//parent
	if(`size($pParams)`!=0){
		string $conInput[];
		tokenize($pParams, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_parent_tf");
		symbolButton -e -en 1 -command ("select "+$conInput[0]+";") ($type+"_parent_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_parent_tf");
		symbolButton -e -en 0 ($type+"_parent_button");
	}
	
	string $params[];
	string $primParams[];
	setParent -menu ($type+"_child_button_popup");
	$itemCount = `popupMenu -q -numberOfItems ($type+"_child_button_popup")`;
	for($i=0; $i<$itemCount; $i++){
		deleteUI -menuItem ($type+"_child_button_popup_item_"+$i);
	}
	if( catchQuiet ($params = `connectionInfo -dfs ($attr+"outChildParameters[0]")`)) $params={};		//child
	if(`size($params)`>0){
		string $conInput[];
		tokenize($params[0], ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_child_tf");
		symbolButton -e -en 1 -command ("select "+$conInput[0]+";") ($type+"_child_button");
		for($i=0; $i<`size($params)`; $i++){
			tokenize($params[$i], ".", $conInput);
			menuItem -label $conInput[0] -command ("select "+$conInput[0]) ($type+"_child_button_popup_item_"+$i);
		}
	} else {
		textField -e -tx "<no connection>" ($type+"_child_tf");
		symbolButton -e -en 0 ($type+"_child_button");
	}
	if( catchQuiet ($primParams = `connectionInfo -dfs ($attr+"outChildTranslation[0]")`)) $primParams={};	//childPrim
	if(`size($primParams)`>0){
		string $conInput[];
		tokenize($primParams[0], ".", $conInput);
		string $childs[] =`listRelatives -children -fullPath $conInput[0]`;
		if (`size($childs)`>0){
			symbolButton -e -en 1 -command ("select "+$childs[0]+";") ($type+"_child_button");
			$childs =`listRelatives -children $conInput[0]`;
			textField -e -tx $childs[0] ($type+"_child_prim_tf");
		} else {
			textField -e -tx "<no connection>" ($type+"_child_prim_tf");
		}	
	} else {
		textField -e -tx "<no connection>" ($type+"_child_prim_tf");
	}
	string $actionCommand 	=  "string $objName = \"\";						\n";
	$actionCommand		+= "if(!catch($objName = `XFConnectChild 0`)){				\n";
	$actionCommand		+= "	textField -e -tx $objName (\""+$type+"_child_tf\");		\n";
	$actionCommand		+= "}									\n";
	$actionCommand		+= "select "+$objectName[0]+";						\n";
	symbolButton -e -command $actionCommand ($type+"_child_add_button");
	
	
	setParent -menu ($type+"_shape_button_popup");
	$itemCount = `popupMenu -q -numberOfItems ($type+"_shape_button_popup")`;
	for($i=0; $i<$itemCount; $i++){
		deleteUI -menuItem ($type+"_shape_button_popup_item_"+$i);
	}
	if( catchQuiet ($params = `connectionInfo -dfs ($attr+"outShapeParameters")`)) $params={};		//shape
	if(`size($params)`>0){
		string $conInput[];
		tokenize($params[0], ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_shape_tf");
		symbolButton -e -en 1 -command ("select "+$conInput[0]+";") ($type+"_shape_button");
		for($i=0; $i<`size($params)`; $i++){
			tokenize($params[$i], ".", $conInput);
			menuItem -label $conInput[0] -command ("select "+$conInput[0]) ($type+"_shape_button_popup_item_"+$i);
		}
	} else {
		textField -e -tx "<no connection>" ($type+"_shape_tf");
		symbolButton -e -en 0 ($type+"_shape_button");
	}
	if( catchQuiet ($primParams = `connectionInfo -dfs ($attr+"outShapeTranslation")`)) $primParams={};	//shapePrim
	if(`size($primParams)`>0){
		string $conInput[];
		tokenize($primParams[0], ".", $conInput);
		string $childs[] =`listRelatives -children -fullPath $conInput[0]`;
		if (`size($childs)`>0){
			symbolButton -e -en 1 -command ("select "+$childs[0]+";") ($type+"_shape_button");
			$childs =`listRelatives -children $conInput[0]`;
			textField -e -tx $childs[0] ($type+"_shape_prim_tf");
		} else {
			textField -e -tx "<no connection>" ($type+"_shape_prim_tf");
		}	
	} else {
		textField -e -tx "<no connection>" ($type+"_shape_prim_tf");
	}
	string $actionCommand 	=  "string $objName = \"\";						\n";
	$actionCommand		+= "if(!catch($objName = `XFConnectChild 1`)){				\n";
	$actionCommand		+= "	textField -e -tx $objName (\""+$type+"_shape_tf\");		\n";
	$actionCommand		+= "}									\n";
	$actionCommand		+= "select "+$objectName[0]+";						\n";
	symbolButton -e -command $actionCommand ($type+"_shape_add_button");
	
	
	setParent -menu ($type+"_head_button_popup");
	$itemCount = `popupMenu -q -numberOfItems ($type+"_head_button_popup")`;
	for($i=0; $i<$itemCount; $i++){
		deleteUI -menuItem ($type+"_head_button_popup_item_"+$i);
	}
	if( catchQuiet ($params = `connectionInfo -dfs ($attr+"outHeadParameters")`)) $params={};		//head
	if(`size($params)`>0){
		string $conInput[];
		tokenize($params[0], ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_head_tf");
		symbolButton -e -en 1 -command ("select "+$conInput[0]+";") ($type+"_head_button");
		for($i=0; $i<`size($params)`; $i++){
			tokenize($params[$i], ".", $conInput);
			menuItem -label $conInput[0] -command ("select "+$conInput[0]) ($type+"_head_button_popup_item_"+$i);
		}
	} else {
		textField -e -tx "<no connection>" ($type+"_head_tf");
		symbolButton -e -en 0 ($type+"_head_button");
	}
	if( catchQuiet ($primParams = `connectionInfo -dfs ($attr+"outHeadTranslation")`)) $primParams={};	//headPrim
	if(`size($primParams)`>0){
		string $conInput[];
		tokenize($primParams[0], ".", $conInput);
		string $childs[] =`listRelatives -children -fullPath $conInput[0]`;
		if (`size($childs)`>0){
			symbolButton -e -en 1 -command ("select "+$childs[0]+";") ($type+"_head_button");
			$childs =`listRelatives -children $conInput[0]`;
			textField -e -tx $childs[0] ($type+"_head_prim_tf");
		} else {
			textField -e -tx "<no connection>" ($type+"_head_prim_tf");
		}	
	} else {
		textField -e -tx "<no connection>" ($type+"_head_prim_tf");
	}
	string $actionCommand 	=  "string $objName = \"\";						\n";
	$actionCommand		+= "if(!catch($objName = `XFConnectChild 2`)){				\n";
	$actionCommand		+= "	textField -e -tx $objName (\""+$type+"_head_tf\");		\n";
	$actionCommand		+= "}									\n";
	$actionCommand		+= "select "+$objectName[0]+";						\n";
	symbolButton -e -command $actionCommand ($type+"_head_add_button");
}

global proc branchPruneNewAttrib(string $attr)
{
	branchPruneReplaceAttrib($attr);
}

global proc branchPruneReplaceAttrib(string $attr)
{
	$type = `nodeType ($attr+"pruneObject")`;
	string $objectName[];
	tokenize($attr, ".", $objectName);

	if(!`layout -exists ($type+"_prune_layout")`) columnLayout ($type+"_prune_layout");

	setParent ($type+"_prune_layout");
	if(!`layout -exists ($type+"_pruneObject_layout")`) rowLayout -nc 3 ($type+"_pruneObject_layout"); //pruneObject
	if(!`text -exists ($type+"_pruneObject_text")`){
		setParent ($type+"_pruneObject_layout");
		text -label ("Pruning Object") ($type+"_pruneObject_text");
	}
	if(!`textField -exists ($type+"_pruneObject_tf")`){
		setParent ($type+"_pruneObject_layout");
		textField  -ed 0 -tx "<no connection>" ($type+"_pruneObject_tf");
	}
	if(!`symbolButton -exists ($type+"_pruneObject_button")`){
		setParent ($type+"_pruneObject_layout");
		symbolButton -i "addy.xpm" -h 20 ($type+"_pruneObject_button");
	}
	
	string $pParams;
	if( catchQuiet ($pParams = `connectionInfo -sfd ($attr+"pruneObject[0]")`)) $pParams="";		//pruning-object
	if (`size($pParams)`!=0){
		string $conInput[];
		tokenize($pParams, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_pruneObject_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_pruneObject_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_pruneObject_tf");
		string $actionCommand  = "string $sel[]=`ls -selection`;										\n";
		$actionCommand += "if(`size($sel)`==2){												\n";
		$actionCommand += "	connectAttr ($sel[0]+\".worldMesh[0]\") (\""+$attr+"pruneObject[0]\");				\n";
		$actionCommand += "	textField -e -tx $sel[0] (\""+$type+"_pruneObject_tf\");							\n";
		$actionCommand += "	symbolButton -e -i \"inArrow.xpm\" -command (\"select \"+$sel[0]+\";\") (\""+$type+"_pruneObject_button\");	\n";
		$actionCommand += "}																";
		symbolButton -e -i "addy.xpm" -h 20 -command $actionCommand ($type+"_pruneObject_button");
	}
}

global proc branchDeviationNewAttrib(string $attr)
{
	branchDeviationReplaceAttrib($attr);
}

global proc branchDeviationReplaceAttrib(string $attr)
{
	$type = `nodeType ($attr+"deviationIntensity")`;
	int $end   = `size($attr)`-1;
	$node = `substring $attr 1 $end`;
	
	if(!`layout -exists ($type+"_deviationCurveParam_layout")`) columnLayout ($type+"_deviationCurveParam_layout");
	
	setParent ($type+"_deviationCurveParam_layout");
	if(!`layout -exists ($type+"_deviation_layout")`) rowLayout -nc 3 ($type+"_deviation_layout"); //deviationIntensity
	if(!`text -exists ($type+"_deviation_text")`){
		setParent ($type+"_deviation_layout");
		text -label ("Deviation Intensity") ($type+"_deviation_text");
	}
	if(!`textField -exists ($type+"_deviation_tf")`){
		setParent ($type+"_deviation_layout");
		textField  -ed 0 -tx "<no connection>" ($type+"_deviation_tf");
	}
	if(!`symbolButton -exists ($type+"_deviation_button")`){
			setParent ($type+"_deviation_layout");
			symbolButton -i "inArrow.xpm" -h 20 ($type+"_deviation_button");
	}	
	
	string $params = `connectionInfo -sfd ($attr+"deviationIntensity")`;				//deviationIntensity
	if(`size($params)`!=0 && `nodeType $params`=="curveEmulation"){
		string $conInput[];
		tokenize($params, ".", $conInput);
		textField -e -tx $conInput[0] ($type+"_deviation_tf");
		symbolButton -e -i "inArrow.xpm" -h 20 -command ("select "+$conInput[0]+";") ($type+"_deviation_button");
	} else {
		textField -e -tx "<no connection>" ($type+"_deviation_tf");
		$actionCommand  = "string $XFtempStringCurveEmulationName = `XFCreateCurveEmulation`; 								\n";
		$actionCommand += "string $XFtempStringCurveEmulationResult = `XFConnectCurveAttr $XFtempStringCurveEmulationName "+$node+" deviationIntensity`;		\n";
		$actionCommand += "textField -e -tx $XFtempStringCurveEmulationResult (\""+$type+"_deviation_tf\");						\n";
		$actionCommand += "symbolButton -e -i \"inArrow.xpm\" -h 20 -command (\"select \"+$XFtempStringCurveEmulationResult+\";\") "+$type+"_deviation_button;	\n";
		symbolButton -e -i "addy.xpm" -h 20 -command $actionCommand ($type+"_deviation_button");
	}
}

global proc branchAlternateNewAttrib(string $attr)
{
	branchAlternateReplaceAttrib($attr);
}

global proc branchAlternateReplaceAttrib(string $attr)
{
	$type = `nodeType ($attr)`;
	string $altInput[];
	tokenize($attr, ".", $altInput);
	
	if(`layout -exists ($type+"_clear_a0")`) deleteUI -layout ($type+"_clear_a0");
	if(`layout -exists ($type+"_clear_a1")`) deleteUI -layout ($type+"_clear_a1");
	if(`layout -exists ($type+"_clear_b1")`) deleteUI -layout ($type+"_clear_b1");
	if(`layout -exists ($type+"_clear_a2")`) deleteUI -layout ($type+"_clear_a2");
	if(`layout -exists ($type+"_clear_b2")`) deleteUI -layout ($type+"_clear_b2");
	if(`layout -exists ($type+"_clear_a3")`) deleteUI -layout ($type+"_clear_a3");
	if(`layout -exists ($type+"_clear_b3")`) deleteUI -layout ($type+"_clear_b3");
	
	if(`layout -exists ($type+"_alternate_line_layout")`) {
		deleteUI -control ($type+"_alternate_fill");
		deleteUI -control ($type+"_alternate_text");
		deleteUI -control ($type+"_alternate_button");
		deleteUI -layout ($type+"_alternate_line_layout");
	}
	int $altIterate=0;
	while(`layout -exists ($type+"_alternate_"+$altIterate+"_layout1")`){
		$altIterate++;
	}
	if($altIterate>0){	// delete unneeded lines
		for($i=0; $i<$altIterate; $i++){
			deleteUI -control ($type+"_alternate_"+$i+"_text1");
			deleteUI -control ($type+"_alternate_"+$i+"_offset_tf");
			deleteUI -control ($type+"_alternate_"+$i+"_fill");
			deleteUI -layout ($type+"_alternate_"+$i+"_tf");
			deleteUI -layout ($type+"_alternate_"+$i+"_layout1");
		}
	}
	
	if(!`layout -exists ($type+"_alternate_layout")`) columnLayout ($type+"_alternate_layout");
	
	setParent ($type+"_alternate_layout");
	attrControlGrp -l "Clear Mesh" -attribute ($altInput[0] + ".clearMeshOrLink[0]") ($type+"_clear_a0");
	attrControlGrp -l "Clear Child-Link" -attribute ($altInput[0] + ".clearMeshOrLink[1]") ($type+"_clear_a1");
	attrControlGrp -l "Clear Child-Native" -attribute ($altInput[0] + ".clearNative[0]") ($type+"_clear_b1");
	attrControlGrp -l "Clear Shape-Link" -attribute ($altInput[0] + ".clearMeshOrLink[2]") ($type+"_clear_a2");
	attrControlGrp -l "Clear Shape-Native" -attribute ($altInput[0] + ".clearNative[1]") ($type+"_clear_b2");
	attrControlGrp -l "Clear Head-Link" -attribute ($altInput[0] + ".clearMeshOrLink[3]") ($type+"_clear_a3");
	attrControlGrp -l "Clear Head-Native" -attribute ($altInput[0] + ".clearNative[2]") ($type+"_clear_b3");
	
	setParent ($type+"_alternate_layout");
	if(!`layout -exists ($type+"_alternate_line_layout")`) rowLayout -nc 3 ($type+"_alternate_line_layout"); //alternate
	if(!`text -exists ($type+"_alternate_fill")`){
		setParent ($type+"_alternate_line_layout");
		text -label ("") ($type+"_alternate_fill");
	}
	if(!`text -exists ($type+"_alternate_text")`){
		setParent ($type+"_alternate_line_layout");
		text -label ("Generate alternate growth") -align "right" ($type+"_alternate_text");
	}
	if(!`symbolButton -exists ($type+"_alternate_button")`){
			setParent ($type+"_alternate_line_layout");
			symbolButton -i "addy.xpm" -h 20 ($type+"_alternate_button");
	}

	int $altIdxList[] = `getAttr -mi ($altInput[0]+".alternateGrowthOffset")`;
	int $altCount  = `size($altIdxList)`;
	if($altCount>0){	// create additional lines
		for($i=0; $i<$altCount; $i++){
			setParent ($type+"_alternate_layout");
			rowLayout -nc 3 ($type+"_alternate_"+$i+"_layout1");
			text -label ("Alternate Offset"+$i) ($type+"_alternate_"+$i+"_text1");
			textField  -ed 1 -tx "" ($type+"_alternate_"+$i+"_offset_tf");
			text -label ("") ($type+"_alternate_"+$i+"_fill");
			setParent ($type+"_alternate_layout");
			attrControlGrp -attribute ($altInput[0] + ".alternateGrowth[" + $i + "]") ($type+"_alternate_"+$i+"_tf");
		}
	}
	for($i=0; $i<$altCount; $i++){
		string $inputOffset = "[" + $altIdxList[$i] + "]";
		text -e -label ("Alternate Offset"+$inputOffset) ($type+"_alternate_"+$i+"_text1");
		string $changeCommand = "setAttr (\"" + $altInput[0] + ".alternateGrowthOffset" + $inputOffset + "\") -type \"string\" (`textField -q -tx (\"" + $type + "_alternate_" + $i + "_offset_tf\")`);\n";
		string $changeValue = `getAttr ($altInput[0] + ".alternateGrowthOffset" + $inputOffset)`;
		textField -e -tx ($changeValue) -cc ($changeCommand) ($type+"_alternate_"+$i+"_offset_tf");
	}
	
	string $actionCommand	= "setAttr (\"" + $altInput[0] + ".alternateGrowthOffset[" + $altCount + "]\") -type \"string\" \"\";			\n";
	symbolButton -e -command $actionCommand ($type+"_alternate_button");
}