View Full Version : face translation (move) about it's normal... coordsys issues

05 May 2005, 07:32 AM
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!

05 May 2005, 04:55 PM
nobody? :(

05 May 2005, 08:53 PM

You can try FraX of Orionflame found @


05 May 2005, 08:23 PM
Hey schwett, here is one way to do it. I'm sure there are other ways too.

facenormal = polyop.getFaceNormal $.baseobject ((polyop.getFaceSelection $.baseobject) as array)[1]
--gets the facenormal of the currently selected face. You could just write the facenumber instead of the last part.
faceTM = matrixFromNormal facenormal
move $.selectedfaces ([0,0,10]*faceTM)

cheers, CML

05 May 2005, 02:35 AM
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!

05 May 2005, 12:01 AM
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

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?

CGTalk Moderation
05 May 2005, 12:01 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.