[Closed] How to access the Normal Align tool???
I need to align an object to another based on picked faces, but I just cannot find in the help files any way to access the normal align tool for this…
Any help is much appreciated…
Regards,
Jr.
Hi Eugenio, you can do that directly though maxscipt. Here is something to get you started:
lePicked = picked object
leFace = picked face
leTM = matrixfromNormal (polyop.getFaceNormal lePicked.baseobject leFace node:lePicked)
leTM.row4 = (polyop.getFaceCenter lePicked.baseobject leFace node:lePicked)
$.transform = leTM --align selected object
cheers,
CML
WOW! This is so damn simple!!! 😮
If you have an idea of how much I was studying to figure out how to rotate the model based on the normal…
But at least it was good for learning, and a bit more knowledge in math is always useful, especially when doing scripts…
Man, many thanks!
Regards,
Jr.
Hey, I’m a bit new to script, and I would like to ask why to use the parameter “node” in the command “matrixFromNormal”…I don’t understand very well because the object is already specified…:shrug:
The rest seems to be quite nice!
Thanks,
Jr.
the node command is used with the getFaceNormal command. If you leave that part out then the normal(direction) you get is in the objects local coordinate system. When you supply node:obj the normal is in the world coordinate system wich is what you would want when doing alignment. Same thing with getFaceCenter.
Glad I could help some,
CML
i may be wrong but i think that node refers to a scene object in MXS and may or may not be used after it is specified ?