Notifications
Clear all

[Closed] Howto AddKnot to animated Spline ?

Max2012. For test I am using this:

the_string = splineShape ()
 addNewSpline the_string
 For i = 1 to 2 do
 (
 	addKnot the_string 1 #corner #curve [0,0,0]
 )
 updateshape the_string
 animateVertex the_string #all
 
 For SimTime = 0 to 100 do
 (
 	For i = 1 to  (NumKnots the_string) do
 	(
 		theKey = addNewKey the_string[4][8][(3*(i - 1) + 2)].controller SimTime
 		theKey.value = random [-50.0,-50.0,-50.0] [50.0,50.0,50.0]
 	)
 )
 

This will animate spline. If I add knot manualy. It is working. Knot is not animated But it could be.
But when I add knot with maxscript:

addKnot the_string 1 #corner #curve [0,0,0]
 updateshape the_string

This will produce spline that will kill Max after selecting and moving added knot. Is there way in maxscript to correctly update spline or its animate controller ?