Notifications
Clear all

[Closed] setKnotSelection per edit_spline modifier in the stack???

I’m trying to add a controle helper for a linkedX mod for each vertex on a spline.

this is the code:

max modify mode
for spline in selection where superclassof spline == shape do (
	convertToSplineShape spline
	for knot = 1 to (numKnots spline) do(
		addmodifier spline (edit_Spline ())			
		subObjectLevel = 1
		 knotArr = #(knot)
		 setKnotselection spline 1 knotArr
		knotPos = getKnotPoint spline 1 knot
		 thePoint = point pos:knotPos wirecolor:yellow name:(uniquename(spline.name + "_kontroller_"))
		 knotMod = modPanel.addModToSelection (Linked_XForm ())
		spline.modifiers[1].control = thePoint
	)
)

the problem is that all the edit_spline modifiers do get the same knot selection.
how do I tell maxscript only to change the current modifiers selection like it does that when I do the same thing manually?

2 Replies

Read the topic “Passing SplineShape Knot Selections Up The Stack” in the MAXScript Reference. It shows a “hack” to fool the system

haha, this is awesome!!

you’re the man!! thanks