|
DeleteDoubleFaces
MaxScript Release 5.0 Source (11/06/2010)
Copyright (c) 1998-2010 by Borislav Petrov. |
SHORT DESCRIPTION
DeleteDoubleFaces is a short utility that
lets you check for double faces
(faces sharing 3 identical vertices) and
remove them.
The MAX's own built-in STL-check modifier
detects DoubleFaces,
but selects both the correct and the wrong
face for some strange reason (bug?).
HOW DOES IT WORK?
DDF compares every single face in a mesh with
all other faces to detect redundancy. It lets you extract the wrong faces
to a new mesh, select+delete the faces in the Modifier Stack, or remove
the faces permanently from the EditableMesh.
FEATURES
Version 5.0 (11/06/2010)
This version removes support for MAX 2 and 3 and
the Quick Check option, but accelerates the overall performance significantly.
Note that the script is now a MacroScript with a floating dialog - evaluate and
customize from "Bobo_s Tools" category.
Tested in 3ds Max 2010.
Version 4.0 (06/28/2001)
This version includes a fix for MAX 4.
No other changes, should work in R3 and earlier, too.
Version 3.4 (8/10/2000)
This version includes explicit check for
MAX version.
Version 3.3 relied on an error trapping
code and failed to work with MAX 3 correctly.
Version 3.3 (10/29/99)
This version makes DDF compatible with
3D Studio MAX R3.
The same version remains compatible with
R2.x, but I encourage
R2.x users to keep on using version 3.01
No new functions have been implemented.
Version 3.01 (11/10/98)
-
Select any number of Meshes.
-
Press the [CHECK Selected Meshes] button to
search for DoubleFaces.
-
By default, the "Quick Check" checkbox is
active. This will let the utility use an "exact match" - for example, it
will detect two faces using vertices [1,2,3], but not faces using [1,2,3]
and [3,2,1].
-
If you deactivate the "Quick Chek" checkbox,
every face will be checked for duplicates with any vertex order (and flipped
normal). This option is much slower, but more precise.
-
The [EXTRACT DoubleFaces] checkbutton lets
you create a copy of all faces that will be deleted as duplicates. This
way you will have a "trash bin" version of the deleted faces with all their
properties (except VertexColor). The new mesh will have the same name with
a "DF_" prefix, will have the same material, and will keep the Mat.IDs,
Edge Visibilities, Smoothing Groups, and Texture Coordinates.
-
Check the [DELETE DoubleFaces] checkbutton
to delete the detected faces. They will be selected using MeshSelect, and
deleted by a "DeleteMesh" modifier. You can use the MAX's Undo butons or
remove the Modifiers by hand if you want to restore the original state.
-
The Radio buttons let you alter the way the
Deletion works. If you select the second option "Collapse EMeshes only",
the Modifier Stack of Emeshes that used to have NO MODIFIERS will be collapsed.
This way you end up with EMeshes with reduced face count and the same modifier
stack state as before. Meshes with modifiers on the stack will receive
the Select/Delete Modifiers and will not be collapsed. You can Undo the
changes on per-object basis.
-
If you select the third option "Collapse All
Meshes", the Modifier Stack of ALL MESHES will be collapsed, no matter
how many modifiers they used to have initially. You can Undo the changes
on per-object basis.
BUGS REPORT:
-
Version 3.01 Fix: All older versions seem
to cause an Unknown System Exception under R2. V 3.01 fixes this by working
with EditableMeshes ONLY (Primitives and any other objects will not be
checked). I know the source of the problem, but not the reason :o( Anyway,
this version should work ok with all MAX R2.x releases.
-
Version 1.13 Changes: lots of labels and text
changed.
-
Version 1.13 Fix: with Precise check in older
versions, tripple and more faces have been detected, but just the first
face got selected.
-
Version 1.13 Fix: The message box about Modifiers
present appeared randomly, since the value checked was retrieved AFTER
the check :o( Stupid me!
-
Version 1.12 fixes a typo-bug in the Precise
check mode. Once again, sorry for the bugs :o)
-
I got reports about MatIDs getting corrupted
when using DDF, and even about MAX crashing, system freezing etc.. I could't
recreate any of these disasters. Please let me know if you find any troubles
with the script!
-
Version 1.1 fixes a bug with the Precise check
mode (Quick Check OFF) which did what the STL-Check usually does... :o)
Now, the first faces encountered remain in the mesh, every duplicate that
follows gets deleted.
-
Version 1.1 added a message box when modifiers
are present on the mesh - 1.0 crashed when trying to delete faces permanently
from a modified Emesh.
CREDITS
Thanks to Kouros Moghaddam for the idea.
SPECIAL thanks to John Jordan for the bug
report!
Thanks to August Johnston for forcing the
Batch Mode idea ;o)
DOWNLOAD DDF
Version 5.0 Source (3ds Max 4
and higher) - updated using 3ds Max 2010.
Version 4.0 Source (R4.x)
Version 3.4 Source
(R3.x)
Version 3.01 Source
(R2.x)