Find identical geometry and instance it
Everybody who have imported large amount of data from any cad system know that it normally kills the instancing. The intention of this script is to find geometrically identical nodes and instance them. This script will of course work if someone have used copy instead of instance in a scene and wants them instanced instead.
I'm happy to see that so many have tried out my Sunday hack that I made 5 years ago...but as it was only something to do for a Sunday its not really something I support. I would love to, but my daytime job takes all my time ;-)
But the code is open so please take it and redo it....take the idea and redo from scratch or improve it (and there is a lot of possibilities to do that ;-)
The basic idea was to: Compare the geometries by looking at face order and relations between faces and disregard everything else. If they match, then instance and align the 1st face of the new instance with the object that matches, 1st face, before deleting the found object. This is to make it stay in the same position as before even if its a totally different pivot point and rotation.
To be instanced.....
The nodes needs to have:
Identical face count, same class, identical face topology and identical scale
The nodes does not need to have :
Identical Transform,Pivot point position, Materials, Parents or Children
I did not want to read a book and crosswords are boring so I thought I would make a type of script, that is far from what I do as a daytime job.
I have already got some hints on what to do, and I really appreciate it.
The really slow part is the compare geometry topology stuff. If the face count is big and they are very close to the same topology then it will go through all faces in both objects while comparing, and that takes time.
I have included a MAX and Collada test file for anybody that wants to test out the script or help me improve it....
Hope this can help someone in their daily work....
... and as always, don't run this before backing up your scene... ;-)
|A testfile for the script.... MAX 2010 format||1.88 MB|
|A testfile for the script.... Collada format||808.36 KB|