Script for creating curve at the center of the volume of object ?


Hi Guys is there any script that creates curve at the center of the mesh ,like if the cylindrical pipe is there and curve at the center of it ?


I’m your huckleberry.

For this script to work your edge loops have to be clean and “Track Selection Order” has to be enabled in your maya settings.

import maya.cmds as cmd
import maya.mel
def makeCenter():
    #track selection order must be on for this to work
    points = 'curve -d 3 '
    sel =
    for one in sel:
        strip ="\[([0-9]+)\]", one)
        num =
        clust = cmd.cluster(n = 'poo#')
        posi = cmd.getAttr(clust[0]+'HandleShape.origin')
        points = points + ('-p %s %s %s ' %(posi[0][0], posi[0][1], posi[0][2]))
        cmd.delete (clust[0])


Sample Video: