Forum Groups
  All forums
    Help & Feedback
      Work in progress
      Finished Art
      Non-Max related

Maxunderground news unavailable

Maxscript question - moving spline knots
show user profile  Black Mariah
Is there any simple way to move a selection of knots that have been stored in an array using setKnotSelection? The only way I've seen to move knots in the reference is to use setKnotPoint. I'm making a very simple script to generate utility lines (a huge time-consuming pain in the ass when dealing with miles-long race tracks) and can't figure this little bit out.

I think it was Socrates who said... "I drank what?"

read 1318 times
8/12/2012 10:36:57 PM (last edit: 8/12/2012 10:36:57 PM)
show user profile  Garp
You could write your own function:

where sh is the shape object, sp one of its spline sub-objects, k_arr an array of knot indices and pt3 the vector used to move them.

Here is an example that moves all the selected knots in the current shape of 20 units in Z, no matter which sub-spline they belong to:

read 1305 times
8/13/2012 3:00:45 AM (last edit: 8/13/2012 3:02:57 AM)
show user profile  Dub.
Just to add to Garps post, you probably already know this but you MUST run the update command when you change splines or you can run into all sorts of weird trouble.

You can see he added it into the function.

read 1276 times
8/13/2012 5:40:45 AM (last edit: 8/13/2012 5:40:45 AM)
show user profile  Black Mariah
Thanks for the pointer, Garp. Wading through the mounds of documentation is one thing, but correlating it all is another. Been a looooong time since I touched a script so it's a total relearning process.

I think it was Socrates who said... "I drank what?"

read 1266 times
8/13/2012 5:50:22 PM (last edit: 8/13/2012 5:50:22 PM)
#Maxforums IRC
Open chat window