4
$\begingroup$

I have a model that I cell fractured and I would like the cells to fall down one after another from top to bottom, like a kind of wipe. Is there a way to activate the rigid body simulation of these hundreds of shards depending on their distance to another object (an empty or anything else) ?

It's basically the same question as this one, but for blender 3.0 : Turn on rigid body by means of distance

Or this tutorial, but for 3.0 : https://www.youtube.com/watch?v=pEd0NuiMG3E

Thanks a lot for the help.

$\endgroup$
1
  • $\begingroup$ Is this question about Animation Nodes (links) or Geometry Nodes (tag)? $\endgroup$
    – Blunder
    Jun 16, 2022 at 16:35

1 Answer 1

3
$\begingroup$

UPDATE:

if you change the script like this:

import bpy

# two sample functions
def calcActivating(object):
        
    objectName = object.rna_type.id_data.name
    
    location1 = bpy.context.scene.objects[objectName].location
    location2 = bpy.context.scene.objects["Empty"].location
    
    print("distance is", (location2 - location1).length)
    
    return (location2 - location1).length > 5

# Add functions defined in this script into the drivers namespace.
bpy.app.driver_namespace["calcActivating"] = calcActivating

And if you add an Empty with the name "Empty" (or adapt the script) it will react (change the animated property) depending on the distance.

possible result:

enter image description here


if you run this script:

import bpy

# two sample functions
def calcActivating(object):
        
    objectName = object.rna_type.id_data.name

    location1 = bpy.context.scene.objects[objectName].location
    
   return location1.z - (bpy.context.scene.frame_current / 30) > 0


# Add functions defined in this script into the drivers namespace.
bpy.app.driver_namespace["calcActivating"] = calcActivating

and then give to one fractured cell for "animated" property ....

enter image description here

this driver:

enter image description here

then select all cells, shift select your cell with the driver at last, press CTRL-L -> animation data.

then you can get this:

enter image description here

of course you can change the "30" to any other value to change the effect:

enter image description here

Note: I just took the location.z value as "timing" function. So your location.z values of all fractured cells should be > 0 in the beginning of the animation. Of course you can take also a distance to another object or whatever function you want to calculate the timing.

$\endgroup$
9
  • $\begingroup$ nice crumble effect! $\endgroup$
    – Blunder
    Jun 16, 2022 at 18:52
  • $\begingroup$ @Blunder: thank you mate!!! $\endgroup$
    – Chris
    Jun 16, 2022 at 18:53
  • $\begingroup$ Very nice Chris! :) $\endgroup$
    – Edgel3D
    Jun 17, 2022 at 1:15
  • $\begingroup$ @Edgel3D : thank you ‼️‼️ $\endgroup$
    – Chris
    Jun 17, 2022 at 3:35
  • $\begingroup$ Wow, thanks ! I've never used scripts and drivers in Blender but I'll look into it ! $\endgroup$
    – Fab P
    Jun 17, 2022 at 10:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .