killkhergit
Squire
As the title suggests here's a lodding script you can use with (gmax)/3dsmax:
It's not 100% perfect (yet), but it will do.
Explanation:
- An "actionman" normally is a keyboard shortcut
- The messageboxes are "Dutch / English"
- When you want to use it, open up (g)max, menubar --> MAXScript, new, paste it, save it as the default format (.ms)
- How to use: open up max or reset. Having objects loaded in the current scene might screw your model up.
Then go to the asset browser, select maxscript, then "Run Script", or nenubar --> MAXscript, run script
- Upon running it will immediately prompt you to import a file (I for now suggest using .obj or a single-object "Editable Mesh/Poly"max, they're confirmed to work). When a message pops up saying "fixed", it has welded and cleaned up some vertices, asking you to export.
- When you're done exporting it will apply a LOD modifier, which lowers the model's detail to 50%. Export. Down to 20%. Export.
- Then, when a message says "Low vertext count", it's because the vertex count has dropped so much, adding a LOD to be loaded will actualy slow down the game.
- If the limit isn't reached it will go down to 10 percent. Export.
- For use on multiple objects one by one, it will ask you to reset and run a script again.
- Don't try to save a mesh as (name).lod# yet. Still have to figure out how to let Max export names with periods. Instead, just save your files as axe, axe1, axe2 etc, and then paste ".lod" between the name and the number.
- How to let LOD's work:
Let's say you made an axe called the "zezomgaxe", do the following:
Export.
Run the script
Result files, numbers are just an example:
zezomgaxe
zezomgaxe1
zezomgaxe2
zezomgaxe3
Add ".lod":
zezomgaxe (fixed or not)
zezomgaxe.lod1
zezomgaxe.lod2
zezomgaxe.lod3
Import.
Correct names if needed
Correct texture name missfires if needed (BRFedit empties the "Material" textbox if you decide to change the object's name in-BRF) . Use the same texture as the original "zezomgaxe". Coords WILL be preserved.
Save BRF.
Feedback will be appreciated
Code:
actionMan.executeAction 0 "40010" -- File: Import File
Weldtest = $.numverts
actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected
modPanel.addModToSelection (Vertex_Weld ()) ui:on
$.modifiers[#Vertex_Weld].threshold = 1.0e-015
if $.NumVerts < Weldtest do
(
messagebox "Gefixt!! / Fixed!!"
macros.run "Modifier Stack" "Convert_to_Mesh"
actionMan.executeAction 0 "40011" -- File: Export File
)
macros.run "Modifier Stack" "Convert_to_Mesh"
modPanel.addModToSelection (MultiRes ()) ui:on
$.modifiers[#MultiRes].mergeVertex = on
$.modifiers[#MultiRes].mergeWithinMesh = on
$.modifiers[#MultiRes].reqGenerate = off
$.modifiers[#MultiRes].vertexPercent = 50
actionMan.executeAction 0 "40011" -- File: Export File
$.modifiers[#MultiRes].vertexPercent = 20
actionMan.executeAction 0 "40011" -- File Export File
if $.modifiers[#MultiRes].vertexCount < 35 do
(
messagebox "Erg weinig vertices!! / Low vertex count!!"
)
$.modifiers[#MultiRes].vertexPercent = 10
actionMan.executeAction 0 "40011" -- File Export File
actionMan.executeAction 0 "40005" -- File: Reset File
actionMan.executeAction 0 "40470" -- MAX Script: Run Script
It's not 100% perfect (yet), but it will do.
Explanation:
- An "actionman" normally is a keyboard shortcut
- The messageboxes are "Dutch / English"
- When you want to use it, open up (g)max, menubar --> MAXScript, new, paste it, save it as the default format (.ms)
- How to use: open up max or reset. Having objects loaded in the current scene might screw your model up.
Then go to the asset browser, select maxscript, then "Run Script", or nenubar --> MAXscript, run script
- Upon running it will immediately prompt you to import a file (I for now suggest using .obj or a single-object "Editable Mesh/Poly"max, they're confirmed to work). When a message pops up saying "fixed", it has welded and cleaned up some vertices, asking you to export.
- When you're done exporting it will apply a LOD modifier, which lowers the model's detail to 50%. Export. Down to 20%. Export.
- Then, when a message says "Low vertext count", it's because the vertex count has dropped so much, adding a LOD to be loaded will actualy slow down the game.
- If the limit isn't reached it will go down to 10 percent. Export.
- For use on multiple objects one by one, it will ask you to reset and run a script again.
- Don't try to save a mesh as (name).lod# yet. Still have to figure out how to let Max export names with periods. Instead, just save your files as axe, axe1, axe2 etc, and then paste ".lod" between the name and the number.
- How to let LOD's work:
Let's say you made an axe called the "zezomgaxe", do the following:
Export.
Run the script
Result files, numbers are just an example:
zezomgaxe
zezomgaxe1
zezomgaxe2
zezomgaxe3
Add ".lod":
zezomgaxe (fixed or not)
zezomgaxe.lod1
zezomgaxe.lod2
zezomgaxe.lod3
Import.
Correct names if needed
Correct texture name missfires if needed (BRFedit empties the "Material" textbox if you decide to change the object's name in-BRF) . Use the same texture as the original "zezomgaxe". Coords WILL be preserved.
Save BRF.
Feedback will be appreciated