BxHBxH
10-22-2003, 12:40 PM
Hey there MaxScripters... I posted this on support.discreet.com, but haven't heard anything... perhaps someone in here could help?
Struggling my way through learning MAXScript... very excited about the possibilities, but I'm banging my head on this seeming simple one and can't seem to figure it out.
I'm trying to create an effect that will slice up an object using the 'section' command, and then extrude each of the spline sections. However it appears that the section command gives verts that aren't welded completely - so the resultant extrusion doesn't cap it's end. So I'm trying to have the script weld the verts before extruding but I can't get it to go. Here's the portion of the script that I'm having problems with:
minZ = $HeightTool.min.z
maxZ = $HeightTool.max.z
LayerHeight = 10
for currentZ = minZ to maxZ by LayerHeight do
(
s = section pos:[0, 0, currentZ]
max views redraw
convertToSplineShape s
select s
max modify mode
--modPanel.setCurrentObject $.baseObject
subobjectLevel = 1
max select invert
splineOps.weld s
updateShape s
--addModifier splineSection (Extrude())
--splineSection.modifiers[#Extrude].amount = LayerHeight/2
)
run it on the included sample scene attached to this post and you'll see the problem. It appears that only the last spline is getting welded the way it should... all the other splines are getting their verts selected as they should, but the weld isn't working. Hmmmmmm... can't figure it out. Any help would be greatly appreaciated. Thanks
Testing File HERE (http://www.bxhdesigns.com/misc/LayerCakeMaker_Tester_01.max)
Struggling my way through learning MAXScript... very excited about the possibilities, but I'm banging my head on this seeming simple one and can't seem to figure it out.
I'm trying to create an effect that will slice up an object using the 'section' command, and then extrude each of the spline sections. However it appears that the section command gives verts that aren't welded completely - so the resultant extrusion doesn't cap it's end. So I'm trying to have the script weld the verts before extruding but I can't get it to go. Here's the portion of the script that I'm having problems with:
minZ = $HeightTool.min.z
maxZ = $HeightTool.max.z
LayerHeight = 10
for currentZ = minZ to maxZ by LayerHeight do
(
s = section pos:[0, 0, currentZ]
max views redraw
convertToSplineShape s
select s
max modify mode
--modPanel.setCurrentObject $.baseObject
subobjectLevel = 1
max select invert
splineOps.weld s
updateShape s
--addModifier splineSection (Extrude())
--splineSection.modifiers[#Extrude].amount = LayerHeight/2
)
run it on the included sample scene attached to this post and you'll see the problem. It appears that only the last spline is getting welded the way it should... all the other splines are getting their verts selected as they should, but the weld isn't working. Hmmmmmm... can't figure it out. Any help would be greatly appreaciated. Thanks
Testing File HERE (http://www.bxhdesigns.com/misc/LayerCakeMaker_Tester_01.max)
