Notifications
Clear all

[Closed] Aligning bounding box to detached elements

Hello, this is my first post in this area, and of course, I would need help from the with a script
This is what I’m trying to do. I have an object with several identical elements. I want to replace each element for an instance, so I can change the geometry to taste. So first, I break the object in his elements using “objectDetacher” (from the great Neil Blevin’s Soulburn scripts http://www.neilblevins.com/soulburnscripts/soulburnscripts.htm )

Then, I want to substitute each new detached object with the instance using “objectReplacer”. This script works quite well but the instances are not following the direction of former elements, because the Bounding Boxes of these detached objects are not correct.

So, the perfect situation would be to execute a script to realign the bbox and then, when applying “objectReplacer”, I’ll have everything in place.

Looking for a soultion I found this post

http://forums.cgsociety.org/showthread.php?f=98&t=617614&highlight=align+axis

Unfortunately for me, I have no idea of scripting so, even if I copy the code and paste it in the listener in Max, I couldn’t make it work, I got a syntax error.

Do you think would be a solution for this?
Thanks for your help.
Manuel

1 Reply

The problem is not that the bounding boxes are incorrect. It is that each new object created from the elements of the original object has its pivot at the same point as the original.

The replace script uses the pivot point as the location for each new replacement.

You can use the SoulBurn CenterPivot on each of the new objects before you do the replace.