Home Technical Talk

Needing a script : Select face or vert by number

polycounter lvl 18
Offline / Send Message
rv_el polycounter lvl 18
Hi. I need a script for Max. I use 2010.

I need to select a face by number input.

Ideally iw would look like this.

Right click
Go down quad menu to SelectFaceByNumber
Put 1647 into a box. hit OK
then that face would be selected in Max sub-object face selection.

For right now I think that would work. Dual use of vert and face would be great. More than one at a time would be greator. Face select by a single integer is prefered right now though.

Thanks!

Replies

  • monster
    Options
    Offline / Send Message
    monster polycounter
    I can hook you up. Just give me about an hour.
  • Jonathan
    Options
    Offline / Send Message
    Here's a quick 5 minute dialogue version,
    (
    	/*
    	===============================================
    	Simple script for Polycount Forum help by Jonathan Ferguson
    	===============================================
    	*/
    	rollout roMiniHelper "Mini Selector"
    	(
    		edittext editTextBox  "Enter Face:" fieldWidth:200 labelOnTop:true
    		radiobuttons radMode labels:#("Face", "Vertex") columns:2 default: 1
    		button btnSelectThatFace "Select that Face" width:200
    
    		on btnSelectThatFace pressed do
    		(
    			if ((selection.count == 1) and ( canconvertto selection[1] Editable_Poly))then
    			(
    			local multipleSelections = filterString editTextBox.text ","
    			local userInput = editTextBox.text as integer
    			local theSelectedObj = selection[1]
    			
    			if ((userInput != undefined)  and (userInput > 0 ))then
    			(
    				max modify mode
    				if (radMode.state == 1) then
    				(
    					subobjectLevel = 4
    					polyop.setFaceSelection theSelectedObj #{userInput}
    				)
    				else
    				(
    					subobjectLevel = 1
    					polyop.setVertSelection theSelectedObj #{userInput}
    				)
    			)
    			else	
    				MessageBox ("No valid input, got " + userInput as string) beep:false
    			
    			completeRedraw()
    			)
    			else
    				MessageBox ("Please select one mesh.") beep:false
    		)
    
    	)
    	CreateDialog roMiniHelper style:#(#style_toolwindow, #style_resizing, #style_sysmenu) width: 225 fgcolor:([128,255,128]) bitmap:
    	undefined 
    )
    
  • rv_el
    Options
    Offline / Send Message
    rv_el polycounter lvl 18
    Bad ass guys! I'll try to figure out how to hook this thing up. I found the polys by hand but in the future this will save me a LOT of time in these rare but bad situations.

    Thanks!!!!!
  • monster
    Options
    Offline / Send Message
    monster polycounter
    Cool Johnathan!

    Here's my attempt: http://dl.dropbox.com/u/2904948/Tools/Martinez_Macro_SelectByNumber.mcr

    Put the script in 3DMax/UI/MacroScripts/
    Restart Max, and look in the monsterBlues category to bind to a hotkey.

    It works with Edit Poly or Mesh, and there is an add to selection checkbox.

    I also clear the text box after you enter a number, so that you can quickly keep typing numbers to add to the selection.
Sign In or Register to comment.