Fracture Voronoi

284 votes
Version: 
1.1

This script breaks any mesh while preserving its volume.

Additional Info: 

v1.0: The object is broken in a number of chunks equal to 'Nb Parts' to the power of 'Iterations', using Voronoi cells. The final number appears on the 'Break' button.
The creation process is visible in the viewport.
For a similar result, it is faster to use several iterations with a small number of parts than creating all the parts in one iteration.
Note that the original object is just hidden, not deleted.

v1.1: In this version, the code has been improved and runs much faster. But there is no viewport feedback any more.
Materials:
- the outer faces keep their original material IDs and the new faces are assigned a unique ID. The value that appears by default is the highest ID in use (by the original object) + 1.
- mapping coordinates (if any) are preserved and somehow 'projected' onto the new faces.
- an extra planar mapping is applied to all the pieces at once and set on its own channel, typically for use with 3D procedural maps, so the pattern flows continuously from piece to piece but sticks to them when they are moved apart.
Hierarchy:
- when using several iterations, it is possible to keep the intermediate generations of parts.
- when linked, each part is parented to the one it is derived from.
- generations are set on their own layers, which are hidden except for the last one.

Enjoy :)

AttachmentSize
FractureVoronoi_v1.1.ms10.85 KB
FractureVoronoi_v1.0.ms4.67 KB

Comments

Comment viewing options

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

Uhmm... How can i put this

Uhmm...
How can i put this script on a Toolbar?
Can't find it through Customize UI...

Thanks!

Garp's picture

@pokoy: I suppose it's

@pokoy: I suppose it's possible, though I wouldn't know how. Sorry about that (and the late answer).

@kearns892: say you have a geosphere at [0,0,0]. Break it, select all the fragments and run something like
for obj in selection do obj.pos *= 1.2
in the listener.
This would effectively add 20% to each distance from the origin.

kearns892's picture

Expanding Elements?

Is there a relatively simple method for achieving an effect similar to that in the photo where the fragments are slightly spaced apart?

pokoy's picture

Awesome script, having much

Awesome script, having much fun with it!
I'd like to request following workflow feature: is it possible to map the 'break' operation to a key instead of clicking 'choose object' first?
This way you'd just select the object you want to break, press the hotkey and it would break with the current settings. This would greatly speed up the process when breaking many parts.

Suzume's picture

Will try this script, thx for

Will try this script, thx for posting this one here.

Garp's picture

Yep, I saw you over there. I

Yep, I saw you over there.
I knew there was an easy way :)

tumblingweed's picture

Another kind soul on

Another kind soul on maxforum.org gave me some help and Iv got the planet textured and breaking apart now, again this script is just pure awsome!

tumblingweed's picture

Thanks for the speedy reply

Thanks for the speedy reply Garp :)

Garp's picture

Thanks for the feedback,

Thanks for the feedback, tumblingweed.

I haven't played much with particles, but surely there's a way to keep materials and mapping when replacing particles with objects. Someone else might step in.
Or maybe you're better off asking on a regular 3ds max forum, like maxforums.org.
Sorry I can't be of more help mate.

tumblingweed's picture

Awsome script I'v been having

Awsome script I'v been having endless hours of fun with it. I'm fairly new to Max and I'm having some trouble with keeping my materials on the object i want to fracture, After I break my object up the texture remains on it but when I use particle flow to destroy the object (using sdeflectors with some scripting I picked up from a tutorial) the materials on my object disappear leaving a stock bland colour. After I hide the original object and use the particle flow to generate the new object it doesnt appear on my view port anymore either. I have hunted all over google for an answer and just decided to ask for help. Attatched is the image of my object after I use the break option.

Kind Regards

AttachmentSize
planet_rendered.jpg 34.78 KB

Comment viewing options

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