Video: Molecular Signaling Pathway of Interleukin 1

Marcin writes:

I made a short animation of molecular signaling pathway of Interleukin 1, which is important part of our immune system response:

There are over 5 thousands objects in the scene, and majority of them, like phospholipids in the cell membrane or tiny molecules like ATP and aminoacids, are animated using Python scripting. It wouldn’t be possible to animate them manually giving them random, more realistic pattern.

Here’s the Python script, some of you may find it useful. The script works on selected objects only, so the workflow is:

  • select objects to animate
  • insert keyframe (location rotation)
  • move timeline to desired frame
  • run script
  • insert keyframe (location rotation)
  • repeat

The below script will select random value from -5 to 5 Blender units for location and from -15 to 15 euler for rotation. These values can be changed to achieve desired effect. Some lines can be commented out or removed if changes are desired only in particular axes.

Here’s the script:

selected_objects = bpy.context.selected_objects
for object in selected_objects:
x_value = random.uniform(-5.00,5.00)
y_value = random.uniform(-5.00,5.00)
z_value = random.uniform(-5.00,5.00)
x_value_rot = random.uniform(-15,15)
y_value_rot = random.uniform(-15,15)
z_value_rot = random.uniform(-15,15)
object.location.x += x_value
object.location.y += y_value
object.location.z += z_value
object.rotation_euler.x += x_value_rot
object.rotation_euler.y += y_value_rot
object.rotation_euler.z += z_value_rot

Enjoy!

Advertisement