ScriptSpot

Script

Find Coinstances

By colinsenner · Credited author: Colin Senner · 2008-03-25

Version
v1.01
Version requirement
3dsmax 7+
Date updated
2008-05-08
Votes
26
Description

Find CoInstances works in two ways:

1. With Multiple Objects selected it will find objects that are cloned on top of each other resulting in animation flickering

2. With a Single object selected it will find and select faces that are coinstanced

To select all faces which are coplanar use the list-box to "Select All", or

To select only those faces which are copies of the original, use "Select Only Duplicates"

Additional Info

1. Run script

2. In Max goto "Customize->Customize User Interface...->Toolbars tab->Category: ColinScripts" and drag "Find Coinstances" to a toolbar, click to run.

Attachments

Tags: colin, find, coplanar, co-planar, coinstance, co-instance, arnold, imaging, senner, faces, geometry

Comments (12)

Fantabulous!!

pixeld · 2019-12-21

What an awesome script. I was pulling out my hair fighting with a very nasty model that had dozens and dozens of overlapping faces but this little beauty found them all in minutes!

Thanks

zwrtron · 2019-07-18

Thank you very much, such an amazing tool!

designer3d · 2019-01-12

great tool, thank you very much

thank you!

harumscarum · 2012-01-16

works great! but in single mode not always. i guess it need very accurate position co-planar polygons. is it possible to add threshold for shared verticles?

life and time saver !

titane357 · 2012-01-16

just save hours of hard and stupid work !!!!

another great script

crystal3d · 2011-07-29

for reducing the everydays hassles and possible harsh times with co-workers

colinsenner · 2011-08-15

Thanks Crystal as always!

-Colin

colinsenner · 2008-05-08

Used and commented your code till I think of a more graceful way, thank you, great suggestion. 1.01 is up.

colinsenner · 2008-05-08

Ah, figured out what you're saying, the functionality was built in, that's why there is a list in there allowing the user to select "only duplicates" or "all objects" but for whatever reason it got broken, I'll update and upload the fix today. Thanks for the good eye.

-Colin

colinsenner · 2008-05-07

I'm not quite sure I understand what you mean, the script will find coinstanced objects that are on top of each other. Let me know if this isn't what you mean.

defex · 2008-05-08

after the script is run on multiple objects both coincident objects are selected. so say you wanted to find all duplicates and then delete just 1 of them it will still be a chore.

i made a little quick and dirty mod to one of your functions


fn findCoinstancedObjects arr = (
	local dupObjs = #()
	
	for o in arr do (
		for j in arr where o != j do (
			if ((o.transform as string) == (j.transform as string)) and (o.min == j.min) and (o.max == j.max) and (o.wirecolor ==j.wirecolor)then
			(
				append dupObjs j
				j.wirecolor = red
			)	
		)
	)
	trim_dupsArray dupObjs
)

this way the first duplicate gets selected and the wireframe color is changed, it no longer gets counted as a duplicate because the wireframe color is compared as well as position etc.

of course it wont work if your wireframes are already red! :) could be fixed by using a color nobody would likely use because its not in the color picker.

defex · 2008-05-06

This is great, except with multiple objects, it would be nice to only pick one of the duplicates, so you can just delete them right away, the way it is now, you still have to go through them 1 by one, and it takes ages with 10000 trees!