KSP_TEXTURE_SET:NEEDS[TexturesUnlimited&!TURD/TU_B9_ProcWings]
{
    name = Smooth-Metal-Solid
    title = Smooth Metal Solid
    recolorable = true
    MATERIAL
    {
        shader = TU/Metallic
		texture = _MainTex,         B9_Aerospace_ProceduralWings/Textures/Mains/B9PWings-Metal-DIFF
        texture = _BumpMap,         B9_Aerospace_ProceduralWings/Textures/Normals/B9PWings-Smooth-NRM
        texture = _MetallicGlossMap,B9_Aerospace_ProceduralWings/Textures/Metallic/B9PWings-Smooth-METAL
        texture = _MaskTex,         B9_Aerospace_ProceduralWings/Textures/Masks/B9PWings-Solid-MASK
        keyword = TU_RECOLOR
        channelMask = 1
        vector = _DiffuseNorm,      0.5,0.5,0.5
        vector = _MetalNorm,        0.5,0.5,0.5
        vector = _SmoothnessNorm,   0.5,0.5,0.5
        mode = create
    }
    COLORS
    {
        mainColor = silver
    }
}

KSP_TEXTURE_SET:NEEDS[TexturesUnlimited&!TURD/TU_B9_ProcWings]
{
    name = B9PWings-edge-leading-metal
    title = B9PWings edge leading metal
    recolorable = true
    MATERIAL
    {

		mesh = edge_leading_type1
		mesh = edge_leading_type2
		mesh = edge_leading_type3
		mesh = edge_leading_type4
		
		
        shader = TU/Metallic
        texture = _MainTex,         B9_Aerospace_ProceduralWings/Textures/Mains/B9PWings-Metal-DIFF
        texture = _BumpMap,         B9_Aerospace_ProceduralWings/Textures/Normals/B9PWings-Smooth-NRM
        texture = _MetallicGlossMap,B9_Aerospace_ProceduralWings/Textures/Metallic/B9PWings-Smooth-METAL
        texture = _MaskTex,         B9_Aerospace_ProceduralWings/Textures/Masks/B9PWings-Solid-MASK
        keyword = TU_RECOLOR
        channelMask = 1
        vector = _DiffuseNorm,      0.5,0.5,0.5
        vector = _MetalNorm,        0.5,0.5,0.5
        vector = _SmoothnessNorm,   0.5,0.5,0.5
        mode = create
    }
    COLORS
    {
        mainColor = silver
    }
}

KSP_TEXTURE_SET:NEEDS[TexturesUnlimited&!TURD/TU_B9_ProcWings]
{
    name = B9PWings-edge-trailing-metal
    title = B9PWings edge trailing metal
    recolorable = true
    MATERIAL
    {
		mesh = edge_trailing_type1
		mesh = edge_trailing_type2
		mesh = edge_trailing_type3
		mesh = edge_trailing_type4
		
		
        shader = TU/Metallic
        texture = _MainTex,         B9_Aerospace_ProceduralWings/Textures/Mains/B9PWings-Metal-DIFF
        texture = _BumpMap,         B9_Aerospace_ProceduralWings/Textures/Normals/B9PWings-Smooth-NRM
        texture = _MetallicGlossMap,B9_Aerospace_ProceduralWings/Textures/Metallic/B9PWings-Smooth-METAL
        texture = _MaskTex,         B9_Aerospace_ProceduralWings/Textures/Masks/B9PWings-Solid-MASK
        keyword = TU_RECOLOR
        channelMask = 1
        vector = _DiffuseNorm,      0.5,0.5,0.5
        vector = _MetalNorm,        0.5,0.5,0.5
        vector = _SmoothnessNorm,   0.5,0.5,0.5
        mode = create
    }
    COLORS
    {
        mainColor = silver
    }
}

KSP_TEXTURE_SET:NEEDS[TexturesUnlimited&!TURD/TU_B9_ProcWings]
{
    name = B9PWings-edge-metal
    title = B9PWings edge metal
    recolorable = true
    MATERIAL
    {
		mesh = edge_type1
		mesh = edge_type2
		mesh = edge_type3
		
		
        shader = TU/Metallic
        texture = _MainTex,         B9_Aerospace_ProceduralWings/Textures/Mains/B9PWings-Metal-DIFF
        texture = _BumpMap,         B9_Aerospace_ProceduralWings/Textures/Normals/B9PWings-Smooth-NRM
        texture = _MetallicGlossMap,B9_Aerospace_ProceduralWings/Textures/Metallic/B9PWings-Smooth-METAL
        texture = _MaskTex,         B9_Aerospace_ProceduralWings/Textures/Masks/B9PWings-Solid-MASK
        keyword = TU_RECOLOR
        channelMask = 1
        vector = _DiffuseNorm,      0.5,0.5,0.5
        vector = _MetalNorm,        0.5,0.5,0.5
        vector = _SmoothnessNorm,   0.5,0.5,0.5
        mode = create
    }
    COLORS
    {
        mainColor = silver
    }
}

@PART[B9_Aero_Wing_Procedural_TypeA]:HAS[@MODULE[WingProcedural]]:FOR[B9_Aerospace_WingStuff]:NEEDS[TexturesUnlimited&!TURD/TU_B9_ProcWings]
{
    MODULE
    {
        name = SSTURecolorGUI
    }

    MODULE
    {
        name = KSPTextureSwitch
        transformName = surface
        sectionName = Surface

        currentTextureSet = Smooth-Metal-Solid
        textureSet = Smooth-Metal-Solid
    }

    MODULE
    {
        name = KSPTextureSwitch
        transformName = section
        sectionName = Section

        currentTextureSet = Smooth-Metal-Solid
        textureSet = Smooth-Metal-Solid
    }

	MODULE
    {
        name = KSPTextureSwitch
        sectionName = Trailing edge

        currentTextureSet = B9PWings-edge-trailing-metal
        textureSet = B9PWings-edge-trailing-metal 
	}
	
	MODULE
    {
        name = KSPTextureSwitch
        sectionName = Leading edge

        currentTextureSet = B9PWings-edge-leading-metal
        textureSet = B9PWings-edge-leading-metal
    }
}

@PART[B9_Aero_Wing_Procedural_TypeB]:HAS[@MODULE[WingProcedural]]:FOR[B9_Aerospace_WingStuff]:NEEDS[TexturesUnlimited&!TURD/TU_B9_ProcWings]
{
    MODULE
    {
        name = SSTURecolorGUI
    }

    MODULE
    {
        name = KSPTextureSwitch
        transformName = surface
        sectionName = Surface

        currentTextureSet = Smooth-Metal-Solid
        textureSet = Smooth-Metal-Solid
    }

	MODULE
    {
        name = KSPTextureSwitch
        transformName = frame
        sectionName = Frame

        currentTextureSet = Smooth-Metal-Solid
        textureSet = Smooth-Metal-Solid
    }

	MODULE
    {
        name = KSPTextureSwitch
        sectionName = Edge

		currentTextureSet = B9PWings-edge-metal
        textureSet = B9PWings-edge-metal
    }
}

@PART[B9_Aero_Wing_Procedural_TypeC]:HAS[@MODULE[WingProcedural]]:FOR[B9_Aerospace_WingStuff]:NEEDS[TexturesUnlimited&!TURD/TU_B9_ProcWings]
{
    MODULE
    {
        name = SSTURecolorGUI
    }

    MODULE
    {
        name = KSPTextureSwitch
        transformName = surface
        sectionName = Surface

        currentTextureSet = Smooth-Metal-Solid
        textureSet = Smooth-Metal-Solid
    }

    MODULE
    {
        name = KSPTextureSwitch
        transformName = section
        sectionName = Section

        currentTextureSet = Smooth-Metal-Solid
        textureSet = Smooth-Metal-Solid
    }

	MODULE
    {
        name = KSPTextureSwitch
        sectionName = Trailing edge

        currentTextureSet = B9PWings-edge-trailing-metal
        textureSet = B9PWings-edge-trailing-metal 
	}
	
	MODULE
    {
        name = KSPTextureSwitch
        sectionName = Leading edge

        currentTextureSet = B9PWings-edge-leading-metal
        textureSet = B9PWings-edge-leading-metal
    }
}


@PART[B9_Aero_Wing_Procedural*]:HAS[@MODULE[WingProcedural]]:FOR[B9_Aerospace_WingStuff]:NEEDS[TexturesUnlimited&!TURD/TU_B9_ProcWings]
{
    @MODULE[KSPTextureSwitch]:HAS[#transformName[surface]],*
    {
//        textureSet = Smooth-Metal-Solid
    }
}
