Unknown property: "slice_plane" in false

I am writing a script which shatters objects into different pieces, and am using slice modifiers to do this.

This is the part of the code which actually does the slicing:

for i=1 to Segs do
(
o=i+1
addmodifier Seg[i] (slicemodifier())
Seg[i].slice.slice_plane.transform=Cut[i].transform
Seg[i].slice.slice_type=2
addmodifier Seg[i] (cap_holes())
addmodifier Seg[i] (slicemodifier())
Seg[i].slice.slice_plane.transform=Cut[o].transform
Seg[i].slice.slice_type=3
addmodifier Seg[i] (cap_holes())
)

(the many Seg objects are created beforehand, aswell as the Cut objects)
When the script is used with a box, it works fine, and all the objects are sliced correctly.
However, when used with anything else(I have tried sphere, geosphere, cylinder) it comes up with this error:
Unknown property: "slice_plane" in false
Re-running the script, and/or restarting Max doesn't help.
There is nothing in the script which requires the object to be a box, or anything apart from a geometric object.
Since I got the main part working it has never failed with box's(I had been testing it on box's from the start(it didn't always work, but now it works only with box's) and I would like it to be able to work with more then box's...
Any idea why this error would be coming up, and how could I fix it?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

On this forum you have

On this forum you have different solution for "slice" modifier.Also there are several scripts that perform what you want to achieve.

bga

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.