LOD from 3DS Max

(copied from UE4 forums)

Just a quick LOD question here (I’m not on my Unreal Engine computer at the moment so I can’t test it).
I have a model in 3ds max with thousands of meshes/polys in it and I want to start setting up a LOD system in UE4 so it doesn’t kill the FPS.
Now I don’t want to go into each mesh/poly and setup a LOD and then have to group them (like off the youtube tutorial) because this will take ages.
Is it possible to run the “Batch ProOptimize” plugin in 3ds max which spits out a different .max file each optimization level and then export each one of those .max files as an .fbx and import them into UE4 as the Import LOD Level option? or Does anyone have a better way of doing it with thousands of meshes?

Hi, sorry no one actually got back to you yet, LOD is generally applied on meshes (lots of polygons, grouped together), not individual polygons.
If you have a single mesh, with lots of polygons, you can use the MultiRes modifier in 3ds Max to create varying levels of detail, and there even 3ds max scripts you can run to generate, and group, and create a 3DS max LOD set for you.

If you have thousands of meshes, and you want to create a LOD for all of them, you can use a 3DS max script to do that.

I can give you an example script, but you will have to run the script on each mesh, or open all of the meshes in 3DS max, and modify the script to run oni all selected meshes in your current editor. It also supports exporting to FBX, it will by default use your last settings, but you can modify individual properties as well, if need be *some googling will help.
Here is the base script, you need to run this in 3DS MAX, then go to the customize menu, and give it a key binding, select the mesh you want to create an LOD for in Max, then run the script. Works in 3DS Max 2012 - 2014

macroScript CreateProperLOD category: "AlwynTools"
(
on isEnabled return
 selection.count > 0 

on execute do
(
	createDialog ( 	
		rollout mf_main "Create Proper LOD"
		(
			
		fn unwrapMe obj =
		(
			previousSel = $
			
			select obj
			--Add modifier
			addModifier $ ( Unwrap_UVW() )
			--Set map channel
			$.modifiers[#Unwrap_UVW].setMapChannel 2
			$.modifiers[#Unwrap_UVW].edit()
			$.modifiers[#Unwrap_UVW].setTVSubObjectMode 3
			polyOp.setFaceSelection $ #{1..polyOp.getNumFaces $}
			$.modifiers[#Unwrap_UVW].flattenMapNoParams()
			collapseStack $
			
			select previousSel
		)			
			
			button savebtn "Create Proper LOD"
			on savebtn pressed do 
			(
				exportlist = #()
				
				
				--Add LOD Level 0
				addmodifier $ ( MultiRes() )
				$.modifiers[#MultiRes].reqGenerate = true
				append exportlist $

				--Make and add LOD Level 1
				$.modifiers[#MultiRes].vertexPercent = 60.0
				objtmp2 = (snapshot $ name:($.name + "1") )
				ConvertTo objtmp2 Editable_Poly
				unwrapMe objtmp2
				append exportlist objtmp2
				
				--Make and add LOD level 2.
				$.modifiers[#MultiRes].vertexPercent = 30.0
				objtmp2 = (snapshot $ name:($.name + "2") )
				ConvertTo objtmp2 Editable_Poly
				unwrapMe objtmp2
				append exportlist objtmp2
				
				--No longer require modifier.
				deleteModifier $ 1
				
				--Select all meshes from above.
				select exportlist
				
				--group now.
				thegroup = group exportlist name: (exportlist[1].name)
				select thegroup
				
				--Now Level Of Detail, and add set.
				max utility mode
				UtilityPanel.OpenUtility Level_of_Detail
				panel = (windows.getChildHWND #max "Utilities")
				CreateNewSetButton = (windows.getChildHWND (UIAccessor.GetParentWindow panel[3]) "Create New Set")
				UIAccessor.PressButton CreateNewSetButton[1]
				
				--Also select the UCX_ object, for collision, if it exists.
				obj = getnodebyname ("UCX_" + exportlist[1].name)
				if obj != undefined then selectMore obj
				
				--Export only selected to FBX.
				FBXSavePath = ("d:\\temp\\" + exportlist[1].name + ".fbx")
				exportFile FBXSavePath #noPrompt selectedOnly:true using:FBXEXP 

				
			)
			
			
			
		)) 200 (120)
)
)

A great way for creating a new set of polygon group .! And Could u tell me that how can I use maxscript to remove from set.? I just use (windows.getChildHWND #max “list window”). Unfortunatly , I can’t get any object that in LOD-set, so that I can’t click the “Remove From Set” button.

Solved by myself …