I’m trying to figure out how to destroy any object into cube shards. As in small cubes. Similar to the derez effect seen in tron legacy when the identity disc is thrown through the player. Ive looked for tutorials but none of them show how to do it. They all show how to destroy just a cube into smaller cubes or how to destroy an object into random shards. Say you were destroying a sphere in the way im describing. The outer cubes would have one curved surface matching the curve of the sphere and the inner faces would just be flat, cube like.
One possible way to replace your exact mesh profile with cubes (with only outer ones matching the mesh surface) could be cutting the mesh shape from a 3d array of cubes using booleans. Then, you could maybe make it explode, fall, whatever.
A simplified example:
I started with a sphere, which I wish to replace ("destroy") with cubes:
Then I add another object a little cube, then add 3 array modifiers for each axis (X, Y, Z) with fixed count suitable to "contain" the target sphere (here array modifiers are disabled - eye icon)
Here is a detail of the first (enabled) array modifier on X: note that I leaved a little space between cubes using 1.05 as relative spacing.
which seen in perspective appears as
then you enable also Y and Z
Of course the sphere is now inside this big 3d array of cubes
Now if you enable a further modifier on the cube array, a boolean that intersects the target sphere, you get this resulting shape:
as you see the cubes are a little spaced as planned.
Now you can apply all modifiers: since boolean is quite slow, I suggest to first disable it temporary (eye icon), then apply all 3 array modifiers. Only then enable again the boolean and apply it.
After getting the resulting shape, identical to the image above but a real object, you need to make each cube a single object, to let it later explode, fall, etc.
So you enter edit mode, select all, and press P to get the "separate" menu, and choose "by loose parts":
beware this is very slow since geometry is quite complex here, blender will seem to freeze but it's not, let it finish (when the "separate"menu disappears, it's done)
After a few (minutes in my case - crappy old notebook) you get something like this (I've just hidden half of the "cubespheres" to let you see the inside and the outside)
Each of the cubes is an object independent that will fall, explode, move as you expect...
As an example, here is after setting all cubes as active (mesh) rigid bodies, and letting them fall onto a passive (mesh) rigid body plane: