Hi, does anyone know how the heck I can make an object attach to another object's vertex and rotate according to the normal vertex, using Maxscript and/or Script controller?
I've found this
script that attach one object to the vertex of another, but only follows its position. I need it to align to the normal of the vertex as well. Any help is appreciated.
Replies
https://help.autodesk.com/view/3DSMAX/2022/ENU/?guid=GUID-4A8906C8-281F-4B75-8DD2-F08237216BF4
on the target object (the one you want to align to)
add a custom attribute from Animation::Parameter Editor...
called vert
make it of type integer, ui spinner, from 1, to 999999, default 1, width 64. Press Add.
now select the aligned node.
in the motion panel select the Transform Controller in the tree view then click the assign controller button and select Transforn Script.
This should throw up the script controller editor.
create 2 new variables
mobj, Assign Node this to the target object
vert, Assign track this to the custom attribute called vert
now in the expression copy and paste the following...
now press Evaluate.
going back to the target object you should be able to change the vert aligned to with the vert spinner custom attribute giving this....
changed it slightly for the ca is now on the align object so multiple objects can align to a single target
it's worth noting that to return the objects to a "normal" state you'll need to reset the transform controller back to the position/rotation/scale one in the motion panel
added an offset & zrotation