<?xml version="1.0" encoding="UTF-8"?>

<!--
SMP setup by Everglaid, feel free to use
 -->
 
 <system xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="description.xsd">
 
 
	<!--Let's declare our bone templates.
	We can use these templates to give multiple bones the same physics values, without needing to retype them over and over for each individual bone.
	This can be very helpful if you're making something with a high bone count.-->
	
	<bone name="NPC L Clavicle [LClv]"/>
	<bone name="NPC R Clavicle [RClv]"/>
	<bone name="NPC L Hand [LHnd]"/>
	<bone name="NPC R Hand [RHnd]"/>
	<bone name="NPC Head [Head]"/>
	<bone name="NPC Spine2 [Spn2]"/>
	<bone name="NPC L Thigh [LThg]"/>
	<bone name="NPC R Thigh [RThg]"/>
	
	<bone-default name="ExquisiteClothTemplateBase">
		<mass>1.5</mass>
		<inertia x="100" y="100" z="100"/>
		<linearDamping>0.87</linearDamping>
		<angularDamping>0.87</angularDamping>
	</bone-default>

	<bone-default name="ExquisiteClothExpand">
		<mass>1.5</mass>
		<inertia x="100" y="100" z="100"/>
		<linearDamping>0.87</linearDamping>
		<angularDamping>0.87</angularDamping>
		<margin-multiplier>2</margin-multiplier>
	</bone-default>
	
	<bone-default name="ExquisiteChainTemplateBase">
		<mass>4</mass>
		<inertia x="100" y="100" z="100"/>
		<linearDamping>0.9</linearDamping>
		<angularDamping>0.8</angularDamping>
	</bone-default>

	<bone-default name="ExquisiteHoodTemplateBase">
		<mass>4</mass>
		<inertia x="100" y="100" z="100"/>
		<linearDamping>0.2</linearDamping>
		<angularDamping>0.2</angularDamping>
	</bone-default>
	
	<bone-default name="ExquisiteChainExpand">
		<mass>4</mass>
		<inertia x="100" y="100" z="100"/>
		<linearDamping>0.8</linearDamping>
		<angularDamping>0.8</angularDamping>
		<margin-multiplier>4</margin-multiplier>
	</bone-default>

	<!-- Here, I'm using 'bodyexpand' (name doesn't matter) to literally expand the collision distance for specific body parts.
		This helps prevent clipping in specific areas -->
		
	<bone-default name="armexpand">	
		<mass>0</mass>
		<inertia x="0" y="0" z="0"/>
		<margin-multiplier>1</margin-multiplier>
	</bone-default>

	<bone-default name="backexpand">	
		<mass>0</mass>
		<inertia x="0" y="0" z="0"/>
		<margin-multiplier>3.5</margin-multiplier>
	</bone-default>
	
	<bone name="NPC L UpperArm [LUar]" template="armexpand"/>
	<bone name="NPC R UpperArm [RUar]" template="armexpand"/>
	<bone name="NPC L UpperarmTwist1 [LUt1]" template="armexpand"/>
	<bone name="NPC R UpperarmTwist1 [RUt1]" template="armexpand"/>
	<bone name="NPC L UpperarmTwist2 [LUt2]" template="armexpand"/>
	<bone name="NPC R UpperarmTwist2 [RUt2]" template="armexpand"/>	
	
	<bone name="NPC L Forearm [LLar]" template="armexpand"/>
	<bone name="NPC R Forearm [RLar]" template="armexpand"/>
	<bone name="NPC L ForearmTwist1 [LLt1]" template="armexpand"/>
	<bone name="NPC R ForearmTwist1 [RLt1]" template="armexpand"/>
	<bone name="NPC L ForearmTwist2 [LLt2]" template="armexpand"/>
	<bone name="NPC R ForearmTwist2 [RLt2]" template="armexpand"/>

	<bone name="NPC Pelvis [Pelv]" template="backexpand"/>
	<bone name="NPC Spine [Spn0]" template="backexpand"/>
	<bone name="NPC Spine1 [Spn1]" template="backexpand"/>
	
<!--Now that we have our templates, let's apply them to our bones.-->
	
	<bone name="evgexhood1a" template="ExquisiteHoodTemplateBase"/>
	<bone name="evgexhood1b" template="ExquisiteHoodTemplateBase"/>

	<bone name="evgexcapeB1a" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeB1b" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeB1c" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeB1d" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeB1e" template="ExquisiteClothTemplateBase"/>
	
	<bone name="evgexcapeL1a" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeL1b" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeL1c" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeL1d" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeL1e" template="ExquisiteClothTemplateBase"/>

	<bone name="evgexcapeL2a" template="ExquisiteClothExpand"/>
	<bone name="evgexcapeL2b" template="ExquisiteClothExpand"/>
	<bone name="evgexcapeL2c" template="ExquisiteClothExpand"/>
	<bone name="evgexcapeL2d" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeL2e" template="ExquisiteClothTemplateBase"/>
	
	<bone name="evgexcapeR1a" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeR1b" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeR1c" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeR1d" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeR1e" template="ExquisiteClothTemplateBase"/>
	
	<bone name="evgexcapeR2a" template="ExquisiteClothExpand"/>
	<bone name="evgexcapeR2b" template="ExquisiteClothExpand"/>
	<bone name="evgexcapeR2c" template="ExquisiteClothExpand"/>
	<bone name="evgexcapeR2d" template="ExquisiteClothTemplateBase"/>
	<bone name="evgexcapeR2e" template="ExquisiteClothTemplateBase"/>
	
	<bone name="evgexchainB1a" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainB1b" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainB1c" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainB1d" template="ExquisiteChainExpand"/>
	<bone name="evgexchainB1e" template="ExquisiteChainExpand"/>
	
	<bone name="evgexchainL1a" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainL1b" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainL1c" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainL1d" template="ExquisiteChainExpand"/>
	<bone name="evgexchainL1e" template="ExquisiteChainExpand"/>

	<bone name="evgexchainL2a" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainL2b" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainL2c" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainL2d" template="ExquisiteChainExpand"/>
	<bone name="evgexchainL2e" template="ExquisiteChainExpand"/>
	
	<bone name="evgexchainR1a" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainR1b" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainR1c" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainR1d" template="ExquisiteChainExpand"/>
	<bone name="evgexchainR1e" template="ExquisiteChainExpand"/>
	
	<bone name="evgexchainR2a" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainR2b" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainR2c" template="ExquisiteChainTemplateBase"/>
	<bone name="evgexchainR2d" template="ExquisiteChainExpand"/>
	<bone name="evgexchainR2e" template="ExquisiteChainExpand"/>
	
<!--With our bones declared, we need to apply constraints: 'connecting' our bones from child to parent, with some more physics settings.
Again, we'll start with templates: these will define how the physics work on children bones, relative to the parent.-->
	
	<generic-constraint-default name="ExquisiteClothConstraintStart">
		<frameInA>
			<basis x="0" y="0" z="0" w="1"/>
			<origin x="0" y="0" z="0"/>
		</frameInA>
		<useLinearReferenceFrameA>false</useLinearReferenceFrameA>
		<linearLowerLimit x="-0.01" y="-0.01" z="-0.01"/>
		<linearUpperLimit x="0.01" y="0.01" z="0.01"/>
		<angularLowerLimit x="-0.45" y="-0.45" z="-0.05"/>
		<angularUpperLimit x="0.45" y="0.45" z="0.05"/>
		<angularStiffness x="1" y="1" z="1"/>
	</generic-constraint-default>

	<generic-constraint-default name="ExquisiteClothConstraintBase">
		<frameInA>
			<basis x="0" y="0" z="0" w="1"/>
			<origin x="0" y="0" z="0"/>
		</frameInA>
		<useLinearReferenceFrameA>false</useLinearReferenceFrameA>
		<linearLowerLimit x="-0.01" y="-0.01" z="-0.01"/>
		<linearUpperLimit x="0.01" y="0.01" z="0.01"/>
		<angularLowerLimit x="-0.25" y="-0.25" z="-0.05"/>
		<angularUpperLimit x="0.25" y="0.25" z="0.05"/>
		<angularStiffness x="1" y="1" z="1"/>
	</generic-constraint-default>

	<generic-constraint-default name="ExquisiteChainConstraintStart">
		<frameInA>
			<basis x="0" y="0" z="0" w="1"/>
			<origin x="0" y="0" z="0"/>
		</frameInA>
		<useLinearReferenceFrameA>false</useLinearReferenceFrameA>
		<linearLowerLimit x="-0.01" y="-0.01" z="-0.01"/>
		<linearUpperLimit x="0.01" y="0.01" z="0.01"/>
		<angularLowerLimit x="-0.45" y="-0.12" z="-0.05"/>
		<angularUpperLimit x="0.45" y="0.12" z="0.05"/>
		<angularStiffness x="1" y="1" z="1"/>
	</generic-constraint-default>
	
	<generic-constraint-default name="ExquisiteClothConstraintHood">
		<frameInA>
			<basis x="0" y="0" z="0" w="1"/>
			<origin x="0" y="0" z="0"/>
		</frameInA>
		<useLinearReferenceFrameA>false</useLinearReferenceFrameA>
		<linearLowerLimit x="-0.5" y="-0.5" z="-0.01"/>
		<linearUpperLimit x="0.5" y="-0.4" z="0.01"/>
		<angularLowerLimit x="-0.9" y="-0.2" z="-0.1"/>
		<angularUpperLimit x="-0.1" y="0.2" z="0.1"/>
		<angularStiffness x="1" y="1" z="1"/>
	</generic-constraint-default>

	<generic-constraint-default name="ExquisiteClothConstraintHoodSecond">
		<frameInA>
			<basis x="0" y="0" z="0" w="1"/>
			<origin x="0" y="0" z="0"/>
		</frameInA>
		<useLinearReferenceFrameA>false</useLinearReferenceFrameA>
		<linearLowerLimit x="-0.1" y="-0.1" z="-0.01"/>
		<linearUpperLimit x="0.1" y="0.1" z="0.01"/>
		<angularLowerLimit x="-0.2" y="-0.1" z="-0.1"/>
		<angularUpperLimit x="0.2" y="0.1" z="0.1"/>
		<angularStiffness x="1" y="1" z="1"/>
	</generic-constraint-default>
	
	<!-- Because we have several bone chains on a single 'sheet' of cloth, we need to prevent the bone chains from splitting too far apart, as well as getting too close together.
		 The exquisite cloak also needs many more constraints to help prevent the metal portions from clipping into the cloth. -->
	
	<generic-constraint-default name="ExquisiteClothConstraintNearby">
		<frameInA>
			<basis x="0" y="0" z="0" w="1"/>
			<origin x="0" y="0" z="0"/>
		</frameInA>
		<useLinearReferenceFrameA>false</useLinearReferenceFrameA>
		<linearLowerLimit x="-2" y="-2" z="-2"/>
		<linearUpperLimit x="2" y="2" z="2"/>
		<angularLowerLimit x="-12" y="-12" z="-12"/>
		<angularUpperLimit x="12" y="12" z="12"/>
		<angularStiffness x="0" y="0" z="0"/>
	</generic-constraint-default>
	
	<generic-constraint-default name="ExquisiteChainConstraintNearby">
		<frameInA>
			<basis x="0" y="0" z="0" w="1"/>
			<origin x="0" y="0" z="0"/>
		</frameInA>
		<useLinearReferenceFrameA>false</useLinearReferenceFrameA>
		<linearLowerLimit x="-0.75" y="-0.75" z="-0.75"/>
		<linearUpperLimit x="0.75" y="0.75" z="0.75"/>
		<angularLowerLimit x="-2" y="-2" z="-2"/>
		<angularUpperLimit x="2" y="2" z="2"/>
		<angularStiffness x="0" y="0" z="0"/>
	</generic-constraint-default>

	<generic-constraint-default name="ExquisiteChainConstrainttoCape">
		<frameInA>
			<basis x="0" y="0" z="0" w="1"/>
			<origin x="0" y="0" z="0"/>
		</frameInA>
		<useLinearReferenceFrameA>false</useLinearReferenceFrameA>
		<linearLowerLimit x="-1" y="-2" z="-1"/>
		<linearUpperLimit x="1" y="-0" z="1"/>
		<angularLowerLimit x="-12" y="-12" z="-12"/>
		<angularUpperLimit x="12" y="12" z="12"/>
		<angularStiffness x="0" y="0" z="0"/>
	</generic-constraint-default>

	<generic-constraint-default name="ExquisiteChainConstrainttoCapeFar">
		<frameInA>
			<basis x="0" y="0" z="0" w="1"/>
			<origin x="0" y="0" z="0"/>
		</frameInA>
		<useLinearReferenceFrameA>false</useLinearReferenceFrameA>
		<linearLowerLimit x="-4" y="-9" z="-4"/>
		<linearUpperLimit x="4" y="-1" z="4"/>
		<angularLowerLimit x="-12" y="-12" z="-12"/>
		<angularUpperLimit x="12" y="12" z="12"/>
		<angularStiffness x="0" y="0" z="0"/>
	</generic-constraint-default>
	
<!-- Apply the templates to the bones, and set the proper parents.-->

	<!-- The order doesn't matter, but I'll start with attaching the parent chains to the vanilla spine bone.-->

	<generic-constraint bodyA="evgexhood1a" bodyB="NPC Spine2 [Spn2]" template="ExquisiteClothConstraintHood"/>
	<generic-constraint bodyA="evgexhood1b" bodyB="evgexhood1a" template="ExquisiteClothConstraintHoodSecond"/>

	<generic-constraint bodyA="evgexcapeB1a" bodyB="NPC Spine2 [Spn2]" template="ExquisiteClothConstraintStart"/>
	<generic-constraint bodyA="evgexcapeB1b" bodyB="evgexcapeB1a" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeB1c" bodyB="evgexcapeB1b" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeB1d" bodyB="evgexcapeB1c" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeB1e" bodyB="evgexcapeB1d" template="ExquisiteClothConstraintBase"/>

	<generic-constraint bodyA="evgexcapeL1a" bodyB="NPC Spine2 [Spn2]" template="ExquisiteClothConstraintStart"/>
	<generic-constraint bodyA="evgexcapeL1b" bodyB="evgexcapeL1a" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeL1c" bodyB="evgexcapeL1b" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeL1d" bodyB="evgexcapeL1c" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeL1e" bodyB="evgexcapeL1d" template="ExquisiteClothConstraintBase"/>

	<generic-constraint bodyA="evgexcapeL2a" bodyB="NPC Spine2 [Spn2]" template="ExquisiteClothConstraintStart"/>
	<generic-constraint bodyA="evgexcapeL2b" bodyB="evgexcapeL2a" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeL2c" bodyB="evgexcapeL2b" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeL2d" bodyB="evgexcapeL2c" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeL2e" bodyB="evgexcapeL2d" template="ExquisiteClothConstraintBase"/>

	<generic-constraint bodyA="evgexcapeR1a" bodyB="NPC Spine2 [Spn2]" template="ExquisiteClothConstraintStart"/>
	<generic-constraint bodyA="evgexcapeR1b" bodyB="evgexcapeR1a" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeR1c" bodyB="evgexcapeR1b" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeR1d" bodyB="evgexcapeR1c" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeR1e" bodyB="evgexcapeR1d" template="ExquisiteClothConstraintBase"/>

	<generic-constraint bodyA="evgexcapeR2a" bodyB="NPC Spine2 [Spn2]" template="ExquisiteClothConstraintStart"/>
	<generic-constraint bodyA="evgexcapeR2b" bodyB="evgexcapeR2a" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeR2c" bodyB="evgexcapeR2b" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeR2d" bodyB="evgexcapeR2c" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexcapeR2e" bodyB="evgexcapeR2d" template="ExquisiteClothConstraintBase"/>

	<!-- chains! -->
	
	<generic-constraint bodyA="evgexchainB1a" bodyB="NPC Spine2 [Spn2]" template="ExquisiteChainConstraintStart"/>
	<generic-constraint bodyA="evgexchainB1b" bodyB="evgexchainB1a" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainB1c" bodyB="evgexchainB1b" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainB1d" bodyB="evgexchainB1c" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainB1e" bodyB="evgexchainB1d" template="ExquisiteClothConstraintBase"/>

	<generic-constraint bodyA="evgexchainL1a" bodyB="NPC Spine2 [Spn2]" template="ExquisiteClothConstraintStart"/>
	<generic-constraint bodyA="evgexchainL1b" bodyB="evgexchainL1a" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainL1c" bodyB="evgexchainL1b" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainL1d" bodyB="evgexchainL1c" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainL1e" bodyB="evgexchainL1d" template="ExquisiteClothConstraintBase"/>

	<generic-constraint bodyA="evgexchainL2a" bodyB="NPC Spine2 [Spn2]" template="ExquisiteClothConstraintStart"/>
	<generic-constraint bodyA="evgexchainL2b" bodyB="evgexchainL2a" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainL2c" bodyB="evgexchainL2b" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainL2d" bodyB="evgexchainL2c" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainL2e" bodyB="evgexchainL2d" template="ExquisiteClothConstraintBase"/>

	<generic-constraint bodyA="evgexchainR1a" bodyB="NPC Spine2 [Spn2]" template="ExquisiteClothConstraintStart"/>
	<generic-constraint bodyA="evgexchainR1b" bodyB="evgexchainR1a" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainR1c" bodyB="evgexchainR1b" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainR1d" bodyB="evgexchainR1c" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainR1e" bodyB="evgexchainR1d" template="ExquisiteClothConstraintBase"/>

	<generic-constraint bodyA="evgexchainR2a" bodyB="NPC Spine2 [Spn2]" template="ExquisiteClothConstraintStart"/>
	<generic-constraint bodyA="evgexchainR2b" bodyB="evgexchainR2a" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainR2c" bodyB="evgexchainR2b" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainR2d" bodyB="evgexchainR2c" template="ExquisiteClothConstraintBase"/>
	<generic-constraint bodyA="evgexchainR2e" bodyB="evgexchainR2d" template="ExquisiteClothConstraintBase"/>
	
	<!-- supporting constraints! -->

	<generic-constraint bodyA="evgexcapeB1a" bodyB="evgexcapeL1a" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeB1b" bodyB="evgexcapeL1b" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeB1c" bodyB="evgexcapeL1c" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeB1d" bodyB="evgexcapeL1d" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeB1e" bodyB="evgexcapeL1e" template="ExquisiteClothConstraintNearby"/>

	<generic-constraint bodyA="evgexcapeB1a" bodyB="evgexcapeR1a" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeB1b" bodyB="evgexcapeR1b" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeB1c" bodyB="evgexcapeR1c" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeB1d" bodyB="evgexcapeR1d" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeB1e" bodyB="evgexcapeR1e" template="ExquisiteClothConstraintNearby"/>


	<generic-constraint bodyA="evgexcapeR2a" bodyB="NPC R Clavicle [RClv]" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeL2a" bodyB="NPC L Clavicle [LClv]" template="ExquisiteClothConstraintNearby"/>
	
	<generic-constraint bodyA="evgexcapeR1a" bodyB="evgexcapeR2a" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeR1b" bodyB="evgexcapeR2b" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeR1c" bodyB="evgexcapeR2c" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeR1d" bodyB="evgexcapeR2d" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeR1e" bodyB="evgexcapeR2e" template="ExquisiteClothConstraintNearby"/>

	<generic-constraint bodyA="evgexcapeL1a" bodyB="evgexcapeL2a" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeL1b" bodyB="evgexcapeL2b" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeL1c" bodyB="evgexcapeL2c" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeL1d" bodyB="evgexcapeL2d" template="ExquisiteClothConstraintNearby"/>
	<generic-constraint bodyA="evgexcapeL1e" bodyB="evgexcapeL2e" template="ExquisiteClothConstraintNearby"/>
	
	<!-- chains! -->

	<generic-constraint bodyA="evgexchainB1a" bodyB="evgexchainL1a" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainB1b" bodyB="evgexchainL1b" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainB1c" bodyB="evgexchainL1c" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainB1d" bodyB="evgexchainL1d" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainB1e" bodyB="evgexchainL1e" template="ExquisiteChainConstraintNearby"/>

	<generic-constraint bodyA="evgexchainB1a" bodyB="evgexchainR1a" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainB1b" bodyB="evgexchainR1b" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainB1c" bodyB="evgexchainR1c" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainB1d" bodyB="evgexchainR1d" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainB1e" bodyB="evgexchainR1e" template="ExquisiteChainConstraintNearby"/>
	
	<generic-constraint bodyA="evgexchainR1a" bodyB="evgexchainR2a" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainR1b" bodyB="evgexchainR2b" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainR1c" bodyB="evgexchainR2c" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainR1d" bodyB="evgexchainR2d" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainR1e" bodyB="evgexchainR2e" template="ExquisiteChainConstraintNearby"/>

	<generic-constraint bodyA="evgexchainL1a" bodyB="evgexchainL2a" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainL1b" bodyB="evgexchainL2b" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainL1c" bodyB="evgexchainL2c" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainL1d" bodyB="evgexchainL2d" template="ExquisiteChainConstraintNearby"/>
	<generic-constraint bodyA="evgexchainL1e" bodyB="evgexchainL2e" template="ExquisiteChainConstraintNearby"/>

	<!-- attach chains to cape -->

	<generic-constraint bodyA="evgexchainB1a" bodyB="evgexcapeB1a" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainB1b" bodyB="evgexcapeB1a" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainB1c" bodyB="evgexcapeB1b" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainB1d" bodyB="evgexcapeB1c" template="ExquisiteChainConstrainttoCapeFar"/>
	<generic-constraint bodyA="evgexchainB1e" bodyB="evgexcapeB1c" template="ExquisiteChainConstrainttoCapeFar"/>

	<generic-constraint bodyA="evgexchainR1a" bodyB="evgexcapeR1a" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainR1b" bodyB="evgexcapeR1a" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainR1c" bodyB="evgexcapeR1b" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainR1d" bodyB="evgexcapeR1c" template="ExquisiteChainConstrainttoCapeFar"/>
	<generic-constraint bodyA="evgexchainR1e" bodyB="evgexcapeR1c" template="ExquisiteChainConstrainttoCapeFar"/>

	<generic-constraint bodyA="evgexchainL1a" bodyB="evgexcapeL1a" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainL1b" bodyB="evgexcapeL1a" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainL1c" bodyB="evgexcapeL1b" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainL1d" bodyB="evgexcapeL1c" template="ExquisiteChainConstrainttoCapeFar"/>
	<generic-constraint bodyA="evgexchainL1e" bodyB="evgexcapeL1c" template="ExquisiteChainConstrainttoCapeFar"/>

	<generic-constraint bodyA="evgexchainR2a" bodyB="evgexcapeR2a" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainR2b" bodyB="evgexcapeR2a" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainR2c" bodyB="evgexcapeR2b" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainR2d" bodyB="evgexcapeR2c" template="ExquisiteChainConstrainttoCapeFar"/>
	<generic-constraint bodyA="evgexchainR2e" bodyB="evgexcapeR2c" template="ExquisiteChainConstrainttoCapeFar"/>

	<generic-constraint bodyA="evgexchainL2a" bodyB="evgexcapeL2a" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainL2b" bodyB="evgexcapeL2a" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainL2c" bodyB="evgexcapeL2b" template="ExquisiteChainConstrainttoCape"/>
	<generic-constraint bodyA="evgexchainL2d" bodyB="evgexcapeL2c" template="ExquisiteChainConstrainttoCapeFar"/>
	<generic-constraint bodyA="evgexchainL2e" bodyB="evgexcapeL2c" template="ExquisiteChainConstrainttoCapeFar"/>
	
<!-- Now we introduce our collision meshes & values to prevent clipping with the body as much as possible.-->
	
	<per-triangle-shape name="bodycollisionF">
		<margin>1</margin>
		<prenetration>5</prenetration>
		<shared>private</shared>
		<tag>bodycollision</tag>
		<can-collide-with-tag>clothcollision</can-collide-with-tag>
		<can-collide-with-tag>chaincollision</can-collide-with-tag>
	</per-triangle-shape>

	<!--male-->
	<per-triangle-shape name="bodycollision">
		<margin>0.75</margin>
		<prenetration>4</prenetration>
		<shared>private</shared>
		<tag>bodycollision</tag>
		<can-collide-with-tag>clothcollision</can-collide-with-tag>
		<can-collide-with-tag>chaincollision</can-collide-with-tag>
	</per-triangle-shape>
	
	<per-vertex-shape name="exquisiteproxy">
		<margin>0.85</margin>
		<prenetration>0.1</prenetration>
		<shared>private</shared>
		<tag>clothcollision</tag>
		
		<no-collide-with-bone>NPC Pelvis [Pelv]</no-collide-with-bone>
		<no-collide-with-bone>NPC L Thigh [LThg]</no-collide-with-bone>
		<no-collide-with-bone>NPC R Thigh [RThg]</no-collide-with-bone>

		<weight-threshold bone="evgexcapeL2a">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeL2b">0.02</weight-threshold>
		<weight-threshold bone="evgexcapeL2c">0.02</weight-threshold>
		<weight-threshold bone="evgexcapeL2d">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeL2e">0.15</weight-threshold>
		
		<weight-threshold bone="evgexcapeL1a">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeL1b">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeL1c">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeL1d">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeL1e">0.15</weight-threshold>
		
		<weight-threshold bone="evgexcapeB1a">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeB1b">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeB1c">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeB1d">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeB1e">0.15</weight-threshold>
		
		<weight-threshold bone="evgexcapeR2a">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeR2b">0.02</weight-threshold>
		<weight-threshold bone="evgexcapeR2c">0.02</weight-threshold>
		<weight-threshold bone="evgexcapeR2d">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeR2e">0.15</weight-threshold>
		
		<weight-threshold bone="evgexcapeR1a">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeR1b">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeR1c">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeR1d">0.15</weight-threshold>
		<weight-threshold bone="evgexcapeR1e">0.15</weight-threshold>
		
	</per-vertex-shape>

	<per-vertex-shape name="exquisiteproxychain">
		<margin>1</margin>
		<prenetration>0.1</prenetration>
		<shared>private</shared>
		<tag>chaincollision</tag>
		<can-collide-with-tag>bodycollision</can-collide-with-tag>
		<can-collide-with-tag>clothcollision</can-collide-with-tag>		

		<no-collide-with-bone>NPC Pelvis [Pelv]</no-collide-with-bone>
		<no-collide-with-bone>NPC L Thigh [LThg]</no-collide-with-bone>
		<no-collide-with-bone>NPC R Thigh [RThg]</no-collide-with-bone>

		<no-collide-with-bone>NPC L UpperArm [LUar]</no-collide-with-bone>
		<no-collide-with-bone>NPC R UpperArm [RUar]</no-collide-with-bone>
		<no-collide-with-bone>NPC L UpperarmTwist1 [LUt1]</no-collide-with-bone>
		<no-collide-with-bone>NPC R UpperarmTwist1 [RUt1]</no-collide-with-bone>
		<no-collide-with-bone>NPC L UpperarmTwist2 [LUt2]</no-collide-with-bone>
		<no-collide-with-bone>NPC R UpperarmTwist2 [RUt2]</no-collide-with-bone>	
	
		<weight-threshold bone="evgexchainL2a">0.9</weight-threshold>
		<weight-threshold bone="evgexchainL2b">0.9</weight-threshold>
		<weight-threshold bone="evgexchainL2c">0.9</weight-threshold>
		<weight-threshold bone="evgexchainL2d">0.5</weight-threshold>
		<weight-threshold bone="evgexchainL2e">0.5</weight-threshold>
		
		<weight-threshold bone="evgexchainL1a">0.9</weight-threshold>
		<weight-threshold bone="evgexchainL1b">0.9</weight-threshold>
		<weight-threshold bone="evgexchainL1c">0.9</weight-threshold>
		<weight-threshold bone="evgexchainL1d">0.5</weight-threshold>
		<weight-threshold bone="evgexchainL1e">0.5</weight-threshold>
		
		<weight-threshold bone="evgexchainB1a">0.9</weight-threshold>
		<weight-threshold bone="evgexchainB1b">0.9</weight-threshold>
		<weight-threshold bone="evgexchainB1c">0.9</weight-threshold>
		<weight-threshold bone="evgexchainB1d">0.5</weight-threshold>
		<weight-threshold bone="evgexchainB1e">0.5</weight-threshold>
		
		<weight-threshold bone="evgexchainR2a">0.9</weight-threshold>
		<weight-threshold bone="evgexchainR2b">0.9</weight-threshold>
		<weight-threshold bone="evgexchainR2c">0.9</weight-threshold>
		<weight-threshold bone="evgexchainR2d">0.5</weight-threshold>
		<weight-threshold bone="evgexchainR2e">0.5</weight-threshold>
		
		<weight-threshold bone="evgexchainR1a">0.9</weight-threshold>
		<weight-threshold bone="evgexchainR1b">0.9</weight-threshold>
		<weight-threshold bone="evgexchainR1c">0.9</weight-threshold>
		<weight-threshold bone="evgexchainR1d">0.5</weight-threshold>
		<weight-threshold bone="evgexchainR1e">0.5</weight-threshold>
		
	</per-vertex-shape>
	
</system>