Tuesday, July 3, 2012

Fracture Tools - Animation Tip

I released a new animation that I was trying to get done completely with game physics. Come to find out it's just not that easy. I saw a video of someone using physics to drop a cup to a floor, it breaks, and that was it, but he didn't explain how he did it.

I tried to replicate it like he did, but I couldn't get the cup shards to fall without interacting with each other before they hit the floor.

I started to analyze the video, saw the cup was fractured before it hit the ground. I was hoping to reproduce it, but I wanted to do it better. I think the animation tools in blender are really ingenious, with what you can do with key frames. After the break, I've got the video I made last night, along with a quick tip of using key frames to create a dynamic animation like this.

So really simply, the scene is a 2 wall setup, a floor, and two emitters (top and camera). Two Wall Stage scene blend file.

But I want to show you how to use keyframes to make this animation, so I won't go into the details of the scene itself.

Here is the final blend file of the video above, Cup Break blend file.

First I set up the scene with a cup above the scene, middle of the scene.

Within blender game, make sure you're Recording Animation to IPO, which is under the Game menu while in blender game engine. Start the animation with [P]

Stop the animation just after it hits the floor object. Stop the animation with [ESC].

This is where I decided to start with the keyframing, fracture tool afterwords. So first lets keyframe this cup at frame 0. We want to make sure this cup is visible during the fall.

Hover your mouse over the eye and hit [I] for a keyframe, do the same with the camera icon.

Now find the frame the cup touches the floor, this is the frame that you are going to replace the cup with a duplicate, but fractured one. So you are going to do the same thing with key frames above, but to hide it from view and hide it from rendering.

Next, is to duplicate the cup [Shift] + [D], but to do the opposite with the cup, hide it at frame 0, and show it at the "hit the floor" frame.

Now, go into your add-on's and make sure you've got fracture tools ready.

At the frame the cup hits the floor, select the duplicate, and hit the space bar to search for the fracture tool kit. Choosing fracture object.

You'll be presented with the tool on the tool frame.  Don't go too crazy at first with the tool, because the fractures start with a big piece, then end up breaking only half at a time. So above 8 you'll have a lot of microscopic pieces but 8 big ones. Start with some bigger fractures at first, 5-8 to break up the cup. Check execute when you're ready for it to fracture your object.

Edit: I found that the tool works, properly to break up your object, I forgot to apply my solidify modifier, this screwed things up with my fracture. So I would recommend breaking up into big pieces then break up first impact chunks into smaller pieces.

So when you've got that done. you should have a fracture object, where each piece is a separate object.

Now its time to go back into the game, and let these pieces fly apart, and hit the ground itself.

While on the frame the cup hits the floor go back into game, if you aren't already, and let the game continue to run where the shards break apart and fly where the physics takes it.

Now make sure everything runs through the animation like expected. Finish any final touches on the textures and materials. Then render the animation.

If you have any questions, let me know. I'll try to answer them. I'll upload the scene to the site today, so you can take a look at how my scene was set up.

Some additional items to take into consideration when setting up the scene:

  • Make sure the game speeds is the same frame rate as your render animation. Too slow will make it look like slow motion, too fast will make it look like it's too fast.

  • Make sure you set up RVO Cells for Obstacle Simulation.

  • Make sure objects are the correct materials.

  • Adjust your final animation so you're not waiting for the cup to fall from out of frame too long.

That's about it for this one. Let me know if you want me to cover something more in depth.

-Austere Grim

No comments:

Post a Comment