SCENARIO
- You want to make box-based spheres easily
- create a sphere the conventional way and select it
- run script
- a new box-based sphere is created at the object's location
- if DeleteObject setting is true, the old object will be deleted
- adjust box segments and turbosmooth iterations as desired
-- USAGE -- create a sphere the conventional way and select it -- run script -- a new box-based sphere is created at the object's location -- if DeleteObject setting is true, the old object will be deleted -- adjust box segments and turbosmooth iterations as desired -- SETTINGS DeleteObject = true -- should the selected object(s) be deleted? objarray = getcurrentselection() max modify mode for obj in objarray do ( -- get size lengthx = (obj.max.x - obj.min.x) lengthy = (obj.max.y - obj.min.y) lengthz = (obj.max.z - obj.min.z) size = (lengthx + lengthy + lengthz) / 3 * 1.18 newsphere = Box lengthsegs:1 widthsegs:1 heightsegs:1 length:size width:size height:size mapcoords:on pos:[obj.center.x,obj.center.y,(obj.center.z - (size / 2))] isSelected:on newsphere.pivot = newsphere.center select newsphere TS = TurboSmooth () TS.iterations = 3 modPanel.addModToSelection (TS) ui:on modPanel.addModToSelection (Spherify ()) ui:on newsphere.wirecolor = obj.wirecolor if DeleteObject then (delete obj) )
No comments:
Post a Comment