Wednesday, April 29, 2009

Bounding Box to Box

There is one sample script trick to make Box with same dimention as Bounding Box of selected object and align it:

if selection.count == 1 then
b = Box pos:$.pos
b.width = ($.max.x - $.min.x)
b.length = ($.max.y - $.min.y)
b.height = ($.max.z - $.min.z)
b.transform = $.transform = $.center
b.pivot = $.pivot
b.xray = on = $.name + "_BBox"

It's useful in 2 cases: then you wish to make a low polygon version of object for proxy usage in XRef; or then need dimension for calculations.

No comments:

Post a Comment

Thanks for your comment