Looking for a script that will check the object for duplicated geometry and remove it.
I did a search on www.scriptspot.com but only script came out from there was for max 4 and it doesnt work in 9.
Any one has a clue?
I’m planning on writing one soon, do you mean it on a singular object with coinstanced faces or a duplicated object that is on top of each other?
its basically a copy of the object which is attached on the component level and is in the same space. It can be cleaned out by selecting each shell and deleting it, but it has way too many pieces to do it by hand.
It’s not a trivial task by any stretch of imagination, Morbid.
Max only passes vertex/face numbers.
You can have it select an element which is attached to a face, or vertex, or edge.
But in no case there’s a direct way to know what that element is.
What would need to be done would be to iterate through all the faces of an element and see which face has its points lying on the exact same coordinates.
But then, who’s to say the iteration doesn’t delete a face for one element, and the next coincident one from the next element?
Sure, in theory vertex/face numbers are progressive, but it’s not always so, particularly for meshes imported from other softwares.
It’s probably a lot quicker to do it by hand.
Then again, my algorithmic skills are close to zero, so someone with a bit more insight might have better luck.
My take would be to store each face (if morbid wanted to do it on a sub-object level) in an array and compare between members of the array for coinstanced faces. I think that would work, but then again if it’s that easy why hasn’t someone done it…
Morbid,
Here is Bobo’s script form max3, I think, but I slightly modified it and it works in max 9 (32). Be carefull if you use it on high-vertex-count objects. Break up into smaller chunks if necessary.
Appart from that, works great.
All credit goes to the genius of Bobo. He is a great guy. Once I asked him to modify one of his scripts for me and he did it the very next day!!
I think he is from Bulgaria too, so it looks like there is some serious software breeding going on in there, he he.
Hope this might help.
Zoran
Edit:
I uploaded script. Please rename txt to ms and put into Scripts folder
ddf34-z modified.txt (7.16 KB)
Thanks!
But when I try to run it, I get error:
>> MAXScript FileIn Exception: -- Syntax error: at [, expected name
-- In line: checkbutton extract_faces “EXTRACT DoubleFaces” width:140 checked:false highlightcolor[1 <<
Did you copy and paste the smiley face
![]()
haha…I just grabbed the whole thing without looking!
thanks. However the script does not work. It checks double mesh and reports there are no redundant faces. Though there are.
Script can only check verteces within an object where duplicate verteces are welded and share the same co-ords, on a face by face level.
For example: if you have 2 same cubes, with welded verteces the face count = 24. After running the script it’ll change to 12 faces.
It’d be nice, though, if someone could expand script and include some sort of tolerance between verteces.
I edited the first post and uploaded the original script. Funny thing is that whenever there was an “: (” combination, editor replaced it with the :(! He he
Good luck
Zoran
In order to post code you need to use the code bb tags :
This is some serious code : (
Regards,
Thorsten