5
$\begingroup$

I would like to animate a heart pumping (Realistically) like this video below.

https://www.cgtrader.com/3d-models/science-medical/medical/animated-realistic-human-heart-medically-accurate

Does anyone know a Python script (it can be animated, does not have to be Python) or can point me in the right direction for this?

I already created the heart.

$\endgroup$
  • 1
    $\begingroup$ Why Python? What is wrong with keyframes? Do you also need a model or you already have one? $\endgroup$ – lbalazscs Jan 3 '17 at 18:01
  • $\begingroup$ It does not have to by Python, It can be keyframes. From the link I posted it almost looks like a wave modifier. I just figured maybe someone wrote a script to automate this. Yes I already created a heart model. $\endgroup$ – icYou520 Jan 3 '17 at 18:29
  • 1
    $\begingroup$ Are you looking for a relatively easy way to generate the pumping animation like the example at the link? Per the notes at the link, the animator manually generated the motion using something like keyframes/shape keys using CT scans as a reference. $\endgroup$ – Ed Tate Jan 5 '17 at 14:56
  • $\begingroup$ Good catch I didn't see the notes below. I was in a rush for work and was looking for a quick way to animate the heart. I ended up just using a wave modifier on the different heart valve and although it was good enough for my job it didn't look as good as the reference video. I believe shape keys would of been best for this. Thanks. $\endgroup$ – icYou520 Jan 5 '17 at 15:46
10
+50
$\begingroup$

An animation of a beating heart can be generated using a fixed geometry and armatures to animate the beating. This method is a way to generate the complex motion by animating a few elements.

enter image description here

(Geometry from Blendswap.com - courtesy Bruno Laurencich/elZancudo)


Procedure:

  1. Load heart geometry as a single mesh

enter image description here

  1. Add bones for the left atrium, right atrium, left ventricle, and right ventricle. Place the bones roughly at the center of each of these parts of the heart. These bones will be animated to make the heart pump.

enter image description here

  1. Add bones for the arteries and veins. These bones will keep that part of the heart relatively stationary. The image below shows all of the bones in the model.

enter image description here

  1. Select all of the bones and join them into a single armature. This can be done using ctrl+J after selecting all of the bones.

  2. The armature is connected to the mesh using automatically calculated weights (see armature automatic weights). This allows each bone to affect only part of the mesh in the heart. This is done by selecting the mesh, then the armature, then hitting ctrl+P. The menu which appears will have an option for armature deform with automatic weights. Select that option.

enter image description here

This will automatically setup all of the weights for the different bones on the mesh. The weights for the 4 bones in the heart are shown below. For finer control, the weights can be edited.

enter image description here enter image description here enter image description here enter image description here

To keep the rest of the heart still the other bones are affecting the veins and arteries. One of these is shown.

enter image description here

  1. To simulate the pumping, the bones in the center of the left atrium, the right atrium, left ventricle, and right ventricle are scaled. Over the timeline, these bones are scaled between 0.9 and 1.1. In the animation that follows, the bones in the 4 chambers of the heart are animated by scaling the bones, this causes the rest of the mesh to smoothly pump. Because the other bones are kept in the same position and with the same scale, the veins and arteries stay relatively still. Looking closely at the following animation shows the small changes in the bones driving the changes in the mesh.

enter image description here

enter image description here enter image description here enter image description here enter image description here

  1. Adding material properties and rending gets the final result.

enter image description here


The blend file can be downloaded at:

| improve this answer | |
$\endgroup$
6
$\begingroup$

You need shape keys.

Model the object (you have done that already). Add two shape keys. Select the second and edit the heart to be in the other beating position. In object mode drag the "Value" slider up and down. See how the heart changes between the two shapes. Add more shapes if you need. Select each new key and edit the heart.

When you have enough shape keys, you can keyframe between them.

Shape key 1

Basis key

| improve this answer | |
$\endgroup$
  • 3
    $\begingroup$ Also if a single shape key doesn't give enough detail and realism to the motion, you can always create multiple shapekeys that turn on sequentially (like subdividing the motion). $\endgroup$ – Greg Zaal Jan 6 '17 at 11:21

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.