Lumberman

5 votes
Version: 
1.0
Date Updated: 
08/11/2011
Author Name: 
Anubis

"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.

Version Requirement: 
any 3ds Max version
AttachmentSize
lumberman.ms1022 bytes

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Smallpoly's picture

Comparing bounding box helps kill stray clones

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's picture

:)

glad to know its helpful :)

my recent MAXScripts RSS (archive here)

3D R.n.D's picture

wow thanx allot that exactly

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

titane357's picture

coool ! :-)

coool ! :-)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.