ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
I am looking for a script that will select spline vertices based on type. For example selecting only the corner vertices of a spline or just the bezier vertices of a spline. Any help would be much appreciated. Thanks!
Select the spline. Go to Vertex sub-object level, deselect all verts. Run this script:
(
global rol_selKnotsByType
try(destroyDialog rol_selKnotsByType)catch()
rollout rol_selKnotsByType "Select knots by type"(
radiobuttons rb_knotsType "" labels:#("Corner", "Smooth", "Bezier", "Bezier Corner") default:1 columns:2
button btn_select "SELECT" width:190
on btn_select pressed do(ifselection.count != 0 do(
selObjsArr = selection as arrayfor o in selObjsArr where (classOf o == Line or classOf o == SplineShape)do(
knotsToSelArr = #()
splCnt = numSplines o
if splCnt != 0 do(for ss = 1 to splCnt do(
tmpArr = #()
knotsCnt = numKnots o ss
for k = 1 to knotsCnt do(
knotType = getKnotType o ss k
case rb_knotsType.state of
(
1:
(if knotType == #corner do append tmpArr k
)
2:
(if knotType == #smooth do append tmpArr k
)
3:
(if knotType == #bezier do append tmpArr k
)
4:
(if knotType == #bezierCorner do append tmpArr k
)))
setKnotSelection o ss tmpArr keep:true))))))
createdialog rol_selKnotsByType width:200)
Comments
.
Select the spline. Go to Vertex sub-object level, deselect all verts. Run this script:
Tools and Scripts for Autodesk 3dsMax
Perfect! Exactly what I was
Perfect! Exactly what I was looking for. Thanks a lot!