how to apply on mutliple objects
I would really to apply this script on multple splines, but I cant get it to work.
As you would imagine I'm a bit of a noob with maxscript, so any help would be really appreciated.
gsl = getsegLenghts $ cum:false byVertex:false numArcSteps:1
heightspline = amax gsl as float
mycylinder = cylinder radius:1 height:heightspline pos:(getKnotPoint $ 1 1)
mydummy = dummy pos:(getKnotPoint $ 1 2)
select mycylinder
lookAtCon=lookAt_Constraint()
showInterfaces lookAtCon --Look at the listener
showProperties lookAtCon --Look at the listener
lookAtCon.appendTarget mydummy 100
lookAtCon.target_axisFlip=false
lookAtCon.set_orientation=true
lookAtCon.target_axis=2
rotList=rotation_list()
mycylinder.rotation.controller=rotList
rotList.available.controller=lookAtCon
select mycylinder
snapshot mycylinder
delete mycylinder
select (for h in helpers where h.category == #standard collect h)
delete $
Thanks
Comments
Model
I have a model made of splines and want to replace them with cylinders to be able to convert them to body objects.
After that i can edit the model in inventor.
whate exactly you want to
whate exactly you want to achive? A cylinder that goes beetween 1st and 2nd (or any other) point of spline?
Awesome
Thnx a lot :)
This works really good.
I also found another way to align the cylinder to the spline which is much shorter and probably easier to control.
I'll try to post it later today.
easiest way is to pt your
easiest way is to put your script to function
AND:
change last line to
or
LITTLE CHAOTIC, but works
Thnx a lot So if I change the
Thnx a lot
So if I change the getSegLengths and the deletionof the helpers it should work on multiple splines?
Or do it need add anything?
you dont need to select
you dont need to select before deleting
there a couple of errors (Checking them now)
ex:
getSegLengths splineShape spline_index [cum:boolean] [byVertex:boolean] [numArcSteps:integer]
yours:
gsl = getsegLenghts $ NO_spline_index_HERE cum:false byVertex:false numArcSteps:1
EDIT:
CHANGE 1st line to
gsl = getSegLengths $ 1 cum:false byVertex:false numArcSteps:1
and should work