First of all we have to fine the number of vertex that we want to like our object to.
This can be derived by this script:
getVertSelection <mesh>
The equal script for Editable Ploy is:
polyOp.getVertSelection <Poly poly>
We have to go to the vertex subobject level and select the specified vertex and then use this script in the Maxsript Listener (F11) to get the vertex number.
For example if our object name is “Obj2” the script must be:
getVertSelection $Obj2
Now we are going to use position script controller.
Select your object(the object that you want to link to the vertex) then go to the motion panel and from the assign controller rollout select position then click the assign control button , select position script from the list , script controller window appears.
First of all we must define the objects that we are going to use in the script we will do that by this script:
dependsOn $<object name>
Now we have to find the position of the vertex.
It’ll come with this script:
getVert <mesh> <vert_index_integer>
And for poly objects:
polyOp.getVert <Poly poly> <int vertex>
For example if we want to like an object which named obj1(a poly object) to the vertex number 59(that obtain before with getvertselection method) of another object which named obj2 we must do the following steps:
1 - Before linking object to vertex we have to align pivot point of object to pivot of vertex. |