def copyCtlShapes(*args):
    '''Copies the selected control's shape to a global variable for pasting'''
    global ctlShapeClipboard
    ctlShapeClipboard = manager.getShape(mc.ls(sl=1, fl=1)[0])
    for ctlShape in ctlShapeClipboard:
        # ctlShape.pop("colour")
        pass
def _flipCtlShape(crv=None, axis=[-1, -1, -1]):
    '''Scales the points of the crv argument by the axis argument. This function is not meant to be
    called directly. Look at the flipCtlShape instead.'''
    shapes = manager.getShape(crv)
    newShapes = []
    for shape in shapes:
        for i, each in enumerate(shape["points"]):
            shape["points"][i] = [
                each[0] * axis[0], each[1] * axis[1], each[2] * axis[2]
            ]
        newShapes.append(shape)
    manager.setShape(crv, newShapes)
    mc.select(crv)
def mirrorCtlShapes(*args):
    '''Mirrors the selected control's shape to the other control on the other side'''
    sel = mc.ls(sl=1, fl=1)
    for ctl in sel:
        if ctl[0] not in ["L", "R"]:
            continue
        search = "R_"
        replace = "L_"
        if ctl[0] == "L":
            search = "L_"
            replace = "R_"
        shapes = manager.getShape(ctl)
        for shape in shapes:
            shape.pop("colour")
        manager.setShape(ctl.replace(search, replace), shapes)
        _flipCtlShape(ctl.replace(search, replace))
    mc.select(sel)