-- function to move poly in Editable Mesh object -- "object_to_move" - object to work with. Only one! -- "offset" - point3 offset value fn sergo_moveEditableMesh object_to_move offset = ( faceSelected = getFaceSelection object_to_move as array --get face seletion refcoordsys = getRefCoordSys() if refcoordsys == #local then --for local coordsys move every polygon in its local axe ( polyList = #{} --polygon's faces for face in faceSelected do ( if not polyList[face] then --if current face is not in list of processed faces then move it ( tempPolyList = meshop.getPolysUsingFace object_to_move face --collect faces of current polygon polyList = polyList + tempPolyList --accumulate processed faces tempAxis = matrixFromNormal (getFaceNormal object_to_move face) --calculate face's matrix for local coordsys verts = meshop.getVertsUsingFace object_to_move tempPolyList as array --get verts from whole polygon containing current face in coordsys tempAxis meshop.moveVert object_to_move verts offset node:object_to_move --move whole polygon's vertices ) ) ) else if refcoordsys == #parent then -- for parent coordsys move all polys at once in the parent coordsys ( tempAxis = object_to_move.transform --use object transform matrix if parent coordsys is selected verts = meshop.getVertsUsingFace object_to_move faceSelected --get verts from all selected faces in coordsys tempAxis meshop.moveVert object_to_move verts offset node:object_to_move --move vertices ) else if refcoordsys == #object then -- for parent coordsys move all polys at once in the parent coordsys ( tempAxis = (toolMode.coordSysNode) --see if coordsys is an object if tempAxis == undefined then --if coordsys is an active Grid tempAxis = activeGrid if tempAxis == undefined then --if active grid is a home grid tempAxis = #world verts = meshop.getVertsUsingFace object_to_move faceSelected --get verts from all selected faces in coordsys tempAxis meshop.moveVert object_to_move verts offset node:object_to_move --move vertices ) else --if not parent nor local then use world coordsys ( tempAxis = matrix3 1 --use world axis if not local nor parent is selected verts = meshop.getVertsUsingFace object_to_move faceSelected --get verts from all selected faces in coordsys tempAxis meshop.moveVert object_to_move verts offset node:object_to_move --move vertices ) ) -- function to move poly in Editable Poly object -- "object_to_move" - object to work with. Only one! -- "offset" - point3 offset value fn sergo_moveEditablePoly object_to_move offset = ( faceSelected = polyop.getFaceSelection object_to_move as array --get face seletion refcoordsys = getRefCoordSys() if refcoordsys == #local then --for local coordsys move every polygon in its local axe ( for face in faceSelected do ( tempAxis = matrixFromNormal (polyop.getFaceNormal object_to_move face node:object_to_move) --calculate face's matrix for local coordsys verts = polyop.getVertsUsingFace object_to_move face as array --get verts from one face in coordsys tempAxis polyop.moveVert object_to_move verts offset node:object_to_move --move vertices ) ) else if refcoordsys == #parent then -- for parent coordsys move all polys at once in the parent coordsys ( tempAxis = object_to_move.transform --use object transform matrix if parent coordsys is selected verts = polyop.getVertsUsingFace object_to_move faceSelected --get verts from all selected faces in coordsys tempAxis polyop.moveVert object_to_move verts offset node:object_to_move --move vertices ) else if refcoordsys == #object then -- for parent coordsys move all polys at once in the parent coordsys ( tempAxis = (toolMode.coordSysNode) --see if coordsys is an object if tempAxis == undefined then --if coordsys is an active Grid tempAxis = activeGrid if tempAxis == undefined then --if active grid is a home grid tempAxis = #world verts = polyop.getVertsUsingFace object_to_move faceSelected --get verts from all selected faces in coordsys tempAxis polyop.moveVert object_to_move verts offset node:object_to_move --move vertices ) else --if not parent nor local then use world coordsys ( tempAxis = matrix3 1 --use world axis if not local nor parent is selected verts = polyop.getVertsUsingFace object_to_move faceSelected --get verts from all selected faces in coordsys tempAxis polyop.moveVert object_to_move verts offset node:object_to_move --move vertices ) ) -- function to move poly in Edit Poly modifier -- "objects_to_move" - array of objects to work with -- "offset" - point3 offset value fn sergo_movePoly objects_to_move offset = ( for obj1 in objects_to_move do ( if objects_to_move.count > 1 then select obj1 faceSelected = obj1.Edit_Poly.EditPolyMod.GetSelection #Face node:obj1 as array --save face seletion for face in faceSelected do ( obj1.Edit_Poly.EditPolyMod.SetSelection #Face #{} node:obj1 --clear the selection obj1.Edit_Poly.EditPolyMod.Select #Face #{face} node:obj1 --select one face refcoordsys = getRefCoordSys() if refcoordsys == #local then tempAxis = matrixFromNormal (polyop.getFaceNormal obj1 face node:obj1) --calculate face's matrix else if refcoordsys == #object then -- for parent coordsys move all polys at once in the parent coordsys ( tempAxis = (toolMode.coordSysNode) --see if coordsys is an object if tempAxis == undefined then --if coordsys is an active Grid ( tempAxis = activeGrid if tempAxis == undefined then --if active grid is a home grid tempAxis = matrix3 1 else tempAxis = tempAxis.transform ) else tempAxis = tempAxis.transform ) else tempAxis = matrix3 1 --world axis --move this one face obj1.Edit_Poly.EditPolyMod.MoveSelection offset axis:tempAxis obj1.Edit_Poly.EditPolyMod.Commit() ) --restore face selection obj1.Edit_Poly.EditPolyMod.Select #Face (faceSelected as bitArray) node:obj1 ) --restore object selection if objects_to_move.count > 1 then select objects_to_move else () try ( toolmode.commandmode = toolmode.commandmode) catch () --to change focus back to viewport ) fn excludeChildren objects = ( local childarray = #() local parentarray = #() for obj_temp in objects do --collect children in array ( children = obj_temp.children if (children.count !=0) then ( for i=1 to children.count do ( append childarray children[i] ) ) ) --create parent array parentarray = for obj_temp in objects where (findItem childarray obj_temp == 0) collect obj_temp ) -- function I've got from the MaxScript reference. -- I've just add few lines to work with group as single object fn axisRotate obj rotation = ( local axis local objArr = if classof obj == objectSet or classof obj == array then obj else #(obj) if getCoordCenter() != #local then ( axis = getTransformAxis objArr[1] 0 for objOne in objArr do ( in coordsys axis about axis rotate objOne rotation ) ) else ( for objOne in objArr do ( axis = getTransformAxis objOne 0 in coordsys axis about axis rotate objOne rotation ) ) ) --this is the same MAX Reference function but with 'rotate point' parameter fn axisRotateAbout obj rotation point = ( local axis local objArr = if classof obj == objectSet or classof obj == array then obj else #(obj) if getCoordCenter() != #local then ( axis = getTransformAxis objArr[1] 0 axis[4] = point for objOne in objArr do ( in coordsys axis about axis rotate objOne rotation ) ) else ( for objOne in objArr do ( axis = getTransformAxis objOne 0 axis[4] = point in coordsys axis about axis rotate objOne rotation ) ) )