Physics Anomalies

I was trying to help another Blender user with a simple rigid body physics setup. The question he asked was why he couldn’t get two cubes to collide using keyframes. It was a rather vague question so I didn’t wait for more info before I attempted to recreate the problem. I know he was trying this outside the BGE because he said he had set the cubes to Active, which isn’t an option in the BGE.

So, in Blender Render I created a plane for a ground surface and set it to Passive.

I then created two cubes, one at x-5 and one at x+5, and set them to Active with default settings. I then added a keyframe for each at frame 1. Going to frame 20, I moved both cubes to 0,0,0 and set keyframes for both.

When I ran the animation (first resetting the frame to 1), for some reason the cubes did nothing. They didn’t move at all.

I next toggled the Animated checkbox for their physics and ran the animation again. This time, the cubes both moved to the center of the grid and superimposed themselves on the same position without interfering with each other. I didn’t expect that.

Next, I turned off the Animated option for just one cube, and ran the animation. This time, the non-animated cube immediately jumped to the center of the grid while the Animated cube slid as it should across the ground until it hit the other cube and knocked it off the ground plane. This wasn’t expected.

Next, I turned off the Animation option for both cubes again and ran the animation once more. This time the cubes both jumped immediately to the center of the grid and collided. This isn’t what was expected either.

Why is the physics changing how it works with the same settings? Why would the Animation option being turned on and run and then turned off and run change the way objects react?

Here’s the file…

https://drive.google.com/file/d/0B7Tlcrz9ZntGNmJoaVpvTWJOZk0/view?usp=sharing

Here’s one way to make that kind of effect happen. Keyframe a cube moving from frame 1 to 20, change the interpolation mode to linear. On frame 20 keyframe the rigid body ‘animated’ checkbox. On frame 21 uncheck ‘animated’ and keyframe that. Do it for both boxes and change around rigid body parameters. Two boxes sliding into each other and colliding.

test-physics2.blend (495 KB)

I’m not trying to make it happen. I’m curious as to WHY the physics isn’t acting the same with the same settings all the time. This is a major bug.

When I ran the animation (first resetting the frame to 1), for some reason the cubes did nothing. They didn’t move at all.

Correct. There is nothing to make them move. No Animation, no physical force either.

I next toggled the Animated checkbox for their physics and ran the animation again. This time, the cubes both moved to the center of the grid and superimposed themselves on the same position without interfering with each other. I didn’t expect that.

Correct. Animation takes precedence over the physics. You’re the master.

I turned off the Animated option for just one cube, and ran the animation. This time, the non-animated cube immediately jumped to the center of the grid while the Animated cube slid as it should across the ground until it hit the other cube and knocked it off the ground plane.

Unchecking “Animated” resets something not obvious. Object you uncheck returns to reset position (like Alt-G) upon animation start. Might be feature, might be not. The rest is correct.

I turned off the Animation option for both cubes again and ran the animation once more. This time the cubes both jumped immediately to the center of the grid and collided

As before, unchecking Animated equals Alt-G. If this is a feature -correct.

Perhaps you misunderstood what I meant. I set the frame to 1 and ran the animation in which the cube should have moved across the plane. I didn’t mean that I just put it on frame 1 and expected something to happen.

Correct. Animation takes precedence over the physics. You’re the master.

If I’m the master, then why doesn’t Blender make sure coffee is always in my cup?

Unchecking “Animated” resets something not obvious. Object you uncheck returns to reset position (like Alt-G) upon animation start. Might be feature, might be not. The rest is correct.

As before, unchecking Animated equals Alt-G. If this is a feature -correct.

Okay! I thought it might have something to do with the animation getting baked, since I know Blender preserves some of the calculations during an animation test.

"No Animation, no physical force " - You had Animated checkboxes off if i’m not mistaken? “You’re the master” applies here too ;).

“why doesn’t Blender make sure coffee is always in my cup” - have you tried to open CD drive, put the mug on it, close and press the button “Coffe” on a toolshelf? You have too get that Addon too, i guess… :smiley: By itself, Blender ain’t so intrusive…

I was also looking for some traces of some cache. Seems there is not.