newbie help, changing knot type
I am trying to make a simple script to change a selected spline knot type. it goes as as follows:
a = ((getsplineselection $ )[1]) --------to get the spline integer
b = ((getknotselection $ a )[1]) --------to get the knot integer
setknottype $ a b #corner --------assigns new knot type to selection
I dragged the macro into a toolbar to make a button and it works as I need it to. The problem arises when I restart max. when I press my macroscript button again I get an error
" --unable to convert: undefined to type: integer"
so for some reason a & b are not kicking back an integer when the desired knot is selected.
In the maxscript help file the syntax for getknottype is defined as:
setKnotType (#smooth | #corner | #bezier | #bezierCorner)
Any help is greatly appreciated ! this is driving me nuts :)
also, I made a simple ui for it and the when I run the script nothing happens. I used the visual maxscript editor the final script looked something like this:
rollout knots "knot types" width:140 height:171
(
button btn1 "corner" pos:[14,32] width:107 height:24
button btn2 "smooth" pos:[15,62] width:107 height:24
button btn3 "bezier" pos:[16,96] width:107 height:24
button btn4 "bez corner" pos:[16,130] width:107 height:24
on btn1 pressed do
(
a = ((getsplineselection $)[1])
b = ((getknotselection $ a)[1])
setknottype $ a b #corner
)
on btn2 pressed do
(
a = ((getsplineselection $)[1])
b = ((getknotselection $ a)[1])
setknottype $ a b #smooth
)
on btn3 pressed do
(
a = ((getsplineselection $)[1])
b = ((getknotselection $ a)[1])
setknottype $ a b #bezier
)
on btn4 pressed do
(
a = ((getsplineselection $)[1])
b = ((getknotselection $ a)[1])
setknottype $ a b #bezierCorner
)
)
any help regarding this problem is also greatly appreciated,
Thanks,
Paul
Comments
great tool
hi. thats so usefull tool.
but his can't work on stack modifire [editable spline]
can be get work the script on stack?
Wow, thanks! This is
Wow, thanks!
This is great,works perfectly :)
This is your tool
This is your tool
--work on single selected shape (with multiple attached splines) without assigned modifiers.
--supports multiple selected knots
bga