1. Introduction to ePMV in C4D


will contain screen grabs to guide many key steps by December 3, 2012

Click Here for PDF version for now


Graham Johnson & Fabian de Kok

Made possible by Ludovic Autin, Graham Johnson, Michel Sanner & Arthur Olson

http://epmv.scripps.edu Download free | Install | Tutorials | Gallery | Forum

embedded Python Molecular Viewer (ePMV) runs free molecular modeling software directly inside of professional 3D animation applications (hosts) to provide simultaneous access to the capabilities of these newly connected systems. Uniting host and molecular toolkit functionalities into a single interface, allows illustrators to quickly create common representations of molecular models and to perform computational simulations, like molecular dynamics, directly inside of a host’s viewport with relative ease.

If you have experience with 3D software, especially with Cinema 4D, this tutorial should take about 2 hours and it will turn you into an intermediate ePMV user. If you are new to 3D software, the tutorial could take you anywhere between 3 and 12 hours. It introduces you slowly and methodically to the Cinema 4D interface as you learn how to generate and work with molecules in the ePMV GUI.

Quickstart Activities

  1. Basics 1: Build a PDB file representation in a Professional 3D application with 2 mouse clicks

    1. Start C4D

    2. Open ePMV GUI

      1. C4Dmenu: Plugins > ePMV (one click-n-drag)

    3. Get a Molecule using the ePMV GUI

      1. Click [Fetch] to get 1crn (box comes filled with this 4-digit PDB code by default)

        1. (second click)

        2. You have a ribbon model of the protein Crambin (PDB ID code 1crn)

    1. Zoom in on scene

      1. Hover mouse over viewport & type H on keyboard

    1. Build Atoms

      1. 1. Check [√]Atoms radio box

        1. a) See all of the atoms in the PDB file with their canonical IUPAC colors

    1. F. Study model

      1. 1. Click & drag upper right viewport icons to rotate camera, pan, zoom, etc.

        1. a)

      2. 2. Turn Atoms on and off as you explore to compare to the underlying ribbon.

        1. a) Check & uncheck [√]Atoms. Leave Atoms on when you’re done.

    1. G. Align view to defaults to match instructor screen

      1. 1. ViewportMenu: Edit>Frame Default

      2. 2. Hover over viewport & type H to center and zoom again

    1. H. Render the molecule (⌘R)

    2. I. Expand to 4 panel view

      1. 1. Click upper right viewport icon

        1. a)

      2. 2. Zoom each of 4 panels

        1. a) Hover mouse over each panel & hit H each time

      1. 3. Render all four panels

        1. a) ⌘R while mouse hovers over each panel one at a time

    1. J. Experiment with each of the different Color by scheme: <options>

      1. 1. In the Object Manager:

        1. a) Unfold 1crn

        2. b) Unfold 1crn:A

        3. c) Unfold 1crn:A_cpk to expose the instances of each atom on the molecule and to understand the hierarchy format

      2. 2. In the ePMV GUI:

        1. a) Unfold >Color by

        2. b) Try every menu pulldown to witness changes to the molecule and to the material manager. Depending on the molecule, Domains may have no effect

    1. K. Beautify

      1. 1. Open Render Settings

        1. a) Click Effects>AmbientOcclusion

        2. b) Render to see results

      2. 2. Speed up

        1. a) Set Acc = 20% | Min = 8 | Max = 32

        2. b) Render

      1. 3. Uncheck [ ]Specular for all materials

        1. a) Double-click the first material to open the Material Editor

        2. b) Hover mouse over Material Manager

        3. c) Hit ⌘A to select all materials

        4. d) Uncheck [ ]Specular in the Material Editor

        5. e) Render

    1. L. Save your Cinema 4D file

      1. 1. C4D menu: File>Save file as…

        1. a) 1crnSpaceFillAO1.c4d to a new folder you make on the desktop

    1. M. Add a doodle object signature and consider a white background

      1. 1. C4D menu: Tools>Doodle>DoodleEraser

        1. a) Click once in the scene

      2. 2. Select Doodle Object in Object Manager

      3. 3. Attributes Manager>Options Tab

        1. a) Set size to 800x600 or greater

        2. b) Load Bitmap

        3. c) Import your signature PNG

      1. 4. C4Dmenu>Create>Environment>Environment

        1. a) Select Environment in the Object Manager

        2. b) Check [√]Enable Fog

Render a JPG

      1. 5. Render settings:

        1. a) Output>Preset: 800x600

        2. b) Output>Frame Range: Current Frame

        3. c) Save>File: Browse to the folder you created for the file to create a new file path with .jpg name

        4. d) Save>Format: JPG

      2. 6. Render with PictureViewer to save a file (Click Center Clapboard)

    1. N. Share your signed creation with the world

      1. 1. Upload JPG to ePMV gallery by following instructions

      2. 2. Add a caption to your online gallery image with a description and credits

    2. O. Save this final incarnation of your C4D file

      1. 1. File>Save (S)

      2. II. Basics 2: model a ribbon representation

    1. A. Turn atoms off

    2. B. Build a Basic PMV-style Ribbon

    3. C. Unfold Backbone Representation

    4. D. Check [√] Ribbon to build (you may already have a ribbon that was built by the new default when you first loaded 1crn)

    5. E. Explore color options

      1. 1. Try all o f the color options

        1. a) Many schemes either don’t work in this beta version or are meaningless on a ribbon representation.

      2. 2. When finished exploring, choose Color by scheme: [rainbow]

        1. a) Some schemes, like rainbow, currently work with limited functionality on ribbons, coloring from N term to C term in reverse ROYGBIV

    1. F. Choose Color by scheme: [secondary structure]

    2. G. We will now work with molecules in a familiar interface

      1. 1. Change a default color:

        1. a) Double click the first hot pink material in the Material Manager

        2. b) Change the blasted pink to a blue of your choosing

        3. c) Unfold the hierarchy to expose the coils, strands, and helices in 1crn:A_ss

        4. d) Material Manager>Function>Render All Materials

        5. e) See in the Object Manager how this changes the applied material

      2. 2. Override a default color

        1. a) Create a new material in the material manager

        2. b) Change it from white to green

        3. c) Drag the new green material onto the other pink helix in the viewport

        4. d)

        5. e) Note in the Object manager how this retains the original pink material, but overrides it with a second green material on top of it (to the right).

    1. H. Add a point light to the scene

      1. 1. Drag it up on Y to about 50 (show them how to grab the green handle and pull up)

      2. 2. Set Z to -20

      3. 3. ⌘R to render viewport

    1. I. Add a fill light and an ambient light

      1. 1. Create>Light

        1. a) Do this twice, or duplicate the light by control dragging in the Object Manager to make two lights

      1. 2. Select one of the lights

        1. a) Double click to rename it Key Light

        2. b) Move it to your favorite Key Light position

      2. 3. Select the other light

        1. a) In the attributes manager, check [√] Ambient Illumination

        2. b) Reduce intensity to ~30

      1. 4. Render to test your lights

      2. 5. Tinker with the lights and colors for 5 minutes

    1. J. Render a JPG and post it to the gallery

    1. III. Quickstart Basics 3: Upgrade to a Fancy Ribbon Model

    2. A. Uncheck [ ]Ribbons

    3. B. Check [√]Beaded Ribbons

    4. C. Click [Options] (right of beaded ribbon)

    5. D. Experiment with huge palette of settings for 5 minutes

      1. 1. Use your glossary as a guide if you want

    6. E. Render a JPEG and post to the gallery

    7. IV. Quickstart basics 4: Add a transparent surface

    8. A. With fancy ribbon still visible

    9. B. Make an MSMsurface

      1. 1. Unfold Surface representations

      2. 2. Check [√] MSMSurf

    1. C. Experiment with Surface Colors

      1. 1. Unfold Color by

        1. a) Try all of the colors.

      2. 2. Set Pulldown to Scheme: Atoms using CPK

      3. 3. Render view to see result

      4. 4. Set Pulldown to Scheme: AtomsDG (polarity/charge)

      5. 5. Render view to see result

    1. D. Make the AtomSurface coloring transparent

      1. 1. Double Click the first Material named “_Blue” to open the Material Editor

      2. 2. Shift select the “_Red” and “_Green”

      3. 3. In Material Editor check [√]Transparency

      4. 4. Scroll 20% up to 60

    1. E. In RenderSettings>AmbientOcclusion, click evaluate transparency

      1. 1. Render

      2. V. Quickstart basics 5: Animate a Ribbon-in-Surface Turntable Rotation

    1. A. In Object Manager, select 1crn (topmost parent null)

    2. B. Set playback head to zero using VCR controller

    3. C. Uncheck Translate, Scale and Parameter Key record options next to Key button so only Rotate is blue

    4. D. Click the [Key] button

    5. E. Set VCR to end at frame 90

    6. F. In Coordinate Manager in H box type 360-360/90

      1. 1. Make sure H says 356, then hit [Apply]

    1. G. Click the [key]

    2. H. Hit VCR play

    3. I. Linearize the anchors to make a clean rotation

      1. 1. Open timeline

      2. 2. Select all keyframes (⌘A)

      3. 3. Right Click on a Keyframe and select linear

    1. J. Set up to render an animation in the RenderSettings

    1. K. Render the movie as a quicktime with H264 60% compression

    2. L. Post to the gallery when it finishes and meanwhile work on next project.

    3. M. Save file

    4. VI. Build the Biological Unit representation of a protein file:

    5. A. Restart C4D and then ePMV

    6. B. ePMV menu>Edit>Options:

      1. 1. uncheck [ ] Center molecule

      2. 2. Change [Secondary structure] in the pulldown to [CMS]

    1. C. Get Molecule: enter the 4 digit ID 2plv and click [Fetch]

      1. 1. We are fetching the asymmetric unit instead of downloading the all-atoms biological unit, which could unnecessarily bring 60x more data into your scene.

    2. D. ePMV menu>Edit>Biological Unit

    1. E. Type 2plv in the box and click OK (Type the exact name of your molecule, which is visible in the object manger)

      1. 1. Wait patiently

      2. 2. 60 copies of the original asymmetric unit have been replicated to form the entire viral capsid for polio virus- an icosohedral (soccer ball) sphere

    2. F. Unfold > Surface Representations

      1. 1. Adjust the settings for coarseMolSurf to Isovalue= 10, Resolution= -0.15, Grid Size= 20

    1. G. Unfold > Color By:

      1. 1. Select [Chains] from the drop down

    1. H. Adjust Color by Chain Settings (there is a bug in 0.5.2 that prevents color palette edits from sticking – update to 0.5.3 as soon as its available)

      1. 1. ePMV menu Edit > Color Palettes

      2. 2. Unfold > Chains

      3. 3. See in object manager that there are 4 chains labeled 1-4, so click to adjust those colors as desired

      4. 4. Click [Set To]

      5. 5. In the main ePMV GUI, set Color by [Chains] form the drop down menu

    1. I. Color by pentamers

      1. 1. Delete the textures of the parent geometry

        1. a) In the C4D object manager unfold 2plv

        2. b) Delete all but the phong tag from the CoarseMS_2plv mesh object (your virus should turn gray)

      2. 2. Unfold 2plvbioMT

        1. a) In the Material Manger, make 12 new materials colored as you see fit

        2. b) Under 2plvbioMT, color 5 instances at a time

        3. c) From top to bottom, select the top 5 monomers that make a pentamer 2plv_60 to 2plv_56

        4. d) Adjust viewport to see them clearly

        5. e) In the Material Manager, select the material you want to apply to the pentamer then click Function > Apply

        6. f) Repeat steps fo 2plv_55 to 2plv_51, etc. eleven times

    1. J. Backbone Worm Model (loft)

      1. 1. Under > Surface Representations uncheck [ ] coarsMolSurf

      2. 2. Unfold > Backbone Representations

        1. a) Check [√] Loft

        2. b) In the object manager under 2plv, unfold each of the chain parent nulls e.g., unfold 2plv:4 to 2plv:1 so you can see the loft object children.

        3. c) Unfold each loft object

        4. d) To speed up your viewport, simplify the loft objects by selecting the circle under each loft at once and in the attributes manager for the four circles set Intermediate points= Uniform, Number= 1, Set radius to 1 or any thickness for the backbone trace you like

        1. e) Remove linear interpolations by updating the settings in the attributes manger for the four spline objects. Set intermediate points= Uniform, Number= 1, Change type form [Cubic] to [Linear] and then back to [Cubic]

      1. 3. Unfold > Color By:

        1. a) Select [Chains] from the drop down

        2. b) ePMV menus Edit > Color Palettes (note, there is a bug in 0.5.2 that prevents color palette edits from sticking – update to 0.5.3 as soon as its available)

        3. c) Unfold > Chains, see in the object manger that there are 4 chains labeled 1-4, so click to adjust those colors as desired

        4. d) Click [Set To], in the main ePMV GUI set Color By to [Chains] from the drop down

      2. 4. Take a peak inside:

        1. a) Select 5 monomers that make a pentamer and hit ‘Option + G’ to group them

        2. b) Move the parent of the group to pull the pentamer aside or hide it to take a peak inside the empty virus

        3. c) Turn on ambient occlusion effect under render settings and crank the Maximum Ray Length to >400 to make it dark inside

        1. VII. Full To-Scale Tobacco Mosaic Virus Particle (TMV)

    1. A. Under ePMV options (edit menu), deselect 'center molecule', and set 'representation at loading' to none, press ok

    2. B. Fetch: 2om3

    3. C. Create Coarse Molecular Surface and set isovalue to 3 and grid size to 7

    4. D. Select biological unit in ePMV edit menu. Type in 2om3 and hit OK

    5. E. Create cloner object and set mode to 'linear.' Set x to 70cm, y and z to 0cm and count to 43 (Virions are ~300 nm in length and ~18 nm in diameter, these parameters are approximately to scale)

    1. F. Rotate cloner object -90 degrees on Z axis

    2. G. Place 2om3bioMT into the cloner object

    3. H. Enable ambient occlusion in render settings and set color scheme in ePMV gui

    4. I. Create a background object and set color ‘Use Color’ to ‘On’ in the attributes panel, default color should be white

    5. J. Play with materials and lighting if time permits. Increase grid size in small increments for more detail.

    6. K. Render out scene and save file

    7. VIII. Different Representations for RNA and Coat Protein for TMV

    8. A. Under ePMV options (edit menu), deselect 'center molecule' and set 'representation at loading' to none, press ok

    9. B. Fetch: 2om3

    10. C. Expand 2om3 in the object manager, there should be two chains (R=vRNA, and A=Coat Protein)

    11. D. Make sure 2om3 is selected in the ‘Current Selection’ drop down menu

    12. E. Select 'chain' under the 'Add selection set using string or...' drop down menu in the ePMV gui

    13. F. Type in R after chain (it should read 'Chain R')

    1. G. Hit the ‘save set’ button. You should have another selectable object under the 'Current selection' drop down menu named '2om3_selection0.' This is the RNA.

    1. H. Repeat for chain A, but make sure to reselect 2om3 under the 'Current selection' drop down menu. 2om3_Selection1 will be the Coat protein.

    1. I. Create biological unit for 2om3

    2. J. Select 2om3_selection1 (Coat protein) and apply MSMsurf or CoarseMolSurf

    3. K. Select 20m3_ selection0 (vRNA) and select atoms. The Coat protein and vRNA should be visually distinct at this point

    4. L. Play with different representations for each chain and render out scene and save file

    5. IX. NMR 2kzy

    6. A. Restart C4D

    7. B. ePMV menu>Edit>Options:

      1. 1. deselect [ ] Center molecule and [ ] Remove water

      2. 2. Click OK and close the options window

    8. C. Fetch 2kzy

    9. D. Check [√] Lines

    10. E. Unfold Data Player

    11. F. Click the pulldown that says 2kzy.mo… and drag to 2kzy.model to reinitialize the data player

      1. 1. The Grey slider bar below should move to zero at the left

    1. G. Scroll back and forth to see the different states (represented by your line model) in the viewport… there are 20 possible states (the last two of the 21 states are redundant)

    2. H. Don’t try to animate this with simple interpolation- your teacher will explain why.

    3. X. Bake Texture to Surface

    4. A. Restart C4D

    5. B. Fetch 1crn

    6. C. Build a molecular surface by checking [√] MSMSurf

    7. D. Render

    8. E. Color by <Per Residue>

    9. F. Save the File

    10. G. Make a new Light and check [√] Ambient Illumination

      1. 1. Your scene will appear dark, but this is fine- render the viewport if you want

    11. H. Apply a Bake Texture Tag on the object MSMS-MOL1crn in the Object Manager

    1. I. In the Attribute Manager for the Bake Tag:

      1. 1. Tag:

        1. a) Filename= 1crnPerResMat

        2. b) Format = jpg

        1. c) Options > Select Surface Color > Click Bake and be patient

    1. J. In the Material Manager, create a new material

      1. 1. Double click to open your new material in the Material Editor

      2. 2. In the Color Channel, click the […] button to the right of Texture to set a path to the jpg you just created

      3. 3. Drag this material onto your MSMS-MOL1crn object

      4. 4. Turn off your light and you should see a fully textured object that looks like your rendered version, directly in your viewport

        1. a) This step is not necessary for Blender and Maya which now have Vertex rendering directly in the viewport

        1. XI. Represent DNA in a Variety of Styles

    1. A. Restart Cinema 4D

    2. B. Open ePMV

    3. C. In the ePMV menu at top, click Extension>BuildDNA(w3DNA). In the Build DNA palette:

      1. 1. In the box enter a name (i.e. test.pdb): type AMInews.pdb

      2. 2. In the box enter a sequence: paste or type: GCC ATG ATT AAC GAG TGG AGT (you can repeat it three or four times to make a longer DNA strand, but its wise to keep it simple for this tutorial)

      3. 3. Choose a type [M4>B-DNA (generic)]

      1. 4. Click [Build] and wait for a few seconds (time depends on the length of your strand and any traffic on the Rutgers server)

        1. a) The widget sends users a sequence to the w3DNA server (http://w3dna.rutgers.edu/index.php/rebuild) to generate a straight PDB file of the specific sequence that automatically gets constructed into the scene

      2. 5. Create different representations

        1. a) Unfold > Backbone representations and uncheck [ ] Ribbons

        2. b) Under Atoms/Bonds check [√] Sticks under Color by: choose [Per Residue] then uncheck

        3. c) Under Atoms/Bonds check [√] Atoms and under Color By: choose [Per Residue] then uncheck

        4. d) Under Surface Representations check [√] MSMSurf. Change the probe radius to 0.01 and Color by: choose [Per Residue]

        5. e) Leaving [√] MSMSurf checked, change the probe radius to 1.4 and under Color By: choose [Chain]

      1. 6. Adjust the default colors of the Color By Chain settings (note, there is a bug in 0.5.2 that prevents color palette edits from sticking)

        1. a) ePMV menu, Edit > ColorPalettes

        2. b) Unfold > Chains

        3. c) See in object manager that there are 4 chains labeled 1-4, so click to adjust those colors as desired

        4. d) Click [Set Color]

        5. e) In the main ePMV GUI set ColorBy to [Chains] from the drop down

        6. f) Uncheck [ ] MSMSurf

      1. 7. Under Surface Representations check [√] CoarseMolSurf. Set Iso= 0, res= -0.15, and Grid Size= 60, then under Color By: choose [Chain]

        1. a) You can adjust the default colors of the color By Chain settings as described in the MSMS step if desired

        2. XII. Loading a volumetric file (3D density map) derived from single-particle Electron Microscopy

    1. A. Visit the Electron Microscopy Data Base

      1. 1. Click Basic Search

      2. 2. Type nuclear into the Title box on the search page and hit the [start search] button

      3. 3. Click on entry 1097

      4. 4. Click Map Information

      5. 5. Click to download then unzip emd_1097.map.gz

    2. B. CHANGE emd_1097.map to emd_1097.ccp4 (bug in PMV doesn't recognize the .map tag)

    3. C. Open ePMV

    4. D. Load a molecule, e.g., 1crn to trigger needed functions (temporary glitch we'll fix soon)

      1. 1. This dummy molecule need not be visible, but its good to leave on to get an idea of the major scale differences between a tiny protein like 1crn (crambin) and your relatively large Nuclear Pore Complex

    1. E. Unfold DataPLayer

    2. F. In Data Player panel, Browse to your .ccp4 file to load it

      1. 1. Since the file is formatted with proper headers, the map will load at a correct scale compared to any molecules in the scene (often shockingly large)

    1. G. Zoom out to see your nuclear pore complex surface map

      1. 1. Hover over viewport and Type H… you’ll be shocked by the size difference.

    1. H. Adjust your data slider to approximately 2.6 (better to type then to slide, but play around since this is a large file)

    2. I. Now you can center the molecule to the origin, generate a large sphere to mock up a nucleus, and I'll show you how to map the nuclear pore to your fake sphere nucleus in a separate tutorial for Cinema 4D.

    3. XIII. Apply the nuclear pore to a mock nucleus

    4. (These Cinema4D-specific instructions are generalizable to skilled users of other host software like Maya and Blender)

    5. A. Generate a 3D isocontoured surface model using ePMV in the 1st part of this tutorial

    6. B. Reduce the Polygon Count on your molecule

      1. 1. C4D top menu Object>Deformer>PolygonReduction

      2. 2. In the Object Manager panel, drag the new PolygonReduction deformer onto 'yourLoadedDummyMoleculeName'IsoSurface to make it a child of yourLoadedDummyMoleculeName'IsoSurface

      3. 3. Right click on 'yourLoadedDummyMoleculeName'IsoSurface and select Current state to object

      4. 4. After the new object is created below the original, delete the original (and its child Polygon Reduction Deformer

    1. C. Center your nuclear pore complex to the origin of the scene.

      1. 1. Select your reduced polygon mesh in the Object Manager

      2. 2. Click on the PointTool button (in the left-most palette in C4D's default layout)

      3. 3. Hover in the viewport and Select all of the points ⌘A on a mac, Cntrl A on a PC

      4. 4. In the Coordinates manager, set all values to zero and click [Apply]

      5. 5. In the Coordinates manager, type -90 in the H box and -300 in the Y box and click [Apply]

    1. D. C4D top menu Object>Primitive>Sphere

    2. E. With the sphere selected, in the attributes manager, change Radius=8000, Segments=3, and Type=Icosohedron

    3. F. Double click the sphere in the object manager to change its name to mockNucleusOuterMembrane

    4. G. C4D top menu Mograph>Cloner

    5. H. With Cloner selected, set Mode=Object and drag mockNucleusOuterMembrane sphere from the object manager into the Object box in the Cloner attribute manager

    6. I. In the object manager, drag your LoadedDummyMoleculeName'IsoSurface onto the Cloner to make it a child of the cloner.

    7. J. Click on Cloner and change Distribution=Surface

    8. K. Click on mockNucleusOuterMembrane and change segments=24

    9. L. Create a new material and drag it onto mockNucleusOuterMembrane

    10. M. Hack a hole into the outer membrane

      1. 1. Double click the material name to change it to Nuc

      2. 2. Double click the mockNucleusOuterMembrane material icon to open the Material Editor

      3. 3. Check the [√] Alpha box and in the Alpha box details:

      4. 4. Check [√] Invert

      5. 5. Set the Texture pulldown menu to Effects>Proximal

      6. 6. Click Proximal (spherical gradient box) to edit its details in the Material Editor Alpha

      7. 7. Drag Cloner from the object manager into the big Objects area box

      8. 8. Set Start Distance=410 and End Distance=500

    1. N. Render your scene

    2. O. Play with adding bump maps with noise and transparency, etc.

    3. P. Try adding a Displacer Deformer as a child of mockNucleusOuterMembrane with noise scaled to ~3000 and height to ~200 to make the sphere more organic.

      1. 1. This works fine for mocking up a nuclear membrane, from outside of the nucleus, but recall that its actually a double membrane (like a continuous spherical Endoplasmic Reticulum that is fenestrated by the nuclear pores.

      2. 2. If you plan to fly close to or inside of your nucleus you may need to temporarily replace your pores with cylinders, duplicate the sphere and reduce that spheres radius to mock the inner bilayer, then boolean to remove the spheres, etc.