Notifications
Clear all
[Closed] How to get position from spline vertex by maxscript
Oct 15, 2017 6:50 am
Hello , i search from maxscript help
http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/index.html?url=files/GUID-6C6A35EB-DD5F-40C1-9869-0938849F6842.htm,topicNumber=d30e380960
but i dont know how to get position current selected vertex , can you help me ?
Thank you very much
Best regard
4 Replies
Oct 15, 2017 6:50 am
[quote=]getKnotSelection <shape> <spline_index_integer>
Returns the indices of the selected knots in the specified shape spline as an array of integers.
shp = -- your spline shape
selectedKnots = #()
for i=1 to numsplines shp do
(
for j in getKnotSelection shp i do append selectedKnots #( i, j, getKnotPoint shp i j )
)
Oct 15, 2017 6:50 am
thank you for you quick reply , i try many ways but it not work
Oct 15, 2017 6:50 am
(
delete objects
shp = SplineShape()
-- Create splineshape
for i=1 to 5 do (
addNewSpline shp
for j=1 to 5 do addKnot shp i #corner #line ([i*50 + random -10 10, j*25 + random 0 25, 0])
)
updateShape shp
-- Select random knots
for i=1 to numSplines shp do (
sel = #()
for j=1 to numKnots shp i where random 0.0 1.0 > 0.5 do append sel j
setKnotSelection shp i sel
)
select shp
selectedKnots = #()
for i=1 to numsplines shp do
(
for j in getKnotSelection shp i do (append selectedKnots #( i, j, getKnotPoint shp i j ))
)
for s in selectedKnots do format "spline index:% knot index:% knot position:%
" s[1] s[2] s[3]
subobjectlevel = 1
)