How to activate Rigid body on (animated)object as it collides

I’ve found plenty of examples on how to activate a Dynamic Rigid body that starts deactivated by having another animated Rigid body collide with it, but in my case I need it the other way around and it dosnt seem to work?

My simplified scene of the problem is;
I have a fractured sphere that is animated to pass the cube at an angle. So about half of the rigid bodies in the sphere passes through/collides with the cube.


Settings for the Sphere cells;

This does nothing, it seems to me that you cant have a Rigid Body that is both, dynamic, animated and starts deactivated. It will never activate.
Any tips on how I would do this? Is it possible with Rigid bodies or do I need to dive into sim nodes in GeoNode?

If I flip it around and have the cube move instead, it works, because then I can turn of the “animated” on my sphere and the Rigid Bodies just stays deactivated till the cube reaches it.

I am open to any creative ways to fake it if it isnt possible with rigid bodies.
In my actual scene. I have a pencil that writes over a paper, and I have the pencil tip fractured and I want it to slowly break away as the pencil get pushed into the paper. So the rigid bodies should be activated one by one as it slowly get pushed into the paper.

Cheers for any input!

I got pretty close with using a driver for the “Animated” property Z-axis on one of the cells. It works, and toogles on once it get close enough to the ground, but the problem is as the object bounces around, if it goes above that Z-axis it deactivates again. So now i have a jittering mess x)

I’ve been thinking maybe I coulde use proximity in GeoNode, once its close enough I can use an boolean, so it gives either True or False as an output in the modifier. Then connect that too the Animated property with drivers. I would have the same problem as the original driver set up, but im thinking maybe if I use simulation zones it could work?
I am not good at all in GeoNodes, so im struggeling over here, any help appreciated!

Why don’t you just set a custom property via the driver e.g. “notanimated” to true. And you drive the animated property via this value. By this the animated and the “notanimated” property stay the same and it should work. If it doesn’t work, pls provide a blend file so we can check it out. thx.

Not sure if I understood correct, but I tried and I have the same problem as before. It works, but the moment it goes above the threashold it naturally activates again goes crazy.
Let me know if im completly on the wrong track here
Driver setup;


I use the Z position, if its less then 0, it disables the Animation layer, but it still enables ones it goes over 0 again. I dont understand how to get it to not re-activate
Anim

try this (although it might be “dangerous” but in my little test it worked):

You set the value back in the else part, which of course changes it back again.

I just set the value to the same value as it was before.

Please provide a blend file so i can check it out on your file - you can e.g. provide a link to dropbox or any cloud service if you cannot upload blend file here.

And note: you have to move the object back to under 0 to be able to uncheck the “notanimated” value again.

Dosnt seem to work on my end, but now I’ve switched these if else statements so much back and forth, so might just be me getting a bit dizzy. Here is the blend, with your example in it).

https://drive.google.com/file/d/1StBp_JD3yv_-J7rwur9X1Ce-y7DyNQDG/view?usp=sharing

sorry, couldn’t download. I needed to ask for access…

Sorry, this should work;
https://drive.google.com/file/d/1StBp_JD3yv_-J7rwur9X1Ce-y7DyNQDG/view?usp=sharing

use “not var” here:

important: on frame 1 you always have to uncheck

image

so that the simulation can start correct.

I updated your blend file so you can check it out:

DriverExp.blend (926.5 KB)

I added some rotation animation so that i can distinguish between animated and rigid body sim.

result:

result

3 Likes

Cheers! Not sure where I went wrong when I tried your solution, but now it works at least!

I also replaced “Z” with “self.location.z”, since im going to apply it to multiplie objects. so my whole expression is;

1 if self.location.z < 0 else self[“AnimationDisabled”]

I have a new problem that I didnt quite think of now tho. I am going to apply this to multiplie objects, which is also going to be parented to the same object. So its Z location is of course not changing, as it always follows the Parent. Any way I can get the real world z location of an parented objected inside of drivers?

It works without my change, but I need all these multpile objects to be refering to themselvs, and not the same object(as they are all going to be starting out at different heights).

Thanks so much for the help so far!

yes, this should be possible too.

I think you have to use a simple script to convert local to world coordinates and therefore you can use the driver template script of blender:

So in the script you have to

  1. calculate the world z coordinate
  2. compare that to your “wished” limit
  3. return the result

then in scripted expression you just enter your function name.

Make sure you run the script once before entering the function name in the driver, else Blender doesn’t know your self written function.

1 Like

I’ll be honest, I feel a bit on thin ice once I have to start breaking out the script editor, but I will do some googeling and fiddle around with it tomorrow. I’ve managed to copy paste togheter script before! I will mark one of the answers further up as answered as well.

Thanks so much for the help, I was afraid I had to abandon this project, but I see glimpses towards the end of the tunnel now!

I think I found a “cleaner” solution, meaning I keep it all in drivers. I figured out(and its pretty obvious I guess) that real world position of a parented Object is just; Parent position + local position of parented object.

So I changed the expression to;

1 if Z + self.location.z < 0 else self[“AnimationDisabled”]

I have 3 objects at 3 different heigts now, all parented to the same empty. They all activate in order as they pass the real world Z position of 0. I have to go to bed now, but from what I can gather, I think I have everything I need. Now I just need to apply it to my fractured cells.
RealPos