Fracture Modifier Documentation - Note: This is a DRAFT
This tool makes it fun to break things! Fracture! Shatter! Explode! Destroy! Many options are available to choose the type of resulting objects and how they break apart. Custom helpers allow advanced detail control and shaping of the fracturing pattern. It is a modifier so it is nondestructive to the original geometry unless applied and it can interact with other modifiers in the stack. The modifier works seamlessly with the Bullet Physics library to make simulations and animations.
The modifier is very fast by itself in the 1,000 and above shard range and it keeps all the resulting shards in the modifier so they do not clutter the Outliner. The fast workflow gives artists a powerful tool for experimentation and fine tuning results for both still images of fractured objects and physics based distructability animations.
NOTE: The Fracture Modifier is a custom build from a code branch of Blender. It is not a Python addon. See below for more information.
(NOTE: right click on the link and click open in new tab or window to also stay on this page)
DF-VFX Hosted Builds
- http://df-vfx.de/fracturemodifier/ Windows, Mac OS X and Linux - Thanks to DF-VFX for hosting these
(NOTE: Current builds are merged with Blender v 2.77a and in general the FM builds merged with official releases are usually available a week or two after the official releases)
Branch on git.blender.org https://git.blender.org/gitweb/gitweb.cgi/blender.git/shortlog/refs/heads/fracture_modifier
(NOTE: you can check out the branch when you download and work with Blender's source code master via git.)
Fracture Panel Settings in Blender
You can store all settings for Fracture Settings, Fracture Constraint Settings and Fracture Utilities panels in presets. After you selected an existing preset, you need to Execute Fracture afterwards to apply the changed settings.
It will show an error message if you attempt to select a preset prior to adding one first.
Here the same rule about being on frame 1 or the start frame of rigid body cache applies too. The fracturing will not be executed otherwise.
Due to problems/crashes with fractures on different frames this restriction was necessary to implement.
Algorithm Brief Explanations
Voronoi is the base method everywhere. It decomposes the object Bounding Box via voro++ to the given Number of Shards in Uniform (in bottom of selections) mode, which is default under Experimental. You have two main possibilities to get shards of actual geometry: Boolean and Bisect.
Bisect comes from blender and means cutting the mesh in halves along cell faces (as planes), keeping always the inner part and cutting away the next half with the next face and so on, until a piece in the shape of the cell is cut out. It does not fill the inner faces so you have to use + Fill for this, but beware, its not reliable as boolean, leaving many faces open. Bisect is good for open shapes, but with many cells it can be slow. But it creates exactly shaped shards.
Fast bisect reduces the number of bisections per cell to 1 face (?) it creates differently shaped shards by halving the remainders again and again, being faster than conventional bisect because those mesh remainders get smaller each time. Fast bisect is good for open shapes, [???] it cannot fill. Shapes look different but also good patterns might be achieved (tested in uniform mode only up to now) and it is significantly faster than conventional bisect.
Boolean is good for closed shapes, but can throw errors, making the result unusable, but all inner faces will be closed. For Boolean make sure you have water tight meshes, also if you have small meshes, scale up in edit mode and scale down in object mode again, so the internal mesh is big enough to avoid float inaccuracies. When size becomes too small, boolean errors occur likely.
Bisect + Fill is good for closed shapes on simple geometry too. It will not error out as boolean, but it may omit inner faces. Bisect fill uses a Blender internal fill algorithm triangle fill, which is very unreliable in some cases.
Additional Settings Below Algorithm Section in Fracture Panel
- Shard count: For uniform mode only. It determines how many raw voronoi cells are created over the bounding box. Actual shard count may be lower due to intersection with actual geometry.
- Cluster count: It is recommended to set it to 0 to disable it. It is used it conjunction with Constraints and determines how many "bigger" compounds are made from the actual shards. This is an attempt to fake a two level breaking behavior via constraints and stronger "inner" thresholds ONLY.
- Seed: For uniform mode only. This is the starting seed for creating a random uniform point cloud over the bounding box. Varying it gives different pattern looks, which remain uniformly distributed though. It also affects the cluster build up, which is only visible in simulation.
- Split Shards to Islands: In case there are multiple visually disconnected pieces per shard, those will be decompose further to their single parts. Use this to avoid shards which look like being connected over the air. When changing this option, make sure to execute fracture again prior to saving the file ! Otherwise the mesh could be messed up. (TODO)
- Execute Fracture: Triggers the fracture process. This is necessary after ALL changes not related to constraints only (algorithm, source, percentage, seed, cluster count). Remind being on the cache startframe, otherwise nothing will happen. After adding a modifier to an object, make sure to actually execute the fracture once prior to saving the file ! Otherwise unexpected behavior could occur. (TODO)
Fracture Point Source Modes
Here you can change the point source to any combination of the five possibilities. It is recommended to leave it set to "Uniform." Modes are cumulative. You can select multiple sources. They add up to a combined point cloud.
Use a particle System of the same object as point cloud source. Only one particle system per object supported. Do not use multiple ones, otherwise the behavior might be undetermined. The number of particles will map to the number of shards over the bounding box. Recommended Particle System settings are: Volume, Random, all particles emitted in 1 Frame. Otherwise there are problems, for example with boolean when emitting from faces, especially when points are very close to the bounding box boundaries.
Each vertex of the object becomes a point in the point cloud. It is recommend to use only on low poly respectively low vertex objects. Can lead to problems too if points get close to bounding box boundaries.
You can create a particle system on another object, with the same recommended settings and add to a helper group. Then you specify this group in Extra Group. This way can get nonuniform fracture. The "Own Particles" mode should nonuniform fracture too, when manipulating the particle system emission via a texture for example.
Each vertex of one or more other objects become source points for fracturing. You add those helper objects to a group and specify it as Extra Group. If you have both particles and vertex options selected, you get a combined point cloud. Here also better use low poly objects.
WARNING: may crash! DO NOT MOVE object by hand out of "grease pencil drawing area," not even partially! At the moment it is not recommended to use.
If you use despite this warning: You can draw points or SHORT lines. Each stroke becomes a point cloud point. Here it helps to limit the total amount of source points with the "Percentage" setting below "Extra Group". With longer strokes you otherwise risk a huge amount of misshaped shards, a long fracturing process and possibly even crashes either in fracture or in the simulation
Constraint Breaking Settings
- Percentage: If the given percentage of the constraints per island is broken, then ALL remaining constraints of this island will break automatically. Setting it to 0 disables it. Set to high values to completely break all constraints which might dangle around after collision, lower values makes the object break more easily, 25 means if only 25% are broken, break the rest too for example.
- Angle: If an angle greater than x degrees occur between two islands, break the according constraint. This restricts bending behavior of constraints, which will break then when bent too much.
- Distance: If a distance (blender units) greater than x is between two islands, break the according constraint, This restricts stretching behavior of constraints, which will break when stretched too much.
- Solver iterations: This applies for the entire fracture object and overrides the scene setting. Higher iterations will reduce wobbling/rubber behavior, but simulation gets slower.
- Mass Dependent Thresholds: Reduce the given Threshold value according to ratio of current shard to shard with maximum mass, like shard with mass x has Threshold 100, mass x/2 has 50 then. This allows constraints to break more easily without changing the masses and avoids rubber behavior.
Other Experimental Settings
- Threshold vertex group: You can weight paint weights on the mesh PRIOR to fracture with modifier. This wont be visible with enabled modifier. (TODO) The weights reduce the given threshold by multiplying weights and threshold. A weight at 1 means full threshold, the lower you get, the lower the threshold will be. (0 -> undetermined ?, TEST...)
- Passive vertex group: You can paint passive parts with high weights analogous to the thresholds. It is recommended to use weight of 1, because the total weight of all vertices of a shard must be > 0.5 to set the shard passive, so it remains static during sim. The objects can either be active or passive, there is nothing inbetween.
- Toggle ground / Toggle connect ground: Was supposed to setup dynamic paint to automate the weight painting of grounds and ground touching objects, but its incomplete. It is recommended not to use this, because it might be removed again. With manually painting the objects you simply have more control on how the result will look like.
- Fix normals: This copies the closest normals from the source object to fractured object and allows to hide cracks better on smooth objects. Works only correctly if you do not have any modifiers before the fracture modifier!
- Execute as Threaded Job: This applies to the fracture process itself only. It shows a progress bar and keeps UI responsive during long fracture processes. Its WIP and may crash.
- Convert to Objects: Converts the modifier shards and constraints to single rigid body objects and single constraint objects. This might consume much memory on many shars, as you need to create many individual objects in blender which is slow and resource-intensive.
New Improvements and Workflow Information
Recent improvements, additions and clarifications are here for now but eventually will be integrated into the rest of the docs.
- GUI workflow adjustments
- New Breakable-checkbox by the Constraints-settings (can make constraints unbreakable)
- More cluster breaking rules
- Improved “Convert to keyframed objects”
- Now after “Execute fracture” timeline autojumps to frame 1
- New Object-Ghost-Mode (Collision detection without collision)
- Optimized fix normals
- Autohide optimized (Clearer glass fractures)
- Trigger now supports constrained objects and automatic enabling/disabling of active/passive shards
- New Clusters solver iterations override (higher value reduces rubbery motion)
Understanding clusters and shards. If you have 100 shards and 10 clusters, you get 10 clusters of 10 shards each. Important: Clusters work only in conjunction with constraints, so enable them as well. (They are just glued together with a separate, higher threshold) Changing the cluster number affects just... the cluster number yes, that is intended.
Changing cluster number basically changes the size and shape of the clusters while retaining the same shard count (you will have to change both if you want more shards AND clusters) And changing shard count or cluster count requires a refracture, because the assignment which shard belongs to which cluster happens in fracture step already and according to this they will be connected if constraints are enabled. You can also use the seed value to change the fracture shapes (a bit) and so the clusters resulting from them too.
Additionally, to see a fast effect, you could set the cluster angle to 0.1 (at the fractured default cube, with 100 Shards and 10 clusters) and rotate the cube a bit so it rests on a corner, then start animation and when it hits the ground it should decompose to its clusters basically. Cluster Angle is one of the special breaking conditions which override the regular threshold settings. (so shards or clusters break if there is a certain angle between them)
Shard mass distribution. Upon fracturing an object's total mass is distributed to the shards according to their volume. This might not be visible if you have for example 1000 Shards and Total Mass 1. This is because each shard has a very little mass than the minimum mass which makes the objects look equally heavy. Increase the total mass of the object if more mass is desired per shard.
A new checkbox "Use Initial Particle Coordinates" has been added which when checked uses the particle birth coordinates and the coordinates from the current simulation state of the particle system. In your blend you need to uncheck it and if you use autoexecute and move your cube a bit around the mesh might look wrong or right depending on its position.
Helper Objects adddon. Included in the branch download is an addon named Fracture Helpers. You can activate it from the menus File>User Preferences>Addons>Object: Fracture Helpers. It adds a tab in the Tool Shelf named Fracture. This addon makes it easier to use shapes and lines to control the look of the fracture. For more information see the addon tutorial on the DF-VFX website.
More new docs coming soon!
Additional Workflow Information
Using the Particle System on the original object or on Helper Objects:
Always add the particle system prior to the fracture modifier in the stack. In particle system you do not need the "Use Modifier stack" unless you want to emit particles from the shards. Alternatively you could place the particle system modifier below the fracture modifier. Use modifier stack tick box is a bit odd there.
It is best to setup the particle system while being on frame 1 or the rigidbody cache start frame. Set it to Volume, Random and let all particles emit on frame 1. To do this, set Emission start and Emission end on frame 1. The particle system display might be visually unreliable, but the particle birth coordinates should be valid anyways.
Then under Experimental you can specify "Own Particles" as point source. You can manipulate the particle system via texture for example to manipulate the particle distribution and thus the input point cloud to get irregular shards. Alternatively you can specify a particle system on another object. This must be put into a group and that group will be linked to the modifier as "Extra Group". You then have to use "Extra Particles" as point source. A group is used because this way you can add multiple objects as helper objects. For example you can make the point cloud more dense, if you put a particle system on a small helper object and place it inside the original object you want to fracture. In the environment of the helper object the shards will become smaller than everywhere else in the original object. You get bigger shards farther away from the helper object. If you emit on faces, boolean can get into trouble, and with bisect fill probably also because you are close to the edge of the bounding box.
The voronoi method always decomposes the entire objects, the shards get bigger because those cells are basically "open" cells, only the container or "boundary" cells limit them. For multiple helper objects, if you have some objects, each with particle system and all in the "extra" group, their particles all add points into the point source.
Ground Plane Interaction:
Here is additional information on the settings to where collision with the ground plane does not cause an undesired fracture. One technique is to make a hole in the ground. The hole in the ground in the wood blend example is a pocket, which should prevent the entire object from dropping to the side when hit. But this is not very reliable and tedious to setup every time. For gluing objects to a passive ground plane you basically weightpaint those areas touching the ground with a weight of 1.0. You will have to paint the object prior to adding the modifier, because at the moment you cannot see the weightpaint on the object with the modifier enabled. A weight of 1.0 is recommended because the shard weight will be calculated as average from all vertices belonging to the fracture shard, and the more verts have a weight = 1, the higher the probability is that the entire shard gets a weight of > 0.5 and will be considered passive during simulation.
After you have finished painting the original object, you get a vertex group as "result". This must be linked into the modifier prior to fracturing. If you then execute the fracture, the weightpaints will be interpolated from the orginal geometry to the fractured one and the shard weights will be calculated from the interpolated vertex weights as described above.
If you notice that the desired passive areas of the object still move during simulation, you will have to paint more of the original mesh with a high weight. Hint: it might help to subdivide the original object to have more control over the weight paint distribution and allow a more exact weight interpolation to the shards. This is another technique if you do not want to cut holes into the ground.
1) Have the object touch the ground so it does not fall down any further
2) Disable gravity (this should be made on object basis, not on scene basis as it is now), probably not an option since you can not animate the field weights as it seems
3) Use "Start Deactivated" and the object will be activated on collision then (and start falling down)
4) Use constraints and "good" settings for thresholds, so an object touching the ground won't collapse by its own. You have to experiment and try out settings by running the simulation until you get the desired results.
Using Compound Objects:
For a wall of compound objects(boards, beams and plaster). Basically you first fracture the separate objects with the voronoi methods, then apply. Then join everything together and refracture to the existing shards (with an "invalid" source, like Extra Particles without a helper Object) then you get a simulatable single object.
Apply is not a good approach, but at the moment there is no feasible concept on how to join separate objects under 1 modifier, because that concept is unknown to Blender.
Advanced Workflow Information
(This section is a work-in-progress stub and will be continuously improved)
Vertex groups and weightpainting can be used to get more advanced fractures and control. See the Other Experimental Settings and Ground Plane Interaction sections above. (More workflow specific information will be added soon here.)
Interaction with rigid body constraints to and from fractured objects. Currently using a fractured object and making a rigid body constraint with and empty object to another object is not supported directly. As a workaround you can try to join the objects and put the modifier on and reuse the existing islands but currently only the "Fixed" constraint is implemented for that. Another technique to try is to convert the modifier to separate objects with the "Convert to Objects" button at the very bottom of the "Experimental" section. Then single objects can be worked with if that is what is desired.
Advanced UV mapping. Currently inner faces do not get a UV. Inner materials can be assigned to new filled in faces from boolean or bisect+fill methods. Existing UVs on outer faces are preserved for the most part. Note: some options under Experimental do not quite work with CustomData like textures currently.(More workflow specific information will be added soon here.)
Using the Sub Object Group. This feature is intended to join multiple derived meshs of different objects with different modifier settings together in a "collector" object. Then theoretically constraint shards of different objects together. But this may not give the desired results. Note: DO NOT attempt to fracture in the collector object. It will mess up the mesh. Only RE-USE the shards there, and textures etc. All customdata stuff does not work there.
One way to experiment is to put all objects with fracture modifiers into a group and assign it to another object as Sub Object Group. Then choose extra particles (WITHOUT a helper object....) If all works well you get a "merged" copy of all objects from the sub object group in your "collector" object. Since it is then in one derivedmesh, you can constraint that together. But beware, many ODD results still happen with this.
Working with glass materials. This technique from Bashi is for removing inner polygons before they break apart. This is mainly used for glass materials. See the following thread: Bashi's BA post
Exporting animations to other Blender versions. A workaround to try is to export with MDD and MeshCache Modifier. In case of re-using in blend try a joined mesh of the islands. (More workflow specific information will be added soon here.)
Additional Workflow Links
(NOTE: right click on the link and click open in new tab or window to also stay on this page)
- Meshes should be water tight(non manifold) for boolean if inner surfaces are desired. This is because bisect with inner surfaces is not very reliable on more complex objects. But fast bisect for example leaves open pieces and should work for almost all meshes.
- Additional notes on voronoi, bisect and boolean: voronoi decomposes the bounding box in the first step, and in the 2nd step you make boolean with each cell face or bisect with each cell face or fast bisect uses 1 random face of each cell only. Bisect + fill basically cuts the mesh in halves along the cell faces which are treated as planes and tries to fill the inner faces. Bisect does not fill. Fast bisect is a different variant, using one random face per cell only and basically shrinking the processed mesh in each step by sorting the shards according to their size and splitting the biggest ones always. Boolean and Bisect are reused from the blender code base.
- Regular constraints will not work with fractured objects. This is a known limitation ATM. But if fixed constraints are used, alternatively both objects could be joined prior to fracturing them. This way there is 1 mesh, which can then bebfractured with "Split Shards to Islands" option. This will decompose cells which consist of several visually unconnected parts to separate mesh islands.
- To make objects break more easily you can scale up the mass, this way you can scale up thresholds too and do not have to fiddle around in the 0.000x area. Higher masses create higher forces in the simulation.
- To limit constraints, use the per island count or a searching range, this can avoid building too "long" of constraints.
- If you get fracture problems in boolean due to float limitations, scale up the mesh in edit mode and then scale back down in object mode. This at least can eliminate those problems, but it might affect the sim.
- You can override the thresholds with a breaking angle, distance or percentage (means when x percent of all constraints of an island is broken, the rest will break too). This is so dangling islands fall off easier.
- Enable the "execute as threaded job" option to have a progress bar and it provide a Cancel button. The progress bar calculation still is a bit odd, it might get longer than its maximum. :D This a temporary glitch. It will be fixed eventually.
- You can use existing mesh islands as shards IF you specify an invalid point source, LIKE extra Particles with NO helper group selected. THIS will reuse the islands.
- To build compound objects fracture one object, apply, fracture another, apply, join the mesh, and set up a new modifier with invalid source -> you get a simulation compound where all shards can interact with each other. They are not limited by object border.
- Following other modifiers being executed permanently slows down the sim speed unless they would cache their results as well during sim. But currently only this fracture modifier does this.
Suggestions on some settings to change for different results and experimentation:
Trying the different algorithms would cover four possibilities. There are more with/without constraints, high/low thresholds, breaking angle, breaking percentage. It depends on how you want to make the effect look like.
Also possibly higher rigid body masses will create some different results.
Constraint limits (distance and number limit) Good settings for that might be distance = 1 and limit around 5-6. You can set distance to 0, then it will take max bbox length as distance (and set it in the GUI as well, so do not wonder about this...)
The more constraints, the slower it will be, but also more stable (won't collapse so easily) Check the terminal console maybe, on how many constraints were built actually (it's printed there).
If thresholds or contact distances are too high, you experience rubber like behavior, so weaken thresholds or increase mass, or use mass dependent thresholds check box, this multiplies maximum threshold with mass fraction of shard. For rigid body collision shapes, for the shards -> convex, if you apply this to the main object, it applies to all shards automatically.
With multiple objects in a scene you could also apply all fracture modifiers on all the objects. Then join them to one object and use as point source "Extra Particles.", which is an empty source if you dont specify an extra group as well. The modifier detects this and will decompose it into the given islands then. That is especially useful if you need different fracture settings for parts of the same object. This is useful for wood wall for example. It could have boards and plaster. NOTE: it is better to put the textures onto the objects before. Boolean and bisect should handle the UVs. But most likely boolean will fail anyway with complex objects and bisect fill does not reliably fill the faces (its the default bisect filling code that is used). Triangle fill works terribly but edgnet-fill is not much better though (internal bisect filling algorithms). According to a developer this is "expected behavior." :S
If boolean fails with smaller objects, it might help to scale them up in edit mode. And then scale them down in object mode again(float inaccuracies mostly when object too small or too big). Or changing the seed might help too. Or just the amount of shards. And edge split after fracture helps great with smooth objects. Remember to apply all modifiers before fracture - bad performance otherwise.
You can also try to weight paint on the original mesh to define a vertex group. These weights are multiplied with the maximum threshold, so higher weighted areas are more stable due to higher thresholds.
Thoughts on one container inside another method:
The more and smaller shards an object is decomposed into, the more likely you do not get concave parts. You will have to use Convex Hull as Rigidbody shape type because Mesh is very unstable when used at active / simulated objects and causes only trouble. The convex hulls apply only to each shard separately, so its safe to use them on concave objects too, given the fact you have enough small shards so you dont get visually concave parts. Those will still have a convex hull and behave in an unexpected way. Example/test blend - http://www.pasteall.org/blend/29286 In this file the outer object has more shards, so they are less likely concave.
Workflow for preparing text for fracture:
Keep in mind, even with this workflow, some text it better for converting than others. Custom modeled text is the best for text effects. This is the ideal way that experienced text animators do it.
The general workflow is as follows - convert to mesh, remove doubles, limited dissolve, optionally remesh, set geometry to center of bbox to set the point of mass to the center (avoids "unexpected" movement during simulation, like falling to one side -> can set point of mass anywhere if such behavior is wanted.) Then use boolean, if fails use bisect + fill or bisect.
NOTE: using the bevel command may result in a small self intersection where boolean failed. Manual editing of the mesh may be required. Manual editing is typically needed in text based meshes since the quality of original text may not be suited for conversion to mesh.
Sometimes when hitting esc to stop a running animation, it can happen that a refracture is triggered unintentionally. This is problematic especially when you have a long fracturing process.
Older Fracture Branch blends WILL crash with the newer builds because of changes to blend loader so beware ! The solution is to save without modifier first with the older build and then put it back on in newer build. Then when saved in new build with the modifier it will work again.
Do NOT attempt to execute fracture or change the "Use constraints" setting while a simulation is running ! A crash at the next execution of the simulation is very probably then (TODO) Keep in mind to change fracture settings only when the simulation is stopped and the current frame is frame 1 or the rigidbody cache startframe.