Wednesday, 13 March 2013

Center Pivot (or bottom-center)

99% of all obects I make I want the pivot to be at object-center or object-bottom-center (min z). I got tired of using the transform toolbox to do this, so here we are...

Scenario
  • You want to center (or bottom-center) the pivot of one or more objects
  • A button to do this would be splendid
Usage
  • Select one or more objects
  • run script once to center pivot
  • run again if desired to bottom-center

  
-- MixeScript snippet: Center Pivot 
-- Centers pivot. if run again, will bottom-center pivot.

--USAGE
-- select one or more objects
-- run script
-- centers pivot, or if already centered, places at min z

for obj in selection do
if obj.pivot != obj.center then (
 obj.pivot = obj.center
) else (
 obj.pivot = obj.center
 obj.pivot.z = obj.min.z
)
redrawviews()
  

1 comment: