2. PyMol and ChimeraX
There are several ways to import protein structures into Blender and other 3D programs for animation and rendering, they all have their advantages and disadvantages. In this section we will cover how to export a 3D model from PyMol or ChimeraX (the principle remains the same for other Molecular Graphics Software) and to then import it into Blender.
Exporting the Model
PyMol
fetch 4ozsIf we run the following command inside of PyMol, we get some information on the save command and the formats that we can save in:
help saveDESCRIPTION
"save" writes content to a file.
USAGE
save filename [, selection [, state [, format ]]]
ARGUMENTS
filename = string: file path to be written
selection = string: atoms to save {default: (all)}
state = integer: state to save {default: -1 (current state)}
PYMOL API
cmd.save(string file, string selection, int state, string format)
NOTES
The file format is automatically chosen if the extesion is one of
the supported output formats: pdb, pqr, mol, sdf, pkl, pkla, mmd, out,
dat, mmod, cif, pov, png, pse, psw, aln, fasta, obj, mtl, wrl, dae, idtf,
or mol2.
If the file format is not recognized, then a PDB file is written
by default.
For molecular files and where applicable and supported:
* if state = -1 (default), then only the current state is written.
* if state = 0, then a multi-state output file is written.
SEE ALSO
load, get_model
Inside of the nodes, we see the supported output formats are: pdb, pqr, mol, sdf, pkl, pkla, mmd, out, dat, mmod, cif, pov, png, pse, psw, aln, fasta, obj, mtl, wrl, dae, idtf, or mol2.
Some of these are relevant to the work that you are likely already familiar with such as the .mol and the .pdb, but a lot of them may seem strange. .obj, .dae, .wrl are all generic 3D model formats that are not specific to proteins at all. You can save your 3D model you have displayed inside of your viewport with the following command:
save protein.wrlDifferent 3D model formats have pros and cons. I have found .wrl to be the best when exporting from PyMol.
PyMol will export the 3D model relative to where the camera currently is. That means if you export one half a dimer, move the camera, then export the other half of the dimer, they will not line up when importing to Blender.
You should now have a 3D model save in your working directory, which is ready to be imported into Blender.
