Quadrify Multiple

Problem I’m solving

Sometimes you received Triagulated mesh from importing from other softwares or simple just weird way of modeling, and you want to fix the model really quick. You can convert to Editable Poly and click Quadrify one by one, but that takes time.

Solution

This scripts allow you to Quadrify multiple objects at once. If the objects are Editable_mesh, it’ll convert to EditablePoly first, then Quadrify them all.

The script will only work on Editable Poly and Editable Mesh.

Installation

  1. Simply just drag the script to the viewport to install.
  2. Right-click on the toolbar > Customize…
  3. Choose the tab ‘Toolbars’
  4. In the Category: dropdown, select ‘ManniiCode’
  5. Drag the script to the toolbar where ever you want!

Code (Maxscript)

macroscript QuadrifyMultiple
	Category:"ManniiCode"
	toolTip:"Quadrify Multiple"
	icon: #("ManniiCode_QuadrifyMultiple",1)
(

	global TM_oneInstEach = #()
	try(DestroyDialog QuadrifyMultiple) catch()
	rollout QuadrifyMultiple "Quadrify Multiple Objects" width: 307 
	(
	  
		local diricon = getdir #userIcons 
		local dirsourceimage = "\SRCIMG"
		  
		  
		local bannerimage = "\ManniiCode_QuadrifyMultiple_Header.jpg"
		local dirbanner = diricon + dirsourceimage + bannerimage
		local banner = openbitmap(dirbanner)
		
		local ChkScale = false
		local targetscale = 1
		local caseerror = 0.2
		local BoxProxyOnly = true
		  
		local DispBox = false
		  

		imgTag imgLogo "logo" pos:[0,0] style:#bmp_center bitmap:banner align:#center
		

		label description1 "This script convert all selected Editable Mesh to Editable Poly" pos:[10,80]
		label description2 "and attempt to make all triangles into quad polygons" pos:[10,95]
		label description3 "" pos:[10,110]
		

		button Quadriproceed "Quadrify Selected" width:150 height:50
		label verlabel "version: 1.0.0" pos:[10,190]
		on Quadriproceed pressed do
		(
			-- get one from all instances into TM_oneInstEach
			
			thesel = getCurrentSelection() 
			setCommandPanelTaskMode mode:#modify
			for i in thesel where (superclassof i == GeometryClass) do
			(
				local getinst = #()
				InstanceMgr.GetInstances i &getinst
				appendIfUnique TM_oneInstEach getinst[1]

			)
			
			--Start converting EditableMesh to EditablePoly from TM_oneInstEach 
			for o in TM_oneInstEach where classof o == Editable_mesh do
			(
				select o
				modPanel.addModToSelection (Edit_Poly ()) ui:on
				maxOps.CollapseNodeTo $ 1 true
			)

			--Start Quadify All Poly
			for p in TM_oneInstEach where classof p == Editable_Poly do
			(
				select p
				PolyToolsModeling.Quadrify false false
			)
			try(DestroyDialog QuadrifyMultiple) catch()
			
			select thesel
		)
		

	)CreateDialog QuadrifyMultiple 

)

Images