27
$\begingroup$

I'm trying to create a bowling animation and I want the ball to hit the pins. I already added the Rigid Body physics to the objects but can't get the ball to move.

Obviously I could just add keyframes but

  • that seems to interfere with the Rigid Body physics
  • it doesn't look too realistic.

Is there a way to add some kind of motion to the ball?

$\endgroup$
33
$\begingroup$

Using keyframes is the only way I know of to do this currently, but you should be able to get good results by allowing the rigidbody object to be controlled by the animating system, then switching control back to the physics system while maintaining momentum gained from the keyframe animation.

This can be done by animating the Animated option in Physics > Rigid Body.
See the wiki:

The most common trick is to keyframe animate the location or rotation of an Active physics object as well as the Animated checkbox. When the curve on the Animated property switches to disabled, the physics engine takes over using the object's last known location, rotation and velocities.

Also see this post

For example:

  1. Enable Animated on your rigidbody object and inset a keyframe by right clicking on the check box and selecting Insert Keyframe:

    enter image description here

  2. On the same frame, add a location keyframe (or rotation if you want some angular momentum) to the rigid body object

  3. Go to a later frame and insert another location keyframe

  4. On the same frame, disable Animated and insert a keyframe by right clicking on the Animated checkbox and selecting Insert Keyframe again.

The motion from the keyframed animation will be carried over to the motion of the object as it is controlled by the physics system.

Result:

enter image description here

Note that while Animated is enabled the object will still interact with other rigid bodies, however its motion will be controlled by the animation system.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Is there any way to simply set the object's velocity at the first frame? $\endgroup$ – snapfractalpop Jan 26 '15 at 7:52
  • $\begingroup$ @snapfractalpop Not currently. $\endgroup$ – gandalf3 Jan 26 '15 at 7:54
  • 1
    $\begingroup$ Ok. I just tried your method, and I found that I needed to have at least two frames with "animated" checked. I guess that is needed to calculate momentum. $\endgroup$ – snapfractalpop Jan 26 '15 at 8:33
  • $\begingroup$ @snapfractalpop Yes, exactly. The object needs to be moving when the rigid body simulator takes over. $\endgroup$ – gandalf3 Jan 26 '15 at 8:37
  • $\begingroup$ It doesn't appear to be working. Can you give a .blend download so I can analyze what you did for that bowling ball example. $\endgroup$ – TheMinecraftMan757 Mar 26 '15 at 18:42
9
$\begingroup$

I have created an addon to make this process described by gandalf3 easier. It's called Projectile. Download it from GitHub. The download is for 2.8x, for a 2.7x version see this branch

To use it

  1. Select an object
  2. In the sidebar (N panel) there is a panel called Projectile. In the panel is a button titled "Add Object." Click to initialize velocity.
  3. In the Velocity Settings subpanel, set the velocity. By default, the operator will run each time a setting is changed.
  4. Then play the animation! You will see the object start with an initial velocity.
  5. There are many other settings like initial location and rotation, start frame, angular velocity, physics solver quality, auto updating, auto play, trajectory drawing. Experiment with the settings to get a good result.

For more detailed instructions see the readme on GitHub.

| improve this answer | |
$\endgroup$
  • $\begingroup$ This is fantastic! Works as advertised. $\endgroup$ – Xavier Shay Jan 25 '18 at 21:51
0
$\begingroup$

I wondered a similar thing (Using "Rigid Body" for rolling ball. Flat surface. How to push the ball to roll?) and someone in the comment mentioned this question. The top answer worked, but only when I had sufficient length of moving animation right before the physics (moving between frame 1 and 2 did not work, I had to make it between frame 1 and 20). But that defeats the purpose of this physics movement. I was thinking about adding this physics movement because I wanted to avoid the unrealistic sliding animation, and now I have to add it to make the physics work.

So, I modified the top answer slightly. Instead of animating the ball itself, I added an invisible cube and animated that cube. Basically the cube hits the ball, and the ball starts to rolling. I extrude the top part of the cube a little bit so it would hit the top part of the ball. I am not sure if it affects the animation or not.

enter image description here

You don't need to add any special keyframes to the ball itself. Do

  1. Add a cube to some tens of frames before, set keyframes on its location.
  2. Make the cube a "Rigid Body"
  3. At the frame you want the ball to start rolling, move the cube to a location where it slightly touches the ball and set keyframes on the cube's location.
  4. Make the cube invisible in the render result (Outliner -> filter -> camera icon -> uncheck for the cube) enter image description here
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.