Home Technical Talk

[3DSMAX] Maxscript Selecting Remove/Copy/Inst in Proboolean panel

interpolator
Offline / Send Message
OccultMonk interpolator
Remove/Copy/Inst radio buttons are not exposed in maxscript. In 3DSMax 2016 I had a working solution. The interface changed a bit in 3dsmax 2017 so that could be a possible cause. I have quite a lot of code that is now useless in 3DSMax 2017. Does anyone know a way to set the radio buttons for Remove/Copy/Inst and also for show end Result/Operands in Proboolean object panel? 

This was the previously working code:
http://www.scriptspot.com/forums/3ds-max/general-scripting/press-radio-button-with-maxscript-in-command-panel#comment-34374

Replies

  • monster
    Options
    Offline / Send Message
    monster polycounter
    Yeah the new UI is done in QT. So some of the panel names have changed. "Modify Task" changed to a generic "QWidget". I had to add "return OK" to because of the more generic panel name.
    (
    	fn proboolean_Extract_pressRadioButton rbName state =
    	(
    		local properRb = false
    		local BN_CLICKED = 0 			-- clicky message ID
    		local BM_SETCHECK = 241 		-- checkbutton toggle message ID
    		local WM_COMMAND = 273 			-- windows command message
    		
    		max modify mode
    
    		for child in (windows.getChildrenHWND #max) where child[4] == "#32770" do
    		(
    			for classN in (windows.getChildrenHWND child[1]) where (classN[4] == "QWidget") do
    			(
    				for btn in (windows.getChildrenHWND classN[1]) do
    				(
    					if btn[5] == "Extract Selected" do properRb = true
    						
    					if properRb == true and (btn[5] == rbName) do
    					(
    						local parent = UIAccessor.getParentWindow btn[1]
    						local id = UIAccessor.getWindowResourceID btn[1]
    						windows.sendMessage btn[1] BM_SETCHECK (if state then 1 else 0) 0
    						If state then windows.sendMessage parent WM_COMMAND ((bit.shift BN_CLICKED 16) + id) btn[1]
    						
    						return OK
    					)
    				)
    			)
    		)
    	)
    
    	fn pressRadioButton rbName =
    	(
    		rbNamesArr = #("Remove", "Copy", "Inst")
    		
    		for rb in rbNamesArr do
    		(
    			proboolean_Extract_pressRadioButton rb false
    		)
    
    		proboolean_Extract_pressRadioButton rbName true
    	)
    	
    	pressRadioButton "Inst"
    )
  • OccultMonk
    Options
    Offline / Send Message
    OccultMonk interpolator
Sign In or Register to comment.