def addRightSideToList(l):
    '''
    doesn't work because order matters
    '''
    toAdd = []
    for item in l:
        if 'LT_' in item:
            toAdd.append(item.replace('LT_', 'RT_'))
    return l + toAdd

# to switch off an action,
# just add '-' or something so it won't run
build_actions = ['-bind',
                 '-sec_motion_system',
                 '-primary_ctl_system_first',
                 '-primary_ctl_system_second',
                 '-load_weights',
                 '-clean',
                 '-surface_constraint',
                 '-eyes',
                 'eyeballs']

# bnds to attach to surface
slidingBnds = [u'LT_corner_cheek_bnd',
                u'CT_lower_chin_bnd',
                u'LT_lowerPinch_lip_bnd',
                u'LT_upperSide_lip_bnd',
                u'CT_lower_lip_bnd',
                u'LT_lowerSneer_lip_bnd',
                u'LT_corner_lip_bnd',
                u'LT_lowerSide_lip_bnd',
                u'CT_upper_lip_bnd',
                u'LT_upperPinch_lip_bnd',
                u'LT_upperSneer_lip_bnd',
                u'LT_lowerOuter_eyeSocket_bnd',
                u'LT_lowerPinch_chin_bnd',
                u'LT_lowerInner_eyeSocket_bnd',
                u'LT_lower_eyeSocket_bnd',
                u'LT_lowerSide_chin_bnd',
                u'LT_low_temple_bnd',
                u'LT_lowerSneer_chin_bnd',
                u'LT_mid_brow_bnd',
                u'LT_out_brow_bnd',
                u'LT__eyeMover_bnd',
                u'CT_mid_forehead_bnd',
                u'LT_up_temple_bnd',
                u'LT_in_brow_bnd',
                u'LT_upper_eyeSocket_bnd',
                u'LT_upperInner_eyeSocket_bnd',
                u'LT_upperOuter_eyeSocket_bnd',
                u'LT_outer_eyeSocket_bnd',
                u'LT_inner_eyeSocket_bnd',
                u'LT_mid_temple_bnd',
                u'LT_out_forehead_bnd']

all_slidingBnds = addRightSideToList(slidingBnds)

# list of priCtls for first pass
# order is important
# those created earlier can be affected by those created later
# only need to specify LT and CT - RT is added in all_bnds_for_priCtls

bnds_for_priCtls = [u'LT_mid_brow_pLoc',
                    u'LT__eyeMover_pLoc',
                    u'LT_inner_eyelid_pLoc',
                    u'LT_upper_eyelid_pLoc',
                    u'LT_outer_eyelid_pLoc',
                    u'LT_lower_eyelid_pLoc',
                    u'CT__mouthMover_pLoc',
                    u'CT__jawDown_pLoc',
                    u'CT__jawUp_pLoc',
                    u'CT_upper_lip_pLoc',
                    u'CT_lower_lip_pLoc',
                    u'LT_upperSneer_lip_pLoc',
                    u'LT_lowerSneer_lip_pLoc',
                    u'LT_corner_lip_pLoc']

all_bnds_for_priCtls = addRightSideToList(bnds_for_priCtls)

priCtlMappings = {u'CT__jawDown_pri_ctrl': {u'CT__jawDown_bnd': 1.0,
                           u'CT__mouthMover_bnd': 0.5,
                           u'CT_lower_chin_bnd': 0.1,
                           u'CT_lower_lip_bnd': 1.0,
                           u'CT_upper_lip_bnd': 0.01,
                           u'LT_corner_cheek_bnd': 0.1,
                           u'LT_corner_lip_bnd': 0.5,
                           u'LT_lowerPinch_chin_bnd': 0.1,
                           u'LT_lowerPinch_lip_bnd': 0.8,
                           u'LT_lowerSide_chin_bnd': 0.1,
                           u'LT_lowerSide_lip_bnd': 0.975,
                           u'LT_lowerSneer_chin_bnd': 0.1,
                           u'LT_lowerSneer_lip_bnd': 0.9,
                           u'LT_upperPinch_lip_bnd': 0.2,
                           u'LT_upperSide_lip_bnd': 0.025,
                           u'LT_upperSneer_lip_bnd': 0.1,
                           u'RT_corner_cheek_bnd': 0.1,
                           u'RT_corner_lip_bnd': 0.5,
                           u'RT_lowerPinch_chin_bnd': 0.1,
                           u'RT_lowerPinch_lip_bnd': 0.8,
                           u'RT_lowerSide_chin_bnd': 0.1,
                           u'RT_lowerSide_lip_bnd': 0.975,
                           u'RT_lowerSneer_chin_bnd': 0.1,
                           u'RT_lowerSneer_lip_bnd': 0.9,
                           u'RT_upperPinch_lip_bnd': 0.2,
                           u'RT_upperSide_lip_bnd': 0.025,
                           u'RT_upperSneer_lip_bnd': 0.1},
 u'CT__jawUp_pri_ctrl': {u'CT__jawUp_bnd': 1.0,
                         u'CT__mouthMover_bnd': 0.5,
                         u'CT_lower_lip_bnd': 0.01,
                         u'CT_upper_lip_bnd': 1.0,
                         u'LT_corner_cheek_bnd': 0.1,
                         u'LT_corner_lip_bnd': 0.5,
                         u'LT_low_temple_bnd': 0.1,
                         u'LT_lowerInner_eyeSocket_bnd': 0.1,
                         u'LT_lowerOuter_eyeSocket_bnd': 0.1,
                         u'LT_lowerPinch_lip_bnd': 0.2,
                         u'LT_lowerSide_lip_bnd': 0.025,
                         u'LT_lowerSneer_lip_bnd': 0.1,
                         u'LT_lower_eyeSocket_bnd': 0.1,
                         u'LT_upperPinch_lip_bnd': 0.8,
                         u'LT_upperSide_lip_bnd': 0.975,
                         u'LT_upperSneer_lip_bnd': 0.9,
                         u'RT_corner_cheek_bnd': 0.1,
                         u'RT_corner_lip_bnd': 0.5,
                         u'RT_low_temple_bnd': 0.1,
                         u'RT_lowerInner_eyeSocket_bnd': 0.1,
                         u'RT_lowerOuter_eyeSocket_bnd': 0.1,
                         u'RT_lowerPinch_lip_bnd': 0.2,
                         u'RT_lowerSide_lip_bnd': 0.025,
                         u'RT_lowerSneer_lip_bnd': 0.1,
                         u'RT_lower_eyeSocket_bnd': 0.1,
                         u'RT_upperPinch_lip_bnd': 0.8,
                         u'RT_upperSide_lip_bnd': 0.975,
                         u'RT_upperSneer_lip_bnd': 0.9},
 u'CT__mouthMover_pri_ctrl': {u'CT__mouthMover_bnd': 1.0,
                              u'CT_lower_chin_bnd': 0.1,
                              u'CT_lower_lip_bnd': 1.0,
                              u'CT_upper_lip_bnd': 1.0,
                              u'LT_corner_cheek_bnd': 0.2,
                              u'LT_corner_lip_bnd': 1.0,
                              u'LT_low_temple_bnd': 0.1,
                              u'LT_lowerInner_eyeSocket_bnd': 0.1,
                              u'LT_lowerOuter_eyeSocket_bnd': 0.1,
                              u'LT_lowerPinch_chin_bnd': 0.1,
                              u'LT_lowerPinch_lip_bnd': 1.0,
                              u'LT_lowerSide_chin_bnd': 0.1,
                              u'LT_lowerSide_lip_bnd': 1.0,
                              u'LT_lowerSneer_chin_bnd': 0.1,
                              u'LT_lowerSneer_lip_bnd': 1.0,
                              u'LT_lower_eyeSocket_bnd': 0.1,
                              u'LT_upperPinch_lip_bnd': 1.0,
                              u'LT_upperSide_lip_bnd': 1.0,
                              u'LT_upperSneer_lip_bnd': 1.0,
                              u'RT_corner_cheek_bnd': 0.2,
                              u'RT_corner_lip_bnd': 1.0,
                              u'RT_low_temple_bnd': 0.1,
                              u'RT_lowerInner_eyeSocket_bnd': 0.1,
                              u'RT_lowerOuter_eyeSocket_bnd': 0.1,
                              u'RT_lowerPinch_chin_bnd': 0.1,
                              u'RT_lowerPinch_lip_bnd': 1.0,
                              u'RT_lowerSide_chin_bnd': 0.1,
                              u'RT_lowerSide_lip_bnd': 1.0,
                              u'RT_lowerSneer_chin_bnd': 0.1,
                              u'RT_lowerSneer_lip_bnd': 1.0,
                              u'RT_lower_eyeSocket_bnd': 0.1,
                              u'RT_upperPinch_lip_bnd': 1.0,
                              u'RT_upperSide_lip_bnd': 1.0,
                              u'RT_upperSneer_lip_bnd': 1.0},
 u'CT_lower_lip_pri_ctrl': {u'CT_lower_lip_bnd': 1.0,
                            u'LT_lowerPinch_lip_bnd': 0.2,
                            u'LT_lowerSide_lip_bnd': 0.9,
                            u'LT_lowerSneer_lip_bnd': 0.5,
                            u'RT_lowerPinch_lip_bnd': 0.2,
                            u'RT_lowerSide_lip_bnd': 0.9,
                            u'RT_lowerSneer_lip_bnd': 0.5},
 u'CT_upper_lip_pri_ctrl': {u'CT_upper_lip_bnd': 1.0,
                            u'LT_upperPinch_lip_bnd': 0.2,
                            u'LT_upperSide_lip_bnd': 0.9,
                            u'LT_upperSneer_lip_bnd': 0.5,
                            u'RT_upperPinch_lip_bnd': 0.2,
                            u'RT_upperSide_lip_bnd': 0.9,
                            u'RT_upperSneer_lip_bnd': 0.5},
 u'LT__eyeMover_pri_ctrl': {u'CT_mid_forehead_bnd': 0.25,
                            u'LT__eyeMover_bnd': 1.0,
                            u'LT_corner_cheek_bnd': 0.125,
                            u'LT_inner_eyeSocket_bnd': 1.0,
                            u'LT_inner_eyelid_bnd': 1.0,
                            u'LT_low_temple_bnd': 0.25,
                            u'LT_lowerInner_eyeSocket_bnd': 1.0,
                            u'LT_lowerInner_eyelid_bnd': 1.0,
                            u'LT_lowerOuter_eyeSocket_bnd': 1.0,
                            u'LT_lowerOuter_eyelid_bnd': 1.0,
                            u'LT_lower_eyeSocket_bnd': 1.0,
                            u'LT_lower_eyelid_bnd': 1.0,
                            u'LT_mid_temple_bnd': 0.25,
                            u'LT_out_forehead_bnd': 0.25,
                            u'LT_outer_eyeSocket_bnd': 1.0,
                            u'LT_outer_eyelid_bnd': 1.0,
                            u'LT_up_temple_bnd': 0.25,
                            u'LT_upperInner_eyeSocket_bnd': 1.0,
                            u'LT_upperInner_eyelid_bnd': 1.0,
                            u'LT_upperOuter_eyeSocket_bnd': 1.0,
                            u'LT_upperOuter_eyelid_bnd': 1.0,
                            u'LT_upper_eyeSocket_bnd': 1.0,
                            u'LT_upper_eyelid_bnd': 1.0,
                            u'RT_inner_eyeSocket_bnd': 0.1},
 u'LT_corner_lip_pri_ctrl': {u'CT_lower_chin_bnd': 0.01,
                             u'CT_lower_lip_bnd': 0.01,
                             u'CT_upper_lip_bnd': 0.01,
                             u'LT_corner_cheek_bnd': 0.2,
                             u'LT_corner_lip_bnd': 1.0,
                             u'LT_low_temple_bnd': 0.1,
                             u'LT_lowerInner_eyeSocket_bnd': 0.025,
                             u'LT_lowerOuter_eyeSocket_bnd': 0.05,
                             u'LT_lowerPinch_chin_bnd': 0.3,
                             u'LT_lowerPinch_lip_bnd': 0.75,
                             u'LT_lowerSide_chin_bnd': 0.1,
                             u'LT_lowerSide_lip_bnd': 0.15,
                             u'LT_lowerSneer_chin_bnd': 0.2,
                             u'LT_lowerSneer_lip_bnd': 0.35,
                             u'LT_lower_eyeSocket_bnd': 0.05,
                             u'LT_upperPinch_lip_bnd': 0.75,
                             u'LT_upperSide_lip_bnd': 0.15,
                             u'LT_upperSneer_lip_bnd': 0.35},
 u'LT_inner_eyelid_pri_ctrl': {u'LT_inner_eyeSocket_bnd': 1.0,
                               u'LT_inner_eyelid_bnd': 1.0,
                               u'LT_lowerInner_eyelid_bnd': 1.0,
                               u'LT_upperInner_eyelid_bnd': 1.0},
 u'LT_lowerSneer_lip_pri_ctrl': {u'CT_lower_lip_bnd': 0.45,
                                 u'LT_lowerPinch_lip_bnd': 0.75,
                                 u'LT_lowerSide_lip_bnd': 0.8,
                                 u'LT_lowerSneer_lip_bnd': 1.0,
                                 u'RT_lowerSide_lip_bnd': 0.2},
 u'LT_lower_eyelid_pri_ctrl': {u'LT_inner_eyelid_bnd': 1.0,
                               u'LT_lowerInner_eyelid_bnd': 1.0,
                               u'LT_lowerOuter_eyelid_bnd': 1.0,
                               u'LT_lower_eyelid_bnd': 1.0,
                               u'LT_outer_eyelid_bnd': 1.0},
 u'LT_mid_brow_pri_ctrl': {u'LT_in_brow_bnd': 1.0,
                           u'LT_mid_brow_bnd': 1.0,
                           u'LT_out_brow_bnd': 1.0},
 u'LT_outer_eyelid_pri_ctrl': {u'LT_lowerOuter_eyelid_bnd': 1.0,
                               u'LT_outer_eyeSocket_bnd': 1.0,
                               u'LT_outer_eyelid_bnd': 1.0,
                               u'LT_upperOuter_eyelid_bnd': 1.0},
 u'LT_upperSneer_lip_pri_ctrl': {u'CT_upper_lip_bnd': 0.45,
                                 u'LT_upperPinch_lip_bnd': 0.75,
                                 u'LT_upperSide_lip_bnd': 0.8,
                                 u'LT_upperSneer_lip_bnd': 1.0,
                                 u'RT_upperSide_lip_bnd': 0.2},
 u'LT_upper_eyelid_pri_ctrl': {u'LT_inner_eyelid_bnd': 1.0,
                               u'LT_outer_eyelid_bnd': 1.0,
                               u'LT_upperInner_eyelid_bnd': 1.0,
                               u'LT_upperOuter_eyelid_bnd': 1.0,
                               u'LT_upper_eyelid_bnd': 1.0},
 u'RT__eyeMover_pri_ctrl': {u'CT_mid_forehead_bnd': 0.25,
                            u'LT_inner_eyeSocket_bnd': 0.1,
                            u'RT__eyeMover_bnd': 1.0,
                            u'RT_corner_cheek_bnd': 0.125,
                            u'RT_inner_eyeSocket_bnd': 1.0,
                            u'RT_inner_eyelid_bnd': 1.0,
                            u'RT_low_temple_bnd': 0.25,
                            u'RT_lowerInner_eyeSocket_bnd': 1.0,
                            u'RT_lowerInner_eyelid_bnd': 1.0,
                            u'RT_lowerOuter_eyeSocket_bnd': 1.0,
                            u'RT_lowerOuter_eyelid_bnd': 1.0,
                            u'RT_lower_eyeSocket_bnd': 1.0,
                            u'RT_lower_eyelid_bnd': 1.0,
                            u'RT_mid_temple_bnd': 0.25,
                            u'RT_out_forehead_bnd': 0.25,
                            u'RT_outer_eyeSocket_bnd': 1.0,
                            u'RT_outer_eyelid_bnd': 1.0,
                            u'RT_up_temple_bnd': 0.25,
                            u'RT_upperInner_eyeSocket_bnd': 1.0,
                            u'RT_upperInner_eyelid_bnd': 1.0,
                            u'RT_upperOuter_eyeSocket_bnd': 1.0,
                            u'RT_upperOuter_eyelid_bnd': 1.0,
                            u'RT_upper_eyeSocket_bnd': 1.0,
                            u'RT_upper_eyelid_bnd': 1.0},
 u'RT_corner_lip_pri_ctrl': {u'CT_lower_chin_bnd': 0.01,
                             u'CT_lower_lip_bnd': 0.01,
                             u'CT_upper_lip_bnd': 0.01,
                             u'RT_corner_cheek_bnd': 0.2,
                             u'RT_corner_lip_bnd': 1.0,
                             u'RT_low_temple_bnd': 0.1,
                             u'RT_lowerInner_eyeSocket_bnd': 0.025,
                             u'RT_lowerOuter_eyeSocket_bnd': 0.05,
                             u'RT_lowerPinch_chin_bnd': 0.3,
                             u'RT_lowerPinch_lip_bnd': 0.75,
                             u'RT_lowerSide_chin_bnd': 0.1,
                             u'RT_lowerSide_lip_bnd': 0.15,
                             u'RT_lowerSneer_chin_bnd': 0.2,
                             u'RT_lowerSneer_lip_bnd': 0.35,
                             u'RT_lower_eyeSocket_bnd': 0.05,
                             u'RT_upperPinch_lip_bnd': 0.75,
                             u'RT_upperSide_lip_bnd': 0.15,
                             u'RT_upperSneer_lip_bnd': 0.35},
 u'RT_inner_eyelid_pri_ctrl': {u'RT_inner_eyeSocket_bnd': 1.0,
                               u'RT_inner_eyelid_bnd': 1.0,
                               u'RT_lowerInner_eyelid_bnd': 1.0,
                               u'RT_upperInner_eyelid_bnd': 1.0},
 u'RT_lowerSneer_lip_pri_ctrl': {u'CT_lower_lip_bnd': 0.45,
                                 u'LT_lowerSide_lip_bnd': 0.2,
                                 u'RT_lowerPinch_lip_bnd': 0.75,
                                 u'RT_lowerSide_lip_bnd': 0.8,
                                 u'RT_lowerSneer_lip_bnd': 1.0},
 u'RT_lower_eyelid_pri_ctrl': {u'RT_inner_eyelid_bnd': 1.0,
                               u'RT_lowerInner_eyelid_bnd': 1.0,
                               u'RT_lowerOuter_eyelid_bnd': 1.0,
                               u'RT_lower_eyelid_bnd': 1.0,
                               u'RT_outer_eyelid_bnd': 1.0},
 u'RT_mid_brow_pri_ctrl': {u'RT_in_brow_bnd': 1.0,
                           u'RT_mid_brow_bnd': 1.0,
                           u'RT_out_brow_bnd': 1.0},
 u'RT_outer_eyelid_pri_ctrl': {u'RT_lowerOuter_eyelid_bnd': 1.0,
                               u'RT_outer_eyeSocket_bnd': 1.0,
                               u'RT_outer_eyelid_bnd': 1.0,
                               u'RT_upperOuter_eyelid_bnd': 1.0},
 u'RT_upperSneer_lip_pri_ctrl': {u'CT_upper_lip_bnd': 0.45,
                                 u'LT_upperSide_lip_bnd': 0.2,
                                 u'RT_upperPinch_lip_bnd': 0.75,
                                 u'RT_upperSide_lip_bnd': 0.8,
                                 u'RT_upperSneer_lip_bnd': 1.0},
 u'RT_upper_eyelid_pri_ctrl': {u'RT_inner_eyelid_bnd': 1.0,
                               u'RT_outer_eyelid_bnd': 1.0,
                               u'RT_upperInner_eyelid_bnd': 1.0,
                               u'RT_upperOuter_eyelid_bnd': 1.0,
                               u'RT_upper_eyelid_bnd': 1.0}}
