[Closed] Bezier handles not changing spline – maxscript
This is sample code out of the help docs that I’ve been playing with. It runs fine, but if you manually convert it to bezier knots or a smooth curve it doesn’t affect the spline.
Any one have an idea what this would be missing? Do I have to add bezier handles through code for this to work?
Any ideas would be helpful, thanks!
(
sp = splineShape()
addnewSpline sp
addKnot sp 1 #corner #line [20,10,0]
addKnot sp 1 #corner #line [-20,11,0]
addKnot sp 1 #corner #line [-20,-11,0]
addKnot sp 1 #corner #line [20,-10,0]
close sp 1
updateShape sp
select sp
subobjectlevel = 1
setKnotSelection sp 1 #(1,4) keep:false – Select the right most knots
weldSpline sp 21.0
knotCount = numknots sp
if (knotCount != 3) do
throw (“Spline should have 3 knots, found “+ (knotCount as string))
)
**Alright, a quick update.
So I’ve messed with this a bit more. I set the line type to #smooth #curve and that seems to let me later manually change it to bezier if I wanted to.
So I guess when you set it to #corner #line, it’s a way of hard coding it to ONLY be a line? There’s no way of manually converting that to bezier afterwards I guess? Not a big deal, just curious as to why it does that.
Maybe this lame little finding of mine helped some one, heh :shrug:
If you mean that with #corner #line you cant get a curvy rectangle, that is true. Because you explicitly declared your intentions. But you can use #corner #curve in the script. Once you create the spline, convert the vertices manually to smooth or bezier to get your curvy result again.