Brent Forrest’s Script Can Easily Find the Volumetric Center of an Object.
Ever wanted to quickly draw a line in the center of a 3D object in Maya? Let’s say you need to place a curve there or joints, or both. You could eyeball it, but Brent Forrest has a handy script solution. This short Python script will let you create a curve or joints down the volumetric center of a mesh by way of an edge loop selection.
“This came from a help request on some forum – someone was asking if there was a quick way to draw a line down the center of a 3D mesh,” Forrest says. “The answer is “Yes if it has edge loops” – And here’s a useful python script for generating either NURBS curves, joint chains or both down the middle of an object with edge loops.” The script has three functions, depending on what you select.
- If you select one edge and run the script, it will generate a curve down the center of the object using all edge loops.
- Select two edges, and it will generate a curve BETWEEN those two edge loops.
- Select three or more edges, and it will generate a curve only using those selected edge loops (Good for heavy, redundant geo)
There are two flags, make centerline(0,1) creates a joint chain, (1,0) makes a NURBS curve and (1,1) makes both.
Check out MakeCenterLine here.