PDA

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


schwett
05-05-2005, 08: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!

schwett
05-06-2005, 05:55 PM
nobody? :(

Light
05-06-2005, 09:53 PM
Hi,

You can try FraX of Orionflame found @ www.flamefx.com.




Light

Rivendale
05-07-2005, 09: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

schwett
05-08-2005, 03: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!

schwett
05-09-2005, 01: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-09-2005, 01: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.