PDA

View Full Version : setKnotSelection per edit_spline modifier in the stack???


CapitanRed
11-03-2009, 11:14 PM
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?

Bobo
11-03-2009, 11:29 PM
Read the topic "Passing SplineShape Knot Selections Up The Stack" in the MAXScript Reference. It shows a "hack" to fool the system ;)

CapitanRed
11-03-2009, 11:53 PM
haha, this is awesome!! :D

you're the man!! thanks

CGTalk Moderation
11-03-2009, 11:53 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.