Hello as title says, I wonder how to get selected knot position ?
new_spline = $
sk = getKnotSelection new_spline 1
skp = getKnotPoint $ 1 ?
aaa = addKnot new_spline 1 #corner #curve skp
updateshape new_spline
Thanks.
Forum topic · General Scripting
By titane357 · 2013-11-15
Hello as title says, I wonder how to get selected knot position ?
new_spline = $
sk = getKnotSelection new_spline 1
skp = getKnotPoint $ 1 ?
aaa = addKnot new_spline 1 #corner #curve skp
updateshape new_spline
Thanks.
titane357 · 2013-11-16
Thanks Miauu...
If I understand well, you create an array of the one selected knot, so you know which index is used by this knot (index =1)
very clever... I hate arrays, but so powerfull...
so I have what I want : create a new knot at the end of my spline (don't work for begin of the spline)
new_spline = $
selKnotsArr = getKnotSelection new_spline 1
-- check if only one knot is selected
if selKnotsArr.count == 1 do
(
skp = getKnotPoint new_spline 1 selKnotsArr[1]
aaa = addKnot new_spline 1 #corner #curve skp
updateshape new_spline
setKnotSelection new_spline 1 #(aaa)
)
.
miauu · 2013-11-16
I did not create the array. getKnotSelection returns the selected knots as array.:)
.
miauu · 2013-11-16
(
new_spline = $
selKnotsArr = getKnotSelection new_spline 1
-- check if only one knot is selected
if selKnotsArr.count == 1 do
(
skp = getKnotPoint new_spline 1 selKnotsArr[1]
aaa = addKnot new_spline 1 #corner #curve skp
updateshape new_spline
)
)