ScriptSpot home

Forum topic · General Scripting

help selecting only vertical faces in scene or object

By thp777 · 2010-12-23

Description

Im using 3ds max
basically i have alot of boxes as one object and i want to select only the sides and not the top and bottom in edit poly. i also need to be able to select only the tops so either one would help then i can just use invert selection for the others i guess.
if anyone can point me towards a script or anything that can help me with creating one thx in advance.

Comments (7)
Graph

as long as it works ;)

Graph

couldve done that yourself

that rlly is a simple modification you couldve done yourself quickly ;)

(
   local deg = 45  /* defines the max angleDiff to straight up for selection */
	
   local dir = 	polyop.getFaceNormal selection[1] ((polyop.getFaceSelection selection[1])as array)[1] node:selection[1]

   --------------------------------------------------------------------------
   --------------------------------------------------------------------------
 
   with undo on
   (
      for Obj in selection as array where isValidNode Obj AND superclassOf Obj == geometryClass do
      (
         polyop.setFaceSelection Obj  ((for f = 1 to Obj.numFaces collect (if acos (dot (polyOp.getFaceNormal Obj f node:Obj) dir) < deg then f else dontcollect)) as bitArray) 
      )
   )
   completeRedraw()
)--END local
Reply to Graph
titane357

Thanks ! :-)
Don't forget that nothing is really simple for me !

Reply to titane357
titane357

I tried the script and something strange : to select same orientation face u must have a "0.1" value : "0" don't select all faces that it should !....

thp777

wow

That worked perfectly.
Thank you so much.
would have taken me forever to figure that out.
Thanks again.

Graph

test it on a sphere ;) (

test it on a sphere ;)


(
   local deg = 45  /* defines the max angleDiff to straight up for selection */

   --------------------------------------------------------------------------
   --------------------------------------------------------------------------

   with undo on
   (
      for Obj in selection as array where isValidNode Obj AND superclassOf Obj == geometryClass do
      (
         polyop.setFaceSelection Obj  ((for f = 1 to Obj.numFaces collect (if acos (dot (polyOp.getFaceNormal Obj f node:Obj) [0,0,1]) < deg OR acos (dot (polyOp.getFaceNormal Obj f node:Obj) [0,0,-1]) < deg  then f else 1)) as bitArray) 
      )
   )
   completeRedraw()
)--END local
Reply to Graph
titane357

ohhh ! It would be great if you could make a script to select all faces oriented like the selected face modulo a value that we can specify... It would be very helpfull ! :-)