ScriptSpot

Script

Lumberman

By Anubis · 2011-08-11

Version
1.0
Version requirement
any 3ds Max version
Date updated
2011-08-11
Votes
5
Description
"Chop away the wood"

:)
Delete overlaped objects/proxies.

Plain script with straightforward idea behind
that partially fill user request.

No big choice for testing overlaped proxies.
Max

Intersects

function test bounding boxes overlap.

This is very quick and dirty solution.
Some extra control on overlaped amount can be done
using boxes to represent objects bounding boxes.
This is not done here. It's not difficult and
if you have the good will (and free time) then
just write this part.

Additional Info

How to use it Select your objects, set iterations, push the button. * Note that its come to you to attend what you select. No Undo recorded, but File/Hold is performed, so you can use File/Fetch to turn step back if needs. How it works Random pairs are tested for intersection on each iteration and if they overlap then random one of them is deleted. So that how many iterations will need and how many steps to clean your overlaped objects is very relative query.
Attachments
Comments (4)

Comparing bounding box helps kill stray clones

Smallpoly · 2013-06-19

Thanks for the script. I was looking for one that I could use to clean up an imported scene that duplicates of meshes on top of each other with no unique features or pattern other than sharing the location. Replacing the interset test with a check of the min/max values of the bounding box solved the problem.

if n1 != n2 and selection[n1].min == selection[n2].min and selection[n1].max == selection[n2].max do delete selection[n2]

 

Eventually I also made it loop through instead of going randomly:

with redraw off for n1 = 1 to selection.count do

(

for n2 = n1 + 1 to selection.count do

(

--print ("(" + n1 as string + ", "+ n2 as string + ")")

s1 = selection[n1]

s2 = selection[n2]

if s1 != undefined and s2 != undefined and (s1.min as string == s2.min as string) and (s1.max as string == s2.max as string) do delete selection[n2]

)

)

:)

Anubis · 2011-08-13

glad to know its helpful :)

3D R.n.D · 2011-08-13

wow thanx allot that exactly what i wanted ...
thanx again

titane357 · 2011-08-12

coool ! :-)