|
Hi all,
I wrote a little script to see if I can get gmax to slice an object. So my script creates a cone and several flat boxes ( the later slices) and with
some boolean operations the cone was perfect sliced.
Now comes my question : If
I don't let the script create a cone but load an object into the scene
I can't figure out how to read the position of the imported object, the
size or the height and so on.( to synchronize the positions of the
object and the slice-boxes) . Gmax sees the imported object only as bounding box and I can't do any boolean operation between my boxes and the object. There only comes up an error-message : can't convert or turn into editible mesh. Searching
the MeshScript hrlp I found the Boolean2 Geometry Class and tried
boolObj.createBooleanObject . This works fine with the 'onboard' cone
but not with my imported object. Error-message : source object has wrong format. However
if I manually click Compund objects > Boolean and select
intersection as result it works fine and the result is as it should be. The MaxScript-Listener doesn't catch the Compound object >boolean clicks . Seems to be no way of doing boolean operations between 'onboard'-objects and loaded objects ??
Here is the script which shows want I want to do:
-- number of boxes/slices Slices = 10
--height of the cone C_height = 80
--height of the slices Box_height = C_height / Slices
--create the cone Cone smooth:on heightsegs:5 crapsegs:1 sides:24 height:C_height radius1:30 radius2:5 pos:[0,0,0] isSelected:on
--create the boxes/slices count = 1 while count < slices+1 do ( Box lengthsegs:1 widthsegs:1 heightsegs:1 length:90 width:90 height:Box_height pos:[00,0,(count-1)*Box_height] isSelected:off count+=1 )
--do the boolean thing count = 1 while count < slices+1 do ( select $*Box*[count] $*Box*[count] * $Cone01
--move the slices to new postion $*Box*[count].pos = [-80,0,(0+(count-1)*10)] count +=1 )
Thanks in advance for every help
Richard
|