Center Pivot on many objects all at once
Published in
1 min readFeb 10, 2018
A situation where this could be needed is when importing external data for example from curve schematic data from a program like AutoCad. After the import the pivots to each cuve is nowhere near the object. With the following mel script we can center the pivot for all selected objects in one go.
Code
string $selectedObjects[] = `ls -sl`;
string $currentObj;
for ($currentObj in $selectedObjects) {
// center $currentObj's pivot
xform -cp $currentObj;
}
Steps
- Selected objects in viewport.
- Open Script Editor from Window > General Editors > Script Editor.
- Paste the above code in the bottom half of the script editor.
- Run the code by selecting menu Command > Execute.