I’ve got an issue copying Edit_Poly modifiers from one object to another. I’ve got an array of flat shapes with multiple splines. I’m extruding the splines with random heights. I need to keep a stack to enable or disable the extrusions, so I’m using an Edit_Poly modifier. Applying the random extrusions takes a bit of time, so I’d like to do that once and copy that modifier to the other objects.
When I copy an Edit_Poly modifier by hand, the extrusions are working nicely, however when I do this by script the extrusions aren’t applied. I’m wondering if I miss a step. Check out the example.
(
--the plane and box have the same amount of faces, though this isn't strictly necessary
thePlane = plane lengthsegs:2 widthsegs:3
theBox = box lengthsegs:1 widthsegs:1 heightsegs:1 pos:[50,0,0]
--set up the edit poly with the extrusions
theMod = Edit_Poly()
addModifier thePlane theMod
max modify mode
select thePlane
subObjectLevel = 4
theMod.extrudeFaceHeight = 20
theMod.SetOperation #ExtrudeFace
theMod.extrudeFaceType = 2
theMod.SetSelection #Face #{}--clear selection
theMod.Select #Face #{1,6}--select some faces
theMod.Commit()
subobjectLevel = 0
--copy the modifier to the box. the extrusions don't work
select theBox
addModifier theBox (copy theMod)
)
If you copy the modifier from the plane to the box by hand, the 2 faces are extruded. Does anyone know how to do this by script?