@staticmethod
    def swapShapeNode(shapeTransform, node):
        """
        SYNOPSIS
         Parents the input shape node to the second input node.
         The original shape node transform is deleted.
         Preserves incoming visibility connections to shapeNode.

        INPUTS
         (string) shapeTransform:  The transform of the shape node to use.
         (string) node:  The node to parent the shape node to.

        RETURNS: new shapeNode.
        """

        shapeTransform = PyNode(shapeTransform)

        # check for current incoming visibility connections
        shapeVisSource = ''
        if node.getShape():
            shapeVisSource = listConnections(node.getShape().visibility, p=1)

        makeIdentity(shapeTransform, apply=True, s=1, r=0, t=0, n=0)
        shapes = listRelatives(shapeTransform, pa=1, s=1)

        # get shape that is 'real' shape, i.e.- non-intermediate object
        shape = ''
        for testShape in map(lambda x: PyNode(x), shapes):
            if not testShape.intermediateObject.get():
                shape = testShape

        # parent right one
        shape = PyNode(parent(shape, node, add=1, s=1)[0])

        # rename shape node proper
        shape = rename(shape, '%sShape' % shape[:shape.find('|')])

        # connect visibility if old shape was connected
        if shapeVisSource:
            shape.v.unlock()
            shapeVisSource[0].connect(shape.v)
            shape.v.lock()

        delete(shapeTransform)
        reorder(shape, f=1)

        return shape
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/core/mayaCore.py/MayaMeshCore.swapShapeNode/original