@classmethod
    def bake_component_animation(cls):
        start = int(pm.playbackOptions(q=1, minTime=1))
        end = int(pm.playbackOptions(q=1, maxTime=1))

        vertices = pm.ls(sl=1, fl=1)

        locator = pm.spaceLocator()

        for i in range(start, end+1):
            pm.currentTime(i)
            point_positions = pm.xform(vertices, q=1, ws=1, t=1)
            point_count = len(point_positions) / 3
            px = reduce(lambda x, y: x+y, point_positions[0::3]) / point_count
            py = reduce(lambda x, y: x+y, point_positions[1::3]) / point_count
            pz = reduce(lambda x, y: x+y, point_positions[2::3]) / point_count

            locator.t.set(px, py, pz)
            pm.setKeyframe(locator.tx)
            pm.setKeyframe(locator.ty)
            pm.setKeyframe(locator.tz)
evaluate spline at specified x values
dataset/ETHPy150Open eoyilmaz/anima/anima/env/mayaEnv/toolbox.py/Animation.bake_component_animation--crossover with--dataset/ETHPy150Open xraypy/xraylarch/plugins/math/spline.py/spline_eval