Render Molecules using Blender

Blender can be extremely useful in generating compelling and illustrative scientific drawings. In this tutorial, the focus is on load and render molecules using Blender.

The first approach is to load molecules in pdb format. The basic workflow in this way is summarized roughly as follows:

  1. draw the target molecule in Avogadro and save it in pdb format
  2. enable atomic blender addon
  3. load the pdb through import by pdb
  4. adjust the imported object
  5. assign material
  6. rendering and save files

When loading the pdb, setup the following parameters:

  • Type: Mesh
  • Azimuth/Zenith: 24 (or 6)
  • scaling factor of balls: 0.5
  • sector: 12 (or 5)
  • radius: 0.1
  • unit: 0.05
  • check bonds
  • default (Dupliverts)

In the loaded molecule, for each type of atoms/bonds, there is a hided atom/bond which is the parent one for the other atoms/bonds (due to Dupliverts). Thus all atoms/bonds in the same type can be scaled at the same time on the parent atom/bond. It provides more freedom to design the molecule, but can also be messy. To make it more efficient in modeling, it would be handy to make those atoms real instances and make them into a whole for later usage.

Geometry Fixing

To fix the loaded molecules, follow the steps:

  • remove all cups in all bonds
  • for any bond type:
    • make all bonds real (as instances)
    • make all link to one (to the last selected)
    • merge vertices in edit mode
    • link all bonds into one
  • do those steps similarly for all atoms

Another way to do is firstly render the molecule in VMD (with more molecular styles available), and save as wavefront format, then load into Blender. Compared to the first method, no additional fixing is needed. The difference is:

  • using pdb file provides more freedom to design (change the size of atoms)
  • the loaded obj file is similar to the final object created in the first approach

Asset Library

One efficient way for molecular figures drawing in Blender is to create a user library and save each fine-tuned molecule (and material for different atoms) for later usage.

  • select object and mark as assert
  • select material (for custom defined material) (right click -> make asset)

Tips

  • ctrl + A: select object and make them real (rather than duplicates)
  • ctrl + J: link selected objects
  • M: in edit mode to merge vertices; in collection move selected one to another

References

  1. 3D Blender Tutorials by ianscott888
  2. CGFigure