A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE General Discussion »WRL Cleanup MaxScript

Author Topic: WRL Cleanup MaxScript (4 messages, Page 1 of 1)
Moderators: Dennis

DeadHamster
Joined: Jun 8, 2014

https://discord.gg/Neu4EJM


Posted: Apr 1, 2019 02:38 PM    Msg. 1 of 4       
You know what's great? Tool's WRL files. Bungie apparently made it through most of development with only Tool's error messages to debug their maps. It wasn't until late in development that tool was updated to export the errors to a file so that you could figure out exactly what part of the geometry caused this issue.


Those .WRL files are wonderful. Until you get an error about an Overlapping face, which is buried underneath all your coplanar faces. Wouldn't it be better if there was a way to organize the error .WRL based on the issue you're actually looking for?

Well now there is!




Download




With this fantastic MaxScript, you can automagically delete all the errors that you're not interested in. No more searching through object_lists to find the overlapping face or z-buffered triangles causing you grief. First, import your .WRL file like always. Then after importing, while all the objects are still selected, run the maxscript in the download above. Select whichever options you want and click the remove button. All selected items that match the descriptor will be deleted from the scene.

For safety, ALWAYS backup your files, and be certain that you have not accidentally selected any part of your BSP geometry before running the MaxScript. This will apply the filter to all objects currently selected, which is why it should be run immediately following importing of the .WRL






----------------------------------------------------------------------------------------------------
-- WRL "Fixer" script
-- <3 hamp
----------------------------------------------------------------------------------------------------

objects_array = #()
all_objects_array = #()


rollout MaterialFixRollout "WRL Cleanup Utility" width:310 height:108
(
GroupBox grp3 "WRL Cleaner 1.0" pos:[3,0] width:304 height:105
checkbox PtlBox "Unsealed Portal Errors" pos:[8,18] width:140 height:20
checkbox UneBox "Unearthed Edges Errors" pos:[8,38] width:140 height:20
checkbox CplBox "Coplanar Faces Errors" pos:[8,58] width:140 height:20
checkbox ZbfBox "Z-Buffer / Edge Errors" pos:[8,78] height:20
checkbox cliBox "Clipped Faces Errors" pos:[150,18] width:140 height:20
checkbox OvlBox "Overlapping Faces Errors" pos:[150,38] width:140 height:20
checkbox hlpBox "Helper / Empty Objects" pos:[150,58] width:140 height:20 checked:true
button FixBtn "Remove All Selected Objects" pos:[150,78] width:150 height:20
label Lbl "<3 Hamp" enabled:false pos:[250,0]


on FixBtn pressed do
(
objects_array = #()
all_objects_array = #()
all_objects_array = selection as array
for i=1 to selection.count do
(
s = selection



if hlpbox.checked == true then
(
if substring s.name 1 4 == "VSep" then
(

append objects_array all_objects_array

)
else
(

if s.numverts < 1 then
(
append objects_array all_objects_array
)

)
)


if s.material != unassigned do
(
if Cplbox.checked == true then
(
if classOf s.material == Multimaterial then
(

append objects_array all_objects_array

)
)

if zbfbox.checked == true then
(
if classof s.material != Multimaterial then
(
if classof s.material.maps[2] == VertexColor then
(
if s.numverts > 0 then
(
if getVertColor s 1 == color 255 0 0 then

(

append objects_array all_objects_array

)
)
)
)
)
if Unebox.checked == true then
(
if classof s.material != Multimaterial then
(
if classof s.material.maps[2] == VertexColor then
(
if s.numverts > 0 then
(
if getVertColor s 1 == color 255 0 255 then

(

append objects_array all_objects_array

)
)
)
)
)


for n = 1 to s.material.numsubs do
(



if classof s.material == standardmaterial then
(



if ptlbox.checked == true then
(
if s.material.diffuse == color 255 255 0 then
(

append objects_array all_objects_array
exit
)
)
if clibox.checked == true then
(
if s.material.diffuse == color 0 255 255 then
(

append objects_array all_objects_array
exit
)
)
if ovlbox.checked == true then
(
if s.material.diffuse == color 255 128 0 then
(

append objects_array all_objects_array
exit
)
)




)
)

)
)


if objects_array.count > 0 then
(
select objects_array
delete selection
)

objects_array = #()
all_objects_array = #()

)

)


CreateDialog materialfixrollout




<3 Hamp





Edited by DeadHamster on Apr 1, 2019 at 02:50 PM


Spiral
Joined: Apr 3, 2011

I hope i'm out of the way


Posted: Apr 1, 2019 02:52 PM    Msg. 2 of 4       
Oh my lord I've always wanted a solution to my horrible sloppy bsp clean up days. I'll give this a go later on.
Thank you DeadHamster


Spartan314
Joined: Aug 21, 2010

Former biped rigger & FP animator


Posted: Apr 2, 2019 04:13 AM    Msg. 3 of 4       
<3


altis94
Joined: Oct 5, 2012

Join my Discord https://discord.gg/GDVEaRD


Posted: Apr 2, 2019 09:27 AM    Msg. 4 of 4       
Nice and cool.

 

 
Previous Older Thread    Next newer Thread







Time: Tue August 20, 2019 11:14 AM 156 ms.
A Halo Maps Website