[Closed] face translation (move) about it's normal… coordsys issues
apologies in advance for what seems like it should be very simple. i searched quite a bit and found a few similar references but they seem so complex, there must be an easier way.
i am writing a script to automate the abstract modeling of large portions of a city based on certain zoning criteria and varying degrees of randomness. i’ve never used maxscript before but have been using max forever.
one part of this requires that i select faces within a mesh and move them some distance relative to their normals.
so i do something like :
in Coordsys local (move whatever.faces [0,0,-10])
but that doesn’t move the faces relative to the local normals of the faces. so then i tried
select whatever.faces[#{7…8}]
in Coordsys local (move whatever.faces [0,0,-10])
but no luck there either. it’s clearly moving the faces in the world z.
what do i need to do to get the move command to move faces relative to their own normal? e.g. moving them in a negative direction along z will push them towards the inside of a box.
thanks in advance!
Hey schwett, here is one way to do it. I’m sure there are other ways too.
[color=wheat]facenormal = polyop.getFaceNormal $.baseobject ((polyop.getFaceSelection $.baseobject) as array)[1][/color]
[color=palegreen]--gets the facenormal of the currently selected face. You could just write the facenumber instead of the last part.
[size=2]faceTM = matrixFromNormal facenormal[/size]
[size=2]move $.selectedfaces ([0,0,10]*faceTM)
[/size][/color]
cheers, CML
thanks much going to try this now! got past a few other hurdles – having fun with this. after so many years of using max through the UI only, it’s liberating!
sigh, can’t seem to get this work on an edit poly modifier as opposed to an editable poly base object (collapsed.) for a number of reasons i can’t be collapsing at this stage.
i took out the .baseobject and have no problem getting the normal and transform matrix (?) from the edit poly modifier on top of the stack, but when i try and do the move itself i get
– Runtime error: Cannot change EPoly with modifiers present: Editable Spline
[size=2][color=white]This seems to be a common pitfall but the three or four threads i found didn’t have an answer, other than the possibility that i need to use something like polyOp.moveVert instead of just ‘move,’ but that means i can’t do it at the face level… which seems odd?[/color][/size]